diff --git a/.github/workflows/docs.yaml b/.github/workflows/docs.yaml new file mode 100644 index 000000000..c5c971f8c --- /dev/null +++ b/.github/workflows/docs.yaml @@ -0,0 +1,19 @@ +name: Check Markdown links + +on: + pull_request: + branches: + - develop + - master + +jobs: + markdown-link-check: + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v3 + - name: Run link check + uses: gaurav-nelson/github-action-markdown-link-check@v1 + with: + use-verbose-mode: 'yes' + check-modified-files-only: 'yes' diff --git a/Dockerfile-csi-controller b/Dockerfile-csi-controller index 1b169b436..964cebc37 100644 --- a/Dockerfile-csi-controller +++ b/Dockerfile-csi-controller @@ -13,20 +13,26 @@ # limitations under the License. FROM registry.access.redhat.com/ubi8/python-38:1-75.1638364053 as builder -COPY controller/requirements.txt /tmp/ USER root RUN if [[ "$(uname -m)" != "x86"* ]]; then yum install -y rust-toolset; fi USER default RUN pip3 install --ignore-installed --default-timeout=100 --upgrade pip==21.2.4 +WORKDIR /tmp +COPY controller/requirements.txt . # avoid default boringssl lib, since it does not support z systems ENV GRPC_PYTHON_BUILD_SYSTEM_OPENSSL=True -RUN pip3 install -r /tmp/requirements.txt +RUN pip3 install -r ./requirements.txt + +USER root +COPY controller/scripts/csi_general . +RUN ./csi_pb2.sh +RUN pip3 install . -FROM registry.access.redhat.com/ubi8/python-38:1-68 +FROM registry.access.redhat.com/ubi8/python-38:1-80.1645821300 MAINTAINER IBM Storage -ARG VERSION=1.8.0 +ARG VERSION=1.9.0 ARG BUILD_NUMBER=0 ###Required Labels diff --git a/Dockerfile-csi-controller.test b/Dockerfile-csi-controller.test index 663815857..626957338 100644 --- a/Dockerfile-csi-controller.test +++ b/Dockerfile-csi-controller.test @@ -17,21 +17,27 @@ # Its similar to the Dockerfile, but with additional requirements-tests.txt and ENTRYPOINT to run the local tests. FROM registry.access.redhat.com/ubi8/python-38:1-75.1638364053 as builder -COPY controller/requirements.txt /tmp/ USER root RUN if [[ "$(uname -m)" != "x86"* ]]; then yum install -y rust-toolset; fi USER default RUN pip3 install --ignore-installed --default-timeout=100 --upgrade pip==21.2.4 -# avoid default boringssl lib, since it does not support z systems +WORKDIR /tmp +COPY controller/requirements.txt . +# avoid default- boringssl lib, since it does not support z systems ENV GRPC_PYTHON_BUILD_SYSTEM_OPENSSL=True -RUN pip3 install -r /tmp/requirements.txt +RUN pip3 install -r ./requirements.txt + +USER root +COPY controller/scripts/csi_general . +RUN ./csi_pb2.sh +RUN pip3 install . # Requires to run local testing -COPY controller/requirements-tests.txt /tmp/ -RUN pip3 install -r /tmp/requirements-tests.txt +COPY controller/requirements-tests.txt . +RUN pip3 install -r ./requirements-tests.txt -FROM registry.access.redhat.com/ubi8/python-38:1-68 +FROM registry.access.redhat.com/ubi8/python-38:1-80.1645821300 COPY --from=builder /opt/app-root /opt/app-root COPY ./common /driver/common diff --git a/Dockerfile-csi-node b/Dockerfile-csi-node index 1bb7f72f1..970101af9 100644 --- a/Dockerfile-csi-node +++ b/Dockerfile-csi-node @@ -27,10 +27,10 @@ COPY . . RUN make ibm-block-csi-driver # Final stage -FROM registry.access.redhat.com/ubi8/ubi-minimal:8.5-204 +FROM registry.access.redhat.com/ubi8/ubi-minimal:8.5-230.1645809059 MAINTAINER IBM Storage -ARG VERSION=1.8.0 +ARG VERSION=1.9.0 ARG BUILD_NUMBER=0 LABEL name="IBM block storage CSI driver node" \ diff --git a/NOTICES b/NOTICES index add01a259..c64970908 100644 --- a/NOTICES +++ b/NOTICES @@ -5,7 +5,7 @@ This file details additional third party software license agreements and third party notices and information that are required to be reproduced for the following programs: -IBM Block Storage CSI Driver version 1.8.0 +IBM Block Storage CSI Driver version 1.9.0 @@ -1409,7 +1409,7 @@ End of GNU GPL Version 3.0 License =========================================================================== END OF TERMS AND CONDITIONS FOR SEPARATELY LICENSED CODE for IBM Block -Storage CSI Driver version 1.8.0 +Storage CSI Driver version 1.9.0 =========================================================================== @@ -1420,7 +1420,7 @@ Storage CSI Driver version 1.8.0 GNU GPL and / or LGPL Source Code for: -IBM Block Storage CSI Driver 1.8.0 +IBM Block Storage CSI Driver 1.9.0 =========================================================================== @@ -1439,7 +1439,7 @@ General Public License 2.0. Red Hat Universal Base Image 8 Python 3.8 Source code to any of the above-listed packages distributed with IBM -Block Storage CSI Driver 1.8.0 is available at the website below, when +Block Storage CSI Driver 1.9.0 is available at the website below, when a URL is provided, or by sending a request to the following address or email: @@ -1468,7 +1468,7 @@ General Public License 3.0. Red Hat Universal Base Image 8 Python 3.8 Source code to any of the above-listed packages distributed with IBM -Block Storage CSI Driver 1.8.0 is available at the website below, when +Block Storage CSI Driver 1.9.0 is available at the website below, when a URL is provided, or by sending a request to the following address or email: @@ -2015,8 +2015,8 @@ END OF grpc-1.41.1 NOTICES AND INFORMATION @@@@@@@@@@@@ =========================================================================== -protobuf version 3.13.0: The Program includes protobuf version 3.13.0 -software. IBM obtained the protobuf version 3.13.0 software under the +protobuf version 3.15.0: The Program includes protobuf version 3.15.0 +software. IBM obtained the protobuf version 3.15.0 software under the terms and conditions of the following license(s): --------------------------------------------------------------------------- @@ -2055,7 +2055,7 @@ support library is itself covered by the above license. =========================================================================== -END OF protobuf version 3.13.0 NOTICES AND INFORMATION +END OF protobuf version 3.15.0 NOTICES AND INFORMATION =========================================================================== @@ -2213,6 +2213,47 @@ END OF sync commit 1122301 NOTICES AND INFORMATION =========================================================================== +@@@@@@@@@@@@ +=========================================================================== +sys commit 742c48e: The Program includes sys commit 742c48e software. +IBM obtained the sys commit 742c48e software under the terms and +conditions of the following license(s): +--------------------------------------------------------------------------- + +Copyright (c) 2009 The Go Authors. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + +=========================================================================== +END OF sys commit 742c48e NOTICES AND INFORMATION +=========================================================================== + + @@@@@@@@@@@@ =========================================================================== yaml-2.2.8: The Program includes yaml-2.2.8 software. IBM obtained diff --git a/common/config.yaml b/common/config.yaml index ee1f12efc..76f5823a0 100644 --- a/common/config.yaml +++ b/common/config.yaml @@ -1,6 +1,6 @@ identity: name: block.csi.ibm.com - version: 1.8.0 + version: 1.9.0 capabilities: Service: [CONTROLLER_SERVICE, VOLUME_ACCESSIBILITY_CONSTRAINTS] VolumeExpansion: ONLINE diff --git a/controller/array_action/array_action_types.py b/controller/array_action/array_action_types.py index 922a85653..446ef3d0a 100644 --- a/controller/array_action/array_action_types.py +++ b/controller/array_action/array_action_types.py @@ -27,15 +27,6 @@ class Snapshot: array_type: str -class Host: - def __init__(self, host_id, host_name, nqn, wwns, iscsi_names): - self.id = host_id - self.name = host_name - self.nqn = nqn - self.wwns = wwns - self.iscsi_names = iscsi_names - - class Replication: def __init__(self, name, volume_internal_id, other_volume_internal_id, copy_type, is_ready, is_primary=None): self.name = name diff --git a/controller/array_action/array_mediator_abstract.py b/controller/array_action/array_mediator_abstract.py index 262566b48..4a6ae89a1 100644 --- a/controller/array_action/array_mediator_abstract.py +++ b/controller/array_action/array_mediator_abstract.py @@ -13,6 +13,11 @@ class ArrayMediatorAbstract(ArrayMediator, ABC): + # https://github.com/PyCQA/pylint/issues/3975 + def __init__(self, user, password, endpoint): # pylint: disable=super-init-not-called + self.user = user + self.password = password + self.endpoint = endpoint @retry(NoConnectionAvailableException, tries=11, delay=1) def map_volume_by_initiators(self, vol_id, initiators): diff --git a/controller/array_action/array_mediator_ds8k.py b/controller/array_action/array_mediator_ds8k.py index 7b744e3f5..437852dc4 100644 --- a/controller/array_action/array_mediator_ds8k.py +++ b/controller/array_action/array_mediator_ds8k.py @@ -11,7 +11,8 @@ from controller.array_action.array_action_types import Volume, Snapshot from controller.array_action.array_mediator_abstract import ArrayMediatorAbstract from controller.array_action.ds8k_rest_client import RESTClient, scsilun_to_int -from controller.array_action.utils import classproperty +from controller.array_action.ds8k_volume_cache import VolumeCache +from controller.array_action.utils import ClassProperty from controller.common import settings from controller.common.csi_logger import get_stdout_logger @@ -117,50 +118,50 @@ def _get_parameter_space_efficiency(array_space_efficiency): class DS8KArrayMediator(ArrayMediatorAbstract): SUPPORTED_FROM_VERSION = '7.5.1' - @classproperty + @ClassProperty def array_type(self): return settings.ARRAY_TYPE_DS8K - @classproperty + @ClassProperty def port(self): return 8452 - @classproperty + @ClassProperty def max_object_name_length(self): return 16 - @classproperty + @ClassProperty def max_object_prefix_length(self): return 5 - @classproperty + @ClassProperty def max_connections(self): # max for rest api is 128. return 50 - @classproperty + @ClassProperty def minimal_volume_size_in_bytes(self): return 512 # 1 block, 512 bytes - @classproperty + @ClassProperty def maximal_volume_size_in_bytes(self): return 16 * 1024 * 1024 * 1024 * 1024 - @classproperty + @ClassProperty def max_lun_retries(self): return 10 - @classproperty + @ClassProperty def default_object_prefix(self): return None def __init__(self, user, password, endpoint): - self.user = user + super().__init__(user, password, endpoint) self.service_address = \ - endpoint[0] if isinstance(endpoint, list) else endpoint - self.password = password + self.endpoint[0] if isinstance(self.endpoint, list) else self.endpoint self._connect() + self.volume_cache = VolumeCache(self.service_address) def _connect(self): try: @@ -235,7 +236,7 @@ def _generate_volume_response(self, api_volume): ) def _create_api_volume(self, name, size_in_bytes, array_space_efficiency, pool_id): - logger.info("Creating volume with name: {}, size: {}, in pool: {}, with parameters: {}".format( + logger.info("creating volume with name: {}, size: {}, in pool: {}, with parameters: {}".format( name, size_in_bytes, pool_id, array_space_efficiency)) try: cli_kwargs = {} @@ -243,24 +244,11 @@ def _create_api_volume(self, name, size_in_bytes, array_space_efficiency, pool_i 'name': name, 'capacity_in_bytes': size_in_bytes, 'pool_id': pool_id, - 'tp': array_space_efficiency, + 'thin_provisioning': array_space_efficiency, }) - logger.debug( - "Start to create volume with parameters: {}".format(cli_kwargs) - ) - - # get the volume before creating again, to make sure it is not existing, - # because volume name is not unique in ds8k. - api_volume = self._get_api_volume_by_name( - name, - pool_id=pool_id - ) - logger.info("Found volume {}".format(name)) - if api_volume is not None: - raise array_errors.VolumeAlreadyExists(name, self.identifier) + logger.debug("start to create volume with parameters: {}".format(cli_kwargs)) api_volume = self.client.create_volume(**cli_kwargs) - logger.info("finished creating volume {}".format(name)) return self.client.get_volume(api_volume.id) except exceptions.ClientException as ex: @@ -270,7 +258,7 @@ def _create_api_volume(self, name, size_in_bytes, array_space_efficiency, pool_i if ERROR_CODE_CREATE_VOLUME_NOT_ENOUGH_EXTENTS in error_message: raise array_errors.NotEnoughSpaceInPool(pool_id) logger.error( - "Failed to create volume {} on array {}, reason is: {}".format( + "failed to create volume {} on array {}, reason is: {}".format( name, self.identifier, ex.details @@ -278,9 +266,10 @@ def _create_api_volume(self, name, size_in_bytes, array_space_efficiency, pool_i ) raise array_errors.VolumeCreationError(name) - def create_volume(self, volume_name, size_in_bytes, space_efficiency, pool): + def create_volume(self, name, size_in_bytes, space_efficiency, pool, io_group): array_space_efficiency = get_array_space_efficiency(space_efficiency) - api_volume = self._create_api_volume(volume_name, size_in_bytes, array_space_efficiency, pool) + api_volume = self._create_api_volume(name, size_in_bytes, array_space_efficiency, pool) + self.volume_cache.add(api_volume.name, api_volume.id) return self._generate_volume_response(api_volume) def _extend_volume(self, api_volume, new_size_in_bytes): @@ -298,7 +287,7 @@ def _extend_volume(self, api_volume, new_size_in_bytes): def copy_to_existing_volume_from_source(self, volume_id, source_id, source_capacity_in_bytes, minimum_volume_size_in_bytes): logger.debug( - "Copy source {0} data to volume {1}. source capacity {2}. Minimal requested volume capacity {3}".format( + "copy source {0} data to volume {1}. source capacity {2}. Minimal requested volume capacity {3}".format( source_id, volume_id, source_capacity_in_bytes, minimum_volume_size_in_bytes)) if minimum_volume_size_in_bytes < source_capacity_in_bytes: @@ -310,18 +299,18 @@ def copy_to_existing_volume_from_source(self, volume_id, source_id, source_capac options=options) def _delete_volume(self, volume_id, not_exist_err=True): - logger.info("Deleting volume {}".format(volume_id)) + logger.info("deleting volume {}".format(volume_id)) try: self.client.delete_volume( volume_id=volume_id ) - logger.info("Finished deleting volume {}".format(volume_id)) + logger.info("finished deleting volume {}".format(volume_id)) except exceptions.NotFound: if not_exist_err: raise array_errors.ObjectNotFoundError(volume_id) except exceptions.ClientException as ex: logger.error( - "Failed to delete volume {} on array {}, reason is: {}".format( + "failed to delete volume {} on array {}, reason is: {}".format( volume_id, self.identifier, ex.details @@ -356,34 +345,45 @@ def _delete_object(self, object_id, object_is_snapshot=False): if flashcopy_as_target: self._delete_flashcopy(flashcopy_id=flashcopy_as_target.id) self._delete_volume(object_id) + self.volume_cache.remove(api_volume.name) @convert_scsi_ids_to_array_ids() def delete_volume(self, volume_id): - logger.info("Deleting volume with id : {0}".format(volume_id)) + logger.info("deleting volume with id : {0}".format(volume_id)) self._delete_object(volume_id) - logger.info("Finished deleting volume {}".format(volume_id)) + logger.info("finished deleting volume {}".format(volume_id)) + + def _get_api_volume_with_cache(self, name, pool_id): + cached_volume_id = self.volume_cache.get(name) + api_volume = None + if cached_volume_id: + logger.debug("found object id: {} in cache".format(cached_volume_id)) + api_volume = self._get_api_volume_by_id(volume_id=cached_volume_id) + if not api_volume or api_volume.name != name: + api_volume = self._get_api_volume_by_name(volume_name=name, pool_id=pool_id) + return api_volume def get_volume(self, name, pool=None): - logger.debug("Getting volume {} in pool {}".format(name, pool)) - api_volume = self._get_api_volume_by_name(volume_name=name, - pool_id=pool) + logger.debug("getting volume {} in pool {}".format(name, pool)) + api_volume = self._get_api_volume_with_cache(name, pool) if api_volume: + self.volume_cache.add_or_delete(api_volume.name, api_volume.id) return self._generate_volume_response(api_volume) raise array_errors.ObjectNotFoundError(name) @convert_scsi_ids_to_array_ids() def expand_volume(self, volume_id, required_bytes): - logger.info("Expanding volume with id : {0} to {1} bytes".format(volume_id, required_bytes)) + logger.info("expanding volume with id : {0} to {1} bytes".format(volume_id, required_bytes)) api_volume = self._get_api_volume_by_id(volume_id) flashcopies = api_volume.flashcopy self._safe_delete_flashcopies(flashcopies=flashcopies, volume_name=api_volume.name) self._extend_volume(api_volume=api_volume, new_size_in_bytes=required_bytes) - logger.info("Finished Expanding volume {0}.".format(volume_id)) + logger.info("finished Expanding volume {0}.".format(volume_id)) @convert_scsi_ids_to_array_ids() def get_volume_mappings(self, volume_id): - logger.debug("Getting volume mappings for volume {}".format(volume_id)) + logger.debug("getting volume mappings for volume {}".format(volume_id)) try: host_name_to_lun_id = {} for host in self.client.get_hosts(): @@ -392,21 +392,21 @@ def get_volume_mappings(self, volume_id): if volume_id == mapping["volume_id"]: host_name_to_lun_id[host.name] = scsilun_to_int(mapping["lunid"]) break - logger.debug("Found volume mappings: {}".format(host_name_to_lun_id)) + logger.debug("found volume mappings: {}".format(host_name_to_lun_id)) return host_name_to_lun_id except exceptions.ClientException as ex: logger.error( - "Failed to get volume mappings. Reason is: {}".format(ex.details) + "failed to get volume mappings. Reason is: {}".format(ex.details) ) raise ex @convert_scsi_ids_to_array_ids() def map_volume(self, volume_id, host_name, connectivity_type): - logger.debug("Mapping volume {} to host {}".format(volume_id, host_name)) + logger.debug("mapping volume {} to host {}".format(volume_id, host_name)) try: mapping = self.client.map_volume_to_host(host_name, volume_id) lun = scsilun_to_int(mapping.lunid) - logger.debug("Successfully mapped volume to host with lun {}".format(lun)) + logger.debug("successfully mapped volume to host with lun {}".format(lun)) return lun except exceptions.NotFound: raise array_errors.HostNotFoundError(host_name) @@ -419,7 +419,7 @@ def map_volume(self, volume_id, host_name, connectivity_type): @convert_scsi_ids_to_array_ids() def unmap_volume(self, volume_id, host_name): - logger.debug("Unmapping volume {} from host {}".format(volume_id, host_name)) + logger.debug("unmapping volume {} from host {}".format(volume_id, host_name)) try: mappings = self.client.get_host_mappings(host_name) lunid = None @@ -432,7 +432,7 @@ def unmap_volume(self, volume_id, host_name): host_name=host_name, lunid=lunid ) - logger.debug("Successfully unmapped volume from host with lun {}.".format(lunid)) + logger.debug("successfully unmapped volume from host with lun {}.".format(lunid)) else: raise array_errors.ObjectNotFoundError(volume_id) except exceptions.ClientException as ex: @@ -444,15 +444,14 @@ def unmap_volume(self, volume_id, host_name): def _get_api_volume_from_volumes(self, volume_candidates, volume_name): for volume in volume_candidates: - logger.info("Checking volume: {}".format(volume.name)) if volume.name == volume_name: - logger.debug("Found volume: {}".format(volume)) + logger.debug("found volume: {} with id: {}".format(volume.name, volume.id)) volume.flashcopy = self.client.get_flashcopies_by_volume(volume.id) return volume return None def _get_api_volume_by_name(self, volume_name, pool_id): - logger.info("Getting volume {} in pool {}".format(volume_name, pool_id)) + logger.info("getting volume {} in pool {}".format(volume_name, pool_id)) if pool_id is None: logger.error( "pool_id is not specified, can not get volumes from storage." @@ -484,7 +483,7 @@ def _get_api_volume_by_id(self, volume_id, not_exist_err=True): return None def _get_flashcopy_process(self, flashcopy_id, not_exist_err=True): - logger.info("Getting flashcopy {}".format(flashcopy_id)) + logger.info("getting flashcopy {}".format(flashcopy_id)) try: return self.client.get_flashcopies(flashcopy_id) except exceptions.ClientException as ex: @@ -497,14 +496,13 @@ def _get_flashcopy_process(self, flashcopy_id, not_exist_err=True): return None def _get_api_snapshot(self, snapshot_name, pool_id=None): - logger.debug("Get snapshot : {} in pool: {}".format(snapshot_name, pool_id)) - api_snapshot = self._get_api_volume_by_name(volume_name=snapshot_name, - pool_id=pool_id) + logger.debug("get snapshot : {} in pool: {}".format(snapshot_name, pool_id)) + api_snapshot = self._get_api_volume_with_cache(snapshot_name, pool_id) if not api_snapshot: return None if not is_snapshot(api_snapshot): logger.error( - "FlashCopy relationship not found for target volume: {}".format(snapshot_name)) + "flashCopy relationship not found for target volume: {}".format(snapshot_name)) raise array_errors.ExpectedSnapshotButFoundVolumeError(api_snapshot.name, self.service_address) return api_snapshot @@ -517,6 +515,7 @@ def get_snapshot(self, volume_id, snapshot_name, pool=None): api_snapshot = self._get_api_snapshot(snapshot_name, pool) if api_snapshot is None: return None + self.volume_cache.add_or_delete(api_snapshot.name, api_snapshot.id) return self._generate_snapshot_response_with_verification(api_snapshot) def _create_similar_volume(self, target_volume_name, source_api_volume, space_efficiency, pool): @@ -550,7 +549,7 @@ def _create_flashcopy(self, source_volume_id, target_volume_id, options): flashcopy_state = self.get_flashcopy_state(api_flashcopy.id) if not flashcopy_state == FLASHCOPY_STATE_VALID: self._delete_flashcopy(api_flashcopy.id) - raise ValueError("Flashcopy state is not correct. expected: '{}' , got: '{}'.".format(FLASHCOPY_STATE_VALID, + raise ValueError("flashcopy state is not correct. expected: '{}' , got: '{}'.".format(FLASHCOPY_STATE_VALID, flashcopy_state)) return self._get_api_volume_by_id(target_volume_id) @@ -564,7 +563,7 @@ def _create_snapshot(self, target_volume_name, source_api_volume, space_efficien try: return self._create_flashcopy(source_api_volume.id, target_api_volume.id, options) except (array_errors.ObjectNotFoundError, array_errors.SnapshotAlreadyExists) as ex: - logger.error("Failed to create snapshot '{0}': {1}".format(target_volume_name, ex)) + logger.error("failed to create snapshot '{0}': {1}".format(target_volume_name, ex)) self._delete_target_volume_if_exist(target_api_volume.id) raise ex @@ -591,6 +590,7 @@ def create_snapshot(self, volume_id, snapshot_name, space_efficiency, pool): raise array_errors.ObjectNotFoundError(volume_id) target_api_volume = self._create_snapshot(snapshot_name, source_api_volume, space_efficiency, pool) logger.info("finished creating snapshot '{0}' from volume '{1}'".format(snapshot_name, volume_id)) + self.volume_cache.add(target_api_volume.name, target_api_volume.id) return self._generate_snapshot_response(target_api_volume, volume_id) def _delete_flashcopy(self, flashcopy_id): @@ -598,7 +598,7 @@ def _delete_flashcopy(self, flashcopy_id): self.client.delete_flashcopy(flashcopy_id) except exceptions.ClientException as ex: logger.error( - "Failed to delete flashcopy {} on array {}, reason is: {}".format( + "failed to delete flashcopy {} on array {}, reason is: {}".format( flashcopy_id, self.identifier, ex.details @@ -608,32 +608,32 @@ def _delete_flashcopy(self, flashcopy_id): @convert_scsi_ids_to_array_ids() def delete_snapshot(self, snapshot_id): - logger.info("Deleting snapshot with id : {0}".format(snapshot_id)) + logger.info("deleting snapshot with id : {0}".format(snapshot_id)) self._delete_object(snapshot_id, object_is_snapshot=True) - logger.info("Finished snapshot deletion. id : {0}".format(snapshot_id)) + logger.info("finished snapshot deletion. id : {0}".format(snapshot_id)) def get_iscsi_targets_by_iqn(self, host_name): return {} - def get_array_fc_wwns(self, host_name=None): - logger.debug("Getting the connected fc port wwpns for host {} from array".format(host_name)) + def get_array_fc_wwns(self, host_name): + logger.debug("getting the connected fc port wwpns for host {} from array".format(host_name)) try: host = self.client.get_host(host_name) wwpns = [port[LOGIN_PORT_WWPN] for port in host.login_ports if port[LOGIN_PORT_STATE] == LOGIN_PORT_STATE_ONLINE] - logger.debug("Found wwpns: {}".format(wwpns)) + logger.debug("found wwpns: {}".format(wwpns)) return wwpns except exceptions.NotFound: raise array_errors.HostNotFoundError(host_name) except exceptions.ClientException as ex: logger.error( - "Failed to get array fc wwpn. Reason is: {}".format(ex.details) + "failed to get array fc wwpn. Reason is: {}".format(ex.details) ) raise ex def get_host_by_host_identifiers(self, initiators): - logger.debug("Getting host by initiators: {}".format(initiators)) + logger.debug("getting host by initiators: {}".format(initiators)) found = "" for host in self.client.get_hosts(): host_ports = host.host_ports_briefs @@ -656,7 +656,7 @@ def validate_supported_space_efficiency(self, space_efficiency): raise array_errors.SpaceEfficiencyNotSupported( space_efficiency) - logger.debug("Finished validate_supported_space_efficiency.") + logger.debug("finished validate_supported_space_efficiency.") def _generate_snapshot_response(self, api_snapshot, source_volume_id): return Snapshot(capacity_bytes=int(api_snapshot.cap), diff --git a/controller/array_action/array_mediator_interface.py b/controller/array_action/array_mediator_interface.py index 67df425bf..19066de22 100644 --- a/controller/array_action/array_mediator_interface.py +++ b/controller/array_action/array_mediator_interface.py @@ -4,7 +4,7 @@ class ArrayMediator(ABC): @abstractmethod - def __init__(self, user, password, address): + def __init__(self, user, password, endpoint): """ This is the init function for the class. it should establish the connection to the storage system. @@ -30,21 +30,22 @@ def disconnect(self): raise NotImplementedError @abstractmethod - def create_volume(self, volume_name, size_in_bytes, space_efficiency, pool): + def create_volume(self, name, size_in_bytes, space_efficiency, pool, io_group): """ This function should create a volume in the storage system. Args: - volume_name : name of the volume to be created in the storage system - size_in_bytes : size in bytes of the volume - space_efficiency : space efficiency (None for default) - pool : pool name to create the volume in + name : name of the volume to be created in the storage system + size_in_bytes : size in bytes of the volume + space_efficiency : space efficiency (None for default) + pool : pool name to create the volume in + io_group : i/o group to create the volume in Returns: volume_id : the volume WWN. Raises: - VolumeAlreadyExists + VolumeAlreadyExists : optional PoolDoesNotExist PoolDoesNotMatchSpaceEfficiency IllegalObjectName @@ -96,12 +97,12 @@ def delete_volume(self, volume_id): raise NotImplementedError @abstractmethod - def get_volume(self, volume_name, pool=None): + def get_volume(self, name, pool=None): """ This function return volume info about the volume. Args: - volume_name: name of the volume on storage system. + name: name of the volume on storage system. pool: pool of the volume to find the volume more efficiently. @@ -285,13 +286,13 @@ def get_iscsi_targets_by_iqn(self, host_name): raise NotImplementedError @abstractmethod - def get_array_fc_wwns(self, host_name=None): + def get_array_fc_wwns(self, host_name): """ This function will return the wwn of the connected FC port of the storage array Args: - None + host_name : used to filter relevant hosts Returns: wwn : the wwn of the storage diff --git a/controller/array_action/array_mediator_svc.py b/controller/array_action/array_mediator_svc.py index 18875de07..8c58cdb89 100644 --- a/controller/array_action/array_mediator_svc.py +++ b/controller/array_action/array_mediator_svc.py @@ -2,18 +2,18 @@ from io import StringIO from random import choice +from packaging.version import Version from pysvc import errors as svc_errors from pysvc.unified.client import connect -from pysvc.unified.response import CLIFailureError +from pysvc.unified.response import CLIFailureError, SVCResponse from retry import retry import controller.array_action.config as config import controller.array_action.errors as array_errors import controller.controller_server.config as controller_config -from controller.array_action.array_action_types import Volume, Snapshot, Host, Replication +from controller.array_action.array_action_types import Volume, Snapshot, Replication from controller.array_action.array_mediator_abstract import ArrayMediatorAbstract -from controller.array_action.svc_cli_result_reader import SVCListResultsReader -from controller.array_action.utils import classproperty, bytes_to_string, convert_scsi_id_to_nguid +from controller.array_action.utils import ClassProperty, convert_scsi_id_to_nguid from controller.common import settings from controller.common.csi_logger import get_stdout_logger @@ -40,13 +40,11 @@ NOT_ENOUGH_EXTENTS_IN_POOL_EXPAND = 'CMMVC5860E' NOT_ENOUGH_EXTENTS_IN_POOL_CREATE = 'CMMVC8710E' -LIST_HOSTS_CMD_FORMAT = 'lshost {HOST_ID};' -HOST_ID_PARAM = 'id' -HOST_NAME_PARAM = 'name' -HOST_NQN_PARAM = 'nqn' -HOST_WWPNS_PARAM = 'WWPN' -HOST_ISCSI_NAMES_PARAM = 'iscsi_name' +HOST_NQN = 'nqn' +HOST_WWPN = 'WWPN' +HOST_ISCSI_NAME = 'iscsi_name' HOST_PORTSET_ID = 'portset_id' +LIST_HOSTS_CMD_FORMAT = 'lshost {HOST_ID};echo;' HOSTS_LIST_ERR_MSG_MAX_LENGTH = 300 LUN_INTERVAL = 128 @@ -64,9 +62,9 @@ ENDPOINT_TYPE_AUX = 'aux' -def is_warning_message(ex): +def is_warning_message(exception): """ Return True if the exception message is warning """ - info_seperated_by_quotation = str(ex).split('"') + info_seperated_by_quotation = str(exception).split('"') message = info_seperated_by_quotation[1] word_in_message = message.split() message_tag = word_in_message[0] @@ -90,7 +88,7 @@ def _get_space_efficiency_kwargs(space_efficiency): return {} -def build_kwargs_from_parameters(space_efficiency, pool_name, volume_name, +def build_kwargs_from_parameters(space_efficiency, pool_name, io_group, volume_name, volume_size): cli_kwargs = {} cli_kwargs.update({ @@ -101,6 +99,8 @@ def build_kwargs_from_parameters(space_efficiency, pool_name, volume_name, }) space_efficiency_kwargs = _get_space_efficiency_kwargs(space_efficiency) cli_kwargs.update(space_efficiency_kwargs) + if io_group: + cli_kwargs['iogrp'] = io_group return cli_kwargs @@ -151,54 +151,54 @@ class SVCArrayMediator(ArrayMediatorAbstract): BLOCK_SIZE_IN_BYTES = 512 MAX_LUN_NUMBER = 511 MIN_LUN_NUMBER = 0 + MIN_SUPPORTED_VERSION = '7.8' - @classproperty + @ClassProperty def array_type(self): return settings.ARRAY_TYPE_SVC - @classproperty + @ClassProperty def port(self): return 22 - @classproperty + @ClassProperty def max_object_name_length(self): return 63 - @classproperty + @ClassProperty def max_object_prefix_length(self): return 20 - @classproperty + @ClassProperty def max_connections(self): return 2 - @classproperty + @ClassProperty def minimal_volume_size_in_bytes(self): return 512 # 512 Bytes - @classproperty + @ClassProperty def maximal_volume_size_in_bytes(self): return 256 * 1024 * 1024 * 1024 * 1024 - @classproperty + @ClassProperty def max_lun_retries(self): return 10 - @classproperty + @ClassProperty def default_object_prefix(self): return "CSI" def __init__(self, user, password, endpoint): - self.user = user - self.password = password + super().__init__(user, password, endpoint) self.client = None # SVC only accept one IP address if len(endpoint) == 0 or len(endpoint) > 1: logger.error("SVC only support one cluster IP") raise array_errors.StorageManagementIPsNotSupportError( endpoint) - self.endpoint = endpoint[0] - self._identifier = None + self.endpoint = self.endpoint[0] + self._cluster = None logger.debug("in init") self._connect() @@ -208,6 +208,10 @@ def _connect(self): try: self.client = connect(self.endpoint, username=self.user, password=self.password) + if Version(self._code_level) < Version(self.MIN_SUPPORTED_VERSION): + raise array_errors.UnsupportedStorageVersionError( + self._code_level, self.MIN_SUPPORTED_VERSION + ) except (svc_errors.IncorrectCredentials, svc_errors.StorageArrayClientException): raise array_errors.CredentialsError(self.endpoint) @@ -216,23 +220,27 @@ def disconnect(self): if self.client: self.client.close() - def get_system_info(self): - for cluster in self.client.svcinfo.lssystem(): - if cluster['location'] == 'local': - return cluster - return None + @property + def _system_info(self): + if self._cluster is None: + for cluster in self.client.svcinfo.lssystem(): + if cluster.location == 'local': + self._cluster = cluster + return self._cluster + + @property + def _code_level(self): + return self._system_info.code_level.split(None, 1)[0] @property def identifier(self): - if self._identifier is None: - cluster = self.get_system_info() - self._identifier = cluster['id_alias'] - return self._identifier + return self._system_info.id_alias def is_active(self): return self.client.transport.transport.get_transport().is_active() def _generate_volume_response(self, cli_volume): + pool = self._get_volume_pool(cli_volume) source_volume_wwn = self._get_source_volume_wwn_if_exists(cli_volume) space_efficiency = _get_cli_volume_space_efficiency(cli_volume) return Volume( @@ -241,7 +249,7 @@ def _generate_volume_response(self, cli_volume): internal_id=cli_volume.id, name=cli_volume.name, array_address=self.endpoint, - pool=cli_volume.mdisk_grp_name, + pool=pool, copy_source_id=source_volume_wwn, array_type=self.array_type, space_efficiency=space_efficiency, @@ -268,25 +276,27 @@ def _generate_snapshot_response_with_verification(self, cli_object): source_volume_id = self._get_wwn_by_volume_name_if_exists(fcmap.source_vdisk_name) return self._generate_snapshot_response(cli_object, source_volume_id) - def _get_cli_volume(self, volume_name, not_exist_err=True): + def _lsvdisk(self, volume_name, not_exist_err): try: - cli_volume = self.client.svcinfo.lsvdisk(bytes=True, object_id=volume_name).as_single_element - if not cli_volume and not_exist_err: - raise array_errors.ObjectNotFoundError(volume_name) - return cli_volume + return self.client.svcinfo.lsvdisk(bytes=True, object_id=volume_name).as_single_element except (svc_errors.CommandExecutionError, CLIFailureError) as ex: - if not is_warning_message(ex.my_message): - if (OBJ_NOT_FOUND in ex.my_message or - NAME_NOT_EXIST_OR_MEET_RULES in ex.my_message): - logger.info("volume not found") - if not_exist_err: - raise array_errors.ObjectNotFoundError(volume_name) - elif any(msg_id in ex.my_message for msg_id in (NON_ASCII_CHARS, VALUE_TOO_LONG)): - raise array_errors.IllegalObjectName(ex.my_message) - else: - raise ex + if (OBJ_NOT_FOUND in ex.my_message or + NAME_NOT_EXIST_OR_MEET_RULES in ex.my_message): + logger.info("volume not found") + if not_exist_err: + raise array_errors.ObjectNotFoundError(volume_name) + elif any(msg_id in ex.my_message for msg_id in (NON_ASCII_CHARS, VALUE_TOO_LONG)): + raise array_errors.IllegalObjectName(ex.my_message) + else: + raise ex return None + def _get_cli_volume(self, volume_name, not_exist_err=True): + cli_volume = self._lsvdisk(volume_name, not_exist_err) + if not cli_volume and not_exist_err: + raise array_errors.ObjectNotFoundError(volume_name) + return cli_volume + def _get_cli_volume_if_exists(self, volume_name): cli_volume = self._get_cli_volume(volume_name, not_exist_err=False) logger.debug("cli volume returned : {}".format(cli_volume)) @@ -310,8 +320,20 @@ def _get_source_volume_wwn_if_exists(self, target_cli_object): source_volume_name = fcmap.source_vdisk_name return self._get_wwn_by_volume_name_if_exists(source_volume_name) - def get_volume(self, volume_name, pool=None): - cli_volume = self._get_cli_volume(volume_name) + def _get_volume_pools(self, cli_volume): + pool = cli_volume.mdisk_grp_name + if isinstance(pool, list): + pool_names = pool[:] + pool_names.remove('many') + return pool_names + return [pool] + + def _get_volume_pool(self, cli_volume): + pools = self._get_volume_pools(cli_volume) + return ':'.join(pools) + + def get_volume(self, name, pool=None): + cli_volume = self._get_cli_volume(name) return self._generate_volume_response(cli_volume) def _get_object_fcmaps(self, object_name): @@ -330,8 +352,11 @@ def _expand_cli_volume(self, cli_volume, increase_in_bytes, is_hyperswap): else: self.client.svctask.expandvdisksize(vdisk_id=volume_name, unit='b', size=increase_in_bytes) except (svc_errors.CommandExecutionError, CLIFailureError) as ex: - if not is_warning_message(ex.my_message): - logger.warning("Failed to expand volume {}".format(volume_name)) + if is_warning_message(ex.my_message): + logger.warning("exception encountered during volume expansion of {}: {}".format(volume_name, + ex.my_message)) + else: + logger.error("Failed to expand volume {}".format(volume_name)) if OBJ_NOT_FOUND in ex.my_message or VOL_NOT_FOUND in ex.my_message: raise array_errors.ObjectNotFoundError(volume_name) if NOT_ENOUGH_EXTENTS_IN_POOL_EXPAND in ex.my_message: @@ -398,11 +423,9 @@ def _lsvdisk_by_uid(self, vdisk_uid): try: return self.client.svcinfo.lsvdisk(bytes=True, filtervalue=filter_value).as_single_element except (svc_errors.CommandExecutionError, CLIFailureError) as ex: - if not is_warning_message(ex.my_message): - if any(msg_id in ex.my_message for msg_id in (NON_ASCII_CHARS, INVALID_FILTER_VALUE)): - raise array_errors.IllegalObjectID(ex.my_message) - raise ex - return None + if any(msg_id in ex.my_message for msg_id in (NON_ASCII_CHARS, INVALID_FILTER_VALUE)): + raise array_errors.IllegalObjectID(ex.my_message) + raise ex def _get_cli_volume_by_wwn(self, volume_id, not_exist_err=False): cli_volume = self._lsvdisk_by_uid(volume_id) @@ -427,20 +450,20 @@ def _get_volume_name_by_wwn(self, volume_id): raise array_errors.ObjectNotFoundError(volume_id) return vol_name - def _create_cli_volume(self, name, size_in_bytes, space_efficiency, pool): + def _create_cli_volume(self, name, size_in_bytes, space_efficiency, pool, io_group): logger.info("creating volume with name : {}. size : {} . in pool : {} with parameters : {}".format( name, size_in_bytes, pool, space_efficiency)) try: size = self._convert_size_bytes(size_in_bytes) - cli_kwargs = build_kwargs_from_parameters(space_efficiency, pool, + cli_kwargs = build_kwargs_from_parameters(space_efficiency, pool, io_group, name, size) self.client.svctask.mkvolume(**cli_kwargs) - cli_volume = self._get_cli_volume(name) - logger.info("finished creating cli volume : {}".format(cli_volume.name)) - return cli_volume except (svc_errors.CommandExecutionError, CLIFailureError) as ex: - if not is_warning_message(ex.my_message): - logger.error(msg="Cannot create volume {0}, Reason is: {1}".format(name, ex)) + if is_warning_message(ex.my_message): + logger.warning("exception encountered during creation of volume {0}: {1}".format(name, + ex.my_message)) + else: + logger.error("Cannot create volume {0}, Reason is: {1}".format(name, ex)) if OBJ_ALREADY_EXIST in ex.my_message: raise array_errors.VolumeAlreadyExists(name, self.endpoint) if NAME_NOT_EXIST_OR_MEET_RULES in ex.my_message: @@ -452,7 +475,7 @@ def _create_cli_volume(self, name, size_in_bytes, space_efficiency, pool): if any(msg_id in ex.my_message for msg_id in (NON_ASCII_CHARS, INVALID_NAME, TOO_MANY_CHARS)): raise array_errors.IllegalObjectName(ex.my_message) raise ex - return None + logger.info("finished creating cli volume : {}".format(name)) @retry(svc_errors.StorageArrayClientException, tries=5, delay=1) def _rollback_copy_to_target_volume(self, target_volume_name): @@ -475,9 +498,9 @@ def copy_to_existing_volume_from_source(self, volume_id, source_id, source_capac target_volume_name = self._get_volume_name_by_wwn(volume_id) self._copy_to_target_volume(target_volume_name, source_name) - def create_volume(self, name, size_in_bytes, space_efficiency, pool): - cli_volume = self._create_cli_volume(name, size_in_bytes, space_efficiency, pool) - + def create_volume(self, name, size_in_bytes, space_efficiency, pool, io_group): + self._create_cli_volume(name, size_in_bytes, space_efficiency, pool, io_group) + cli_volume = self._get_cli_volume(name) return self._generate_volume_response(cli_volume) def _delete_volume_by_name(self, volume_name, not_exist_err=True): @@ -485,8 +508,11 @@ def _delete_volume_by_name(self, volume_name, not_exist_err=True): try: self.client.svctask.rmvolume(vdisk_id=volume_name) except (svc_errors.CommandExecutionError, CLIFailureError) as ex: - if not is_warning_message(ex.my_message): - logger.warning("Failed to delete volume {}".format(volume_name)) + if is_warning_message(ex.my_message): + logger.warning("exception encountered during deletion of volume {}: {}".format(volume_name, + ex.my_message)) + else: + logger.error("Failed to delete volume {}".format(volume_name)) if (OBJ_NOT_FOUND in ex.my_message or VOL_NOT_FOUND in ex.my_message) and not_exist_err: raise array_errors.ObjectNotFoundError(volume_name) raise ex @@ -520,8 +546,9 @@ def _create_similar_volume(self, source_cli_volume, target_volume_name, space_ef space_efficiency = _get_cli_volume_space_efficiency(source_cli_volume) size_in_bytes = int(source_cli_volume.capacity) if not pool: - pool = source_cli_volume.mdisk_grp_name - self._create_cli_volume(target_volume_name, size_in_bytes, space_efficiency, pool) + pool = self._get_volume_pools(source_cli_volume)[0] + io_group = source_cli_volume.IO_group_name + self._create_cli_volume(target_volume_name, size_in_bytes, space_efficiency, pool, io_group) def _create_fcmap(self, source_volume_name, target_volume_name, is_copy): logger.info("creating FlashCopy Mapping from '{0}' to '{1}'".format(source_volume_name, target_volume_name)) @@ -529,11 +556,16 @@ def _create_fcmap(self, source_volume_name, target_volume_name, is_copy): try: self.client.svctask.mkfcmap(source=source_volume_name, target=target_volume_name, **mkfcmap_kwargs) except (svc_errors.CommandExecutionError, CLIFailureError) as ex: - if not is_warning_message(ex.my_message): + if is_warning_message(ex.my_message): + logger.warning("exception encountered during FlashCopy Mapping creation" + " for source '{0}' and target '{1}': {2}".format(source_volume_name, + target_volume_name, + ex.my_message)) + else: if FCMAP_ALREADY_EXIST in ex.my_message: - logger.info(("FlashCopy Mapping already exists" - " for source '{0}' and target '{1}'").format(source_volume_name, - target_volume_name)) + logger.info("FlashCopy Mapping already exists" + " for source '{0}' and target '{1}'".format(source_volume_name, + target_volume_name)) else: raise ex @@ -542,7 +574,11 @@ def _start_fcmap(self, fcmap_id): try: self.client.svctask.startfcmap(prep=True, object_id=fcmap_id) except (svc_errors.CommandExecutionError, CLIFailureError) as ex: - if not is_warning_message(ex.my_message): + if is_warning_message(ex.my_message): + logger.warning("exception encountered while starting" + " FlashCopy Mapping '{}': {}".format(fcmap_id, + ex.my_message)) + else: if FCMAP_ALREADY_COPYING in ex.my_message: logger.info("FlashCopy Mapping '{0}' already copying".format(fcmap_id)) else: @@ -559,7 +595,10 @@ def _delete_fcmap(self, fcmap_id, force): try: self.client.svctask.rmfcmap(object_id=fcmap_id, force=force) except (svc_errors.CommandExecutionError, CLIFailureError) as ex: - if not is_warning_message(ex.my_message): + if is_warning_message(ex.my_message): + logger.warning("exception encountered during fcmap '{}' deletion: {}".format(fcmap_id, + ex.my_message)) + else: logger.error("Failed to delete fcmap '{0}': {1}".format(fcmap_id, ex)) raise ex @@ -568,7 +607,10 @@ def _stop_fcmap(self, fcmap_id): try: self.client.svctask.stopfcmap(object_id=fcmap_id) except (svc_errors.CommandExecutionError, CLIFailureError) as ex: - if not is_warning_message(ex.my_message): + if is_warning_message(ex.my_message): + logger.warning("exception encountered while stopping fcmap '{}': {}".format(fcmap_id, + ex.my_message)) + else: if FCMAP_ALREADY_IN_THE_STOPPED_STATE in ex.my_message: logger.info("fcmap '{0}' is already in the stopped state".format(fcmap_id)) else: @@ -643,8 +685,12 @@ def _get_pool_site(self, pool): raise array_errors.PoolDoesNotExist(pool, self.endpoint) def _is_cli_volume_in_site(self, cli_volume, site_name): - volume_site_name = self._get_pool_site(cli_volume.mdisk_grp_name) - return volume_site_name == site_name + volume_pools = self._get_volume_pools(cli_volume) + for pool in volume_pools: + volume_site_name = self._get_pool_site(pool) + if volume_site_name == site_name: + return True + return False def _get_rcrelationships_as_master_in_cluster(self, volume_name): filter_value = 'master_vdisk_name={}:aux_cluster_id={}'.format(volume_name, self.identifier) @@ -652,7 +698,7 @@ def _get_rcrelationships_as_master_in_cluster(self, volume_name): def _get_cli_volume_in_pool_site(self, volume_name, pool_name): cli_volume = self._get_cli_volume(volume_name) - if not pool_name: + if not pool_name or ':' in pool_name: return cli_volume pool_site_name = self._get_pool_site(pool_name) if self._is_cli_volume_in_site(cli_volume, pool_site_name): @@ -680,23 +726,30 @@ def delete_snapshot(self, snapshot_id): self._delete_object(cli_volume, is_snapshot=True) logger.info("Finished snapshot deletion. id : {0}".format(snapshot_id)) + def _get_host_ports(self, host, attribute_name): + ports = host.get(attribute_name, []) + return ports if isinstance(ports, list) else [ports] + def get_host_by_host_identifiers(self, initiators): logger.debug("Getting host name for initiators : {0}".format(initiators)) detailed_hosts_list = self._get_detailed_hosts_list() nvme_host, fc_host, iscsi_host = None, None, None connectivity_types = set() for host in detailed_hosts_list: - if initiators.is_array_nvme_nqn_match(host.nqn): + host_nqns = self._get_host_ports(host, HOST_NQN) + if initiators.is_array_nvme_nqn_match(host_nqns): nvme_host = host.name connectivity_types.add(config.NVME_OVER_FC_CONNECTIVITY_TYPE) logger.debug("found nvme nqn in list : {0} for host : " "{1}".format(initiators.nvme_nqn, nvme_host)) - if initiators.is_array_wwns_match(host.wwns): + host_wwns = self._get_host_ports(host, HOST_WWPN) + if initiators.is_array_wwns_match(host_wwns): fc_host = host.name connectivity_types.add(config.FC_CONNECTIVITY_TYPE) logger.debug("found fc wwns in list : {0} for host : " "{1}".format(initiators.fc_wwns, fc_host)) - if initiators.is_array_iscsi_iqns_match(host.iscsi_names): + host_iqns = self._get_host_ports(host, HOST_ISCSI_NAME) + if initiators.is_array_iscsi_iqns_match(host_iqns): iscsi_host = host.name connectivity_types.add(config.ISCSI_CONNECTIVITY_TYPE) logger.debug("found iscsi iqn in list : {0} for host : " @@ -718,61 +771,34 @@ def _get_detailed_hosts_list(self): # get all hosts details by sending a single batch of commands, in which each command is per host detailed_hosts_list_cmd = self._get_detailed_hosts_list_cmd(hosts_list) logger.debug("Sending getting detailed hosts list commands batch") - detailed_hosts_list_output, detailed_hosts_list_errors = self._send_raw_cli_command(detailed_hosts_list_cmd) - if detailed_hosts_list_errors: - logger.error("Errors returned from getting detailed hosts list: {0}".format(detailed_hosts_list_errors)) - - return self._get_detailed_hosts_by_raw_output(detailed_hosts_list_output) - - def _get_detailed_hosts_by_raw_output(self, detailed_hosts_list_raw_output): - logger.debug("Reading detailed hosts list commands batch response") - hosts_reader = SVCListResultsReader(detailed_hosts_list_raw_output) - res = [] - for host_details in hosts_reader: - host_id = host_details.get(HOST_ID_PARAM) - host_name = host_details.get(HOST_NAME_PARAM) - nqn = host_details.get_as_list(HOST_NQN_PARAM) - wwns = host_details.get_as_list(HOST_WWPNS_PARAM) - iscsi_names = host_details.get_as_list(HOST_ISCSI_NAMES_PARAM) - host = Host(host_id, host_name, nqn, wwns, iscsi_names) - res.append(host) - return res + raw_response = self.client.send_raw_command(detailed_hosts_list_cmd) + response = SVCResponse(raw_response, {'delim': ' '}) + return response.as_list def _get_detailed_hosts_list_cmd(self, host_list): writer = StringIO() for host in host_list: - host_id = host.get(HOST_ID_PARAM) - writer.write(LIST_HOSTS_CMD_FORMAT.format(HOST_ID=host_id)) + writer.write(LIST_HOSTS_CMD_FORMAT.format(HOST_ID=host.id)) return writer.getvalue() - def _send_raw_cli_command(self, cmd): - output_as_bytes, errors_as_bytes = self.client.send_raw_command(cmd) - output_as_str = bytes_to_string(output_as_bytes) - errors_as_str = bytes_to_string(errors_as_bytes) - formatted_errors_as_str = self._truncate_error_msg(errors_as_str) - return output_as_str, formatted_errors_as_str - - def _truncate_error_msg(self, detailed_host_list_errors): - if len(detailed_host_list_errors) <= HOSTS_LIST_ERR_MSG_MAX_LENGTH: - return detailed_host_list_errors - return "{0} ...".format(detailed_host_list_errors[HOSTS_LIST_ERR_MSG_MAX_LENGTH]) - - def get_volume_mappings(self, volume_id): - logger.debug("Getting volume mappings for volume id : " - "{0}".format(volume_id)) - vol_name = self._get_volume_name_by_wwn(volume_id) - logger.debug("volume name : {0}".format(vol_name)) + def _lsvdiskhostmap(self, volume_name): try: - mapping_list = self.client.svcinfo.lsvdiskhostmap(vdisk_name=vol_name) - res = {} - for mapping in mapping_list: - logger.debug("mapping for volume is :{0}".format(mapping)) - res[mapping.get('host_name', '')] = mapping.get('SCSI_id', '') + return self.client.svcinfo.lsvdiskhostmap(vdisk_name=volume_name) except(svc_errors.CommandExecutionError, CLIFailureError) as ex: logger.error(ex) - raise array_errors.ObjectNotFoundError(volume_id) + raise array_errors.ObjectNotFoundError(volume_name) - return res + def get_volume_mappings(self, volume_id): + logger.debug("Getting volume mappings for volume id : " + "{0}".format(volume_id)) + volume_name = self._get_volume_name_by_wwn(volume_id) + logger.debug("volume name : {0}".format(volume_name)) + mapping_list = self._lsvdiskhostmap(volume_name) + luns_by_host = {} + for mapping in mapping_list: + logger.debug("mapping for volume is :{0}".format(mapping)) + luns_by_host[mapping.get('host_name', '')] = mapping.get('SCSI_id', '') + return luns_by_host def _get_used_lun_ids_from_host(self, host_name): logger.debug("getting used lun ids for host :{0}".format(host_name)) @@ -813,10 +839,10 @@ def _get_free_lun(self, host_name): def map_volume(self, volume_id, host_name, connectivity_type): logger.debug("mapping volume : {0} to host : " "{1}".format(volume_id, host_name)) - vol_name = self._get_volume_name_by_wwn(volume_id) + volume_name = self._get_volume_name_by_wwn(volume_id) cli_kwargs = { 'host': host_name, - 'object_id': vol_name, + 'object_id': volume_name, 'force': True } lun = "" @@ -826,22 +852,26 @@ def map_volume(self, volume_id, host_name, connectivity_type): cli_kwargs.update({'scsi': lun}) self.client.svctask.mkvdiskhostmap(**cli_kwargs) except (svc_errors.CommandExecutionError, CLIFailureError) as ex: - if not is_warning_message(ex.my_message): - logger.error(msg="Map volume {0} to host {1} failed. Reason " - "is: {2}".format(vol_name, host_name, ex)) + if is_warning_message(ex.my_message): + logger.warning("exception encountered during volume {0} mapping to host {1}: {2}".format(volume_name, + host_name, + ex.my_message)) + else: + logger.error("Map volume {0} to host {1} failed. Reason " + "is: {2}".format(volume_name, host_name, ex)) if NAME_NOT_EXIST_OR_MEET_RULES in ex.my_message: raise array_errors.HostNotFoundError(host_name) if SPECIFIED_OBJ_NOT_EXIST in ex.my_message: - raise array_errors.ObjectNotFoundError(vol_name) + raise array_errors.ObjectNotFoundError(volume_name) if LUN_ALREADY_IN_USE in ex.my_message: raise array_errors.LunAlreadyInUseError(lun, host_name) - raise array_errors.MappingError(vol_name, host_name, ex) + raise array_errors.MappingError(volume_name, host_name, ex) return str(lun) def unmap_volume(self, volume_id, host_name): - logger.debug("un-mapping volume : {0} from host : " + logger.debug("unmapping volume : {0} from host : " "{1}".format(volume_id, host_name)) volume_name = self._get_volume_name_by_wwn(volume_id) @@ -853,9 +883,14 @@ def unmap_volume(self, volume_id, host_name): try: self.client.svctask.rmvdiskhostmap(**cli_kwargs) except (svc_errors.CommandExecutionError, CLIFailureError) as ex: - if not is_warning_message(ex.my_message): - logger.error(msg="Map volume {0} to host {1} failed. Reason " - "is: {2}".format(volume_name, host_name, ex)) + if is_warning_message(ex.my_message): + logger.warning("exception encountered during volume {0}" + " unmapping from host {1}: {2}".format(volume_name, + host_name, + ex.my_message)) + else: + logger.error("unmapping volume {0} from host {1} failed. Reason " + "is: {2}".format(volume_name, host_name, ex)) if NAME_NOT_EXIST_OR_MEET_RULES in ex.my_message: raise array_errors.HostNotFoundError(host_name) if OBJ_NOT_FOUND in ex.my_message: @@ -868,14 +903,9 @@ def unmap_volume(self, volume_id, host_name): def _get_array_iqns_by_node_id(self): logger.debug("Getting array nodes id and iscsi name") - try: - nodes_list = self.client.svcinfo.lsnode() - array_iqns_by_id = {node.id: node.iscsi_name for node in nodes_list - if node.status.lower() == "online"} - except (svc_errors.CommandExecutionError, CLIFailureError) as ex: - if not is_warning_message(ex.my_message): - logger.error(ex) - raise ex + nodes_list = self.client.svcinfo.lsnode() + array_iqns_by_id = {node.id: node.iscsi_name for node in nodes_list + if node.status.lower() == "online"} logger.debug("Found iqns by node id: {}".format(array_iqns_by_id)) return array_iqns_by_id @@ -924,22 +954,25 @@ def get_iscsi_targets_by_iqn(self, host_name): return ips_by_iqn raise array_errors.NoIscsiTargetsFoundError(self.endpoint) + def _lsfabric(self, host_name): + try: + return self.client.svcinfo.lsfabric(host=host_name) + except(svc_errors.CommandExecutionError, CLIFailureError) as ex: + logger.error("Failed to get array fc wwn. Reason " + "is: {0}".format(ex)) + raise ex + def get_array_fc_wwns(self, host_name): logger.debug("Getting the connected fc port wwn value from array " "related to host : {}.".format(host_name)) fc_port_wwns = [] - try: - fc_wwns = self.client.svcinfo.lsfabric(host=host_name) - for wwn in fc_wwns: - state = wwn.get('state', '') - if state in ('active', 'inactive'): - fc_port_wwns.append(wwn.get('local_wwpn', '')) - logger.debug("Getting fc wwns : {}".format(fc_port_wwns)) - return fc_port_wwns - except(svc_errors.CommandExecutionError, CLIFailureError) as ex: - logger.error(msg="Failed to get array fc wwn. Reason " - "is: {0}".format(ex)) - raise ex + fc_wwns = self._lsfabric(host_name) + for wwn in fc_wwns: + state = wwn.get('state', '') + if state in ('active', 'inactive'): + fc_port_wwns.append(wwn.get('local_wwpn', '')) + logger.debug("Getting fc wwns : {}".format(fc_port_wwns)) + return fc_port_wwns def _get_cli_host_by_name(self, host_name): filter_value = 'name={}'.format(host_name) @@ -1064,7 +1097,13 @@ def _create_rcrelationship(self, master_cli_volume_id, aux_cli_volume_id, other_ raw_id = message[id_start:id_end] return int(raw_id) except (svc_errors.CommandExecutionError, CLIFailureError) as ex: - if not is_warning_message(ex.my_message): + if is_warning_message(ex.my_message): + logger.warning("exception encountered during creation of rcrelationship for volume id {0} " + "with volume id {1} of system {2}: {3}".format(master_cli_volume_id, + aux_cli_volume_id, + other_system_id, + ex)) + else: logger.error("failed to create rcrelationship for volume id {0} " "with volume id {1} of system {2}: {3}".format(master_cli_volume_id, aux_cli_volume_id, @@ -1081,7 +1120,10 @@ def _start_rcrelationship(self, rcrelationship_id, primary_endpoint_type=None, f kwargs = build_start_replication_kwargs(rcrelationship_id, primary_endpoint_type, force) self.client.svctask.startrcrelationship(**kwargs) except (svc_errors.CommandExecutionError, CLIFailureError) as ex: - if not is_warning_message(ex.my_message): + if is_warning_message(ex.my_message): + logger.warning("exception encountered while starting rcrelationship '{}': {}".format(rcrelationship_id, + ex.my_message)) + else: logger.warning("failed to start rcrelationship '{}': {}".format(rcrelationship_id, ex)) def create_replication(self, volume_internal_id, other_volume_internal_id, other_system_id, copy_type): @@ -1095,7 +1137,11 @@ def _stop_rcrelationship(self, rcrelationship_id, add_access_to_secondary=False) try: self.client.svctask.stoprcrelationship(**kwargs) except (svc_errors.CommandExecutionError, CLIFailureError) as ex: - if not is_warning_message(ex.my_message): + if is_warning_message(ex.my_message): + logger.warning("exception encountered while stopping" + " rcrelationship '{0}': {1}".format(rcrelationship_id, + ex.my_message)) + else: logger.warning("failed to stop rcrelationship '{0}': {1}".format(rcrelationship_id, ex)) def _delete_rcrelationship(self, rcrelationship_id): @@ -1103,7 +1149,11 @@ def _delete_rcrelationship(self, rcrelationship_id): try: self.client.svctask.rmrcrelationship(object_id=rcrelationship_id) except (svc_errors.CommandExecutionError, CLIFailureError) as ex: - if not is_warning_message(ex.my_message): + if is_warning_message(ex.my_message): + logger.warning("exception encountered during rcrelationship" + " '{0}' deletion: {1}".format(rcrelationship_id, + ex.my_message)) + else: logger.warning("failed to delete rcrelationship '{0}': {1}".format(rcrelationship_id, ex)) def delete_replication(self, replication_name): @@ -1119,7 +1169,12 @@ def _promote_replication_endpoint(self, endpoint_type, replication_name): try: self.client.svctask.switchrcrelationship(primary=endpoint_type, object_id=replication_name) except (svc_errors.CommandExecutionError, CLIFailureError) as ex: - if not is_warning_message(ex.my_message): + if is_warning_message(ex.my_message): + logger.warning("exception encountered while making '{}' primary" + " for rcrelationship {}: {}".format(endpoint_type, + replication_name, + ex.my_message)) + else: logger.error("failed to make '{}' primary for rcrelationship {}: {}".format(endpoint_type, replication_name, ex.my_message)) diff --git a/controller/array_action/array_mediator_xiv.py b/controller/array_action/array_mediator_xiv.py index c359e4d14..5207aa57e 100644 --- a/controller/array_action/array_mediator_xiv.py +++ b/controller/array_action/array_mediator_xiv.py @@ -8,7 +8,7 @@ from controller.array_action.array_action_types import Volume, Snapshot from controller.array_action.array_mediator_abstract import ArrayMediatorAbstract from controller.array_action.config import FC_CONNECTIVITY_TYPE, ISCSI_CONNECTIVITY_TYPE -from controller.array_action.utils import classproperty +from controller.array_action.utils import ClassProperty from controller.common import settings from controller.common.csi_logger import get_stdout_logger from controller.common.utils import string_to_array @@ -28,46 +28,44 @@ class XIVArrayMediator(ArrayMediatorAbstract): MAX_LUN_NUMBER = 250 MIN_LUN_NUMBER = 1 - @classproperty + @ClassProperty def array_type(self): return settings.ARRAY_TYPE_XIV - @classproperty + @ClassProperty def port(self): return 7778 - @classproperty + @ClassProperty def max_object_name_length(self): return 63 - @classproperty + @ClassProperty def max_object_prefix_length(self): return 20 - @classproperty + @ClassProperty def max_connections(self): return 2 - @classproperty + @ClassProperty def minimal_volume_size_in_bytes(self): return 1 * 1024 * 1024 * 1024 # 1 GiB - @classproperty + @ClassProperty def maximal_volume_size_in_bytes(self): return 1 * 1024 * 1024 * 1024 * 1024 * 1024 - @classproperty + @ClassProperty def max_lun_retries(self): return 10 - @classproperty + @ClassProperty def default_object_prefix(self): return None def __init__(self, user, password, endpoint): - self.user = user - self.password = password - self.endpoint = endpoint + super().__init__(user, password, endpoint) self.client = None self._identifier = None @@ -159,16 +157,16 @@ def _get_cli_object_by_name(self, volume_name): logger.exception(ex) raise array_errors.IllegalObjectName(ex.status) - def get_volume(self, volume_name, pool=None): - logger.debug("Get volume : {}".format(volume_name)) - cli_volume = self._get_cli_object_by_name(volume_name) + def get_volume(self, name, pool=None): + logger.debug("Get volume : {}".format(name)) + cli_volume = self._get_cli_object_by_name(name) logger.debug("cli volume returned : {}".format(cli_volume)) if not cli_volume: - raise array_errors.ObjectNotFoundError(volume_name) + raise array_errors.ObjectNotFoundError(name) if cli_volume.master_name: - raise array_errors.VolumeNameBelongsToSnapshotError(volume_name, self.endpoint) + raise array_errors.VolumeNameBelongsToSnapshotError(name, self.endpoint) array_volume = self._generate_volume_response(cli_volume) return array_volume @@ -205,7 +203,7 @@ def validate_supported_space_efficiency(self, space_efficiency): def _convert_size_bytes_to_blocks(self, size_in_bytes): return int(size_in_bytes / self.BLOCK_SIZE_IN_BYTES) - def create_volume(self, name, size_in_bytes, space_efficiency, pool): + def create_volume(self, name, size_in_bytes, space_efficiency, pool, io_group): logger.info("creating volume with name : {}. size : {} . in pool : {} with parameters : {}".format( name, size_in_bytes, pool, space_efficiency)) @@ -394,12 +392,12 @@ def get_volume_mappings(self, volume_id): vol_name = self._get_object_name_by_wwn(volume_id) logger.debug("volume name : {0}".format(vol_name)) mapping_list = self.client.cmd.vol_mapping_list(vol=vol_name).as_list - res = {} + luns_by_host = {} for mapping in mapping_list: logger.debug("mapping for volume is :{0}".format(mapping)) - res[mapping.host] = mapping.lun + luns_by_host[mapping.host] = mapping.lun - return res + return luns_by_host def _get_next_available_lun(self, host_name): logger.debug("getting host mapping list for host :{0}".format(host_name)) diff --git a/controller/array_action/ds8k_rest_client.py b/controller/array_action/ds8k_rest_client.py index 7a9db5a69..fa0aae1dd 100644 --- a/controller/array_action/ds8k_rest_client.py +++ b/controller/array_action/ds8k_rest_client.py @@ -143,13 +143,13 @@ def get_used_lun_numbers_by_host(self, host_name): mappings = self._client.get_mappings_by_host(host_name) return [mapping.id for mapping in mappings] - def create_volume(self, name, capacity_in_bytes, pool_id, tp): + def create_volume(self, name, capacity_in_bytes, pool_id, thin_provisioning): return self._client.create_volume_fb( name=name, cap=capacity_in_bytes, captype='bytes', pool=pool_id, - tp=tp + tp=thin_provisioning )[0] def rename_volume(self, volume_id, new_name): diff --git a/controller/array_action/ds8k_volume_cache.py b/controller/array_action/ds8k_volume_cache.py new file mode 100644 index 000000000..d872e9843 --- /dev/null +++ b/controller/array_action/ds8k_volume_cache.py @@ -0,0 +1,58 @@ +from collections import defaultdict +from threading import RLock + +from controller.common.csi_logger import get_stdout_logger + +logger = get_stdout_logger() + + +class VolumeCacheByAddress: + def __init__(self): + logger.debug("creating a new cache") + self._volume_cache_by_address = defaultdict(dict) + self._cache_lock = RLock() + + def add(self, address, key, value): + logger.debug("adding {} to cache".format(key)) + with self._cache_lock: + self._volume_cache_by_address[address][key] = value + + def remove(self, address, key): + logger.debug("removing {} from cache".format(key)) + with self._cache_lock: + if self._volume_cache_by_address[address].get(key) is not None: + del self._volume_cache_by_address[address][key] + + def get(self, address, key): + logger.debug("getting {} from cache".format(key)) + with self._cache_lock: + return self._volume_cache_by_address[address].get(key) + + def add_or_delete(self, address, key, value): + with self._cache_lock: + if self._volume_cache_by_address[address].get(key) is None: + logger.debug("adding {} to cache".format(key)) + self._volume_cache_by_address[address][key] = value + else: + logger.debug("removing {} from cache".format(key)) + del self._volume_cache_by_address[address][key] + + +volume_cache_by_address = VolumeCacheByAddress() + + +class VolumeCache: + def __init__(self, service_address): + self._service_address = service_address + + def add(self, key, value): + volume_cache_by_address.add(self._service_address, key, value) + + def remove(self, key): + volume_cache_by_address.remove(self._service_address, key) + + def get(self, key): + return volume_cache_by_address.get(self._service_address, key) + + def add_or_delete(self, key, value): + volume_cache_by_address.add_or_delete(self._service_address, key, value) diff --git a/controller/array_action/errors.py b/controller/array_action/errors.py index f1850b6b9..93b2c2a2d 100644 --- a/controller/array_action/errors.py +++ b/controller/array_action/errors.py @@ -13,26 +13,30 @@ def __str__(self, *args, **kwargs): class NoConnectionAvailableException(BaseArrayActionException): def __init__(self, endpoint): - self.message = messages.NoConnectionAvailableException_message.format(endpoint) + super().__init__() + self.message = messages.NO_CONNECTION_AVAILABLE_EXCEPTION_MESSAGE.format(endpoint) class StorageManagementIPsNotSupportError(BaseArrayActionException): def __init__(self, endpoint): - self.message = messages.StorageManagementIPsNotSupportError_message.format(endpoint) + super().__init__() + self.message = messages.STORAGE_MANAGEMENT_IPS_NOT_SUPPORT_ERROR_MESSAGE.format(endpoint) class CredentialsError(BaseArrayActionException): def __init__(self, endpoint): - self.message = messages.CredentialsError_message.format(endpoint) + super().__init__() + self.message = messages.CREDENTIALS_ERROR_MESSAGE.format(endpoint) class UnsupportedStorageVersionError(BaseArrayActionException): def __init__(self, version, supported_version): - self.message = messages.UnsupportedStorageVersionError_message.format(version, - supported_version) # noqa + super().__init__() + self.message = messages.UNSUPPORTED_STORAGE_VERSION_ERROR_MESSAGE.format(version, + supported_version) # noqa # ============================================================================= @@ -45,174 +49,203 @@ class InvalidArgumentError(BaseArrayActionException): class ObjectNotFoundError(BaseArrayActionException): def __init__(self, name): - self.message = messages.ObjectNotFoundError_message.format(name) + super().__init__() + self.message = messages.OBJECT_NOT_FOUND_ERROR_MESSAGE.format(name) class VolumeNameBelongsToSnapshotError(BaseArrayActionException): def __init__(self, volume, array): - self.message = messages.VolumeNameBelongsToSnapshotError_message.format(volume, array) + super().__init__() + self.message = messages.VOLUME_NAME_BELONGS_TO_SNAPSHOT_ERROR_MESSAGE.format(volume, array) class VolumeCreationError(BaseArrayActionException): def __init__(self, name): - self.message = messages.VolumeCreationError_message.format(name) + super().__init__() + self.message = messages.VOLUME_CREATION_ERROR_MESSAGE.format(name) class VolumeDeletionError(BaseArrayActionException): def __init__(self, volume_id): - self.message = messages.VolumeDeletionError_message.format(volume_id) + super().__init__() + self.message = messages.VOLUME_DELETION_ERROR_MESSAGE.format(volume_id) class IllegalObjectName(InvalidArgumentError): def __init__(self, msg): + super().__init__() self.message = "{0}".format(msg) class IllegalObjectID(InvalidArgumentError): def __init__(self, msg): + super().__init__() self.message = "{0}".format(msg) class PoolDoesNotMatchSpaceEfficiency(InvalidArgumentError): def __init__(self, pool, space_efficiency, error): - self.message = messages.PoolDoesNotMatchSpaceEfficiency_message.format(pool, space_efficiency, - error) + super().__init__() + self.message = messages.POOL_DOES_NOT_MATCH_SPACE_EFFICIENCY_MESSAGE.format(pool, space_efficiency, + error) class SpaceEfficiencyNotSupported(InvalidArgumentError): def __init__(self, space_efficiency): - self.message = messages.SpaceEfficiencyNotSupported_message.format(space_efficiency) + super().__init__() + self.message = messages.SPACE_EFFICIENCY_NOT_SUPPORTED_MESSAGE.format(space_efficiency) class VolumeAlreadyExists(BaseArrayActionException): def __init__(self, volume_name, array): - self.message = messages.VolumeAlreadyExists_message.format(volume_name, array) + super().__init__() + self.message = messages.VOLUME_ALREADY_EXISTS_MESSAGE.format(volume_name, array) class PoolDoesNotExist(InvalidArgumentError): def __init__(self, pool, array): - self.message = messages.PoolDoesNotExist_message.format(pool, array) + super().__init__() + self.message = messages.POOL_DOES_NOT_EXIST_MESSAGE.format(pool, array) class PoolParameterIsMissing(InvalidArgumentError): def __init__(self, array_type): - self.message = messages.PoolParameterIsMissing.format(array_type) + super().__init__() + self.message = messages.POOL_PARAMETER_IS_MISSING.format(array_type) class FailedToFindStorageSystemType(BaseArrayActionException): def __init__(self, endpoint): - self.message = messages.FailedToFindStorageSystemType_message.format(endpoint) + super().__init__() + self.message = messages.FAILED_TO_FIND_STORAGE_SYSTEM_TYPE_MESSAGE.format(endpoint) class PermissionDeniedError(BaseArrayActionException): def __init__(self, operation): - self.message = messages.PermissionDeniedError_message.format(operation) + super().__init__() + self.message = messages.PERMISSION_DENIED_ERROR_MESSAGE.format(operation) class MultipleHostsFoundError(BaseArrayActionException): def __init__(self, initiators, hosts): - self.message = messages.MultipleHostsFoundError_message.format(initiators, hosts) + super().__init__() + self.message = messages.MULTIPLE_HOSTS_FOUND_ERROR_MESSAGE.format(initiators, hosts) class HostNotFoundError(BaseArrayActionException): def __init__(self, iscsi_iqn): - self.message = messages.HostNotFoundError_message.format(iscsi_iqn) + super().__init__() + self.message = messages.HOST_NOT_FOUND_ERROR_MESSAGE.format(iscsi_iqn) class NoAvailableLunError(BaseArrayActionException): def __init__(self, host): - self.message = messages.NoAvailableLunError_message.format(host) + super().__init__() + self.message = messages.NO_AVAILABLE_LUN_ERROR_MESSAGE.format(host) class LunAlreadyInUseError(BaseArrayActionException): def __init__(self, lun, host): - self.message = messages.LunAlreadyInUse_message.format(lun, host) + super().__init__() + self.message = messages.LUN_ALREADY_IN_USE_MESSAGE.format(lun, host) class MappingError(BaseArrayActionException): def __init__(self, volume_id_or_name, host, err): - self.message = messages.MappingError_message.format(volume_id_or_name, host, err) + super().__init__() + self.message = messages.MAPPING_ERROR_MESSAGE.format(volume_id_or_name, host, err) class VolumeAlreadyUnmappedError(BaseArrayActionException): def __init__(self, volume_id_or_name): - self.message = messages.VolumeAlreadyUnmapped_message.format(volume_id_or_name) + super().__init__() + self.message = messages.VOLUME_ALREADY_UNMAPPED_MESSAGE.format(volume_id_or_name) class UnmappingError(BaseArrayActionException): def __init__(self, volume_id_or_name, host, err): - self.message = messages.UnMappingError_message.format(volume_id_or_name, host, err) + super().__init__() + self.message = messages.UNMAPPING_ERROR_MESSAGE.format(volume_id_or_name, host, err) class VolumeMappedToMultipleHostsError(BaseArrayActionException): def __init__(self, hosts): - self.message = messages.VolumeMappedToMultipleHostsError_message.format(hosts) + super().__init__() + self.message = messages.VOLUME_MAPPED_TO_MULTIPLE_HOSTS_ERROR_MESSAGE.format(hosts) class NoIscsiTargetsFoundError(BaseArrayActionException): def __init__(self, endpoint): - self.message = messages.NoIscsiTargetsFoundError_message.format(endpoint) + super().__init__() + self.message = messages.NO_ISCSI_TARGETS_FOUND_ERROR_MESSAGE.format(endpoint) class UnsupportedConnectivityTypeError(InvalidArgumentError): def __init__(self, connectivity_type): - self.message = messages.UnsupportedConnectivityTypeError_message.format(connectivity_type) + super().__init__() + self.message = messages.UNSUPPORTED_CONNECTIVITY_TYPE_ERROR_MESSAGE.format(connectivity_type) class ExpectedSnapshotButFoundVolumeError(InvalidArgumentError): def __init__(self, id_or_name, array): - self.message = messages.ExpectedSnapshotButFoundVolumeError_message.format(id_or_name, array) + super().__init__() + self.message = messages.EXPECTED_SNAPSHOT_BUT_FOUND_VOLUME_ERROR_MESSAGE.format(id_or_name, array) class SnapshotAlreadyExists(BaseArrayActionException): def __init__(self, snapshot_id_or_name, array): - self.message = messages.SnapshotAlreadyExistsError_message.format(snapshot_id_or_name, array) + super().__init__() + self.message = messages.SNAPSHOT_ALREADY_EXISTS_ERROR_MESSAGE.format(snapshot_id_or_name, array) class SnapshotSourcePoolMismatch(BaseArrayActionException): def __init__(self, snapshot_pool, source_pool): - self.message = messages.SnapshotSourcePoolMismatchError_message.format(snapshot_pool, source_pool) + super().__init__() + self.message = messages.SNAPSHOT_SOURCE_POOL_MISMATCH_ERROR_MESSAGE.format(snapshot_pool, source_pool) class ObjectIsStillInUseError(BaseArrayActionException): def __init__(self, id_or_name, used_by: list): - self.message = messages.ObjectIsStillInUseError_message.format(id_or_name, used_by[0]) + super().__init__() + self.message = messages.OBJECT_IS_STILL_IN_USE_ERROR_MESSAGE.format(id_or_name, used_by[0]) self.message += ' {0} more were truncated.'.format(len(used_by) - 1) if len(used_by) > 1 else '' class InvalidCliResponseError(BaseArrayActionException): def __init__(self, details): - self.message = messages.InvalidCliResponseError_message.format(details) + super().__init__() + self.message = messages.INVALID_CLI_RESPONSE_ERROR_MESSAGE.format(details) class NotEnoughSpaceInPool(BaseArrayActionException): def __init__(self, id_or_name): - self.message = messages.NotEnoughSpaceInPoolError_message.format(id_or_name) + super().__init__() + self.message = messages.NOT_ENOUGH_SPACE_IN_POOL_ERROR_MESSAGE.format(id_or_name) diff --git a/controller/array_action/messages.py b/controller/array_action/messages.py index 8f8bc2797..957e5d15c 100644 --- a/controller/array_action/messages.py +++ b/controller/array_action/messages.py @@ -1,70 +1,71 @@ -NoConnectionAvailableException_message = "Currently no connection is available to endpoint: {0}" +NO_CONNECTION_AVAILABLE_EXCEPTION_MESSAGE = "Currently no connection is available to endpoint: {0}" -CredentialsError_message = "Credential error has occurred while connecting to endpoint : {0} " +CREDENTIALS_ERROR_MESSAGE = "Credential error has occurred while connecting to endpoint : {0} " -StorageManagementIPsNotSupportError_message = "Invalid Management IP for SVC : {0} " +STORAGE_MANAGEMENT_IPS_NOT_SUPPORT_ERROR_MESSAGE = "Invalid Management IP for SVC : {0} " -ObjectNotFoundError_message = "Object was not found : {0} " +OBJECT_NOT_FOUND_ERROR_MESSAGE = "Object was not found : {0} " -VolumeNameBelongsToSnapshotError_message = "Volume not found. Snapshot with the same id exists. \ +VOLUME_NAME_BELONGS_TO_SNAPSHOT_ERROR_MESSAGE = "Volume not found. Snapshot with the same id exists. \ Name : {0} , array : {1}" -PoolDoesNotMatchSpaceEfficiency_message = "Pool : {0} does not match the following space efficiency : {1} . error : {2}" +POOL_DOES_NOT_MATCH_SPACE_EFFICIENCY_MESSAGE = "Pool : {0} does not match the following space efficiency : {1} . " \ + "error : {2}" -SpaceEfficiencyNotSupported_message = "space efficiency is not supported : {0} " +SPACE_EFFICIENCY_NOT_SUPPORTED_MESSAGE = "space efficiency is not supported : {0} " -VolumeAlreadyExists_message = "Volume already exists : {0} , array : {1}" +VOLUME_ALREADY_EXISTS_MESSAGE = "Volume already exists : {0} , array : {1}" -PoolDoesNotExist_message = "Pool does not exist: {0} , array : {1}" +POOL_DOES_NOT_EXIST_MESSAGE = "Pool does not exist: {0} , array : {1}" -PoolParameterIsMissing = "Pool parameter is mandatory in {0}" +POOL_PARAMETER_IS_MISSING = "Pool parameter is mandatory in {0}" -FailedToFindStorageSystemType_message = "Could not identify the type for endpoint: {0} " +FAILED_TO_FIND_STORAGE_SYSTEM_TYPE_MESSAGE = "Could not identify the type for endpoint: {0} " -PermissionDeniedError_message = "Permission was denied to operation : {0}" +PERMISSION_DENIED_ERROR_MESSAGE = "Permission was denied to operation : {0}" -MultipleHostsFoundError_message = "Multiple hosts found for port(s): {0}. hosts are : {1}" +MULTIPLE_HOSTS_FOUND_ERROR_MESSAGE = "Multiple hosts found for port(s): {0}. hosts are : {1}" -HostNotFoundError_message = "Host for node: {0} was not found, ensure all host ports are configured on storage" +HOST_NOT_FOUND_ERROR_MESSAGE = "Host for node: {0} was not found, ensure all host ports are configured on storage" -NoAvailableLunError_message = "No available lun was found for host : {0}" +NO_AVAILABLE_LUN_ERROR_MESSAGE = "No available lun was found for host : {0}" -LunAlreadyInUse_message = "Lun : {0} is already mapped for host : {1}" +LUN_ALREADY_IN_USE_MESSAGE = "Lun : {0} is already mapped for host : {1}" -MappingError_message = "Mapping error has occurred while mapping volume : {0} to host : {1}. error : {2}" +MAPPING_ERROR_MESSAGE = "Mapping error has occurred while mapping volume : {0} to host : {1}. error : {2}" -VolumeAlreadyUnmapped_message = "Volume: {0} is already unmapped." +VOLUME_ALREADY_UNMAPPED_MESSAGE = "Volume: {0} is already unmapped." -UnMappingError_message = "Unmapping error has occurred for volume : {0} and host : {1}. error : {2}" +UNMAPPING_ERROR_MESSAGE = "Unmapping error has occurred for volume : {0} and host : {1}. error : {2}" -VolumeMappedToMultipleHostsError_message = "Volume is already mapped to different hosts {0}" +VOLUME_MAPPED_TO_MULTIPLE_HOSTS_ERROR_MESSAGE = "Volume is already mapped to different hosts {0}" -UnsupportedStorageVersionError_message = ('Unsupported storage system microcode version {}, ' - 'the version should not be lower than {}') +UNSUPPORTED_STORAGE_VERSION_ERROR_MESSAGE = ('Unsupported storage system microcode version {}, ' + 'the version should not be lower than {}') -VolumeCreationError_message = 'Failed to create volume {}' +VOLUME_CREATION_ERROR_MESSAGE = 'Failed to create volume {}' -VolumeDeletionError_message = 'Failed to delete volume {}' +VOLUME_DELETION_ERROR_MESSAGE = 'Failed to delete volume {}' -NoIscsiTargetsFoundError_message = "Could not find iSCSI targets for endpoint: {0}" +NO_ISCSI_TARGETS_FOUND_ERROR_MESSAGE = "Could not find iSCSI targets for endpoint: {0}" -UnsupportedConnectivityTypeError_message = "Unsupported connectivity type: {0}" +UNSUPPORTED_CONNECTIVITY_TYPE_ERROR_MESSAGE = "Unsupported connectivity type: {0}" -SnapshotNotFoundError_message = "Snapshot was not found : {0} " +SNAPSHOT_NOT_FOUND_ERROR_MESSAGE = "Snapshot was not found : {0} " -SnapshotAlreadyExistsError_message = "Snapshot already exists : {0} , array : {1}" +SNAPSHOT_ALREADY_EXISTS_ERROR_MESSAGE = "Snapshot already exists : {0} , array : {1}" -ExpectedSnapshotButFoundVolumeError_message = "Could not find info about the source of: {0}, array: {1}" +EXPECTED_SNAPSHOT_BUT_FOUND_VOLUME_ERROR_MESSAGE = "Could not find info about the source of: {0}, array: {1}" -SnapshotWrongVolumeError_message = "Snapshot {0} exists but it is of Volume {1} and not {2}" +SNAPSHOT_WRONG_VOLUME_ERROR_MESSAGE = "Snapshot {0} exists but it is of Volume {1} and not {2}" -ObjectIsStillInUseError_message = "Object {0} is still in use by {1}" +OBJECT_IS_STILL_IN_USE_ERROR_MESSAGE = "Object {0} is still in use by {1}" -InvalidCliResponseError_message = "Invalid CLI response. Details : {0}" +INVALID_CLI_RESPONSE_ERROR_MESSAGE = "Invalid CLI response. Details : {0}" -NotEnoughSpaceInPoolError_message = "Not enough space in pool {0}" +NOT_ENOUGH_SPACE_IN_POOL_ERROR_MESSAGE = "Not enough space in pool {0}" -SizeOutOfRangeError_message = "requested size is out of limits. requested: {0}," \ - " max_in_byte: {1}" +SIZE_OUT_OF_RANGE_ERROR_MESSAGE = "requested size is out of limits. requested: {0}," \ + " max_in_byte: {1}" -SnapshotSourcePoolMismatchError_message = "Snapshot pool : {0} does not match the source volume pool : {1}" +SNAPSHOT_SOURCE_POOL_MISMATCH_ERROR_MESSAGE = "Snapshot pool : {0} does not match the source volume pool : {1}" diff --git a/controller/array_action/svc_cli_result_reader.py b/controller/array_action/svc_cli_result_reader.py deleted file mode 100644 index 59bc9ac40..000000000 --- a/controller/array_action/svc_cli_result_reader.py +++ /dev/null @@ -1,109 +0,0 @@ -import controller.array_action.errors as array_errors -from controller.common.csi_logger import get_stdout_logger - -logger = get_stdout_logger() - -ID_PARAM_NAME = "id" - - -class SVCListResultsReader: - """ - Iterable object used to read raw command response from SVC array. - Each object in response is translated to SVCListResultsElement. - Input is received as string which represents '\n'-separated list of returned lines from output. - Line with param 'id' (e.g. 'id 1') is recognized as first line of object ans used as separator between objects - (e.g. in input "id 1\nname n3id 2name n2" first object starts with line 'id 1' - and ends with 'id 2') - """ - - def __init__(self, hosts_raw_list_as_string): - self._hosts_raw_list = hosts_raw_list_as_string.splitlines() - self._current_index = 0 - self._next_object_id = None - self._init_first_object_id() - - def _init_first_object_id(self): - """ - Set _next_object_id to id of the first object and _current_index to point to next line - - Raises: - InvalidCliResponseError - """ - while not self._next_object_id and self._current_index < len(self._hosts_raw_list): - line = self._hosts_raw_list[self._current_index].strip() - self._current_index += 1 - if line: - param_name, _, param_value = line.partition(' ') - param_value = param_value.strip() - if param_name == ID_PARAM_NAME: - self._next_object_id = param_value - else: - raise array_errors.InvalidCliResponseError( - "First param is '{0}'. Expected param name '{1}'".format(line, ID_PARAM_NAME)) - - def __iter__(self): - return self - - def __next__(self): - """ - Assumed self._current_index points to the line after line 'id ' of the next object - - Returns: - Next object as SVCListResultsElement. - Raises: - StopIteration - """ - - if not self._has_next(): - raise StopIteration - - res = SVCListResultsElement() - res.add(ID_PARAM_NAME, self._next_object_id) - self._next_object_id = None - while self._current_index < len(self._hosts_raw_list): - line = self._hosts_raw_list[self._current_index].strip() - self._current_index += 1 - if not line: - continue - param_name, _, param_value = line.partition(' ') - param_value = param_value.strip() - if param_name == ID_PARAM_NAME: - self._next_object_id = param_value - return res - res.add(param_name, param_value) - return res - - def _has_next(self): - return self._next_object_id - - -class SVCListResultsElement: - """ - Single parsed object returned from SVC list command - """ - - def __init__(self): - self._dict = {} - - def get(self, name, default_value=None): - return self._dict.get(name, default_value) - - def get_as_list(self, name): - if name in self._dict: - value = self._dict[name] - return value if isinstance(value, list) else [value] - return [] - - def add(self, name, value): - if name in self._dict: - curr_val = self._dict[name] - if isinstance(curr_val, list): - curr_val.append(value) - else: - new_val = [curr_val, value] - self._dict[name] = new_val - else: - self._dict[name] = value - - def __str__(self): - return self._dict.__str__() diff --git a/controller/array_action/utils.py b/controller/array_action/utils.py index 09c1eb7c9..c634cf552 100644 --- a/controller/array_action/utils.py +++ b/controller/array_action/utils.py @@ -8,10 +8,6 @@ logger = get_stdout_logger() -def bytes_to_string(input_as_bytes): - return input_as_bytes.decode(UTF_8) if input_as_bytes else "" - - def convert_scsi_id_to_nguid(volume_id): logger.debug("Converting scsi uuid : {} to nguid".format(volume_id)) oui = volume_id[1:WWN_OUI_END] @@ -22,7 +18,7 @@ def convert_scsi_id_to_nguid(volume_id): return final_nguid -class classproperty: +class ClassProperty: def __init__(self, function): self._function = function diff --git a/controller/controller_server/addons_server.py b/controller/controller_server/addons_server.py index d58b29eab..066cc61c2 100644 --- a/controller/controller_server/addons_server.py +++ b/controller/controller_server/addons_server.py @@ -1,23 +1,22 @@ import grpc +from csi_general import replication_pb2 as pb2 +from csi_general import replication_pb2_grpc as pb2_grpc from controller.array_action import errors as array_errors from controller.array_action.config import REPLICATION_DEFAULT_COPY_TYPE from controller.array_action.storage_agent import get_agent from controller.common.csi_logger import get_stdout_logger -from controller.common.utils import set_current_thread_name from controller.controller_server import config, utils -from controller.controller_server.exception_handler import handle_common_exceptions, build_error_response -from controller.csi_general import replication_pb2 as pb2 -from controller.csi_general import replication_pb2_grpc as pb2_grpc +from controller.controller_server.decorators import csi_method +from controller.controller_server.exception_handler import build_error_response logger = get_stdout_logger() class ReplicationControllerServicer(pb2_grpc.ControllerServicer): - @handle_common_exceptions(pb2.EnableVolumeReplicationResponse) + + @csi_method(error_response_type=pb2.EnableVolumeReplicationResponse, lock_request_attribute="volume_id") def EnableVolumeReplication(self, request, context): - set_current_thread_name(request.volume_id) - logger.info("EnableVolumeReplication") utils.validate_addons_request(request) volume_id_info = utils.get_volume_id_info(request.volume_id) @@ -53,10 +52,8 @@ def EnableVolumeReplication(self, request, context): return pb2.EnableVolumeReplicationResponse() - @handle_common_exceptions(pb2.DisableVolumeReplicationResponse) + @csi_method(error_response_type=pb2.DisableVolumeReplicationResponse, lock_request_attribute="volume_id") def DisableVolumeReplication(self, request, context): - set_current_thread_name(request.volume_id) - logger.info("DisableVolumeReplication") utils.validate_addons_request(request) volume_id_info = utils.get_volume_id_info(request.volume_id) @@ -95,7 +92,6 @@ def _ensure_volume_role_for_replication(mediator, replication, is_to_promote): logger.info("idempotent case. volume is already secondary") def _ensure_volume_role(self, request, context, is_to_promote, response_type): - set_current_thread_name(request.volume_id) method_name = "PromoteVolume" if is_to_promote else "DemoteVolume" logger.info(method_name) utils.validate_addons_request(request) @@ -124,18 +120,16 @@ def _ensure_volume_role(self, request, context, is_to_promote, response_type): logger.info("finished {}".format(method_name)) return response_type() - @handle_common_exceptions(pb2.PromoteVolumeResponse) + @csi_method(error_response_type=pb2.PromoteVolumeResponse, lock_request_attribute="volume_id") def PromoteVolume(self, request, context): return self._ensure_volume_role(request, context, is_to_promote=True, response_type=pb2.PromoteVolumeResponse) - @handle_common_exceptions(pb2.DemoteVolumeResponse) + @csi_method(error_response_type=pb2.DemoteVolumeResponse, lock_request_attribute="volume_id") def DemoteVolume(self, request, context): return self._ensure_volume_role(request, context, is_to_promote=False, response_type=pb2.DemoteVolumeResponse) - @handle_common_exceptions(pb2.ResyncVolumeResponse) + @csi_method(error_response_type=pb2.ResyncVolumeResponse, lock_request_attribute="volume_id") def ResyncVolume(self, request, context): - set_current_thread_name(request.volume_id) - logger.info("ResyncVolume") utils.validate_addons_request(request) volume_id_info = utils.get_volume_id_info(request.volume_id) diff --git a/controller/controller_server/config.py b/controller/controller_server/config.py index 97b8a0121..c5714ab55 100644 --- a/controller/controller_server/config.py +++ b/controller/controller_server/config.py @@ -1,5 +1,6 @@ +from csi_general import csi_pb2 + from controller.common.settings import ALL_ARRAY_TYPES -from controller.csi_general import csi_pb2 SUPPORTED_FS_TYPES = ["ext4", "xfs"] @@ -32,6 +33,7 @@ PARAMETERS_POOL = "pool" PARAMETERS_BY_SYSTEM = "by_management_id" PARAMETERS_SPACE_EFFICIENCY = "SpaceEfficiency" +PARAMETERS_IO_GROUP = "io_group" PARAMETERS_VOLUME_NAME_PREFIX = "volume_name_prefix" PARAMETERS_SNAPSHOT_NAME_PREFIX = "snapshot_name_prefix" PARAMETERS_SYSTEM_ID = "system_id" diff --git a/controller/controller_server/controller_server_manager.py b/controller/controller_server/controller_server_manager.py index 4565aae53..4e04b4c89 100644 --- a/controller/controller_server/controller_server_manager.py +++ b/controller/controller_server/controller_server_manager.py @@ -2,14 +2,13 @@ from concurrent import futures import grpc +from csi_general import csi_pb2_grpc +from csi_general import replication_pb2_grpc from controller.common import settings from controller.common.csi_logger import get_stdout_logger -from controller.controller_server.csi_controller_server import CSIControllerServicer from controller.controller_server.addons_server import ReplicationControllerServicer -from controller.csi_general import csi_pb2_grpc -from controller.csi_general import replication_pb2_grpc - +from controller.controller_server.csi_controller_server import CSIControllerServicer logger = get_stdout_logger() diff --git a/controller/controller_server/controller_types.py b/controller/controller_server/controller_types.py index 010821b92..b283417b6 100644 --- a/controller/controller_server/controller_types.py +++ b/controller/controller_server/controller_types.py @@ -22,3 +22,4 @@ class ObjectParameters: pool: str space_efficiency: str prefix: str + io_group: str diff --git a/controller/controller_server/csi_controller_server.py b/controller/controller_server/csi_controller_server.py index da6114801..c2723c692 100755 --- a/controller/controller_server/csi_controller_server.py +++ b/controller/controller_server/csi_controller_server.py @@ -2,6 +2,8 @@ import grpc import yaml +from csi_general import csi_pb2 +from csi_general import csi_pb2_grpc from retry import retry import controller.array_action.errors as array_errors @@ -12,13 +14,11 @@ from controller.common import settings from controller.common.csi_logger import get_stdout_logger from controller.common.node_info import NodeIdInfo -from controller.common.utils import set_current_thread_name from controller.controller_server import messages as controller_messages -from controller.controller_server.errors import ObjectIdError, ValidationException -from controller.controller_server.exception_handler import handle_common_exceptions, handle_exception, \ +from controller.controller_server.decorators import csi_method +from controller.controller_server.errors import ObjectIdError, ValidationException, InvalidNodeId +from controller.controller_server.exception_handler import handle_exception, \ build_error_response -from controller.csi_general import csi_pb2 -from controller.csi_general import csi_pb2_grpc logger = get_stdout_logger() @@ -35,15 +35,12 @@ def __init__(self): with open(path, 'r') as yamlfile: self.cfg = yaml.safe_load(yamlfile) # TODO: add the following when possible : Loader=yaml.FullLoader) - @handle_common_exceptions(csi_pb2.CreateVolumeResponse) + @csi_method(error_response_type=csi_pb2.CreateVolumeResponse, lock_request_attribute="name") def CreateVolume(self, request, context): - set_current_thread_name(request.name) - logger.info("create volume") try: utils.validate_create_volume_request(request) except ObjectIdError as ex: - return handle_exception(ex, context, grpc.StatusCode.NOT_FOUND, - csi_pb2.CreateVolumeResponse) + return handle_exception(ex, context, grpc.StatusCode.NOT_FOUND, csi_pb2.CreateVolumeResponse) logger.debug("volume name : {}".format(request.name)) @@ -59,11 +56,12 @@ def CreateVolume(self, request, context): array_connection_info = utils.get_array_connection_info_from_secrets( secrets=secrets, topologies=topologies) + system_id = array_connection_info.system_id volume_parameters = utils.get_volume_parameters(parameters=request.parameters, - system_id=array_connection_info.system_id) + system_id=system_id) pool = volume_parameters.pool if not pool: - raise ValidationException(controller_messages.pool_should_not_be_empty_message) + raise ValidationException(controller_messages.POOL_SHOULD_NOT_BE_EMPTY_MESSAGE) space_efficiency = volume_parameters.space_efficiency # TODO : pass multiple array addresses array_type = detect_array_type(array_connection_info.array_addresses) @@ -76,7 +74,7 @@ def CreateVolume(self, request, context): min_size = array_mediator.minimal_volume_size_in_bytes if required_bytes > max_size: - message = messages.SizeOutOfRangeError_message.format(required_bytes, max_size) + message = messages.SIZE_OUT_OF_RANGE_ERROR_MESSAGE.format(required_bytes, max_size) return build_error_response(message, context, grpc.StatusCode.OUT_OF_RANGE, csi_pb2.CreateVolumeResponse) @@ -95,7 +93,7 @@ def CreateVolume(self, request, context): array_mediator.validate_supported_space_efficiency(space_efficiency) volume = array_mediator.create_volume(volume_final_name, required_bytes, space_efficiency, - pool) + pool, volume_parameters.io_group) else: logger.debug("volume found : {}".format(volume)) @@ -104,11 +102,11 @@ def CreateVolume(self, request, context): return build_error_response(message, context, grpc.StatusCode.ALREADY_EXISTS, csi_pb2.CreateVolumeResponse) - copy_source_res = self._handle_existing_volume_source(volume, source_id, source_type, - array_connection_info.system_id, - context) - if copy_source_res: - return copy_source_res + response = self._get_create_volume_response_for_existing_volume_source(volume, source_id, + source_type, system_id, + context) + if response: + return response if source_id: self._copy_to_existing_volume_from_source(volume, source_id, @@ -116,9 +114,9 @@ def CreateVolume(self, request, context): array_mediator) volume.copy_source_id = source_id - res = utils.generate_csi_create_volume_response(volume, array_connection_info.system_id, source_type) - logger.info("finished create volume") - return res + response = utils.generate_csi_create_volume_response(volume, array_connection_info.system_id, + source_type) + return response except array_errors.InvalidArgumentError as ex: return handle_exception(ex, context, grpc.StatusCode.INVALID_ARGUMENT, csi_pb2.CreateVolumeResponse) except array_errors.VolumeAlreadyExists as ex: @@ -152,7 +150,8 @@ def _rollback_create_volume_from_source(self, array_mediator, volume_id): logger.debug("Rollback copy volume from source. Deleting volume {0}".format(volume_id)) array_mediator.delete_volume(volume_id) - def _handle_existing_volume_source(self, volume, source_id, source_type, system_id, context): + def _get_create_volume_response_for_existing_volume_source(self, volume, source_id, source_type, system_id, + context): """ Args: volume : volume fetched or created in CreateVolume @@ -192,10 +191,8 @@ def _handle_volume_exists_with_different_source(self, context, source_id, source logger.debug(message) return build_error_response(message, context, grpc.StatusCode.ALREADY_EXISTS, csi_pb2.CreateVolumeResponse) - @handle_common_exceptions(csi_pb2.DeleteVolumeResponse) + @csi_method(error_response_type=csi_pb2.DeleteVolumeResponse, lock_request_attribute="volume_id") def DeleteVolume(self, request, context): - set_current_thread_name(request.volume_id) - logger.info("DeleteVolume") secrets = request.secrets utils.validate_delete_volume_request(request) @@ -223,17 +220,13 @@ def DeleteVolume(self, request, context): return handle_exception(ex, context, grpc.StatusCode.PERMISSION_DENIED, csi_pb2.DeleteVolumeResponse) - logger.debug("generating delete volume response") - res = csi_pb2.DeleteVolumeResponse() - logger.info("finished DeleteVolume") - return res + return csi_pb2.DeleteVolumeResponse() - @handle_common_exceptions(csi_pb2.ControllerPublishVolumeResponse) + @csi_method(error_response_type=csi_pb2.ControllerPublishVolumeResponse, lock_request_attribute="volume_id") def ControllerPublishVolume(self, request, context): - set_current_thread_name(request.volume_id) - logger.info("ControllerPublishVolume") - utils.validate_publish_volume_request(request) try: + utils.validate_publish_volume_request(request) + volume_id_info = utils.get_volume_id_info(request.volume_id) system_id = volume_id_info.system_id array_type = volume_id_info.array_type @@ -248,12 +241,11 @@ def ControllerPublishVolume(self, request, context): with get_agent(array_connection_info, array_type).get_mediator() as array_mediator: lun, connectivity_type, array_initiators = array_mediator.map_volume_by_initiators(volume_id, initiators) - logger.info("finished ControllerPublishVolume") - res = utils.generate_csi_publish_volume_response(lun, - connectivity_type, - self.cfg, - array_initiators) - return res + response = utils.generate_csi_publish_volume_response(lun, + connectivity_type, + self.cfg, + array_initiators) + return response except array_errors.VolumeMappedToMultipleHostsError as ex: return handle_exception(ex, context, grpc.StatusCode.FAILED_PRECONDITION, @@ -261,18 +253,17 @@ def ControllerPublishVolume(self, request, context): except (array_errors.LunAlreadyInUseError, array_errors.NoAvailableLunError) as ex: return handle_exception(ex, context, grpc.StatusCode.RESOURCE_EXHAUSTED, csi_pb2.ControllerPublishVolumeResponse) - except (array_errors.NoIscsiTargetsFoundError, ObjectIdError) as ex: + except (array_errors.NoIscsiTargetsFoundError, ObjectIdError, InvalidNodeId) as ex: return handle_exception(ex, context, grpc.StatusCode.NOT_FOUND, csi_pb2.ControllerPublishVolumeResponse) except array_errors.UnsupportedConnectivityTypeError as ex: return handle_exception(ex, context, grpc.StatusCode.INVALID_ARGUMENT, csi_pb2.ControllerPublishVolumeResponse) - @handle_common_exceptions(csi_pb2.ControllerUnpublishVolumeResponse) + @csi_method(error_response_type=csi_pb2.ControllerUnpublishVolumeResponse, lock_request_attribute="volume_id") def ControllerUnpublishVolume(self, request, context): - set_current_thread_name(request.volume_id) - logger.info("ControllerUnpublishVolume") - utils.validate_unpublish_volume_request(request) try: + utils.validate_unpublish_volume_request(request) + volume_id_info = utils.get_volume_id_info(request.volume_id) system_id = volume_id_info.system_id array_type = volume_id_info.array_type @@ -288,21 +279,19 @@ def ControllerUnpublishVolume(self, request, context): with get_agent(array_connection_info, array_type).get_mediator() as array_mediator: array_mediator.unmap_volume_by_initiators(volume_id, initiators) - logger.info("finished ControllerUnpublishVolume") - return csi_pb2.ControllerUnpublishVolumeResponse() except ObjectIdError as ex: return handle_exception(ex, context, grpc.StatusCode.INVALID_ARGUMENT, array_errors.VolumeAlreadyUnmappedError) + except (array_errors.HostNotFoundError, InvalidNodeId) as ex: + logger.debug("Idempotent case. {}.".format(str(ex))) except array_errors.VolumeAlreadyUnmappedError: logger.debug("Idempotent case. volume is already unmapped.") - return csi_pb2.ControllerUnpublishVolumeResponse() except array_errors.ObjectNotFoundError: logger.debug("Idempotent case. volume is already deleted.") - return csi_pb2.ControllerUnpublishVolumeResponse() + return csi_pb2.ControllerUnpublishVolumeResponse() - @handle_common_exceptions(csi_pb2.ValidateVolumeCapabilitiesResponse) + @csi_method(error_response_type=csi_pb2.ValidateVolumeCapabilitiesResponse, lock_request_attribute="volume_id") def ValidateVolumeCapabilities(self, request, context): - logger.info("ValidateVolumeCapabilities") try: utils.validate_validate_volume_capabilities_request(request) @@ -328,7 +317,6 @@ def ValidateVolumeCapabilities(self, request, context): if request.parameters: utils.validate_parameters_match_volume(request.parameters, volume) - logger.info("finished ValidateVolumeCapabilities") return utils.generate_csi_validate_volume_capabilities_response(request.volume_context, request.volume_capabilities, request.parameters) @@ -339,15 +327,12 @@ def ValidateVolumeCapabilities(self, request, context): return handle_exception(ex, context, grpc.StatusCode.INVALID_ARGUMENT, csi_pb2.CreateSnapshotResponse) - @handle_common_exceptions(csi_pb2.ListVolumesResponse) + @csi_method(error_response_type=csi_pb2.ListVolumesResponse) def ListVolumes(self, request, context): - logger.info("ListVolumes") raise NotImplementedError() - @handle_common_exceptions(csi_pb2.CreateSnapshotResponse) + @csi_method(error_response_type=csi_pb2.CreateSnapshotResponse, lock_request_attribute="name") def CreateSnapshot(self, request, context): - set_current_thread_name(request.name) - logger.info("Create snapshot") utils.validate_create_snapshot_request(request) source_volume_id = request.source_volume_id logger.info("Snapshot base name : {}. Source volume id : {}".format(request.name, source_volume_id)) @@ -375,9 +360,9 @@ def CreateSnapshot(self, request, context): if snapshot: if snapshot.source_volume_id != volume_id: - message = messages.SnapshotWrongVolumeError_message.format(snapshot_final_name, - snapshot.source_volume_id, - volume_id) + message = messages.SNAPSHOT_WRONG_VOLUME_ERROR_MESSAGE.format(snapshot_final_name, + snapshot.source_volume_id, + volume_id) return build_error_response(message, context, grpc.StatusCode.ALREADY_EXISTS, csi_pb2.CreateSnapshotResponse) else: @@ -389,9 +374,8 @@ def CreateSnapshot(self, request, context): snapshot = array_mediator.create_snapshot(volume_id, snapshot_final_name, space_efficiency, pool) logger.debug("generating create snapshot response") - res = utils.generate_csi_create_snapshot_response(snapshot, system_id, source_volume_id) - logger.info("finished create snapshot") - return res + response = utils.generate_csi_create_snapshot_response(snapshot, system_id, source_volume_id) + return response except (ObjectIdError, array_errors.SnapshotSourcePoolMismatch, array_errors.SpaceEfficiencyNotSupported) as ex: return handle_exception(ex, context, grpc.StatusCode.INVALID_ARGUMENT, csi_pb2.CreateSnapshotResponse) @@ -402,10 +386,8 @@ def CreateSnapshot(self, request, context): return handle_exception(ex, context, grpc.StatusCode.RESOURCE_EXHAUSTED, csi_pb2.CreateSnapshotResponse) - @handle_common_exceptions(csi_pb2.DeleteSnapshotResponse) + @csi_method(error_response_type=csi_pb2.DeleteSnapshotResponse, lock_request_attribute="snapshot_id") def DeleteSnapshot(self, request, context): - set_current_thread_name(request.snapshot_id) - logger.info("Delete snapshot") secrets = request.secrets utils.validate_delete_snapshot_request(request) try: @@ -431,20 +413,14 @@ def DeleteSnapshot(self, request, context): context.set_code(grpc.StatusCode.OK) return csi_pb2.DeleteSnapshotResponse() - logger.debug("generating delete snapshot response") - res = csi_pb2.DeleteSnapshotResponse() - logger.info("finished DeleteSnapshot") - return res + return csi_pb2.DeleteSnapshotResponse() - @handle_common_exceptions(csi_pb2.GetCapacityResponse) + @csi_method(error_response_type=csi_pb2.GetCapacityResponse) def GetCapacity(self, request, context): - logger.info("GetCapacity") raise NotImplementedError() - @handle_common_exceptions(csi_pb2.ControllerExpandVolumeResponse) + @csi_method(error_response_type=csi_pb2.ControllerExpandVolumeResponse, lock_request_attribute="volume_id") def ControllerExpandVolume(self, request, context): - set_current_thread_name(request.volume_id) - logger.info("ControllerExpandVolume") secrets = request.secrets utils.validate_expand_volume_request(request) try: @@ -473,7 +449,7 @@ def ControllerExpandVolume(self, request, context): node_expansion_required=False) if required_bytes > max_size: - message = messages.SizeOutOfRangeError_message.format(required_bytes, max_size) + message = messages.SIZE_OUT_OF_RANGE_ERROR_MESSAGE.format(required_bytes, max_size) return build_error_response(message, context, grpc.StatusCode.OUT_OF_RANGE, csi_pb2.ControllerExpandVolumeResponse) @@ -486,19 +462,21 @@ def ControllerExpandVolume(self, request, context): if not volume_after_expand: raise array_errors.ObjectNotFoundError(volume_id) - res = utils.generate_csi_expand_volume_response(volume_after_expand.capacity_bytes) - logger.info("finished expanding volume") - return res + response = utils.generate_csi_expand_volume_response(volume_after_expand.capacity_bytes) + return response except array_errors.NotEnoughSpaceInPool as ex: return handle_exception(ex, context, grpc.StatusCode.RESOURCE_EXHAUSTED, csi_pb2.ControllerExpandVolumeResponse) + except array_errors.ObjectIsStillInUseError as ex: + return handle_exception(ex, context, grpc.StatusCode.INTERNAL, + csi_pb2.ControllerExpandVolumeResponse) def ControllerGetCapabilities(self, request, context): logger.info("ControllerGetCapabilities") types = csi_pb2.ControllerServiceCapability.RPC.Type - res = csi_pb2.ControllerGetCapabilitiesResponse( + response = csi_pb2.ControllerGetCapabilitiesResponse( capabilities=[csi_pb2.ControllerServiceCapability( rpc=csi_pb2.ControllerServiceCapability.RPC(type=types.Value("CREATE_DELETE_VOLUME"))), csi_pb2.ControllerServiceCapability( @@ -511,14 +489,13 @@ def ControllerGetCapabilities(self, request, context): rpc=csi_pb2.ControllerServiceCapability.RPC(type=types.Value("EXPAND_VOLUME")))]) logger.info("finished ControllerGetCapabilities") - return res + return response def get_identity_config(self, attribute_name): return self.cfg['identity'][attribute_name] - @handle_common_exceptions(csi_pb2.GetPluginInfoResponse) - def GetPluginInfo(self, _, context): - logger.info("GetPluginInfo") + @csi_method(error_response_type=csi_pb2.GetPluginInfoResponse) + def GetPluginInfo(self, _, context): # pylint: disable=invalid-name name = self.get_identity_config("name") version = self.get_identity_config("version") @@ -526,7 +503,6 @@ def GetPluginInfo(self, _, context): message = "plugin name or version cannot be empty" return build_error_response(message, context, grpc.StatusCode.INTERNAL, csi_pb2.GetPluginInfoResponse) - logger.info("finished GetPluginInfo") return csi_pb2.GetPluginInfoResponse(name=name, vendor_version=version) def _get_volume_final_name(self, volume_parameters, name, array_mediator): @@ -563,7 +539,7 @@ def _join_object_prefix_with_name(self, prefix, name): return settings.NAME_PREFIX_SEPARATOR.join((prefix, name)) return name - def GetPluginCapabilities(self, _, __): + def GetPluginCapabilities(self, _, __): # pylint: disable=invalid-name logger.info("GetPluginCapabilities") service_type = csi_pb2.PluginCapability.Service.Type volume_expansion_type = csi_pb2.PluginCapability.VolumeExpansion.Type @@ -586,7 +562,7 @@ def GetPluginCapabilities(self, _, __): capabilities=capability_list ) - def Probe(self, _, context): + def Probe(self, _, context): # pylint: disable=invalid-name context.set_code(grpc.StatusCode.OK) return csi_pb2.ProbeResponse() diff --git a/controller/controller_server/decorators.py b/controller/controller_server/decorators.py new file mode 100644 index 000000000..ed8e4a624 --- /dev/null +++ b/controller/controller_server/decorators.py @@ -0,0 +1,28 @@ +import grpc +from decorator import decorator + +from controller.common.csi_logger import get_stdout_logger +from controller.common.utils import set_current_thread_name +from controller.controller_server.errors import ObjectAlreadyProcessingError +from controller.controller_server.exception_handler import handle_exception, handle_common_exceptions +from controller.controller_server.sync_lock import SyncLock + +logger = get_stdout_logger() + + +def csi_method(error_response_type, lock_request_attribute=''): + @decorator + def call_csi_method(controller_method, servicer, request, context): + lock_id = getattr(request, lock_request_attribute, None) + set_current_thread_name(lock_id) + controller_method_name = controller_method.__name__ + logger.info(controller_method_name) + try: + with SyncLock(lock_request_attribute, lock_id, controller_method_name): + response = handle_common_exceptions(controller_method, servicer, request, context, error_response_type) + except ObjectAlreadyProcessingError as ex: + return handle_exception(ex, context, grpc.StatusCode.ABORTED, error_response_type) + logger.info("finished {}".format(controller_method_name)) + return response + + return call_csi_method diff --git a/controller/controller_server/errors.py b/controller/controller_server/errors.py index ef4a1dabb..7a99e05c4 100644 --- a/controller/controller_server/errors.py +++ b/controller/controller_server/errors.py @@ -10,10 +10,25 @@ def __str__(self, *args, **kwargs): class ValidationException(BaseControllerServerException): def __init__(self, msg): - self.message = messages.ValidationException_message.format(msg) + super().__init__() + self.message = messages.VALIDATION_EXCEPTION_MESSAGE.format(msg) + + +class InvalidNodeId(BaseControllerServerException): + + def __init__(self, node_id): + super().__init__() + self.message = messages.WRONG_ID_FORMAT_MESSAGE.format("node", node_id) class ObjectIdError(BaseControllerServerException): def __init__(self, object_type, object_id): - self.message = messages.ObjectIdError_message.format(object_type, object_id) + super().__init__() + self.message = messages.WRONG_ID_FORMAT_MESSAGE.format(object_type, object_id) + + +class ObjectAlreadyProcessingError(BaseControllerServerException): + def __init__(self, object_id_or_name): + super().__init__() + self.message = messages.OBJECT_ALREADY_PROCESSING_MESSAGE.format(object_id_or_name) diff --git a/controller/controller_server/exception_handler.py b/controller/controller_server/exception_handler.py index 47ba9e054..5552e6466 100644 --- a/controller/controller_server/exception_handler.py +++ b/controller/controller_server/exception_handler.py @@ -1,5 +1,3 @@ -from decorator import decorator - import grpc import controller.array_action.errors as array_errors @@ -17,7 +15,8 @@ array_errors.ObjectNotFoundError: grpc.StatusCode.NOT_FOUND, array_errors.HostNotFoundError: grpc.StatusCode.NOT_FOUND, array_errors.PermissionDeniedError: grpc.StatusCode.PERMISSION_DENIED, - array_errors.ObjectIsStillInUseError: grpc.StatusCode.FAILED_PRECONDITION + array_errors.ObjectIsStillInUseError: grpc.StatusCode.FAILED_PRECONDITION, + array_errors.CredentialsError: grpc.StatusCode.UNAUTHENTICATED } @@ -32,18 +31,14 @@ def build_error_response(message, context, status_code, response_type): return _build_non_ok_response(message, context, status_code, response_type) -def handle_exception(ex, context, status_code, response_type): - logger.exception(ex) - return _build_non_ok_response(str(ex), context, status_code, response_type) - +def handle_exception(exception, context, status_code, response_type): + logger.exception(exception) + return _build_non_ok_response(str(exception), context, status_code, response_type) -def handle_common_exceptions(response_type): - @decorator - def handle_common_exceptions_with_response(controller_method, servicer, request, context): - try: - return controller_method(servicer, request, context) - except Exception as ex: - status_code = status_codes_by_exception.get(type(ex), grpc.StatusCode.INTERNAL) - return handle_exception(ex, context, status_code, response_type) - return handle_common_exceptions_with_response +def handle_common_exceptions(controller_method, servicer, request, context, response_type): + try: + return controller_method(servicer, request, context) + except Exception as exception: + status_code = status_codes_by_exception.get(type(exception), grpc.StatusCode.INTERNAL) + return handle_exception(exception, context, status_code, response_type) diff --git a/controller/controller_server/messages.py b/controller/controller_server/messages.py index d9f67d933..8ff782732 100644 --- a/controller/controller_server/messages.py +++ b/controller/controller_server/messages.py @@ -1,37 +1,39 @@ -ValidationException_message = "Validation error has occurred : {0}" +VALIDATION_EXCEPTION_MESSAGE = "Validation error has occurred : {0}" -ObjectIdError_message = "Wrong {0} id format : {1}" +WRONG_ID_FORMAT_MESSAGE = "Wrong {0} id format : {1}" + +OBJECT_ALREADY_PROCESSING_MESSAGE = "object {0} is already processing. request cannot be completed." # validation error messages -invalid_secret_config_message = "got an invalid secret config" -insufficient_data_to_choose_a_storage_system_message = "insufficient data to choose a storage system" -no_system_match_requested_topologies = "no system match requested topologies: {}" -secret_missing_connection_info_message = "secret is missing connection info" -secret_missing_topologies_message = "secret is missing topologies" -invalid_system_id_message = "got an invalid system id: {}, validation regex: {}" -invalid_json_parameter_message = "got an invalid json parameter: {}, error: {}." -invalid_replication_copy_type_message = "got an invalid copy type: {}" -secret_missing_message = 'secret is missing' -capabilities_not_set_message = "capabilities were not set" -unsupported_fs_type_message = "unsupported fs_type : {}" -unsupported_mount_flags_message = "mount_flags is unsupported" -unsupported_volume_access_type_message = "unsupported volume access type" -unsupported_access_mode_message = "unsupported access mode : {}" -name_should_not_be_empty_message = 'name should not be empty' -volume_id_should_not_be_empty_message = 'volume id should not be empty' -snapshot_id_should_not_be_empty_message = 'snapshot id should not be empty' -size_should_not_be_negative_message = 'size should not be negative' -no_capacity_range_message = 'no capacity range set' -pool_is_missing_message = 'pool parameter is missing.' -pool_should_not_be_empty_message = 'pool should not be empty' -volume_id_wrong_format_message = 'volume id has wrong format' -readonly_not_supported_message = 'readonly parameter is not supported' -volume_source_id_is_missing = 'volume source {0} id is missing' -snapshot_src_volume_id_is_missing = 'snapshot source volume id is missing' -parameter_length_is_too_long = '{} parameter: {} is too long, max length is: {}' -volume_cloning_not_supported_message = 'volume cloning is not supported' -volume_context_not_match_volume_message = 'volume context: {0} does not match existing volume context: {1}' -space_efficiency_not_match_volume_message = 'space efficiency: {0}' \ +INVALID_SECRET_CONFIG_MESSAGE = "got an invalid secret config" +INSUFFICIENT_DATA_TO_CHOOSE_A_STORAGE_SYSTEM_MESSAGE = "insufficient data to choose a storage system" +NO_SYSTEM_MATCH_REQUESTED_TOPOLOGIES = "no system match requested topologies: {}" +SECRET_MISSING_CONNECTION_INFO_MESSAGE = "secret is missing connection info" +SECRET_MISSING_TOPOLOGIES_MESSAGE = "secret is missing topologies" +INVALID_SYSTEM_ID_MESSAGE = "got an invalid system id: {}, validation regex: {}" +INVALID_JSON_PARAMETER_MESSAGE = "got an invalid json parameter: {}, error: {}." +INVALID_REPLICATION_COPY_TYPE_MESSAGE = "got an invalid copy type: {}" +SECRET_MISSING_MESSAGE = 'secret is missing' +CAPABILITIES_NOT_SET_MESSAGE = "capabilities were not set" +UNSUPPORTED_FS_TYPE_MESSAGE = "unsupported fs_type : {}" +UNSUPPORTED_MOUNT_FLAGS_MESSAGE = "mount_flags is unsupported" +UNSUPPORTED_VOLUME_ACCESS_TYPE_MESSAGE = "unsupported volume access type" +UNSUPPORTED_ACCESS_MODE_MESSAGE = "unsupported access mode : {}" +NAME_SHOULD_NOT_BE_EMPTY_MESSAGE = 'name should not be empty' +VOLUME_ID_SHOULD_NOT_BE_EMPTY_MESSAGE = 'volume id should not be empty' +SNAPSHOT_ID_SHOULD_NOT_BE_EMPTY_MESSAGE = 'snapshot id should not be empty' +SIZE_SHOULD_NOT_BE_NEGATIVE_MESSAGE = 'size should not be negative' +NO_CAPACITY_RANGE_MESSAGE = 'no capacity range set' +POOL_IS_MISSING_MESSAGE = 'pool parameter is missing.' +POOL_SHOULD_NOT_BE_EMPTY_MESSAGE = 'pool should not be empty' +WRONG_FORMAT_MESSAGE = '{} has wrong format' +READONLY_NOT_SUPPORTED_MESSAGE = 'readonly parameter is not supported' +VOLUME_SOURCE_ID_IS_MISSING = 'volume source {0} id is missing' +SNAPSHOT_SOURCE_VOLUME_ID_IS_MISSING = 'snapshot source volume id is missing' +PARAMETER_LENGTH_IS_TOO_LONG = '{} parameter: {} is too long, max length is: {}' +VOLUME_CLONING_NOT_SUPPORTED_MESSAGE = 'volume cloning is not supported' +VOLUME_CONTEXT_NOT_MATCH_VOLUME_MESSAGE = 'volume context: {0} does not match existing volume context: {1}' +SPACE_EFFICIENCY_NOT_MATCH_VOLUME_MESSAGE = 'space efficiency: {0}' \ ' does not match existing volume space efficiency: {1}' -pool_not_match_volume_message = 'pool name: {0} does not match existing volume pool name: {1}' -prefix_not_match_volume_message = 'prefix: {0} does not match existing volume name: {1}' +POOL_NOT_MATCH_VOLUME_MESSAGE = 'pool name: {0} does not match existing volume pool name: {1}' +PREFIX_NOT_MATCH_VOLUME_MESSAGE = 'prefix: {0} does not match existing volume name: {1}' diff --git a/controller/controller_server/sync_lock.py b/controller/controller_server/sync_lock.py new file mode 100644 index 000000000..fa9350803 --- /dev/null +++ b/controller/controller_server/sync_lock.py @@ -0,0 +1,59 @@ +import threading +from collections import defaultdict + +from controller.common.csi_logger import get_stdout_logger +from controller.controller_server.errors import ObjectAlreadyProcessingError + +logger = get_stdout_logger() + +ids_in_use = defaultdict(set) +ids_in_use_lock = threading.Lock() + + +def _add_to_ids_in_use(lock_key, object_id): + ids_in_use[lock_key].add(object_id) + + +def _remove_from_ids_in_use(lock_key, object_id): + if object_id in ids_in_use[lock_key]: + ids_in_use[lock_key].remove(object_id) + else: + logger.error("could not find lock to release for {}: {}".format(lock_key, object_id)) + + +class SyncLock: + def __init__(self, lock_key, object_id, action_name): + self.lock_key = lock_key + self.object_id = object_id + self.action_name = action_name + + def __enter__(self): + if self.lock_key: + self._add_object_lock() + + def __exit__(self, exc_type, exc_val, exc_tb): + if self.lock_key: + self._remove_object_lock() + + def _add_object_lock(self): + logger.debug( + ("trying to acquire lock for action {} with {}: {}".format(self.action_name, self.lock_key, + self.object_id))) + ids_in_use_lock.acquire() + if self.object_id in ids_in_use[self.lock_key]: + ids_in_use_lock.release() + logger.error( + "lock for action {} with {}: {} is already in use by another thread".format(self.action_name, + self.lock_key, + self.object_id)) + raise ObjectAlreadyProcessingError(self.object_id) + _add_to_ids_in_use(self.lock_key, self.object_id) + logger.debug( + "succeed to acquire lock for action {} with {}: {}".format(self.action_name, self.lock_key, self.object_id)) + ids_in_use_lock.release() + + def _remove_object_lock(self): + logger.debug("release lock for action {} with {}: {}".format(self.action_name, self.lock_key, self.object_id)) + ids_in_use_lock.acquire() + _remove_from_ids_in_use(self.lock_key, self.object_id) + ids_in_use_lock.release() diff --git a/controller/controller_server/test_settings.py b/controller/controller_server/test_settings.py index 7eac2bbc7..f44d5bc35 100644 --- a/controller/controller_server/test_settings.py +++ b/controller/controller_server/test_settings.py @@ -1,16 +1,16 @@ -user = "temp" -password = "temp" -array = "arr" -pool = "pool1" -space_efficiency = "thin" -volume_name = "volume" -volume_wwn = "volume_wwn" -object_internal_id = "object_internal_id" -other_object_internal_id = "other_object_internal_id" -snapshot_name = "snapshot" -snapshot_volume_wwn = "12345678" -snapshot_volume_name = "snapshot_volume" -clone_volume_name = "clone_volume" -replication_name = "replication_name" -system_id = "system_id" -copy_type = "async" +USER = "temp" +PASSWORD = "temp" +ARRAY = "arr" +POOL = "pool1" +SPACE_EFFICIENCY = "thin" +VOLUME_NAME = "volume" +VOLUME_WWN = "volume_wwn" +OBJECT_INTERNAL_ID = "object_internal_id" +OTHER_OBJECT_INTERNAL_ID = "other_object_internal_id" +SNAPSHOT_NAME = "snapshot" +SNAPSHOT_VOLUME_WWN = "12345678" +SNAPSHOT_VOLUME_NAME = "snapshot_volume" +CLONE_VOLUME_NAME = "clone_volume" +REPLICATION_NAME = "replication_name" +SYSTEM_ID = "system_id" +COPY_TYPE = "async" diff --git a/controller/controller_server/utils.py b/controller/controller_server/utils.py index 09f2e3890..89b28de46 100644 --- a/controller/controller_server/utils.py +++ b/controller/controller_server/utils.py @@ -4,9 +4,9 @@ from operator import eq import base58 +from csi_general import csi_pb2 from google.protobuf.timestamp_pb2 import Timestamp -import controller.array_action.errors as array_errors import controller.controller_server.config as config import controller.controller_server.messages as messages from controller.array_action.config import NVME_OVER_FC_CONNECTIVITY_TYPE, FC_CONNECTIVITY_TYPE, \ @@ -14,8 +14,7 @@ from controller.common.csi_logger import get_stdout_logger from controller.common.settings import NAME_PREFIX_SEPARATOR from controller.controller_server.controller_types import ArrayConnectionInfo, ObjectIdInfo, ObjectParameters -from controller.controller_server.errors import ObjectIdError, ValidationException -from controller.csi_general import csi_pb2 +from controller.controller_server.errors import ObjectIdError, ValidationException, InvalidNodeId logger = get_stdout_logger() @@ -24,7 +23,7 @@ def _parse_raw_json(raw_json): try: parsed_json = json.loads(raw_json) except json.decoder.JSONDecodeError as ex: - raise ValidationException(messages.invalid_json_parameter_message.format(raw_json, ex)) + raise ValidationException(messages.INVALID_JSON_PARAMETER_MESSAGE.format(raw_json, ex)) return parsed_json @@ -53,7 +52,7 @@ def _get_system_info_for_topologies(secrets_config, node_topologies): system_topologies = system_info.get(config.SECRET_SUPPORTED_TOPOLOGIES_PARAMETER) if _is_topology_match(system_topologies, node_topologies): return system_info, system_id - raise ValidationException(messages.no_system_match_requested_topologies.format(node_topologies)) + raise ValidationException(messages.NO_SYSTEM_MATCH_REQUESTED_TOPOLOGIES.format(node_topologies)) def _get_system_info_from_secrets(secrets, topologies=None, system_id=None): @@ -67,7 +66,7 @@ def _get_system_info_from_secrets(secrets, topologies=None, system_id=None): system_info, system_id = _get_system_info_for_topologies(secrets_config=secrets_config, node_topologies=topologies) else: - raise ValidationException(messages.insufficient_data_to_choose_a_storage_system_message) + raise ValidationException(messages.INSUFFICIENT_DATA_TO_CHOOSE_A_STORAGE_SYSTEM_MESSAGE) return system_info, system_id @@ -100,10 +99,12 @@ def get_object_parameters(parameters, prefix_param_name, system_id): default_pool = parameters.get(config.PARAMETERS_POOL) default_space_efficiency = parameters.get(config.PARAMETERS_SPACE_EFFICIENCY) default_prefix = parameters.get(prefix_param_name) + default_io_group = parameters.get(config.PARAMETERS_IO_GROUP) return ObjectParameters( pool=system_parameters.get(config.PARAMETERS_POOL, default_pool), space_efficiency=system_parameters.get(config.PARAMETERS_SPACE_EFFICIENCY, default_space_efficiency), - prefix=system_parameters.get(prefix_param_name, default_prefix)) + prefix=system_parameters.get(prefix_param_name, default_prefix), + io_group=system_parameters.get(config.PARAMETERS_IO_GROUP, default_io_group)) def get_volume_id(new_volume, system_id): @@ -128,25 +129,25 @@ def _is_system_id_valid(system_id): def _validate_system_id(system_id): if not _is_system_id_valid(system_id): raise ValidationException( - messages.invalid_system_id_message.format(system_id, config.SECRET_VALIDATION_REGEX)) + messages.INVALID_SYSTEM_ID_MESSAGE.format(system_id, config.SECRET_VALIDATION_REGEX)) if len(system_id) > config.SECRET_SYSTEM_ID_MAX_LENGTH: raise ValidationException( - messages.parameter_length_is_too_long.format("system id", system_id, config.SECRET_SYSTEM_ID_MAX_LENGTH)) + messages.PARAMETER_LENGTH_IS_TOO_LONG.format("system id", system_id, config.SECRET_SYSTEM_ID_MAX_LENGTH)) def _validate_secrets(secrets): if not (config.SECRET_USERNAME_PARAMETER in secrets and config.SECRET_PASSWORD_PARAMETER in secrets and config.SECRET_ARRAY_PARAMETER in secrets): - raise ValidationException(messages.secret_missing_connection_info_message) + raise ValidationException(messages.SECRET_MISSING_CONNECTION_INFO_MESSAGE) def _validate_topologies(topologies): if topologies: if not all(topologies): - raise ValidationException(messages.secret_missing_topologies_message) + raise ValidationException(messages.SECRET_MISSING_TOPOLOGIES_MESSAGE) else: - raise ValidationException(messages.secret_missing_topologies_message) + raise ValidationException(messages.SECRET_MISSING_TOPOLOGIES_MESSAGE) def _validate_secrets_config(secrets_config): @@ -157,13 +158,13 @@ def _validate_secrets_config(secrets_config): supported_topologies = system_info.get(config.SECRET_SUPPORTED_TOPOLOGIES_PARAMETER) _validate_topologies(supported_topologies) else: - raise ValidationException(messages.invalid_secret_config_message) + raise ValidationException(messages.INVALID_SECRET_CONFIG_MESSAGE) def validate_secrets(secrets): logger.debug("validating secrets") if not secrets: - raise ValidationException(messages.secret_missing_message) + raise ValidationException(messages.SECRET_MISSING_MESSAGE) raw_secrets_config = secrets.get(config.SECRET_CONFIG_PARAMETER) if raw_secrets_config: secrets_config = _parse_raw_json(raw_secrets_config) @@ -177,18 +178,18 @@ def validate_csi_volume_capability(cap): logger.debug("validating csi volume capability") if cap.HasField(config.VOLUME_CAPABILITIES_FIELD_ACCESS_TYPE_MOUNT): if cap.mount.fs_type and (cap.mount.fs_type not in config.SUPPORTED_FS_TYPES): - raise ValidationException(messages.unsupported_fs_type_message.format(cap.mount.fs_type)) + raise ValidationException(messages.UNSUPPORTED_FS_TYPE_MESSAGE.format(cap.mount.fs_type)) if cap.mount.mount_flags: - raise ValidationException(messages.unsupported_mount_flags_message) + raise ValidationException(messages.UNSUPPORTED_MOUNT_FLAGS_MESSAGE) elif not cap.HasField(config.VOLUME_CAPABILITIES_FIELD_ACCESS_TYPE_BLOCK): # should never get here since the value can be only mount (for fs volume) or block (for raw block) - logger.error(messages.unsupported_volume_access_type_message) - raise ValidationException(messages.unsupported_volume_access_type_message) + logger.error(messages.UNSUPPORTED_VOLUME_ACCESS_TYPE_MESSAGE) + raise ValidationException(messages.UNSUPPORTED_VOLUME_ACCESS_TYPE_MESSAGE) if cap.access_mode.mode not in config.SUPPORTED_ACCESS_MODE: logger.error("unsupported access mode : {}".format(cap.access_mode)) - raise ValidationException(messages.unsupported_access_mode_message.format(cap.access_mode)) + raise ValidationException(messages.UNSUPPORTED_ACCESS_MODE_MESSAGE.format(cap.access_mode)) logger.debug("csi volume capabilities validation finished.") @@ -196,7 +197,7 @@ def validate_csi_volume_capability(cap): def validate_csi_volume_capabilities(capabilities): logger.debug("validating csi volume capabilities") if not capabilities: - raise ValidationException(messages.capabilities_not_set_message) + raise ValidationException(messages.CAPABILITIES_NOT_SET_MESSAGE) for cap in capabilities: validate_csi_volume_capability(cap) @@ -218,7 +219,7 @@ def _validate_source_info(source, source_type): source_object = getattr(source, source_type) logger.info("Source {0} specified: {1}".format(source_type, source_object)) source_object_id = getattr(source_object, config.VOLUME_SOURCE_ID_FIELDS[source_type]) - message = messages.volume_source_id_is_missing.format(source_type) + message = messages.VOLUME_SOURCE_ID_IS_MISSING.format(source_type) _validate_object_id(source_object_id, object_type=source_type, message=message) @@ -226,13 +227,13 @@ def _validate_pool_parameter(parameters): logger.debug("validating pool parameter") if config.PARAMETERS_POOL in parameters: if not parameters[config.PARAMETERS_POOL]: - raise ValidationException(messages.pool_should_not_be_empty_message) + raise ValidationException(messages.POOL_SHOULD_NOT_BE_EMPTY_MESSAGE) elif not parameters.get(config.PARAMETERS_BY_SYSTEM): - raise ValidationException(messages.pool_is_missing_message) + raise ValidationException(messages.POOL_IS_MISSING_MESSAGE) def _validate_object_id(object_id, object_type=config.VOLUME_TYPE_NAME, - message=messages.volume_id_should_not_be_empty_message): + message=messages.VOLUME_ID_SHOULD_NOT_BE_EMPTY_MESSAGE): logger.debug("validating volume id") if not object_id: raise ValidationException(message) @@ -240,7 +241,7 @@ def _validate_object_id(object_id, object_type=config.VOLUME_TYPE_NAME, raise ObjectIdError(object_type, object_id) if len(object_id.split(config.PARAMETERS_OBJECT_ID_INFO_DELIMITER)) not in {config.MINIMUM_VOLUME_ID_PARTS, config.MAXIMUM_VOLUME_ID_PARTS}: - raise ValidationException(messages.volume_id_wrong_format_message) + raise ValidationException(messages.WRONG_FORMAT_MESSAGE.format("volume id")) def validate_create_volume_request(request): @@ -248,15 +249,15 @@ def validate_create_volume_request(request): logger.debug("validating volume name") if not request.name: - raise ValidationException(messages.name_should_not_be_empty_message) + raise ValidationException(messages.NAME_SHOULD_NOT_BE_EMPTY_MESSAGE) logger.debug("validating volume capacity") if request.capacity_range: if request.capacity_range.required_bytes < 0: - raise ValidationException(messages.size_should_not_be_negative_message) + raise ValidationException(messages.SIZE_SHOULD_NOT_BE_NEGATIVE_MESSAGE) else: - raise ValidationException(messages.no_capacity_range_message) + raise ValidationException(messages.NO_CAPACITY_RANGE_MESSAGE) validate_csi_volume_capabilities(request.volume_capabilities) @@ -265,7 +266,7 @@ def validate_create_volume_request(request): if request.parameters: _validate_pool_parameter(request.parameters) else: - raise ValidationException(messages.pool_is_missing_message) + raise ValidationException(messages.POOL_IS_MISSING_MESSAGE) logger.debug("validating volume copy source") validate_create_volume_source(request) @@ -277,20 +278,20 @@ def validate_create_snapshot_request(request): logger.debug("validating create snapshot request") logger.debug("validating snapshot name") if not request.name: - raise ValidationException(messages.name_should_not_be_empty_message) + raise ValidationException(messages.NAME_SHOULD_NOT_BE_EMPTY_MESSAGE) validate_secrets(request.secrets) logger.debug("validating source volume id") if not request.source_volume_id: - raise ValidationException(messages.snapshot_src_volume_id_is_missing) + raise ValidationException(messages.SNAPSHOT_SOURCE_VOLUME_ID_IS_MISSING) logger.debug("request validation finished.") def validate_delete_snapshot_request(request): logger.debug("validating delete snapshot request") if not request.snapshot_id: - raise ValidationException(messages.snapshot_id_should_not_be_empty_message) + raise ValidationException(messages.SNAPSHOT_ID_SHOULD_NOT_BE_EMPTY_MESSAGE) validate_secrets(request.secrets) @@ -316,7 +317,7 @@ def validate_volume_context_match_volume(volume_context, volume): if volume_context != context_from_existing_volume: raise ValidationException( - messages.volume_context_not_match_volume_message.format(volume_context, context_from_existing_volume)) + messages.VOLUME_CONTEXT_NOT_MATCH_VOLUME_MESSAGE.format(volume_context, context_from_existing_volume)) logger.debug("volume_context validation finished.") @@ -324,14 +325,14 @@ def validate_expand_volume_request(request): logger.debug("validating expand volume request") if not request.volume_id: - raise ValidationException(messages.volume_id_should_not_be_empty_message) + raise ValidationException(messages.VOLUME_ID_SHOULD_NOT_BE_EMPTY_MESSAGE) logger.debug("validating volume capacity") if request.capacity_range: if request.capacity_range.required_bytes < 0: - raise ValidationException(messages.size_should_not_be_negative_message) + raise ValidationException(messages.SIZE_SHOULD_NOT_BE_NEGATIVE_MESSAGE) else: - raise ValidationException(messages.no_capacity_range_message) + raise ValidationException(messages.NO_CAPACITY_RANGE_MESSAGE) validate_secrets(request.secrets) @@ -352,39 +353,39 @@ def generate_csi_create_volume_response(new_volume, system_id=None, source_type= volume_source = csi_pb2.VolumeContentSource.VolumeSource(volume_id=new_volume.copy_source_id) content_source = csi_pb2.VolumeContentSource(volume=volume_source) - res = csi_pb2.CreateVolumeResponse(volume=csi_pb2.Volume( + response = csi_pb2.CreateVolumeResponse(volume=csi_pb2.Volume( capacity_bytes=new_volume.capacity_bytes, volume_id=get_volume_id(new_volume, system_id), content_source=content_source, volume_context=volume_context)) - logger.debug("finished creating volume response : {0}".format(res)) - return res + logger.debug("finished creating volume response : {0}".format(response)) + return response def generate_csi_create_snapshot_response(new_snapshot, system_id, source_volume_id): logger.debug("creating create snapshot response for snapshot : {0}".format(new_snapshot)) - res = csi_pb2.CreateSnapshotResponse(snapshot=csi_pb2.Snapshot( + response = csi_pb2.CreateSnapshotResponse(snapshot=csi_pb2.Snapshot( size_bytes=new_snapshot.capacity_bytes, snapshot_id=get_snapshot_id(new_snapshot, system_id), source_volume_id=source_volume_id, creation_time=get_current_timestamp(), ready_to_use=new_snapshot.is_ready)) - logger.debug("finished creating snapshot response : {0}".format(res)) - return res + logger.debug("finished creating snapshot response : {0}".format(response)) + return response def generate_csi_expand_volume_response(capacity_bytes, node_expansion_required=True): logger.debug("creating response for expand volume") - res = csi_pb2.ControllerExpandVolumeResponse( + response = csi_pb2.ControllerExpandVolumeResponse( capacity_bytes=capacity_bytes, node_expansion_required=node_expansion_required, ) logger.debug("finished creating expand volume response") - return res + return response def _get_supported_capability(volume_capability): @@ -408,13 +409,14 @@ def generate_csi_validate_volume_capabilities_response(volume_context, volume_ca supported_capability = _get_supported_capability(volume_capability=capability) capabilities.append(supported_capability) - res = csi_pb2.ValidateVolumeCapabilitiesResponse(confirmed=csi_pb2.ValidateVolumeCapabilitiesResponse.Confirmed( + confirmed = csi_pb2.ValidateVolumeCapabilitiesResponse.Confirmed( volume_context=volume_context, volume_capabilities=capabilities, - parameters=parameters)) + parameters=parameters) + response = csi_pb2.ValidateVolumeCapabilitiesResponse(confirmed=confirmed) logger.debug("finished creating validate volume capabilities response") - return res + return response def validate_delete_volume_request(request): @@ -428,17 +430,30 @@ def validate_delete_volume_request(request): logger.debug("delete volume validation finished") +def _validate_node_id(node_id): + logger.debug("validating node id") + + delimiter_count = node_id.count(config.PARAMETERS_NODE_ID_DELIMITER) + + if not 1 <= delimiter_count <= 3: + raise InvalidNodeId(node_id) + + logger.debug("node id validation finished") + + def validate_publish_volume_request(request): logger.debug("validating publish volume request") logger.debug("validating readonly") if request.readonly: - raise ValidationException(messages.readonly_not_supported_message) + raise ValidationException(messages.READONLY_NOT_SUPPORTED_MESSAGE) validate_csi_volume_capability(request.volume_capability) validate_secrets(request.secrets) + _validate_node_id(request.node_id) + logger.debug("publish volume request validation finished.") @@ -491,7 +506,7 @@ def get_node_id_info(node_id): elif len(split_node) == 2: hostname, nvme_nqn = split_node else: - raise array_errors.HostNotFoundError(node_id) + raise ValueError(messages.WRONG_FORMAT_MESSAGE.format("node id")) logger.debug("node name : {0}, nvme_nqn: {1}, fc_wwns : {2}, iscsi_iqn : {3} ".format( hostname, nvme_nqn, fc_wwns, iscsi_iqn)) return hostname, nvme_nqn, fc_wwns, iscsi_iqn @@ -533,10 +548,10 @@ def generate_csi_publish_volume_response(lun, connectivity_type, config, array_i array_initiators_param = config["controller"]["publish_context_array_iqn"] publish_context[array_initiators_param] = separator.join(array_initiators.keys()) - res = csi_pb2.ControllerPublishVolumeResponse(publish_context=publish_context) + response = csi_pb2.ControllerPublishVolumeResponse(publish_context=publish_context) - logger.debug("publish volume response is :{0}".format(res)) - return res + logger.debug("publish volume response is :{0}".format(response)) + return response def validate_unpublish_volume_request(request): @@ -546,6 +561,8 @@ def validate_unpublish_volume_request(request): validate_secrets(request.secrets) + _validate_node_id(request.node_id) + logger.debug("unpublish volume request validation finished.") @@ -554,13 +571,13 @@ def validate_addons_request(request): logger.debug("validating volume id") if request.volume_id == "" or request.replication_id == "": - raise ValidationException(messages.volume_id_should_not_be_empty_message) + raise ValidationException(messages.VOLUME_ID_SHOULD_NOT_BE_EMPTY_MESSAGE) logger.debug("validating copy type") if config.PARAMETERS_COPY_TYPE in request.parameters: copy_type = request.parameters.get(config.PARAMETERS_COPY_TYPE) if copy_type not in (REPLICATION_COPY_TYPE_SYNC, REPLICATION_COPY_TYPE_ASYNC): - raise ValidationException(messages.invalid_replication_copy_type_message.format(copy_type)) + raise ValidationException(messages.INVALID_REPLICATION_COPY_TYPE_MESSAGE.format(copy_type)) validate_secrets(request.secrets) @@ -568,9 +585,9 @@ def validate_addons_request(request): def get_current_timestamp(): - res = Timestamp() - res.GetCurrentTime() - return res + timestamp = Timestamp() + timestamp.GetCurrentTime() + return timestamp def hash_string(string): @@ -590,13 +607,13 @@ def validate_parameters_match_volume(parameters, volume): else: space_efficiency = volume.default_space_efficiency _validate_parameter_match_volume(space_efficiency, volume.space_efficiency, - messages.space_efficiency_not_match_volume_message) + messages.SPACE_EFFICIENCY_NOT_MATCH_VOLUME_MESSAGE) logger.debug("validating pool parameter matches volume's") pool = parameters.get(config.PARAMETERS_POOL) - _validate_parameter_match_volume(pool, volume.pool, messages.pool_not_match_volume_message) + _validate_parameter_match_volume(pool, volume.pool, messages.POOL_NOT_MATCH_VOLUME_MESSAGE) logger.debug("validating prefix parameter matches volume's") prefix = parameters.get(config.PARAMETERS_VOLUME_NAME_PREFIX) - _validate_parameter_match_volume(prefix, volume.name, messages.prefix_not_match_volume_message, + _validate_parameter_match_volume(prefix, volume.name, messages.PREFIX_NOT_MATCH_VOLUME_MESSAGE, lambda pref, name: name.startswith(pref + NAME_PREFIX_SEPARATOR)) diff --git a/controller/csi_general/__init__.py b/controller/csi_general/__init__.py deleted file mode 100644 index e69de29bb..000000000 diff --git a/controller/csi_general/csi_pb2.py b/controller/csi_general/csi_pb2.py deleted file mode 100644 index ceeaffca4..000000000 --- a/controller/csi_general/csi_pb2.py +++ /dev/null @@ -1,5682 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: controller/csi_general/csi.proto -"""Generated protocol buffer code.""" -from google.protobuf import descriptor as _descriptor -from google.protobuf import message as _message -from google.protobuf import reflection as _reflection -from google.protobuf import symbol_database as _symbol_database -# @@protoc_insertion_point(imports) - -_sym_db = _symbol_database.Default() - - -from google.protobuf import descriptor_pb2 as google_dot_protobuf_dot_descriptor__pb2 -from google.protobuf import timestamp_pb2 as google_dot_protobuf_dot_timestamp__pb2 -from google.protobuf import wrappers_pb2 as google_dot_protobuf_dot_wrappers__pb2 - - -DESCRIPTOR = _descriptor.FileDescriptor( - name='controller/csi_general/csi.proto', - package='csi.v1', - syntax='proto3', - serialized_options=b'Z\003csi', - create_key=_descriptor._internal_create_key, - serialized_pb=b'\n controller/csi_general/csi.proto\x12\x06\x63si.v1\x1a google/protobuf/descriptor.proto\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x1egoogle/protobuf/wrappers.proto\"\x16\n\x14GetPluginInfoRequest\"\xad\x01\n\x15GetPluginInfoResponse\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x16\n\x0evendor_version\x18\x02 \x01(\t\x12=\n\x08manifest\x18\x03 \x03(\x0b\x32+.csi.v1.GetPluginInfoResponse.ManifestEntry\x1a/\n\rManifestEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"\x1e\n\x1cGetPluginCapabilitiesRequest\"O\n\x1dGetPluginCapabilitiesResponse\x12.\n\x0c\x63\x61pabilities\x18\x01 \x03(\x0b\x32\x18.csi.v1.PluginCapability\"\xa7\x03\n\x10PluginCapability\x12\x33\n\x07service\x18\x01 \x01(\x0b\x32 .csi.v1.PluginCapability.ServiceH\x00\x12\x44\n\x10volume_expansion\x18\x02 \x01(\x0b\x32(.csi.v1.PluginCapability.VolumeExpansionH\x00\x1a\x91\x01\n\x07Service\x12\x33\n\x04type\x18\x01 \x01(\x0e\x32%.csi.v1.PluginCapability.Service.Type\"Q\n\x04Type\x12\x0b\n\x07UNKNOWN\x10\x00\x12\x16\n\x12\x43ONTROLLER_SERVICE\x10\x01\x12$\n VOLUME_ACCESSIBILITY_CONSTRAINTS\x10\x02\x1a|\n\x0fVolumeExpansion\x12;\n\x04type\x18\x01 \x01(\x0e\x32-.csi.v1.PluginCapability.VolumeExpansion.Type\",\n\x04Type\x12\x0b\n\x07UNKNOWN\x10\x00\x12\n\n\x06ONLINE\x10\x01\x12\x0b\n\x07OFFLINE\x10\x02\x42\x06\n\x04type\"\x0e\n\x0cProbeRequest\":\n\rProbeResponse\x12)\n\x05ready\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.BoolValue\"\xea\x03\n\x13\x43reateVolumeRequest\x12\x0c\n\x04name\x18\x01 \x01(\t\x12-\n\x0e\x63\x61pacity_range\x18\x02 \x01(\x0b\x32\x15.csi.v1.CapacityRange\x12\x35\n\x13volume_capabilities\x18\x03 \x03(\x0b\x32\x18.csi.v1.VolumeCapability\x12?\n\nparameters\x18\x04 \x03(\x0b\x32+.csi.v1.CreateVolumeRequest.ParametersEntry\x12>\n\x07secrets\x18\x05 \x03(\x0b\x32(.csi.v1.CreateVolumeRequest.SecretsEntryB\x03\x98\x42\x01\x12:\n\x15volume_content_source\x18\x06 \x01(\x0b\x32\x1b.csi.v1.VolumeContentSource\x12?\n\x1a\x61\x63\x63\x65ssibility_requirements\x18\x07 \x01(\x0b\x32\x1b.csi.v1.TopologyRequirement\x1a\x31\n\x0fParametersEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\x1a.\n\x0cSecretsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"\xe3\x01\n\x13VolumeContentSource\x12>\n\x08snapshot\x18\x01 \x01(\x0b\x32*.csi.v1.VolumeContentSource.SnapshotSourceH\x00\x12:\n\x06volume\x18\x02 \x01(\x0b\x32(.csi.v1.VolumeContentSource.VolumeSourceH\x00\x1a%\n\x0eSnapshotSource\x12\x13\n\x0bsnapshot_id\x18\x01 \x01(\t\x1a!\n\x0cVolumeSource\x12\x11\n\tvolume_id\x18\x01 \x01(\tB\x06\n\x04type\"6\n\x14\x43reateVolumeResponse\x12\x1e\n\x06volume\x18\x01 \x01(\x0b\x32\x0e.csi.v1.Volume\"\xde\x04\n\x10VolumeCapability\x12\x35\n\x05\x62lock\x18\x01 \x01(\x0b\x32$.csi.v1.VolumeCapability.BlockVolumeH\x00\x12\x35\n\x05mount\x18\x02 \x01(\x0b\x32$.csi.v1.VolumeCapability.MountVolumeH\x00\x12\x38\n\x0b\x61\x63\x63\x65ss_mode\x18\x03 \x01(\x0b\x32#.csi.v1.VolumeCapability.AccessMode\x1a\r\n\x0b\x42lockVolume\x1aT\n\x0bMountVolume\x12\x0f\n\x07\x66s_type\x18\x01 \x01(\t\x12\x13\n\x0bmount_flags\x18\x02 \x03(\t\x12\x1f\n\x12volume_mount_group\x18\x03 \x01(\tB\x03\xa0\x42\x01\x1a\xad\x02\n\nAccessMode\x12\x36\n\x04mode\x18\x01 \x01(\x0e\x32(.csi.v1.VolumeCapability.AccessMode.Mode\"\xe6\x01\n\x04Mode\x12\x0b\n\x07UNKNOWN\x10\x00\x12\x16\n\x12SINGLE_NODE_WRITER\x10\x01\x12\x1b\n\x17SINGLE_NODE_READER_ONLY\x10\x02\x12\x1a\n\x16MULTI_NODE_READER_ONLY\x10\x03\x12\x1c\n\x18MULTI_NODE_SINGLE_WRITER\x10\x04\x12\x1b\n\x17MULTI_NODE_MULTI_WRITER\x10\x05\x12\"\n\x19SINGLE_NODE_SINGLE_WRITER\x10\x06\x1a\x03\xa0\x42\x01\x12!\n\x18SINGLE_NODE_MULTI_WRITER\x10\x07\x1a\x03\xa0\x42\x01\x42\r\n\x0b\x61\x63\x63\x65ss_type\"<\n\rCapacityRange\x12\x16\n\x0erequired_bytes\x18\x01 \x01(\x03\x12\x13\n\x0blimit_bytes\x18\x02 \x01(\x03\"\x88\x02\n\x06Volume\x12\x16\n\x0e\x63\x61pacity_bytes\x18\x01 \x01(\x03\x12\x11\n\tvolume_id\x18\x02 \x01(\t\x12\x39\n\x0evolume_context\x18\x03 \x03(\x0b\x32!.csi.v1.Volume.VolumeContextEntry\x12\x33\n\x0e\x63ontent_source\x18\x04 \x01(\x0b\x32\x1b.csi.v1.VolumeContentSource\x12-\n\x13\x61\x63\x63\x65ssible_topology\x18\x05 \x03(\x0b\x32\x10.csi.v1.Topology\x1a\x34\n\x12VolumeContextEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"_\n\x13TopologyRequirement\x12#\n\trequisite\x18\x01 \x03(\x0b\x32\x10.csi.v1.Topology\x12#\n\tpreferred\x18\x02 \x03(\x0b\x32\x10.csi.v1.Topology\"m\n\x08Topology\x12\x30\n\x08segments\x18\x01 \x03(\x0b\x32\x1e.csi.v1.Topology.SegmentsEntry\x1a/\n\rSegmentsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"\x98\x01\n\x13\x44\x65leteVolumeRequest\x12\x11\n\tvolume_id\x18\x01 \x01(\t\x12>\n\x07secrets\x18\x02 \x03(\x0b\x32(.csi.v1.DeleteVolumeRequest.SecretsEntryB\x03\x98\x42\x01\x1a.\n\x0cSecretsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"\x16\n\x14\x44\x65leteVolumeResponse\"\x8f\x03\n\x1e\x43ontrollerPublishVolumeRequest\x12\x11\n\tvolume_id\x18\x01 \x01(\t\x12\x0f\n\x07node_id\x18\x02 \x01(\t\x12\x33\n\x11volume_capability\x18\x03 \x01(\x0b\x32\x18.csi.v1.VolumeCapability\x12\x10\n\x08readonly\x18\x04 \x01(\x08\x12I\n\x07secrets\x18\x05 \x03(\x0b\x32\x33.csi.v1.ControllerPublishVolumeRequest.SecretsEntryB\x03\x98\x42\x01\x12Q\n\x0evolume_context\x18\x06 \x03(\x0b\x32\x39.csi.v1.ControllerPublishVolumeRequest.VolumeContextEntry\x1a.\n\x0cSecretsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\x1a\x34\n\x12VolumeContextEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"\xae\x01\n\x1f\x43ontrollerPublishVolumeResponse\x12T\n\x0fpublish_context\x18\x01 \x03(\x0b\x32;.csi.v1.ControllerPublishVolumeResponse.PublishContextEntry\x1a\x35\n\x13PublishContextEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"\xc3\x01\n ControllerUnpublishVolumeRequest\x12\x11\n\tvolume_id\x18\x01 \x01(\t\x12\x0f\n\x07node_id\x18\x02 \x01(\t\x12K\n\x07secrets\x18\x03 \x03(\x0b\x32\x35.csi.v1.ControllerUnpublishVolumeRequest.SecretsEntryB\x03\x98\x42\x01\x1a.\n\x0cSecretsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"#\n!ControllerUnpublishVolumeResponse\"\xf9\x03\n!ValidateVolumeCapabilitiesRequest\x12\x11\n\tvolume_id\x18\x01 \x01(\t\x12T\n\x0evolume_context\x18\x02 \x03(\x0b\x32<.csi.v1.ValidateVolumeCapabilitiesRequest.VolumeContextEntry\x12\x35\n\x13volume_capabilities\x18\x03 \x03(\x0b\x32\x18.csi.v1.VolumeCapability\x12M\n\nparameters\x18\x04 \x03(\x0b\x32\x39.csi.v1.ValidateVolumeCapabilitiesRequest.ParametersEntry\x12L\n\x07secrets\x18\x05 \x03(\x0b\x32\x36.csi.v1.ValidateVolumeCapabilitiesRequest.SecretsEntryB\x03\x98\x42\x01\x1a\x34\n\x12VolumeContextEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\x1a\x31\n\x0fParametersEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\x1a.\n\x0cSecretsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"\xe7\x03\n\"ValidateVolumeCapabilitiesResponse\x12G\n\tconfirmed\x18\x01 \x01(\x0b\x32\x34.csi.v1.ValidateVolumeCapabilitiesResponse.Confirmed\x12\x0f\n\x07message\x18\x02 \x01(\t\x1a\xe6\x02\n\tConfirmed\x12_\n\x0evolume_context\x18\x01 \x03(\x0b\x32G.csi.v1.ValidateVolumeCapabilitiesResponse.Confirmed.VolumeContextEntry\x12\x35\n\x13volume_capabilities\x18\x02 \x03(\x0b\x32\x18.csi.v1.VolumeCapability\x12X\n\nparameters\x18\x03 \x03(\x0b\x32\x44.csi.v1.ValidateVolumeCapabilitiesResponse.Confirmed.ParametersEntry\x1a\x34\n\x12VolumeContextEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\x1a\x31\n\x0fParametersEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"A\n\x12ListVolumesRequest\x12\x13\n\x0bmax_entries\x18\x01 \x01(\x05\x12\x16\n\x0estarting_token\x18\x02 \x01(\t\"\xa4\x02\n\x13ListVolumesResponse\x12\x32\n\x07\x65ntries\x18\x01 \x03(\x0b\x32!.csi.v1.ListVolumesResponse.Entry\x12\x12\n\nnext_token\x18\x02 \x01(\t\x1a\x62\n\x0cVolumeStatus\x12\x1a\n\x12published_node_ids\x18\x01 \x03(\t\x12\x36\n\x10volume_condition\x18\x02 \x01(\x0b\x32\x17.csi.v1.VolumeConditionB\x03\xa0\x42\x01\x1a\x61\n\x05\x45ntry\x12\x1e\n\x06volume\x18\x01 \x01(\x0b\x32\x0e.csi.v1.Volume\x12\x38\n\x06status\x18\x02 \x01(\x0b\x32(.csi.v1.ListVolumesResponse.VolumeStatus\"4\n\x1a\x43ontrollerGetVolumeRequest\x12\x11\n\tvolume_id\x18\x01 \x01(\t:\x03\xa0\x42\x01\"\xe3\x01\n\x1b\x43ontrollerGetVolumeResponse\x12\x1e\n\x06volume\x18\x01 \x01(\x0b\x32\x0e.csi.v1.Volume\x12@\n\x06status\x18\x02 \x01(\x0b\x32\x30.csi.v1.ControllerGetVolumeResponse.VolumeStatus\x1a]\n\x0cVolumeStatus\x12\x1a\n\x12published_node_ids\x18\x01 \x03(\t\x12\x31\n\x10volume_condition\x18\x02 \x01(\x0b\x32\x17.csi.v1.VolumeCondition:\x03\xa0\x42\x01\"\xed\x01\n\x12GetCapacityRequest\x12\x35\n\x13volume_capabilities\x18\x01 \x03(\x0b\x32\x18.csi.v1.VolumeCapability\x12>\n\nparameters\x18\x02 \x03(\x0b\x32*.csi.v1.GetCapacityRequest.ParametersEntry\x12-\n\x13\x61\x63\x63\x65ssible_topology\x18\x03 \x01(\x0b\x32\x10.csi.v1.Topology\x1a\x31\n\x0fParametersEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"\xaf\x01\n\x13GetCapacityResponse\x12\x1a\n\x12\x61vailable_capacity\x18\x01 \x01(\x03\x12=\n\x13maximum_volume_size\x18\x02 \x01(\x0b\x32\x1b.google.protobuf.Int64ValueB\x03\xa0\x42\x01\x12=\n\x13minimum_volume_size\x18\x03 \x01(\x0b\x32\x1b.google.protobuf.Int64ValueB\x03\xa0\x42\x01\"\"\n ControllerGetCapabilitiesRequest\"^\n!ControllerGetCapabilitiesResponse\x12\x39\n\x0c\x63\x61pabilities\x18\x01 \x03(\x0b\x32#.csi.v1.ControllerServiceCapability\"\xf3\x03\n\x1b\x43ontrollerServiceCapability\x12\x36\n\x03rpc\x18\x01 \x01(\x0b\x32\'.csi.v1.ControllerServiceCapability.RPCH\x00\x1a\x93\x03\n\x03RPC\x12:\n\x04type\x18\x01 \x01(\x0e\x32,.csi.v1.ControllerServiceCapability.RPC.Type\"\xcf\x02\n\x04Type\x12\x0b\n\x07UNKNOWN\x10\x00\x12\x18\n\x14\x43REATE_DELETE_VOLUME\x10\x01\x12\x1c\n\x18PUBLISH_UNPUBLISH_VOLUME\x10\x02\x12\x10\n\x0cLIST_VOLUMES\x10\x03\x12\x10\n\x0cGET_CAPACITY\x10\x04\x12\x1a\n\x16\x43REATE_DELETE_SNAPSHOT\x10\x05\x12\x12\n\x0eLIST_SNAPSHOTS\x10\x06\x12\x10\n\x0c\x43LONE_VOLUME\x10\x07\x12\x14\n\x10PUBLISH_READONLY\x10\x08\x12\x11\n\rEXPAND_VOLUME\x10\t\x12 \n\x1cLIST_VOLUMES_PUBLISHED_NODES\x10\n\x12\x19\n\x10VOLUME_CONDITION\x10\x0b\x1a\x03\xa0\x42\x01\x12\x13\n\nGET_VOLUME\x10\x0c\x1a\x03\xa0\x42\x01\x12!\n\x18SINGLE_NODE_MULTI_WRITER\x10\r\x1a\x03\xa0\x42\x01\x42\x06\n\x04type\"\xa7\x02\n\x15\x43reateSnapshotRequest\x12\x18\n\x10source_volume_id\x18\x01 \x01(\t\x12\x0c\n\x04name\x18\x02 \x01(\t\x12@\n\x07secrets\x18\x03 \x03(\x0b\x32*.csi.v1.CreateSnapshotRequest.SecretsEntryB\x03\x98\x42\x01\x12\x41\n\nparameters\x18\x04 \x03(\x0b\x32-.csi.v1.CreateSnapshotRequest.ParametersEntry\x1a.\n\x0cSecretsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\x1a\x31\n\x0fParametersEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"<\n\x16\x43reateSnapshotResponse\x12\"\n\x08snapshot\x18\x01 \x01(\x0b\x32\x10.csi.v1.Snapshot\"\x96\x01\n\x08Snapshot\x12\x12\n\nsize_bytes\x18\x01 \x01(\x03\x12\x13\n\x0bsnapshot_id\x18\x02 \x01(\t\x12\x18\n\x10source_volume_id\x18\x03 \x01(\t\x12\x31\n\rcreation_time\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x14\n\x0cready_to_use\x18\x05 \x01(\x08\"\x9e\x01\n\x15\x44\x65leteSnapshotRequest\x12\x13\n\x0bsnapshot_id\x18\x01 \x01(\t\x12@\n\x07secrets\x18\x02 \x03(\x0b\x32*.csi.v1.DeleteSnapshotRequest.SecretsEntryB\x03\x98\x42\x01\x1a.\n\x0cSecretsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"\x18\n\x16\x44\x65leteSnapshotResponse\"\xe3\x01\n\x14ListSnapshotsRequest\x12\x13\n\x0bmax_entries\x18\x01 \x01(\x05\x12\x16\n\x0estarting_token\x18\x02 \x01(\t\x12\x18\n\x10source_volume_id\x18\x03 \x01(\t\x12\x13\n\x0bsnapshot_id\x18\x04 \x01(\t\x12?\n\x07secrets\x18\x05 \x03(\x0b\x32).csi.v1.ListSnapshotsRequest.SecretsEntryB\x03\x98\x42\x01\x1a.\n\x0cSecretsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"\x8e\x01\n\x15ListSnapshotsResponse\x12\x34\n\x07\x65ntries\x18\x01 \x03(\x0b\x32#.csi.v1.ListSnapshotsResponse.Entry\x12\x12\n\nnext_token\x18\x02 \x01(\t\x1a+\n\x05\x45ntry\x12\"\n\x08snapshot\x18\x01 \x01(\x0b\x32\x10.csi.v1.Snapshot\"\x90\x02\n\x1d\x43ontrollerExpandVolumeRequest\x12\x11\n\tvolume_id\x18\x01 \x01(\t\x12-\n\x0e\x63\x61pacity_range\x18\x02 \x01(\x0b\x32\x15.csi.v1.CapacityRange\x12H\n\x07secrets\x18\x03 \x03(\x0b\x32\x32.csi.v1.ControllerExpandVolumeRequest.SecretsEntryB\x03\x98\x42\x01\x12\x33\n\x11volume_capability\x18\x04 \x01(\x0b\x32\x18.csi.v1.VolumeCapability\x1a.\n\x0cSecretsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"Y\n\x1e\x43ontrollerExpandVolumeResponse\x12\x16\n\x0e\x63\x61pacity_bytes\x18\x01 \x01(\x03\x12\x1f\n\x17node_expansion_required\x18\x02 \x01(\x08\"\xf5\x03\n\x16NodeStageVolumeRequest\x12\x11\n\tvolume_id\x18\x01 \x01(\t\x12K\n\x0fpublish_context\x18\x02 \x03(\x0b\x32\x32.csi.v1.NodeStageVolumeRequest.PublishContextEntry\x12\x1b\n\x13staging_target_path\x18\x03 \x01(\t\x12\x33\n\x11volume_capability\x18\x04 \x01(\x0b\x32\x18.csi.v1.VolumeCapability\x12\x41\n\x07secrets\x18\x05 \x03(\x0b\x32+.csi.v1.NodeStageVolumeRequest.SecretsEntryB\x03\x98\x42\x01\x12I\n\x0evolume_context\x18\x06 \x03(\x0b\x32\x31.csi.v1.NodeStageVolumeRequest.VolumeContextEntry\x1a\x35\n\x13PublishContextEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\x1a.\n\x0cSecretsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\x1a\x34\n\x12VolumeContextEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"\x19\n\x17NodeStageVolumeResponse\"J\n\x18NodeUnstageVolumeRequest\x12\x11\n\tvolume_id\x18\x01 \x01(\t\x12\x1b\n\x13staging_target_path\x18\x02 \x01(\t\"\x1b\n\x19NodeUnstageVolumeResponse\"\xa4\x04\n\x18NodePublishVolumeRequest\x12\x11\n\tvolume_id\x18\x01 \x01(\t\x12M\n\x0fpublish_context\x18\x02 \x03(\x0b\x32\x34.csi.v1.NodePublishVolumeRequest.PublishContextEntry\x12\x1b\n\x13staging_target_path\x18\x03 \x01(\t\x12\x13\n\x0btarget_path\x18\x04 \x01(\t\x12\x33\n\x11volume_capability\x18\x05 \x01(\x0b\x32\x18.csi.v1.VolumeCapability\x12\x10\n\x08readonly\x18\x06 \x01(\x08\x12\x43\n\x07secrets\x18\x07 \x03(\x0b\x32-.csi.v1.NodePublishVolumeRequest.SecretsEntryB\x03\x98\x42\x01\x12K\n\x0evolume_context\x18\x08 \x03(\x0b\x32\x33.csi.v1.NodePublishVolumeRequest.VolumeContextEntry\x1a\x35\n\x13PublishContextEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\x1a.\n\x0cSecretsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\x1a\x34\n\x12VolumeContextEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"\x1b\n\x19NodePublishVolumeResponse\"D\n\x1aNodeUnpublishVolumeRequest\x12\x11\n\tvolume_id\x18\x01 \x01(\t\x12\x13\n\x0btarget_path\x18\x02 \x01(\t\"\x1d\n\x1bNodeUnpublishVolumeResponse\"`\n\x19NodeGetVolumeStatsRequest\x12\x11\n\tvolume_id\x18\x01 \x01(\t\x12\x13\n\x0bvolume_path\x18\x02 \x01(\t\x12\x1b\n\x13staging_target_path\x18\x03 \x01(\t\"x\n\x1aNodeGetVolumeStatsResponse\x12\"\n\x05usage\x18\x01 \x03(\x0b\x32\x13.csi.v1.VolumeUsage\x12\x36\n\x10volume_condition\x18\x02 \x01(\x0b\x32\x17.csi.v1.VolumeConditionB\x03\xa0\x42\x01\"\x91\x01\n\x0bVolumeUsage\x12\x11\n\tavailable\x18\x01 \x01(\x03\x12\r\n\x05total\x18\x02 \x01(\x03\x12\x0c\n\x04used\x18\x03 \x01(\x03\x12&\n\x04unit\x18\x04 \x01(\x0e\x32\x18.csi.v1.VolumeUsage.Unit\"*\n\x04Unit\x12\x0b\n\x07UNKNOWN\x10\x00\x12\t\n\x05\x42YTES\x10\x01\x12\n\n\x06INODES\x10\x02\"9\n\x0fVolumeCondition\x12\x10\n\x08\x61\x62normal\x18\x01 \x01(\x08\x12\x0f\n\x07message\x18\x02 \x01(\t:\x03\xa0\x42\x01\"\x1c\n\x1aNodeGetCapabilitiesRequest\"R\n\x1bNodeGetCapabilitiesResponse\x12\x33\n\x0c\x63\x61pabilities\x18\x01 \x03(\x0b\x32\x1d.csi.v1.NodeServiceCapability\"\xc3\x02\n\x15NodeServiceCapability\x12\x30\n\x03rpc\x18\x01 \x01(\x0b\x32!.csi.v1.NodeServiceCapability.RPCH\x00\x1a\xef\x01\n\x03RPC\x12\x34\n\x04type\x18\x01 \x01(\x0e\x32&.csi.v1.NodeServiceCapability.RPC.Type\"\xb1\x01\n\x04Type\x12\x0b\n\x07UNKNOWN\x10\x00\x12\x18\n\x14STAGE_UNSTAGE_VOLUME\x10\x01\x12\x14\n\x10GET_VOLUME_STATS\x10\x02\x12\x11\n\rEXPAND_VOLUME\x10\x03\x12\x19\n\x10VOLUME_CONDITION\x10\x04\x1a\x03\xa0\x42\x01\x12!\n\x18SINGLE_NODE_MULTI_WRITER\x10\x05\x1a\x03\xa0\x42\x01\x12\x1b\n\x12VOLUME_MOUNT_GROUP\x10\x06\x1a\x03\xa0\x42\x01\x42\x06\n\x04type\"\x14\n\x12NodeGetInfoRequest\"s\n\x13NodeGetInfoResponse\x12\x0f\n\x07node_id\x18\x01 \x01(\t\x12\x1c\n\x14max_volumes_per_node\x18\x02 \x01(\x03\x12-\n\x13\x61\x63\x63\x65ssible_topology\x18\x03 \x01(\x0b\x32\x10.csi.v1.Topology\"\xb9\x02\n\x17NodeExpandVolumeRequest\x12\x11\n\tvolume_id\x18\x01 \x01(\t\x12\x13\n\x0bvolume_path\x18\x02 \x01(\t\x12-\n\x0e\x63\x61pacity_range\x18\x03 \x01(\x0b\x32\x15.csi.v1.CapacityRange\x12\x1b\n\x13staging_target_path\x18\x04 \x01(\t\x12\x33\n\x11volume_capability\x18\x05 \x01(\x0b\x32\x18.csi.v1.VolumeCapability\x12\x45\n\x07secrets\x18\x06 \x03(\x0b\x32,.csi.v1.NodeExpandVolumeRequest.SecretsEntryB\x06\x98\x42\x01\xa0\x42\x01\x1a.\n\x0cSecretsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"2\n\x18NodeExpandVolumeResponse\x12\x16\n\x0e\x63\x61pacity_bytes\x18\x01 \x01(\x03\x32\xfa\x01\n\x08Identity\x12N\n\rGetPluginInfo\x12\x1c.csi.v1.GetPluginInfoRequest\x1a\x1d.csi.v1.GetPluginInfoResponse\"\x00\x12\x66\n\x15GetPluginCapabilities\x12$.csi.v1.GetPluginCapabilitiesRequest\x1a%.csi.v1.GetPluginCapabilitiesResponse\"\x00\x12\x36\n\x05Probe\x12\x14.csi.v1.ProbeRequest\x1a\x15.csi.v1.ProbeResponse\"\x00\x32\xcd\t\n\nController\x12K\n\x0c\x43reateVolume\x12\x1b.csi.v1.CreateVolumeRequest\x1a\x1c.csi.v1.CreateVolumeResponse\"\x00\x12K\n\x0c\x44\x65leteVolume\x12\x1b.csi.v1.DeleteVolumeRequest\x1a\x1c.csi.v1.DeleteVolumeResponse\"\x00\x12l\n\x17\x43ontrollerPublishVolume\x12&.csi.v1.ControllerPublishVolumeRequest\x1a\'.csi.v1.ControllerPublishVolumeResponse\"\x00\x12r\n\x19\x43ontrollerUnpublishVolume\x12(.csi.v1.ControllerUnpublishVolumeRequest\x1a).csi.v1.ControllerUnpublishVolumeResponse\"\x00\x12u\n\x1aValidateVolumeCapabilities\x12).csi.v1.ValidateVolumeCapabilitiesRequest\x1a*.csi.v1.ValidateVolumeCapabilitiesResponse\"\x00\x12H\n\x0bListVolumes\x12\x1a.csi.v1.ListVolumesRequest\x1a\x1b.csi.v1.ListVolumesResponse\"\x00\x12H\n\x0bGetCapacity\x12\x1a.csi.v1.GetCapacityRequest\x1a\x1b.csi.v1.GetCapacityResponse\"\x00\x12r\n\x19\x43ontrollerGetCapabilities\x12(.csi.v1.ControllerGetCapabilitiesRequest\x1a).csi.v1.ControllerGetCapabilitiesResponse\"\x00\x12Q\n\x0e\x43reateSnapshot\x12\x1d.csi.v1.CreateSnapshotRequest\x1a\x1e.csi.v1.CreateSnapshotResponse\"\x00\x12Q\n\x0e\x44\x65leteSnapshot\x12\x1d.csi.v1.DeleteSnapshotRequest\x1a\x1e.csi.v1.DeleteSnapshotResponse\"\x00\x12N\n\rListSnapshots\x12\x1c.csi.v1.ListSnapshotsRequest\x1a\x1d.csi.v1.ListSnapshotsResponse\"\x00\x12i\n\x16\x43ontrollerExpandVolume\x12%.csi.v1.ControllerExpandVolumeRequest\x1a&.csi.v1.ControllerExpandVolumeResponse\"\x00\x12\x63\n\x13\x43ontrollerGetVolume\x12\".csi.v1.ControllerGetVolumeRequest\x1a#.csi.v1.ControllerGetVolumeResponse\"\x03\xa0\x42\x01\x32\xda\x05\n\x04Node\x12T\n\x0fNodeStageVolume\x12\x1e.csi.v1.NodeStageVolumeRequest\x1a\x1f.csi.v1.NodeStageVolumeResponse\"\x00\x12Z\n\x11NodeUnstageVolume\x12 .csi.v1.NodeUnstageVolumeRequest\x1a!.csi.v1.NodeUnstageVolumeResponse\"\x00\x12Z\n\x11NodePublishVolume\x12 .csi.v1.NodePublishVolumeRequest\x1a!.csi.v1.NodePublishVolumeResponse\"\x00\x12`\n\x13NodeUnpublishVolume\x12\".csi.v1.NodeUnpublishVolumeRequest\x1a#.csi.v1.NodeUnpublishVolumeResponse\"\x00\x12]\n\x12NodeGetVolumeStats\x12!.csi.v1.NodeGetVolumeStatsRequest\x1a\".csi.v1.NodeGetVolumeStatsResponse\"\x00\x12W\n\x10NodeExpandVolume\x12\x1f.csi.v1.NodeExpandVolumeRequest\x1a .csi.v1.NodeExpandVolumeResponse\"\x00\x12`\n\x13NodeGetCapabilities\x12\".csi.v1.NodeGetCapabilitiesRequest\x1a#.csi.v1.NodeGetCapabilitiesResponse\"\x00\x12H\n\x0bNodeGetInfo\x12\x1a.csi.v1.NodeGetInfoRequest\x1a\x1b.csi.v1.NodeGetInfoResponse\"\x00:1\n\nalpha_enum\x12\x1c.google.protobuf.EnumOptions\x18\xa4\x08 \x01(\x08:<\n\x10\x61lpha_enum_value\x12!.google.protobuf.EnumValueOptions\x18\xa4\x08 \x01(\x08:2\n\ncsi_secret\x12\x1d.google.protobuf.FieldOptions\x18\xa3\x08 \x01(\x08:3\n\x0b\x61lpha_field\x12\x1d.google.protobuf.FieldOptions\x18\xa4\x08 \x01(\x08:7\n\ralpha_message\x12\x1f.google.protobuf.MessageOptions\x18\xa4\x08 \x01(\x08:5\n\x0c\x61lpha_method\x12\x1e.google.protobuf.MethodOptions\x18\xa4\x08 \x01(\x08:7\n\ralpha_service\x12\x1f.google.protobuf.ServiceOptions\x18\xa4\x08 \x01(\x08\x42\x05Z\x03\x63sib\x06proto3' - , - dependencies=[google_dot_protobuf_dot_descriptor__pb2.DESCRIPTOR,google_dot_protobuf_dot_timestamp__pb2.DESCRIPTOR,google_dot_protobuf_dot_wrappers__pb2.DESCRIPTOR,]) - - -ALPHA_ENUM_FIELD_NUMBER = 1060 -alpha_enum = _descriptor.FieldDescriptor( - name='alpha_enum', full_name='csi.v1.alpha_enum', index=0, - number=1060, type=8, cpp_type=7, label=1, - has_default_value=False, default_value=False, - message_type=None, enum_type=None, containing_type=None, - is_extension=True, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key) -ALPHA_ENUM_VALUE_FIELD_NUMBER = 1060 -alpha_enum_value = _descriptor.FieldDescriptor( - name='alpha_enum_value', full_name='csi.v1.alpha_enum_value', index=1, - number=1060, type=8, cpp_type=7, label=1, - has_default_value=False, default_value=False, - message_type=None, enum_type=None, containing_type=None, - is_extension=True, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key) -CSI_SECRET_FIELD_NUMBER = 1059 -csi_secret = _descriptor.FieldDescriptor( - name='csi_secret', full_name='csi.v1.csi_secret', index=2, - number=1059, type=8, cpp_type=7, label=1, - has_default_value=False, default_value=False, - message_type=None, enum_type=None, containing_type=None, - is_extension=True, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key) -ALPHA_FIELD_FIELD_NUMBER = 1060 -alpha_field = _descriptor.FieldDescriptor( - name='alpha_field', full_name='csi.v1.alpha_field', index=3, - number=1060, type=8, cpp_type=7, label=1, - has_default_value=False, default_value=False, - message_type=None, enum_type=None, containing_type=None, - is_extension=True, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key) -ALPHA_MESSAGE_FIELD_NUMBER = 1060 -alpha_message = _descriptor.FieldDescriptor( - name='alpha_message', full_name='csi.v1.alpha_message', index=4, - number=1060, type=8, cpp_type=7, label=1, - has_default_value=False, default_value=False, - message_type=None, enum_type=None, containing_type=None, - is_extension=True, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key) -ALPHA_METHOD_FIELD_NUMBER = 1060 -alpha_method = _descriptor.FieldDescriptor( - name='alpha_method', full_name='csi.v1.alpha_method', index=5, - number=1060, type=8, cpp_type=7, label=1, - has_default_value=False, default_value=False, - message_type=None, enum_type=None, containing_type=None, - is_extension=True, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key) -ALPHA_SERVICE_FIELD_NUMBER = 1060 -alpha_service = _descriptor.FieldDescriptor( - name='alpha_service', full_name='csi.v1.alpha_service', index=6, - number=1060, type=8, cpp_type=7, label=1, - has_default_value=False, default_value=False, - message_type=None, enum_type=None, containing_type=None, - is_extension=True, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key) - -_PLUGINCAPABILITY_SERVICE_TYPE = _descriptor.EnumDescriptor( - name='Type', - full_name='csi.v1.PluginCapability.Service.Type', - filename=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - values=[ - _descriptor.EnumValueDescriptor( - name='UNKNOWN', index=0, number=0, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), - _descriptor.EnumValueDescriptor( - name='CONTROLLER_SERVICE', index=1, number=1, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), - _descriptor.EnumValueDescriptor( - name='VOLUME_ACCESSIBILITY_CONSTRAINTS', index=2, number=2, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), - ], - containing_type=None, - serialized_options=None, - serialized_start=665, - serialized_end=746, -) -_sym_db.RegisterEnumDescriptor(_PLUGINCAPABILITY_SERVICE_TYPE) - -_PLUGINCAPABILITY_VOLUMEEXPANSION_TYPE = _descriptor.EnumDescriptor( - name='Type', - full_name='csi.v1.PluginCapability.VolumeExpansion.Type', - filename=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - values=[ - _descriptor.EnumValueDescriptor( - name='UNKNOWN', index=0, number=0, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), - _descriptor.EnumValueDescriptor( - name='ONLINE', index=1, number=1, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), - _descriptor.EnumValueDescriptor( - name='OFFLINE', index=2, number=2, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), - ], - containing_type=None, - serialized_options=None, - serialized_start=828, - serialized_end=872, -) -_sym_db.RegisterEnumDescriptor(_PLUGINCAPABILITY_VOLUMEEXPANSION_TYPE) - -_VOLUMECAPABILITY_ACCESSMODE_MODE = _descriptor.EnumDescriptor( - name='Mode', - full_name='csi.v1.VolumeCapability.AccessMode.Mode', - filename=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - values=[ - _descriptor.EnumValueDescriptor( - name='UNKNOWN', index=0, number=0, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), - _descriptor.EnumValueDescriptor( - name='SINGLE_NODE_WRITER', index=1, number=1, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), - _descriptor.EnumValueDescriptor( - name='SINGLE_NODE_READER_ONLY', index=2, number=2, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), - _descriptor.EnumValueDescriptor( - name='MULTI_NODE_READER_ONLY', index=3, number=3, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), - _descriptor.EnumValueDescriptor( - name='MULTI_NODE_SINGLE_WRITER', index=4, number=4, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), - _descriptor.EnumValueDescriptor( - name='MULTI_NODE_MULTI_WRITER', index=5, number=5, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), - _descriptor.EnumValueDescriptor( - name='SINGLE_NODE_SINGLE_WRITER', index=6, number=6, - serialized_options=b'\240B\001', - type=None, - create_key=_descriptor._internal_create_key), - _descriptor.EnumValueDescriptor( - name='SINGLE_NODE_MULTI_WRITER', index=7, number=7, - serialized_options=b'\240B\001', - type=None, - create_key=_descriptor._internal_create_key), - ], - containing_type=None, - serialized_options=None, - serialized_start=2099, - serialized_end=2329, -) -_sym_db.RegisterEnumDescriptor(_VOLUMECAPABILITY_ACCESSMODE_MODE) - -_CONTROLLERSERVICECAPABILITY_RPC_TYPE = _descriptor.EnumDescriptor( - name='Type', - full_name='csi.v1.ControllerServiceCapability.RPC.Type', - filename=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - values=[ - _descriptor.EnumValueDescriptor( - name='UNKNOWN', index=0, number=0, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), - _descriptor.EnumValueDescriptor( - name='CREATE_DELETE_VOLUME', index=1, number=1, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), - _descriptor.EnumValueDescriptor( - name='PUBLISH_UNPUBLISH_VOLUME', index=2, number=2, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), - _descriptor.EnumValueDescriptor( - name='LIST_VOLUMES', index=3, number=3, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), - _descriptor.EnumValueDescriptor( - name='GET_CAPACITY', index=4, number=4, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), - _descriptor.EnumValueDescriptor( - name='CREATE_DELETE_SNAPSHOT', index=5, number=5, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), - _descriptor.EnumValueDescriptor( - name='LIST_SNAPSHOTS', index=6, number=6, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), - _descriptor.EnumValueDescriptor( - name='CLONE_VOLUME', index=7, number=7, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), - _descriptor.EnumValueDescriptor( - name='PUBLISH_READONLY', index=8, number=8, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), - _descriptor.EnumValueDescriptor( - name='EXPAND_VOLUME', index=9, number=9, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), - _descriptor.EnumValueDescriptor( - name='LIST_VOLUMES_PUBLISHED_NODES', index=10, number=10, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), - _descriptor.EnumValueDescriptor( - name='VOLUME_CONDITION', index=11, number=11, - serialized_options=b'\240B\001', - type=None, - create_key=_descriptor._internal_create_key), - _descriptor.EnumValueDescriptor( - name='GET_VOLUME', index=12, number=12, - serialized_options=b'\240B\001', - type=None, - create_key=_descriptor._internal_create_key), - _descriptor.EnumValueDescriptor( - name='SINGLE_NODE_MULTI_WRITER', index=13, number=13, - serialized_options=b'\240B\001', - type=None, - create_key=_descriptor._internal_create_key), - ], - containing_type=None, - serialized_options=None, - serialized_start=6227, - serialized_end=6562, -) -_sym_db.RegisterEnumDescriptor(_CONTROLLERSERVICECAPABILITY_RPC_TYPE) - -_VOLUMEUSAGE_UNIT = _descriptor.EnumDescriptor( - name='Unit', - full_name='csi.v1.VolumeUsage.Unit', - filename=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - values=[ - _descriptor.EnumValueDescriptor( - name='UNKNOWN', index=0, number=0, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), - _descriptor.EnumValueDescriptor( - name='BYTES', index=1, number=1, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), - _descriptor.EnumValueDescriptor( - name='INODES', index=2, number=2, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), - ], - containing_type=None, - serialized_options=None, - serialized_start=9654, - serialized_end=9696, -) -_sym_db.RegisterEnumDescriptor(_VOLUMEUSAGE_UNIT) - -_NODESERVICECAPABILITY_RPC_TYPE = _descriptor.EnumDescriptor( - name='Type', - full_name='csi.v1.NodeServiceCapability.RPC.Type', - filename=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - values=[ - _descriptor.EnumValueDescriptor( - name='UNKNOWN', index=0, number=0, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), - _descriptor.EnumValueDescriptor( - name='STAGE_UNSTAGE_VOLUME', index=1, number=1, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), - _descriptor.EnumValueDescriptor( - name='GET_VOLUME_STATS', index=2, number=2, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), - _descriptor.EnumValueDescriptor( - name='EXPAND_VOLUME', index=3, number=3, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), - _descriptor.EnumValueDescriptor( - name='VOLUME_CONDITION', index=4, number=4, - serialized_options=b'\240B\001', - type=None, - create_key=_descriptor._internal_create_key), - _descriptor.EnumValueDescriptor( - name='SINGLE_NODE_MULTI_WRITER', index=5, number=5, - serialized_options=b'\240B\001', - type=None, - create_key=_descriptor._internal_create_key), - _descriptor.EnumValueDescriptor( - name='VOLUME_MOUNT_GROUP', index=6, number=6, - serialized_options=b'\240B\001', - type=None, - create_key=_descriptor._internal_create_key), - ], - containing_type=None, - serialized_options=None, - serialized_start=10010, - serialized_end=10187, -) -_sym_db.RegisterEnumDescriptor(_NODESERVICECAPABILITY_RPC_TYPE) - - -_GETPLUGININFOREQUEST = _descriptor.Descriptor( - name='GetPluginInfoRequest', - full_name='csi.v1.GetPluginInfoRequest', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=143, - serialized_end=165, -) - - -_GETPLUGININFORESPONSE_MANIFESTENTRY = _descriptor.Descriptor( - name='ManifestEntry', - full_name='csi.v1.GetPluginInfoResponse.ManifestEntry', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='key', full_name='csi.v1.GetPluginInfoResponse.ManifestEntry.key', index=0, - number=1, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=b"".decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='value', full_name='csi.v1.GetPluginInfoResponse.ManifestEntry.value', index=1, - number=2, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=b"".decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=b'8\001', - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=294, - serialized_end=341, -) - -_GETPLUGININFORESPONSE = _descriptor.Descriptor( - name='GetPluginInfoResponse', - full_name='csi.v1.GetPluginInfoResponse', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='name', full_name='csi.v1.GetPluginInfoResponse.name', index=0, - number=1, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=b"".decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='vendor_version', full_name='csi.v1.GetPluginInfoResponse.vendor_version', index=1, - number=2, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=b"".decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='manifest', full_name='csi.v1.GetPluginInfoResponse.manifest', index=2, - number=3, type=11, cpp_type=10, label=3, - has_default_value=False, default_value=[], - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[_GETPLUGININFORESPONSE_MANIFESTENTRY, ], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=168, - serialized_end=341, -) - - -_GETPLUGINCAPABILITIESREQUEST = _descriptor.Descriptor( - name='GetPluginCapabilitiesRequest', - full_name='csi.v1.GetPluginCapabilitiesRequest', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=343, - serialized_end=373, -) - - -_GETPLUGINCAPABILITIESRESPONSE = _descriptor.Descriptor( - name='GetPluginCapabilitiesResponse', - full_name='csi.v1.GetPluginCapabilitiesResponse', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='capabilities', full_name='csi.v1.GetPluginCapabilitiesResponse.capabilities', index=0, - number=1, type=11, cpp_type=10, label=3, - has_default_value=False, default_value=[], - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=375, - serialized_end=454, -) - - -_PLUGINCAPABILITY_SERVICE = _descriptor.Descriptor( - name='Service', - full_name='csi.v1.PluginCapability.Service', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='type', full_name='csi.v1.PluginCapability.Service.type', index=0, - number=1, type=14, cpp_type=8, label=1, - has_default_value=False, default_value=0, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - _PLUGINCAPABILITY_SERVICE_TYPE, - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=601, - serialized_end=746, -) - -_PLUGINCAPABILITY_VOLUMEEXPANSION = _descriptor.Descriptor( - name='VolumeExpansion', - full_name='csi.v1.PluginCapability.VolumeExpansion', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='type', full_name='csi.v1.PluginCapability.VolumeExpansion.type', index=0, - number=1, type=14, cpp_type=8, label=1, - has_default_value=False, default_value=0, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - _PLUGINCAPABILITY_VOLUMEEXPANSION_TYPE, - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=748, - serialized_end=872, -) - -_PLUGINCAPABILITY = _descriptor.Descriptor( - name='PluginCapability', - full_name='csi.v1.PluginCapability', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='service', full_name='csi.v1.PluginCapability.service', index=0, - number=1, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='volume_expansion', full_name='csi.v1.PluginCapability.volume_expansion', index=1, - number=2, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[_PLUGINCAPABILITY_SERVICE, _PLUGINCAPABILITY_VOLUMEEXPANSION, ], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - _descriptor.OneofDescriptor( - name='type', full_name='csi.v1.PluginCapability.type', - index=0, containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[]), - ], - serialized_start=457, - serialized_end=880, -) - - -_PROBEREQUEST = _descriptor.Descriptor( - name='ProbeRequest', - full_name='csi.v1.ProbeRequest', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=882, - serialized_end=896, -) - - -_PROBERESPONSE = _descriptor.Descriptor( - name='ProbeResponse', - full_name='csi.v1.ProbeResponse', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='ready', full_name='csi.v1.ProbeResponse.ready', index=0, - number=1, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=898, - serialized_end=956, -) - - -_CREATEVOLUMEREQUEST_PARAMETERSENTRY = _descriptor.Descriptor( - name='ParametersEntry', - full_name='csi.v1.CreateVolumeRequest.ParametersEntry', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='key', full_name='csi.v1.CreateVolumeRequest.ParametersEntry.key', index=0, - number=1, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=b"".decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='value', full_name='csi.v1.CreateVolumeRequest.ParametersEntry.value', index=1, - number=2, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=b"".decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=b'8\001', - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=1352, - serialized_end=1401, -) - -_CREATEVOLUMEREQUEST_SECRETSENTRY = _descriptor.Descriptor( - name='SecretsEntry', - full_name='csi.v1.CreateVolumeRequest.SecretsEntry', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='key', full_name='csi.v1.CreateVolumeRequest.SecretsEntry.key', index=0, - number=1, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=b"".decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='value', full_name='csi.v1.CreateVolumeRequest.SecretsEntry.value', index=1, - number=2, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=b"".decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=b'8\001', - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=1403, - serialized_end=1449, -) - -_CREATEVOLUMEREQUEST = _descriptor.Descriptor( - name='CreateVolumeRequest', - full_name='csi.v1.CreateVolumeRequest', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='name', full_name='csi.v1.CreateVolumeRequest.name', index=0, - number=1, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=b"".decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='capacity_range', full_name='csi.v1.CreateVolumeRequest.capacity_range', index=1, - number=2, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='volume_capabilities', full_name='csi.v1.CreateVolumeRequest.volume_capabilities', index=2, - number=3, type=11, cpp_type=10, label=3, - has_default_value=False, default_value=[], - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='parameters', full_name='csi.v1.CreateVolumeRequest.parameters', index=3, - number=4, type=11, cpp_type=10, label=3, - has_default_value=False, default_value=[], - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='secrets', full_name='csi.v1.CreateVolumeRequest.secrets', index=4, - number=5, type=11, cpp_type=10, label=3, - has_default_value=False, default_value=[], - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=b'\230B\001', file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='volume_content_source', full_name='csi.v1.CreateVolumeRequest.volume_content_source', index=5, - number=6, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='accessibility_requirements', full_name='csi.v1.CreateVolumeRequest.accessibility_requirements', index=6, - number=7, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[_CREATEVOLUMEREQUEST_PARAMETERSENTRY, _CREATEVOLUMEREQUEST_SECRETSENTRY, ], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=959, - serialized_end=1449, -) - - -_VOLUMECONTENTSOURCE_SNAPSHOTSOURCE = _descriptor.Descriptor( - name='SnapshotSource', - full_name='csi.v1.VolumeContentSource.SnapshotSource', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='snapshot_id', full_name='csi.v1.VolumeContentSource.SnapshotSource.snapshot_id', index=0, - number=1, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=b"".decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=1599, - serialized_end=1636, -) - -_VOLUMECONTENTSOURCE_VOLUMESOURCE = _descriptor.Descriptor( - name='VolumeSource', - full_name='csi.v1.VolumeContentSource.VolumeSource', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='volume_id', full_name='csi.v1.VolumeContentSource.VolumeSource.volume_id', index=0, - number=1, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=b"".decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=1638, - serialized_end=1671, -) - -_VOLUMECONTENTSOURCE = _descriptor.Descriptor( - name='VolumeContentSource', - full_name='csi.v1.VolumeContentSource', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='snapshot', full_name='csi.v1.VolumeContentSource.snapshot', index=0, - number=1, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='volume', full_name='csi.v1.VolumeContentSource.volume', index=1, - number=2, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[_VOLUMECONTENTSOURCE_SNAPSHOTSOURCE, _VOLUMECONTENTSOURCE_VOLUMESOURCE, ], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - _descriptor.OneofDescriptor( - name='type', full_name='csi.v1.VolumeContentSource.type', - index=0, containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[]), - ], - serialized_start=1452, - serialized_end=1679, -) - - -_CREATEVOLUMERESPONSE = _descriptor.Descriptor( - name='CreateVolumeResponse', - full_name='csi.v1.CreateVolumeResponse', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='volume', full_name='csi.v1.CreateVolumeResponse.volume', index=0, - number=1, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=1681, - serialized_end=1735, -) - - -_VOLUMECAPABILITY_BLOCKVOLUME = _descriptor.Descriptor( - name='BlockVolume', - full_name='csi.v1.VolumeCapability.BlockVolume', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=1926, - serialized_end=1939, -) - -_VOLUMECAPABILITY_MOUNTVOLUME = _descriptor.Descriptor( - name='MountVolume', - full_name='csi.v1.VolumeCapability.MountVolume', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='fs_type', full_name='csi.v1.VolumeCapability.MountVolume.fs_type', index=0, - number=1, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=b"".decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='mount_flags', full_name='csi.v1.VolumeCapability.MountVolume.mount_flags', index=1, - number=2, type=9, cpp_type=9, label=3, - has_default_value=False, default_value=[], - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='volume_mount_group', full_name='csi.v1.VolumeCapability.MountVolume.volume_mount_group', index=2, - number=3, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=b"".decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=b'\240B\001', file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=1941, - serialized_end=2025, -) - -_VOLUMECAPABILITY_ACCESSMODE = _descriptor.Descriptor( - name='AccessMode', - full_name='csi.v1.VolumeCapability.AccessMode', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='mode', full_name='csi.v1.VolumeCapability.AccessMode.mode', index=0, - number=1, type=14, cpp_type=8, label=1, - has_default_value=False, default_value=0, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - _VOLUMECAPABILITY_ACCESSMODE_MODE, - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=2028, - serialized_end=2329, -) - -_VOLUMECAPABILITY = _descriptor.Descriptor( - name='VolumeCapability', - full_name='csi.v1.VolumeCapability', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='block', full_name='csi.v1.VolumeCapability.block', index=0, - number=1, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='mount', full_name='csi.v1.VolumeCapability.mount', index=1, - number=2, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='access_mode', full_name='csi.v1.VolumeCapability.access_mode', index=2, - number=3, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[_VOLUMECAPABILITY_BLOCKVOLUME, _VOLUMECAPABILITY_MOUNTVOLUME, _VOLUMECAPABILITY_ACCESSMODE, ], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - _descriptor.OneofDescriptor( - name='access_type', full_name='csi.v1.VolumeCapability.access_type', - index=0, containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[]), - ], - serialized_start=1738, - serialized_end=2344, -) - - -_CAPACITYRANGE = _descriptor.Descriptor( - name='CapacityRange', - full_name='csi.v1.CapacityRange', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='required_bytes', full_name='csi.v1.CapacityRange.required_bytes', index=0, - number=1, type=3, cpp_type=2, label=1, - has_default_value=False, default_value=0, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='limit_bytes', full_name='csi.v1.CapacityRange.limit_bytes', index=1, - number=2, type=3, cpp_type=2, label=1, - has_default_value=False, default_value=0, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=2346, - serialized_end=2406, -) - - -_VOLUME_VOLUMECONTEXTENTRY = _descriptor.Descriptor( - name='VolumeContextEntry', - full_name='csi.v1.Volume.VolumeContextEntry', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='key', full_name='csi.v1.Volume.VolumeContextEntry.key', index=0, - number=1, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=b"".decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='value', full_name='csi.v1.Volume.VolumeContextEntry.value', index=1, - number=2, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=b"".decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=b'8\001', - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=2621, - serialized_end=2673, -) - -_VOLUME = _descriptor.Descriptor( - name='Volume', - full_name='csi.v1.Volume', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='capacity_bytes', full_name='csi.v1.Volume.capacity_bytes', index=0, - number=1, type=3, cpp_type=2, label=1, - has_default_value=False, default_value=0, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='volume_id', full_name='csi.v1.Volume.volume_id', index=1, - number=2, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=b"".decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='volume_context', full_name='csi.v1.Volume.volume_context', index=2, - number=3, type=11, cpp_type=10, label=3, - has_default_value=False, default_value=[], - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='content_source', full_name='csi.v1.Volume.content_source', index=3, - number=4, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='accessible_topology', full_name='csi.v1.Volume.accessible_topology', index=4, - number=5, type=11, cpp_type=10, label=3, - has_default_value=False, default_value=[], - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[_VOLUME_VOLUMECONTEXTENTRY, ], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=2409, - serialized_end=2673, -) - - -_TOPOLOGYREQUIREMENT = _descriptor.Descriptor( - name='TopologyRequirement', - full_name='csi.v1.TopologyRequirement', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='requisite', full_name='csi.v1.TopologyRequirement.requisite', index=0, - number=1, type=11, cpp_type=10, label=3, - has_default_value=False, default_value=[], - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='preferred', full_name='csi.v1.TopologyRequirement.preferred', index=1, - number=2, type=11, cpp_type=10, label=3, - has_default_value=False, default_value=[], - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=2675, - serialized_end=2770, -) - - -_TOPOLOGY_SEGMENTSENTRY = _descriptor.Descriptor( - name='SegmentsEntry', - full_name='csi.v1.Topology.SegmentsEntry', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='key', full_name='csi.v1.Topology.SegmentsEntry.key', index=0, - number=1, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=b"".decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='value', full_name='csi.v1.Topology.SegmentsEntry.value', index=1, - number=2, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=b"".decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=b'8\001', - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=2834, - serialized_end=2881, -) - -_TOPOLOGY = _descriptor.Descriptor( - name='Topology', - full_name='csi.v1.Topology', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='segments', full_name='csi.v1.Topology.segments', index=0, - number=1, type=11, cpp_type=10, label=3, - has_default_value=False, default_value=[], - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[_TOPOLOGY_SEGMENTSENTRY, ], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=2772, - serialized_end=2881, -) - - -_DELETEVOLUMEREQUEST_SECRETSENTRY = _descriptor.Descriptor( - name='SecretsEntry', - full_name='csi.v1.DeleteVolumeRequest.SecretsEntry', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='key', full_name='csi.v1.DeleteVolumeRequest.SecretsEntry.key', index=0, - number=1, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=b"".decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='value', full_name='csi.v1.DeleteVolumeRequest.SecretsEntry.value', index=1, - number=2, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=b"".decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=b'8\001', - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=1403, - serialized_end=1449, -) - -_DELETEVOLUMEREQUEST = _descriptor.Descriptor( - name='DeleteVolumeRequest', - full_name='csi.v1.DeleteVolumeRequest', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='volume_id', full_name='csi.v1.DeleteVolumeRequest.volume_id', index=0, - number=1, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=b"".decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='secrets', full_name='csi.v1.DeleteVolumeRequest.secrets', index=1, - number=2, type=11, cpp_type=10, label=3, - has_default_value=False, default_value=[], - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=b'\230B\001', file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[_DELETEVOLUMEREQUEST_SECRETSENTRY, ], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=2884, - serialized_end=3036, -) - - -_DELETEVOLUMERESPONSE = _descriptor.Descriptor( - name='DeleteVolumeResponse', - full_name='csi.v1.DeleteVolumeResponse', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=3038, - serialized_end=3060, -) - - -_CONTROLLERPUBLISHVOLUMEREQUEST_SECRETSENTRY = _descriptor.Descriptor( - name='SecretsEntry', - full_name='csi.v1.ControllerPublishVolumeRequest.SecretsEntry', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='key', full_name='csi.v1.ControllerPublishVolumeRequest.SecretsEntry.key', index=0, - number=1, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=b"".decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='value', full_name='csi.v1.ControllerPublishVolumeRequest.SecretsEntry.value', index=1, - number=2, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=b"".decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=b'8\001', - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=1403, - serialized_end=1449, -) - -_CONTROLLERPUBLISHVOLUMEREQUEST_VOLUMECONTEXTENTRY = _descriptor.Descriptor( - name='VolumeContextEntry', - full_name='csi.v1.ControllerPublishVolumeRequest.VolumeContextEntry', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='key', full_name='csi.v1.ControllerPublishVolumeRequest.VolumeContextEntry.key', index=0, - number=1, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=b"".decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='value', full_name='csi.v1.ControllerPublishVolumeRequest.VolumeContextEntry.value', index=1, - number=2, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=b"".decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=b'8\001', - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=2621, - serialized_end=2673, -) - -_CONTROLLERPUBLISHVOLUMEREQUEST = _descriptor.Descriptor( - name='ControllerPublishVolumeRequest', - full_name='csi.v1.ControllerPublishVolumeRequest', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='volume_id', full_name='csi.v1.ControllerPublishVolumeRequest.volume_id', index=0, - number=1, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=b"".decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='node_id', full_name='csi.v1.ControllerPublishVolumeRequest.node_id', index=1, - number=2, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=b"".decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='volume_capability', full_name='csi.v1.ControllerPublishVolumeRequest.volume_capability', index=2, - number=3, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='readonly', full_name='csi.v1.ControllerPublishVolumeRequest.readonly', index=3, - number=4, type=8, cpp_type=7, label=1, - has_default_value=False, default_value=False, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='secrets', full_name='csi.v1.ControllerPublishVolumeRequest.secrets', index=4, - number=5, type=11, cpp_type=10, label=3, - has_default_value=False, default_value=[], - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=b'\230B\001', file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='volume_context', full_name='csi.v1.ControllerPublishVolumeRequest.volume_context', index=5, - number=6, type=11, cpp_type=10, label=3, - has_default_value=False, default_value=[], - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[_CONTROLLERPUBLISHVOLUMEREQUEST_SECRETSENTRY, _CONTROLLERPUBLISHVOLUMEREQUEST_VOLUMECONTEXTENTRY, ], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=3063, - serialized_end=3462, -) - - -_CONTROLLERPUBLISHVOLUMERESPONSE_PUBLISHCONTEXTENTRY = _descriptor.Descriptor( - name='PublishContextEntry', - full_name='csi.v1.ControllerPublishVolumeResponse.PublishContextEntry', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='key', full_name='csi.v1.ControllerPublishVolumeResponse.PublishContextEntry.key', index=0, - number=1, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=b"".decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='value', full_name='csi.v1.ControllerPublishVolumeResponse.PublishContextEntry.value', index=1, - number=2, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=b"".decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=b'8\001', - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=3586, - serialized_end=3639, -) - -_CONTROLLERPUBLISHVOLUMERESPONSE = _descriptor.Descriptor( - name='ControllerPublishVolumeResponse', - full_name='csi.v1.ControllerPublishVolumeResponse', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='publish_context', full_name='csi.v1.ControllerPublishVolumeResponse.publish_context', index=0, - number=1, type=11, cpp_type=10, label=3, - has_default_value=False, default_value=[], - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[_CONTROLLERPUBLISHVOLUMERESPONSE_PUBLISHCONTEXTENTRY, ], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=3465, - serialized_end=3639, -) - - -_CONTROLLERUNPUBLISHVOLUMEREQUEST_SECRETSENTRY = _descriptor.Descriptor( - name='SecretsEntry', - full_name='csi.v1.ControllerUnpublishVolumeRequest.SecretsEntry', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='key', full_name='csi.v1.ControllerUnpublishVolumeRequest.SecretsEntry.key', index=0, - number=1, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=b"".decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='value', full_name='csi.v1.ControllerUnpublishVolumeRequest.SecretsEntry.value', index=1, - number=2, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=b"".decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=b'8\001', - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=1403, - serialized_end=1449, -) - -_CONTROLLERUNPUBLISHVOLUMEREQUEST = _descriptor.Descriptor( - name='ControllerUnpublishVolumeRequest', - full_name='csi.v1.ControllerUnpublishVolumeRequest', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='volume_id', full_name='csi.v1.ControllerUnpublishVolumeRequest.volume_id', index=0, - number=1, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=b"".decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='node_id', full_name='csi.v1.ControllerUnpublishVolumeRequest.node_id', index=1, - number=2, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=b"".decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='secrets', full_name='csi.v1.ControllerUnpublishVolumeRequest.secrets', index=2, - number=3, type=11, cpp_type=10, label=3, - has_default_value=False, default_value=[], - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=b'\230B\001', file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[_CONTROLLERUNPUBLISHVOLUMEREQUEST_SECRETSENTRY, ], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=3642, - serialized_end=3837, -) - - -_CONTROLLERUNPUBLISHVOLUMERESPONSE = _descriptor.Descriptor( - name='ControllerUnpublishVolumeResponse', - full_name='csi.v1.ControllerUnpublishVolumeResponse', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=3839, - serialized_end=3874, -) - - -_VALIDATEVOLUMECAPABILITIESREQUEST_VOLUMECONTEXTENTRY = _descriptor.Descriptor( - name='VolumeContextEntry', - full_name='csi.v1.ValidateVolumeCapabilitiesRequest.VolumeContextEntry', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='key', full_name='csi.v1.ValidateVolumeCapabilitiesRequest.VolumeContextEntry.key', index=0, - number=1, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=b"".decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='value', full_name='csi.v1.ValidateVolumeCapabilitiesRequest.VolumeContextEntry.value', index=1, - number=2, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=b"".decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=b'8\001', - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=2621, - serialized_end=2673, -) - -_VALIDATEVOLUMECAPABILITIESREQUEST_PARAMETERSENTRY = _descriptor.Descriptor( - name='ParametersEntry', - full_name='csi.v1.ValidateVolumeCapabilitiesRequest.ParametersEntry', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='key', full_name='csi.v1.ValidateVolumeCapabilitiesRequest.ParametersEntry.key', index=0, - number=1, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=b"".decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='value', full_name='csi.v1.ValidateVolumeCapabilitiesRequest.ParametersEntry.value', index=1, - number=2, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=b"".decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=b'8\001', - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=1352, - serialized_end=1401, -) - -_VALIDATEVOLUMECAPABILITIESREQUEST_SECRETSENTRY = _descriptor.Descriptor( - name='SecretsEntry', - full_name='csi.v1.ValidateVolumeCapabilitiesRequest.SecretsEntry', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='key', full_name='csi.v1.ValidateVolumeCapabilitiesRequest.SecretsEntry.key', index=0, - number=1, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=b"".decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='value', full_name='csi.v1.ValidateVolumeCapabilitiesRequest.SecretsEntry.value', index=1, - number=2, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=b"".decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=b'8\001', - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=1403, - serialized_end=1449, -) - -_VALIDATEVOLUMECAPABILITIESREQUEST = _descriptor.Descriptor( - name='ValidateVolumeCapabilitiesRequest', - full_name='csi.v1.ValidateVolumeCapabilitiesRequest', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='volume_id', full_name='csi.v1.ValidateVolumeCapabilitiesRequest.volume_id', index=0, - number=1, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=b"".decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='volume_context', full_name='csi.v1.ValidateVolumeCapabilitiesRequest.volume_context', index=1, - number=2, type=11, cpp_type=10, label=3, - has_default_value=False, default_value=[], - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='volume_capabilities', full_name='csi.v1.ValidateVolumeCapabilitiesRequest.volume_capabilities', index=2, - number=3, type=11, cpp_type=10, label=3, - has_default_value=False, default_value=[], - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='parameters', full_name='csi.v1.ValidateVolumeCapabilitiesRequest.parameters', index=3, - number=4, type=11, cpp_type=10, label=3, - has_default_value=False, default_value=[], - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='secrets', full_name='csi.v1.ValidateVolumeCapabilitiesRequest.secrets', index=4, - number=5, type=11, cpp_type=10, label=3, - has_default_value=False, default_value=[], - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=b'\230B\001', file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[_VALIDATEVOLUMECAPABILITIESREQUEST_VOLUMECONTEXTENTRY, _VALIDATEVOLUMECAPABILITIESREQUEST_PARAMETERSENTRY, _VALIDATEVOLUMECAPABILITIESREQUEST_SECRETSENTRY, ], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=3877, - serialized_end=4382, -) - - -_VALIDATEVOLUMECAPABILITIESRESPONSE_CONFIRMED_VOLUMECONTEXTENTRY = _descriptor.Descriptor( - name='VolumeContextEntry', - full_name='csi.v1.ValidateVolumeCapabilitiesResponse.Confirmed.VolumeContextEntry', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='key', full_name='csi.v1.ValidateVolumeCapabilitiesResponse.Confirmed.VolumeContextEntry.key', index=0, - number=1, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=b"".decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='value', full_name='csi.v1.ValidateVolumeCapabilitiesResponse.Confirmed.VolumeContextEntry.value', index=1, - number=2, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=b"".decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=b'8\001', - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=2621, - serialized_end=2673, -) - -_VALIDATEVOLUMECAPABILITIESRESPONSE_CONFIRMED_PARAMETERSENTRY = _descriptor.Descriptor( - name='ParametersEntry', - full_name='csi.v1.ValidateVolumeCapabilitiesResponse.Confirmed.ParametersEntry', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='key', full_name='csi.v1.ValidateVolumeCapabilitiesResponse.Confirmed.ParametersEntry.key', index=0, - number=1, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=b"".decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='value', full_name='csi.v1.ValidateVolumeCapabilitiesResponse.Confirmed.ParametersEntry.value', index=1, - number=2, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=b"".decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=b'8\001', - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=1352, - serialized_end=1401, -) - -_VALIDATEVOLUMECAPABILITIESRESPONSE_CONFIRMED = _descriptor.Descriptor( - name='Confirmed', - full_name='csi.v1.ValidateVolumeCapabilitiesResponse.Confirmed', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='volume_context', full_name='csi.v1.ValidateVolumeCapabilitiesResponse.Confirmed.volume_context', index=0, - number=1, type=11, cpp_type=10, label=3, - has_default_value=False, default_value=[], - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='volume_capabilities', full_name='csi.v1.ValidateVolumeCapabilitiesResponse.Confirmed.volume_capabilities', index=1, - number=2, type=11, cpp_type=10, label=3, - has_default_value=False, default_value=[], - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='parameters', full_name='csi.v1.ValidateVolumeCapabilitiesResponse.Confirmed.parameters', index=2, - number=3, type=11, cpp_type=10, label=3, - has_default_value=False, default_value=[], - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[_VALIDATEVOLUMECAPABILITIESRESPONSE_CONFIRMED_VOLUMECONTEXTENTRY, _VALIDATEVOLUMECAPABILITIESRESPONSE_CONFIRMED_PARAMETERSENTRY, ], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=4514, - serialized_end=4872, -) - -_VALIDATEVOLUMECAPABILITIESRESPONSE = _descriptor.Descriptor( - name='ValidateVolumeCapabilitiesResponse', - full_name='csi.v1.ValidateVolumeCapabilitiesResponse', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='confirmed', full_name='csi.v1.ValidateVolumeCapabilitiesResponse.confirmed', index=0, - number=1, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='message', full_name='csi.v1.ValidateVolumeCapabilitiesResponse.message', index=1, - number=2, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=b"".decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[_VALIDATEVOLUMECAPABILITIESRESPONSE_CONFIRMED, ], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=4385, - serialized_end=4872, -) - - -_LISTVOLUMESREQUEST = _descriptor.Descriptor( - name='ListVolumesRequest', - full_name='csi.v1.ListVolumesRequest', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='max_entries', full_name='csi.v1.ListVolumesRequest.max_entries', index=0, - number=1, type=5, cpp_type=1, label=1, - has_default_value=False, default_value=0, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='starting_token', full_name='csi.v1.ListVolumesRequest.starting_token', index=1, - number=2, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=b"".decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=4874, - serialized_end=4939, -) - - -_LISTVOLUMESRESPONSE_VOLUMESTATUS = _descriptor.Descriptor( - name='VolumeStatus', - full_name='csi.v1.ListVolumesResponse.VolumeStatus', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='published_node_ids', full_name='csi.v1.ListVolumesResponse.VolumeStatus.published_node_ids', index=0, - number=1, type=9, cpp_type=9, label=3, - has_default_value=False, default_value=[], - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='volume_condition', full_name='csi.v1.ListVolumesResponse.VolumeStatus.volume_condition', index=1, - number=2, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=b'\240B\001', file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=5037, - serialized_end=5135, -) - -_LISTVOLUMESRESPONSE_ENTRY = _descriptor.Descriptor( - name='Entry', - full_name='csi.v1.ListVolumesResponse.Entry', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='volume', full_name='csi.v1.ListVolumesResponse.Entry.volume', index=0, - number=1, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='status', full_name='csi.v1.ListVolumesResponse.Entry.status', index=1, - number=2, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=5137, - serialized_end=5234, -) - -_LISTVOLUMESRESPONSE = _descriptor.Descriptor( - name='ListVolumesResponse', - full_name='csi.v1.ListVolumesResponse', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='entries', full_name='csi.v1.ListVolumesResponse.entries', index=0, - number=1, type=11, cpp_type=10, label=3, - has_default_value=False, default_value=[], - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='next_token', full_name='csi.v1.ListVolumesResponse.next_token', index=1, - number=2, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=b"".decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[_LISTVOLUMESRESPONSE_VOLUMESTATUS, _LISTVOLUMESRESPONSE_ENTRY, ], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=4942, - serialized_end=5234, -) - - -_CONTROLLERGETVOLUMEREQUEST = _descriptor.Descriptor( - name='ControllerGetVolumeRequest', - full_name='csi.v1.ControllerGetVolumeRequest', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='volume_id', full_name='csi.v1.ControllerGetVolumeRequest.volume_id', index=0, - number=1, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=b"".decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=b'\240B\001', - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=5236, - serialized_end=5288, -) - - -_CONTROLLERGETVOLUMERESPONSE_VOLUMESTATUS = _descriptor.Descriptor( - name='VolumeStatus', - full_name='csi.v1.ControllerGetVolumeResponse.VolumeStatus', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='published_node_ids', full_name='csi.v1.ControllerGetVolumeResponse.VolumeStatus.published_node_ids', index=0, - number=1, type=9, cpp_type=9, label=3, - has_default_value=False, default_value=[], - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='volume_condition', full_name='csi.v1.ControllerGetVolumeResponse.VolumeStatus.volume_condition', index=1, - number=2, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=5420, - serialized_end=5513, -) - -_CONTROLLERGETVOLUMERESPONSE = _descriptor.Descriptor( - name='ControllerGetVolumeResponse', - full_name='csi.v1.ControllerGetVolumeResponse', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='volume', full_name='csi.v1.ControllerGetVolumeResponse.volume', index=0, - number=1, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='status', full_name='csi.v1.ControllerGetVolumeResponse.status', index=1, - number=2, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[_CONTROLLERGETVOLUMERESPONSE_VOLUMESTATUS, ], - enum_types=[ - ], - serialized_options=b'\240B\001', - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=5291, - serialized_end=5518, -) - - -_GETCAPACITYREQUEST_PARAMETERSENTRY = _descriptor.Descriptor( - name='ParametersEntry', - full_name='csi.v1.GetCapacityRequest.ParametersEntry', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='key', full_name='csi.v1.GetCapacityRequest.ParametersEntry.key', index=0, - number=1, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=b"".decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='value', full_name='csi.v1.GetCapacityRequest.ParametersEntry.value', index=1, - number=2, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=b"".decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=b'8\001', - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=1352, - serialized_end=1401, -) - -_GETCAPACITYREQUEST = _descriptor.Descriptor( - name='GetCapacityRequest', - full_name='csi.v1.GetCapacityRequest', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='volume_capabilities', full_name='csi.v1.GetCapacityRequest.volume_capabilities', index=0, - number=1, type=11, cpp_type=10, label=3, - has_default_value=False, default_value=[], - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='parameters', full_name='csi.v1.GetCapacityRequest.parameters', index=1, - number=2, type=11, cpp_type=10, label=3, - has_default_value=False, default_value=[], - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='accessible_topology', full_name='csi.v1.GetCapacityRequest.accessible_topology', index=2, - number=3, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[_GETCAPACITYREQUEST_PARAMETERSENTRY, ], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=5521, - serialized_end=5758, -) - - -_GETCAPACITYRESPONSE = _descriptor.Descriptor( - name='GetCapacityResponse', - full_name='csi.v1.GetCapacityResponse', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='available_capacity', full_name='csi.v1.GetCapacityResponse.available_capacity', index=0, - number=1, type=3, cpp_type=2, label=1, - has_default_value=False, default_value=0, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='maximum_volume_size', full_name='csi.v1.GetCapacityResponse.maximum_volume_size', index=1, - number=2, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=b'\240B\001', file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='minimum_volume_size', full_name='csi.v1.GetCapacityResponse.minimum_volume_size', index=2, - number=3, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=b'\240B\001', file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=5761, - serialized_end=5936, -) - - -_CONTROLLERGETCAPABILITIESREQUEST = _descriptor.Descriptor( - name='ControllerGetCapabilitiesRequest', - full_name='csi.v1.ControllerGetCapabilitiesRequest', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=5938, - serialized_end=5972, -) - - -_CONTROLLERGETCAPABILITIESRESPONSE = _descriptor.Descriptor( - name='ControllerGetCapabilitiesResponse', - full_name='csi.v1.ControllerGetCapabilitiesResponse', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='capabilities', full_name='csi.v1.ControllerGetCapabilitiesResponse.capabilities', index=0, - number=1, type=11, cpp_type=10, label=3, - has_default_value=False, default_value=[], - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=5974, - serialized_end=6068, -) - - -_CONTROLLERSERVICECAPABILITY_RPC = _descriptor.Descriptor( - name='RPC', - full_name='csi.v1.ControllerServiceCapability.RPC', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='type', full_name='csi.v1.ControllerServiceCapability.RPC.type', index=0, - number=1, type=14, cpp_type=8, label=1, - has_default_value=False, default_value=0, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - _CONTROLLERSERVICECAPABILITY_RPC_TYPE, - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=6159, - serialized_end=6562, -) - -_CONTROLLERSERVICECAPABILITY = _descriptor.Descriptor( - name='ControllerServiceCapability', - full_name='csi.v1.ControllerServiceCapability', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='rpc', full_name='csi.v1.ControllerServiceCapability.rpc', index=0, - number=1, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[_CONTROLLERSERVICECAPABILITY_RPC, ], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - _descriptor.OneofDescriptor( - name='type', full_name='csi.v1.ControllerServiceCapability.type', - index=0, containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[]), - ], - serialized_start=6071, - serialized_end=6570, -) - - -_CREATESNAPSHOTREQUEST_SECRETSENTRY = _descriptor.Descriptor( - name='SecretsEntry', - full_name='csi.v1.CreateSnapshotRequest.SecretsEntry', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='key', full_name='csi.v1.CreateSnapshotRequest.SecretsEntry.key', index=0, - number=1, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=b"".decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='value', full_name='csi.v1.CreateSnapshotRequest.SecretsEntry.value', index=1, - number=2, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=b"".decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=b'8\001', - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=1403, - serialized_end=1449, -) - -_CREATESNAPSHOTREQUEST_PARAMETERSENTRY = _descriptor.Descriptor( - name='ParametersEntry', - full_name='csi.v1.CreateSnapshotRequest.ParametersEntry', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='key', full_name='csi.v1.CreateSnapshotRequest.ParametersEntry.key', index=0, - number=1, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=b"".decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='value', full_name='csi.v1.CreateSnapshotRequest.ParametersEntry.value', index=1, - number=2, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=b"".decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=b'8\001', - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=1352, - serialized_end=1401, -) - -_CREATESNAPSHOTREQUEST = _descriptor.Descriptor( - name='CreateSnapshotRequest', - full_name='csi.v1.CreateSnapshotRequest', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='source_volume_id', full_name='csi.v1.CreateSnapshotRequest.source_volume_id', index=0, - number=1, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=b"".decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='name', full_name='csi.v1.CreateSnapshotRequest.name', index=1, - number=2, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=b"".decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='secrets', full_name='csi.v1.CreateSnapshotRequest.secrets', index=2, - number=3, type=11, cpp_type=10, label=3, - has_default_value=False, default_value=[], - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=b'\230B\001', file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='parameters', full_name='csi.v1.CreateSnapshotRequest.parameters', index=3, - number=4, type=11, cpp_type=10, label=3, - has_default_value=False, default_value=[], - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[_CREATESNAPSHOTREQUEST_SECRETSENTRY, _CREATESNAPSHOTREQUEST_PARAMETERSENTRY, ], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=6573, - serialized_end=6868, -) - - -_CREATESNAPSHOTRESPONSE = _descriptor.Descriptor( - name='CreateSnapshotResponse', - full_name='csi.v1.CreateSnapshotResponse', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='snapshot', full_name='csi.v1.CreateSnapshotResponse.snapshot', index=0, - number=1, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=6870, - serialized_end=6930, -) - - -_SNAPSHOT = _descriptor.Descriptor( - name='Snapshot', - full_name='csi.v1.Snapshot', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='size_bytes', full_name='csi.v1.Snapshot.size_bytes', index=0, - number=1, type=3, cpp_type=2, label=1, - has_default_value=False, default_value=0, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='snapshot_id', full_name='csi.v1.Snapshot.snapshot_id', index=1, - number=2, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=b"".decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='source_volume_id', full_name='csi.v1.Snapshot.source_volume_id', index=2, - number=3, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=b"".decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='creation_time', full_name='csi.v1.Snapshot.creation_time', index=3, - number=4, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='ready_to_use', full_name='csi.v1.Snapshot.ready_to_use', index=4, - number=5, type=8, cpp_type=7, label=1, - has_default_value=False, default_value=False, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=6933, - serialized_end=7083, -) - - -_DELETESNAPSHOTREQUEST_SECRETSENTRY = _descriptor.Descriptor( - name='SecretsEntry', - full_name='csi.v1.DeleteSnapshotRequest.SecretsEntry', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='key', full_name='csi.v1.DeleteSnapshotRequest.SecretsEntry.key', index=0, - number=1, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=b"".decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='value', full_name='csi.v1.DeleteSnapshotRequest.SecretsEntry.value', index=1, - number=2, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=b"".decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=b'8\001', - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=1403, - serialized_end=1449, -) - -_DELETESNAPSHOTREQUEST = _descriptor.Descriptor( - name='DeleteSnapshotRequest', - full_name='csi.v1.DeleteSnapshotRequest', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='snapshot_id', full_name='csi.v1.DeleteSnapshotRequest.snapshot_id', index=0, - number=1, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=b"".decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='secrets', full_name='csi.v1.DeleteSnapshotRequest.secrets', index=1, - number=2, type=11, cpp_type=10, label=3, - has_default_value=False, default_value=[], - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=b'\230B\001', file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[_DELETESNAPSHOTREQUEST_SECRETSENTRY, ], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=7086, - serialized_end=7244, -) - - -_DELETESNAPSHOTRESPONSE = _descriptor.Descriptor( - name='DeleteSnapshotResponse', - full_name='csi.v1.DeleteSnapshotResponse', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=7246, - serialized_end=7270, -) - - -_LISTSNAPSHOTSREQUEST_SECRETSENTRY = _descriptor.Descriptor( - name='SecretsEntry', - full_name='csi.v1.ListSnapshotsRequest.SecretsEntry', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='key', full_name='csi.v1.ListSnapshotsRequest.SecretsEntry.key', index=0, - number=1, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=b"".decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='value', full_name='csi.v1.ListSnapshotsRequest.SecretsEntry.value', index=1, - number=2, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=b"".decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=b'8\001', - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=1403, - serialized_end=1449, -) - -_LISTSNAPSHOTSREQUEST = _descriptor.Descriptor( - name='ListSnapshotsRequest', - full_name='csi.v1.ListSnapshotsRequest', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='max_entries', full_name='csi.v1.ListSnapshotsRequest.max_entries', index=0, - number=1, type=5, cpp_type=1, label=1, - has_default_value=False, default_value=0, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='starting_token', full_name='csi.v1.ListSnapshotsRequest.starting_token', index=1, - number=2, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=b"".decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='source_volume_id', full_name='csi.v1.ListSnapshotsRequest.source_volume_id', index=2, - number=3, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=b"".decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='snapshot_id', full_name='csi.v1.ListSnapshotsRequest.snapshot_id', index=3, - number=4, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=b"".decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='secrets', full_name='csi.v1.ListSnapshotsRequest.secrets', index=4, - number=5, type=11, cpp_type=10, label=3, - has_default_value=False, default_value=[], - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=b'\230B\001', file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[_LISTSNAPSHOTSREQUEST_SECRETSENTRY, ], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=7273, - serialized_end=7500, -) - - -_LISTSNAPSHOTSRESPONSE_ENTRY = _descriptor.Descriptor( - name='Entry', - full_name='csi.v1.ListSnapshotsResponse.Entry', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='snapshot', full_name='csi.v1.ListSnapshotsResponse.Entry.snapshot', index=0, - number=1, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=7602, - serialized_end=7645, -) - -_LISTSNAPSHOTSRESPONSE = _descriptor.Descriptor( - name='ListSnapshotsResponse', - full_name='csi.v1.ListSnapshotsResponse', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='entries', full_name='csi.v1.ListSnapshotsResponse.entries', index=0, - number=1, type=11, cpp_type=10, label=3, - has_default_value=False, default_value=[], - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='next_token', full_name='csi.v1.ListSnapshotsResponse.next_token', index=1, - number=2, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=b"".decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[_LISTSNAPSHOTSRESPONSE_ENTRY, ], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=7503, - serialized_end=7645, -) - - -_CONTROLLEREXPANDVOLUMEREQUEST_SECRETSENTRY = _descriptor.Descriptor( - name='SecretsEntry', - full_name='csi.v1.ControllerExpandVolumeRequest.SecretsEntry', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='key', full_name='csi.v1.ControllerExpandVolumeRequest.SecretsEntry.key', index=0, - number=1, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=b"".decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='value', full_name='csi.v1.ControllerExpandVolumeRequest.SecretsEntry.value', index=1, - number=2, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=b"".decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=b'8\001', - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=1403, - serialized_end=1449, -) - -_CONTROLLEREXPANDVOLUMEREQUEST = _descriptor.Descriptor( - name='ControllerExpandVolumeRequest', - full_name='csi.v1.ControllerExpandVolumeRequest', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='volume_id', full_name='csi.v1.ControllerExpandVolumeRequest.volume_id', index=0, - number=1, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=b"".decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='capacity_range', full_name='csi.v1.ControllerExpandVolumeRequest.capacity_range', index=1, - number=2, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='secrets', full_name='csi.v1.ControllerExpandVolumeRequest.secrets', index=2, - number=3, type=11, cpp_type=10, label=3, - has_default_value=False, default_value=[], - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=b'\230B\001', file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='volume_capability', full_name='csi.v1.ControllerExpandVolumeRequest.volume_capability', index=3, - number=4, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[_CONTROLLEREXPANDVOLUMEREQUEST_SECRETSENTRY, ], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=7648, - serialized_end=7920, -) - - -_CONTROLLEREXPANDVOLUMERESPONSE = _descriptor.Descriptor( - name='ControllerExpandVolumeResponse', - full_name='csi.v1.ControllerExpandVolumeResponse', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='capacity_bytes', full_name='csi.v1.ControllerExpandVolumeResponse.capacity_bytes', index=0, - number=1, type=3, cpp_type=2, label=1, - has_default_value=False, default_value=0, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='node_expansion_required', full_name='csi.v1.ControllerExpandVolumeResponse.node_expansion_required', index=1, - number=2, type=8, cpp_type=7, label=1, - has_default_value=False, default_value=False, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=7922, - serialized_end=8011, -) - - -_NODESTAGEVOLUMEREQUEST_PUBLISHCONTEXTENTRY = _descriptor.Descriptor( - name='PublishContextEntry', - full_name='csi.v1.NodeStageVolumeRequest.PublishContextEntry', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='key', full_name='csi.v1.NodeStageVolumeRequest.PublishContextEntry.key', index=0, - number=1, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=b"".decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='value', full_name='csi.v1.NodeStageVolumeRequest.PublishContextEntry.value', index=1, - number=2, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=b"".decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=b'8\001', - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=3586, - serialized_end=3639, -) - -_NODESTAGEVOLUMEREQUEST_SECRETSENTRY = _descriptor.Descriptor( - name='SecretsEntry', - full_name='csi.v1.NodeStageVolumeRequest.SecretsEntry', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='key', full_name='csi.v1.NodeStageVolumeRequest.SecretsEntry.key', index=0, - number=1, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=b"".decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='value', full_name='csi.v1.NodeStageVolumeRequest.SecretsEntry.value', index=1, - number=2, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=b"".decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=b'8\001', - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=1403, - serialized_end=1449, -) - -_NODESTAGEVOLUMEREQUEST_VOLUMECONTEXTENTRY = _descriptor.Descriptor( - name='VolumeContextEntry', - full_name='csi.v1.NodeStageVolumeRequest.VolumeContextEntry', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='key', full_name='csi.v1.NodeStageVolumeRequest.VolumeContextEntry.key', index=0, - number=1, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=b"".decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='value', full_name='csi.v1.NodeStageVolumeRequest.VolumeContextEntry.value', index=1, - number=2, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=b"".decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=b'8\001', - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=2621, - serialized_end=2673, -) - -_NODESTAGEVOLUMEREQUEST = _descriptor.Descriptor( - name='NodeStageVolumeRequest', - full_name='csi.v1.NodeStageVolumeRequest', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='volume_id', full_name='csi.v1.NodeStageVolumeRequest.volume_id', index=0, - number=1, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=b"".decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='publish_context', full_name='csi.v1.NodeStageVolumeRequest.publish_context', index=1, - number=2, type=11, cpp_type=10, label=3, - has_default_value=False, default_value=[], - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='staging_target_path', full_name='csi.v1.NodeStageVolumeRequest.staging_target_path', index=2, - number=3, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=b"".decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='volume_capability', full_name='csi.v1.NodeStageVolumeRequest.volume_capability', index=3, - number=4, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='secrets', full_name='csi.v1.NodeStageVolumeRequest.secrets', index=4, - number=5, type=11, cpp_type=10, label=3, - has_default_value=False, default_value=[], - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=b'\230B\001', file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='volume_context', full_name='csi.v1.NodeStageVolumeRequest.volume_context', index=5, - number=6, type=11, cpp_type=10, label=3, - has_default_value=False, default_value=[], - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[_NODESTAGEVOLUMEREQUEST_PUBLISHCONTEXTENTRY, _NODESTAGEVOLUMEREQUEST_SECRETSENTRY, _NODESTAGEVOLUMEREQUEST_VOLUMECONTEXTENTRY, ], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=8014, - serialized_end=8515, -) - - -_NODESTAGEVOLUMERESPONSE = _descriptor.Descriptor( - name='NodeStageVolumeResponse', - full_name='csi.v1.NodeStageVolumeResponse', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=8517, - serialized_end=8542, -) - - -_NODEUNSTAGEVOLUMEREQUEST = _descriptor.Descriptor( - name='NodeUnstageVolumeRequest', - full_name='csi.v1.NodeUnstageVolumeRequest', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='volume_id', full_name='csi.v1.NodeUnstageVolumeRequest.volume_id', index=0, - number=1, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=b"".decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='staging_target_path', full_name='csi.v1.NodeUnstageVolumeRequest.staging_target_path', index=1, - number=2, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=b"".decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=8544, - serialized_end=8618, -) - - -_NODEUNSTAGEVOLUMERESPONSE = _descriptor.Descriptor( - name='NodeUnstageVolumeResponse', - full_name='csi.v1.NodeUnstageVolumeResponse', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=8620, - serialized_end=8647, -) - - -_NODEPUBLISHVOLUMEREQUEST_PUBLISHCONTEXTENTRY = _descriptor.Descriptor( - name='PublishContextEntry', - full_name='csi.v1.NodePublishVolumeRequest.PublishContextEntry', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='key', full_name='csi.v1.NodePublishVolumeRequest.PublishContextEntry.key', index=0, - number=1, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=b"".decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='value', full_name='csi.v1.NodePublishVolumeRequest.PublishContextEntry.value', index=1, - number=2, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=b"".decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=b'8\001', - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=3586, - serialized_end=3639, -) - -_NODEPUBLISHVOLUMEREQUEST_SECRETSENTRY = _descriptor.Descriptor( - name='SecretsEntry', - full_name='csi.v1.NodePublishVolumeRequest.SecretsEntry', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='key', full_name='csi.v1.NodePublishVolumeRequest.SecretsEntry.key', index=0, - number=1, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=b"".decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='value', full_name='csi.v1.NodePublishVolumeRequest.SecretsEntry.value', index=1, - number=2, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=b"".decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=b'8\001', - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=1403, - serialized_end=1449, -) - -_NODEPUBLISHVOLUMEREQUEST_VOLUMECONTEXTENTRY = _descriptor.Descriptor( - name='VolumeContextEntry', - full_name='csi.v1.NodePublishVolumeRequest.VolumeContextEntry', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='key', full_name='csi.v1.NodePublishVolumeRequest.VolumeContextEntry.key', index=0, - number=1, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=b"".decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='value', full_name='csi.v1.NodePublishVolumeRequest.VolumeContextEntry.value', index=1, - number=2, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=b"".decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=b'8\001', - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=2621, - serialized_end=2673, -) - -_NODEPUBLISHVOLUMEREQUEST = _descriptor.Descriptor( - name='NodePublishVolumeRequest', - full_name='csi.v1.NodePublishVolumeRequest', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='volume_id', full_name='csi.v1.NodePublishVolumeRequest.volume_id', index=0, - number=1, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=b"".decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='publish_context', full_name='csi.v1.NodePublishVolumeRequest.publish_context', index=1, - number=2, type=11, cpp_type=10, label=3, - has_default_value=False, default_value=[], - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='staging_target_path', full_name='csi.v1.NodePublishVolumeRequest.staging_target_path', index=2, - number=3, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=b"".decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='target_path', full_name='csi.v1.NodePublishVolumeRequest.target_path', index=3, - number=4, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=b"".decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='volume_capability', full_name='csi.v1.NodePublishVolumeRequest.volume_capability', index=4, - number=5, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='readonly', full_name='csi.v1.NodePublishVolumeRequest.readonly', index=5, - number=6, type=8, cpp_type=7, label=1, - has_default_value=False, default_value=False, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='secrets', full_name='csi.v1.NodePublishVolumeRequest.secrets', index=6, - number=7, type=11, cpp_type=10, label=3, - has_default_value=False, default_value=[], - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=b'\230B\001', file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='volume_context', full_name='csi.v1.NodePublishVolumeRequest.volume_context', index=7, - number=8, type=11, cpp_type=10, label=3, - has_default_value=False, default_value=[], - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[_NODEPUBLISHVOLUMEREQUEST_PUBLISHCONTEXTENTRY, _NODEPUBLISHVOLUMEREQUEST_SECRETSENTRY, _NODEPUBLISHVOLUMEREQUEST_VOLUMECONTEXTENTRY, ], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=8650, - serialized_end=9198, -) - - -_NODEPUBLISHVOLUMERESPONSE = _descriptor.Descriptor( - name='NodePublishVolumeResponse', - full_name='csi.v1.NodePublishVolumeResponse', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=9200, - serialized_end=9227, -) - - -_NODEUNPUBLISHVOLUMEREQUEST = _descriptor.Descriptor( - name='NodeUnpublishVolumeRequest', - full_name='csi.v1.NodeUnpublishVolumeRequest', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='volume_id', full_name='csi.v1.NodeUnpublishVolumeRequest.volume_id', index=0, - number=1, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=b"".decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='target_path', full_name='csi.v1.NodeUnpublishVolumeRequest.target_path', index=1, - number=2, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=b"".decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=9229, - serialized_end=9297, -) - - -_NODEUNPUBLISHVOLUMERESPONSE = _descriptor.Descriptor( - name='NodeUnpublishVolumeResponse', - full_name='csi.v1.NodeUnpublishVolumeResponse', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=9299, - serialized_end=9328, -) - - -_NODEGETVOLUMESTATSREQUEST = _descriptor.Descriptor( - name='NodeGetVolumeStatsRequest', - full_name='csi.v1.NodeGetVolumeStatsRequest', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='volume_id', full_name='csi.v1.NodeGetVolumeStatsRequest.volume_id', index=0, - number=1, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=b"".decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='volume_path', full_name='csi.v1.NodeGetVolumeStatsRequest.volume_path', index=1, - number=2, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=b"".decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='staging_target_path', full_name='csi.v1.NodeGetVolumeStatsRequest.staging_target_path', index=2, - number=3, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=b"".decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=9330, - serialized_end=9426, -) - - -_NODEGETVOLUMESTATSRESPONSE = _descriptor.Descriptor( - name='NodeGetVolumeStatsResponse', - full_name='csi.v1.NodeGetVolumeStatsResponse', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='usage', full_name='csi.v1.NodeGetVolumeStatsResponse.usage', index=0, - number=1, type=11, cpp_type=10, label=3, - has_default_value=False, default_value=[], - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='volume_condition', full_name='csi.v1.NodeGetVolumeStatsResponse.volume_condition', index=1, - number=2, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=b'\240B\001', file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=9428, - serialized_end=9548, -) - - -_VOLUMEUSAGE = _descriptor.Descriptor( - name='VolumeUsage', - full_name='csi.v1.VolumeUsage', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='available', full_name='csi.v1.VolumeUsage.available', index=0, - number=1, type=3, cpp_type=2, label=1, - has_default_value=False, default_value=0, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='total', full_name='csi.v1.VolumeUsage.total', index=1, - number=2, type=3, cpp_type=2, label=1, - has_default_value=False, default_value=0, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='used', full_name='csi.v1.VolumeUsage.used', index=2, - number=3, type=3, cpp_type=2, label=1, - has_default_value=False, default_value=0, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='unit', full_name='csi.v1.VolumeUsage.unit', index=3, - number=4, type=14, cpp_type=8, label=1, - has_default_value=False, default_value=0, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - _VOLUMEUSAGE_UNIT, - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=9551, - serialized_end=9696, -) - - -_VOLUMECONDITION = _descriptor.Descriptor( - name='VolumeCondition', - full_name='csi.v1.VolumeCondition', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='abnormal', full_name='csi.v1.VolumeCondition.abnormal', index=0, - number=1, type=8, cpp_type=7, label=1, - has_default_value=False, default_value=False, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='message', full_name='csi.v1.VolumeCondition.message', index=1, - number=2, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=b"".decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=b'\240B\001', - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=9698, - serialized_end=9755, -) - - -_NODEGETCAPABILITIESREQUEST = _descriptor.Descriptor( - name='NodeGetCapabilitiesRequest', - full_name='csi.v1.NodeGetCapabilitiesRequest', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=9757, - serialized_end=9785, -) - - -_NODEGETCAPABILITIESRESPONSE = _descriptor.Descriptor( - name='NodeGetCapabilitiesResponse', - full_name='csi.v1.NodeGetCapabilitiesResponse', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='capabilities', full_name='csi.v1.NodeGetCapabilitiesResponse.capabilities', index=0, - number=1, type=11, cpp_type=10, label=3, - has_default_value=False, default_value=[], - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=9787, - serialized_end=9869, -) - - -_NODESERVICECAPABILITY_RPC = _descriptor.Descriptor( - name='RPC', - full_name='csi.v1.NodeServiceCapability.RPC', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='type', full_name='csi.v1.NodeServiceCapability.RPC.type', index=0, - number=1, type=14, cpp_type=8, label=1, - has_default_value=False, default_value=0, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - _NODESERVICECAPABILITY_RPC_TYPE, - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=9948, - serialized_end=10187, -) - -_NODESERVICECAPABILITY = _descriptor.Descriptor( - name='NodeServiceCapability', - full_name='csi.v1.NodeServiceCapability', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='rpc', full_name='csi.v1.NodeServiceCapability.rpc', index=0, - number=1, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[_NODESERVICECAPABILITY_RPC, ], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - _descriptor.OneofDescriptor( - name='type', full_name='csi.v1.NodeServiceCapability.type', - index=0, containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[]), - ], - serialized_start=9872, - serialized_end=10195, -) - - -_NODEGETINFOREQUEST = _descriptor.Descriptor( - name='NodeGetInfoRequest', - full_name='csi.v1.NodeGetInfoRequest', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=10197, - serialized_end=10217, -) - - -_NODEGETINFORESPONSE = _descriptor.Descriptor( - name='NodeGetInfoResponse', - full_name='csi.v1.NodeGetInfoResponse', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='node_id', full_name='csi.v1.NodeGetInfoResponse.node_id', index=0, - number=1, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=b"".decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='max_volumes_per_node', full_name='csi.v1.NodeGetInfoResponse.max_volumes_per_node', index=1, - number=2, type=3, cpp_type=2, label=1, - has_default_value=False, default_value=0, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='accessible_topology', full_name='csi.v1.NodeGetInfoResponse.accessible_topology', index=2, - number=3, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=10219, - serialized_end=10334, -) - - -_NODEEXPANDVOLUMEREQUEST_SECRETSENTRY = _descriptor.Descriptor( - name='SecretsEntry', - full_name='csi.v1.NodeExpandVolumeRequest.SecretsEntry', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='key', full_name='csi.v1.NodeExpandVolumeRequest.SecretsEntry.key', index=0, - number=1, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=b"".decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='value', full_name='csi.v1.NodeExpandVolumeRequest.SecretsEntry.value', index=1, - number=2, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=b"".decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=b'8\001', - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=1403, - serialized_end=1449, -) - -_NODEEXPANDVOLUMEREQUEST = _descriptor.Descriptor( - name='NodeExpandVolumeRequest', - full_name='csi.v1.NodeExpandVolumeRequest', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='volume_id', full_name='csi.v1.NodeExpandVolumeRequest.volume_id', index=0, - number=1, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=b"".decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='volume_path', full_name='csi.v1.NodeExpandVolumeRequest.volume_path', index=1, - number=2, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=b"".decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='capacity_range', full_name='csi.v1.NodeExpandVolumeRequest.capacity_range', index=2, - number=3, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='staging_target_path', full_name='csi.v1.NodeExpandVolumeRequest.staging_target_path', index=3, - number=4, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=b"".decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='volume_capability', full_name='csi.v1.NodeExpandVolumeRequest.volume_capability', index=4, - number=5, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='secrets', full_name='csi.v1.NodeExpandVolumeRequest.secrets', index=5, - number=6, type=11, cpp_type=10, label=3, - has_default_value=False, default_value=[], - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=b'\230B\001\240B\001', file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[_NODEEXPANDVOLUMEREQUEST_SECRETSENTRY, ], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=10337, - serialized_end=10650, -) - - -_NODEEXPANDVOLUMERESPONSE = _descriptor.Descriptor( - name='NodeExpandVolumeResponse', - full_name='csi.v1.NodeExpandVolumeResponse', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='capacity_bytes', full_name='csi.v1.NodeExpandVolumeResponse.capacity_bytes', index=0, - number=1, type=3, cpp_type=2, label=1, - has_default_value=False, default_value=0, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=10652, - serialized_end=10702, -) - -_GETPLUGININFORESPONSE_MANIFESTENTRY.containing_type = _GETPLUGININFORESPONSE -_GETPLUGININFORESPONSE.fields_by_name['manifest'].message_type = _GETPLUGININFORESPONSE_MANIFESTENTRY -_GETPLUGINCAPABILITIESRESPONSE.fields_by_name['capabilities'].message_type = _PLUGINCAPABILITY -_PLUGINCAPABILITY_SERVICE.fields_by_name['type'].enum_type = _PLUGINCAPABILITY_SERVICE_TYPE -_PLUGINCAPABILITY_SERVICE.containing_type = _PLUGINCAPABILITY -_PLUGINCAPABILITY_SERVICE_TYPE.containing_type = _PLUGINCAPABILITY_SERVICE -_PLUGINCAPABILITY_VOLUMEEXPANSION.fields_by_name['type'].enum_type = _PLUGINCAPABILITY_VOLUMEEXPANSION_TYPE -_PLUGINCAPABILITY_VOLUMEEXPANSION.containing_type = _PLUGINCAPABILITY -_PLUGINCAPABILITY_VOLUMEEXPANSION_TYPE.containing_type = _PLUGINCAPABILITY_VOLUMEEXPANSION -_PLUGINCAPABILITY.fields_by_name['service'].message_type = _PLUGINCAPABILITY_SERVICE -_PLUGINCAPABILITY.fields_by_name['volume_expansion'].message_type = _PLUGINCAPABILITY_VOLUMEEXPANSION -_PLUGINCAPABILITY.oneofs_by_name['type'].fields.append( - _PLUGINCAPABILITY.fields_by_name['service']) -_PLUGINCAPABILITY.fields_by_name['service'].containing_oneof = _PLUGINCAPABILITY.oneofs_by_name['type'] -_PLUGINCAPABILITY.oneofs_by_name['type'].fields.append( - _PLUGINCAPABILITY.fields_by_name['volume_expansion']) -_PLUGINCAPABILITY.fields_by_name['volume_expansion'].containing_oneof = _PLUGINCAPABILITY.oneofs_by_name['type'] -_PROBERESPONSE.fields_by_name['ready'].message_type = google_dot_protobuf_dot_wrappers__pb2._BOOLVALUE -_CREATEVOLUMEREQUEST_PARAMETERSENTRY.containing_type = _CREATEVOLUMEREQUEST -_CREATEVOLUMEREQUEST_SECRETSENTRY.containing_type = _CREATEVOLUMEREQUEST -_CREATEVOLUMEREQUEST.fields_by_name['capacity_range'].message_type = _CAPACITYRANGE -_CREATEVOLUMEREQUEST.fields_by_name['volume_capabilities'].message_type = _VOLUMECAPABILITY -_CREATEVOLUMEREQUEST.fields_by_name['parameters'].message_type = _CREATEVOLUMEREQUEST_PARAMETERSENTRY -_CREATEVOLUMEREQUEST.fields_by_name['secrets'].message_type = _CREATEVOLUMEREQUEST_SECRETSENTRY -_CREATEVOLUMEREQUEST.fields_by_name['volume_content_source'].message_type = _VOLUMECONTENTSOURCE -_CREATEVOLUMEREQUEST.fields_by_name['accessibility_requirements'].message_type = _TOPOLOGYREQUIREMENT -_VOLUMECONTENTSOURCE_SNAPSHOTSOURCE.containing_type = _VOLUMECONTENTSOURCE -_VOLUMECONTENTSOURCE_VOLUMESOURCE.containing_type = _VOLUMECONTENTSOURCE -_VOLUMECONTENTSOURCE.fields_by_name['snapshot'].message_type = _VOLUMECONTENTSOURCE_SNAPSHOTSOURCE -_VOLUMECONTENTSOURCE.fields_by_name['volume'].message_type = _VOLUMECONTENTSOURCE_VOLUMESOURCE -_VOLUMECONTENTSOURCE.oneofs_by_name['type'].fields.append( - _VOLUMECONTENTSOURCE.fields_by_name['snapshot']) -_VOLUMECONTENTSOURCE.fields_by_name['snapshot'].containing_oneof = _VOLUMECONTENTSOURCE.oneofs_by_name['type'] -_VOLUMECONTENTSOURCE.oneofs_by_name['type'].fields.append( - _VOLUMECONTENTSOURCE.fields_by_name['volume']) -_VOLUMECONTENTSOURCE.fields_by_name['volume'].containing_oneof = _VOLUMECONTENTSOURCE.oneofs_by_name['type'] -_CREATEVOLUMERESPONSE.fields_by_name['volume'].message_type = _VOLUME -_VOLUMECAPABILITY_BLOCKVOLUME.containing_type = _VOLUMECAPABILITY -_VOLUMECAPABILITY_MOUNTVOLUME.containing_type = _VOLUMECAPABILITY -_VOLUMECAPABILITY_ACCESSMODE.fields_by_name['mode'].enum_type = _VOLUMECAPABILITY_ACCESSMODE_MODE -_VOLUMECAPABILITY_ACCESSMODE.containing_type = _VOLUMECAPABILITY -_VOLUMECAPABILITY_ACCESSMODE_MODE.containing_type = _VOLUMECAPABILITY_ACCESSMODE -_VOLUMECAPABILITY.fields_by_name['block'].message_type = _VOLUMECAPABILITY_BLOCKVOLUME -_VOLUMECAPABILITY.fields_by_name['mount'].message_type = _VOLUMECAPABILITY_MOUNTVOLUME -_VOLUMECAPABILITY.fields_by_name['access_mode'].message_type = _VOLUMECAPABILITY_ACCESSMODE -_VOLUMECAPABILITY.oneofs_by_name['access_type'].fields.append( - _VOLUMECAPABILITY.fields_by_name['block']) -_VOLUMECAPABILITY.fields_by_name['block'].containing_oneof = _VOLUMECAPABILITY.oneofs_by_name['access_type'] -_VOLUMECAPABILITY.oneofs_by_name['access_type'].fields.append( - _VOLUMECAPABILITY.fields_by_name['mount']) -_VOLUMECAPABILITY.fields_by_name['mount'].containing_oneof = _VOLUMECAPABILITY.oneofs_by_name['access_type'] -_VOLUME_VOLUMECONTEXTENTRY.containing_type = _VOLUME -_VOLUME.fields_by_name['volume_context'].message_type = _VOLUME_VOLUMECONTEXTENTRY -_VOLUME.fields_by_name['content_source'].message_type = _VOLUMECONTENTSOURCE -_VOLUME.fields_by_name['accessible_topology'].message_type = _TOPOLOGY -_TOPOLOGYREQUIREMENT.fields_by_name['requisite'].message_type = _TOPOLOGY -_TOPOLOGYREQUIREMENT.fields_by_name['preferred'].message_type = _TOPOLOGY -_TOPOLOGY_SEGMENTSENTRY.containing_type = _TOPOLOGY -_TOPOLOGY.fields_by_name['segments'].message_type = _TOPOLOGY_SEGMENTSENTRY -_DELETEVOLUMEREQUEST_SECRETSENTRY.containing_type = _DELETEVOLUMEREQUEST -_DELETEVOLUMEREQUEST.fields_by_name['secrets'].message_type = _DELETEVOLUMEREQUEST_SECRETSENTRY -_CONTROLLERPUBLISHVOLUMEREQUEST_SECRETSENTRY.containing_type = _CONTROLLERPUBLISHVOLUMEREQUEST -_CONTROLLERPUBLISHVOLUMEREQUEST_VOLUMECONTEXTENTRY.containing_type = _CONTROLLERPUBLISHVOLUMEREQUEST -_CONTROLLERPUBLISHVOLUMEREQUEST.fields_by_name['volume_capability'].message_type = _VOLUMECAPABILITY -_CONTROLLERPUBLISHVOLUMEREQUEST.fields_by_name['secrets'].message_type = _CONTROLLERPUBLISHVOLUMEREQUEST_SECRETSENTRY -_CONTROLLERPUBLISHVOLUMEREQUEST.fields_by_name['volume_context'].message_type = _CONTROLLERPUBLISHVOLUMEREQUEST_VOLUMECONTEXTENTRY -_CONTROLLERPUBLISHVOLUMERESPONSE_PUBLISHCONTEXTENTRY.containing_type = _CONTROLLERPUBLISHVOLUMERESPONSE -_CONTROLLERPUBLISHVOLUMERESPONSE.fields_by_name['publish_context'].message_type = _CONTROLLERPUBLISHVOLUMERESPONSE_PUBLISHCONTEXTENTRY -_CONTROLLERUNPUBLISHVOLUMEREQUEST_SECRETSENTRY.containing_type = _CONTROLLERUNPUBLISHVOLUMEREQUEST -_CONTROLLERUNPUBLISHVOLUMEREQUEST.fields_by_name['secrets'].message_type = _CONTROLLERUNPUBLISHVOLUMEREQUEST_SECRETSENTRY -_VALIDATEVOLUMECAPABILITIESREQUEST_VOLUMECONTEXTENTRY.containing_type = _VALIDATEVOLUMECAPABILITIESREQUEST -_VALIDATEVOLUMECAPABILITIESREQUEST_PARAMETERSENTRY.containing_type = _VALIDATEVOLUMECAPABILITIESREQUEST -_VALIDATEVOLUMECAPABILITIESREQUEST_SECRETSENTRY.containing_type = _VALIDATEVOLUMECAPABILITIESREQUEST -_VALIDATEVOLUMECAPABILITIESREQUEST.fields_by_name['volume_context'].message_type = _VALIDATEVOLUMECAPABILITIESREQUEST_VOLUMECONTEXTENTRY -_VALIDATEVOLUMECAPABILITIESREQUEST.fields_by_name['volume_capabilities'].message_type = _VOLUMECAPABILITY -_VALIDATEVOLUMECAPABILITIESREQUEST.fields_by_name['parameters'].message_type = _VALIDATEVOLUMECAPABILITIESREQUEST_PARAMETERSENTRY -_VALIDATEVOLUMECAPABILITIESREQUEST.fields_by_name['secrets'].message_type = _VALIDATEVOLUMECAPABILITIESREQUEST_SECRETSENTRY -_VALIDATEVOLUMECAPABILITIESRESPONSE_CONFIRMED_VOLUMECONTEXTENTRY.containing_type = _VALIDATEVOLUMECAPABILITIESRESPONSE_CONFIRMED -_VALIDATEVOLUMECAPABILITIESRESPONSE_CONFIRMED_PARAMETERSENTRY.containing_type = _VALIDATEVOLUMECAPABILITIESRESPONSE_CONFIRMED -_VALIDATEVOLUMECAPABILITIESRESPONSE_CONFIRMED.fields_by_name['volume_context'].message_type = _VALIDATEVOLUMECAPABILITIESRESPONSE_CONFIRMED_VOLUMECONTEXTENTRY -_VALIDATEVOLUMECAPABILITIESRESPONSE_CONFIRMED.fields_by_name['volume_capabilities'].message_type = _VOLUMECAPABILITY -_VALIDATEVOLUMECAPABILITIESRESPONSE_CONFIRMED.fields_by_name['parameters'].message_type = _VALIDATEVOLUMECAPABILITIESRESPONSE_CONFIRMED_PARAMETERSENTRY -_VALIDATEVOLUMECAPABILITIESRESPONSE_CONFIRMED.containing_type = _VALIDATEVOLUMECAPABILITIESRESPONSE -_VALIDATEVOLUMECAPABILITIESRESPONSE.fields_by_name['confirmed'].message_type = _VALIDATEVOLUMECAPABILITIESRESPONSE_CONFIRMED -_LISTVOLUMESRESPONSE_VOLUMESTATUS.fields_by_name['volume_condition'].message_type = _VOLUMECONDITION -_LISTVOLUMESRESPONSE_VOLUMESTATUS.containing_type = _LISTVOLUMESRESPONSE -_LISTVOLUMESRESPONSE_ENTRY.fields_by_name['volume'].message_type = _VOLUME -_LISTVOLUMESRESPONSE_ENTRY.fields_by_name['status'].message_type = _LISTVOLUMESRESPONSE_VOLUMESTATUS -_LISTVOLUMESRESPONSE_ENTRY.containing_type = _LISTVOLUMESRESPONSE -_LISTVOLUMESRESPONSE.fields_by_name['entries'].message_type = _LISTVOLUMESRESPONSE_ENTRY -_CONTROLLERGETVOLUMERESPONSE_VOLUMESTATUS.fields_by_name['volume_condition'].message_type = _VOLUMECONDITION -_CONTROLLERGETVOLUMERESPONSE_VOLUMESTATUS.containing_type = _CONTROLLERGETVOLUMERESPONSE -_CONTROLLERGETVOLUMERESPONSE.fields_by_name['volume'].message_type = _VOLUME -_CONTROLLERGETVOLUMERESPONSE.fields_by_name['status'].message_type = _CONTROLLERGETVOLUMERESPONSE_VOLUMESTATUS -_GETCAPACITYREQUEST_PARAMETERSENTRY.containing_type = _GETCAPACITYREQUEST -_GETCAPACITYREQUEST.fields_by_name['volume_capabilities'].message_type = _VOLUMECAPABILITY -_GETCAPACITYREQUEST.fields_by_name['parameters'].message_type = _GETCAPACITYREQUEST_PARAMETERSENTRY -_GETCAPACITYREQUEST.fields_by_name['accessible_topology'].message_type = _TOPOLOGY -_GETCAPACITYRESPONSE.fields_by_name['maximum_volume_size'].message_type = google_dot_protobuf_dot_wrappers__pb2._INT64VALUE -_GETCAPACITYRESPONSE.fields_by_name['minimum_volume_size'].message_type = google_dot_protobuf_dot_wrappers__pb2._INT64VALUE -_CONTROLLERGETCAPABILITIESRESPONSE.fields_by_name['capabilities'].message_type = _CONTROLLERSERVICECAPABILITY -_CONTROLLERSERVICECAPABILITY_RPC.fields_by_name['type'].enum_type = _CONTROLLERSERVICECAPABILITY_RPC_TYPE -_CONTROLLERSERVICECAPABILITY_RPC.containing_type = _CONTROLLERSERVICECAPABILITY -_CONTROLLERSERVICECAPABILITY_RPC_TYPE.containing_type = _CONTROLLERSERVICECAPABILITY_RPC -_CONTROLLERSERVICECAPABILITY.fields_by_name['rpc'].message_type = _CONTROLLERSERVICECAPABILITY_RPC -_CONTROLLERSERVICECAPABILITY.oneofs_by_name['type'].fields.append( - _CONTROLLERSERVICECAPABILITY.fields_by_name['rpc']) -_CONTROLLERSERVICECAPABILITY.fields_by_name['rpc'].containing_oneof = _CONTROLLERSERVICECAPABILITY.oneofs_by_name['type'] -_CREATESNAPSHOTREQUEST_SECRETSENTRY.containing_type = _CREATESNAPSHOTREQUEST -_CREATESNAPSHOTREQUEST_PARAMETERSENTRY.containing_type = _CREATESNAPSHOTREQUEST -_CREATESNAPSHOTREQUEST.fields_by_name['secrets'].message_type = _CREATESNAPSHOTREQUEST_SECRETSENTRY -_CREATESNAPSHOTREQUEST.fields_by_name['parameters'].message_type = _CREATESNAPSHOTREQUEST_PARAMETERSENTRY -_CREATESNAPSHOTRESPONSE.fields_by_name['snapshot'].message_type = _SNAPSHOT -_SNAPSHOT.fields_by_name['creation_time'].message_type = google_dot_protobuf_dot_timestamp__pb2._TIMESTAMP -_DELETESNAPSHOTREQUEST_SECRETSENTRY.containing_type = _DELETESNAPSHOTREQUEST -_DELETESNAPSHOTREQUEST.fields_by_name['secrets'].message_type = _DELETESNAPSHOTREQUEST_SECRETSENTRY -_LISTSNAPSHOTSREQUEST_SECRETSENTRY.containing_type = _LISTSNAPSHOTSREQUEST -_LISTSNAPSHOTSREQUEST.fields_by_name['secrets'].message_type = _LISTSNAPSHOTSREQUEST_SECRETSENTRY -_LISTSNAPSHOTSRESPONSE_ENTRY.fields_by_name['snapshot'].message_type = _SNAPSHOT -_LISTSNAPSHOTSRESPONSE_ENTRY.containing_type = _LISTSNAPSHOTSRESPONSE -_LISTSNAPSHOTSRESPONSE.fields_by_name['entries'].message_type = _LISTSNAPSHOTSRESPONSE_ENTRY -_CONTROLLEREXPANDVOLUMEREQUEST_SECRETSENTRY.containing_type = _CONTROLLEREXPANDVOLUMEREQUEST -_CONTROLLEREXPANDVOLUMEREQUEST.fields_by_name['capacity_range'].message_type = _CAPACITYRANGE -_CONTROLLEREXPANDVOLUMEREQUEST.fields_by_name['secrets'].message_type = _CONTROLLEREXPANDVOLUMEREQUEST_SECRETSENTRY -_CONTROLLEREXPANDVOLUMEREQUEST.fields_by_name['volume_capability'].message_type = _VOLUMECAPABILITY -_NODESTAGEVOLUMEREQUEST_PUBLISHCONTEXTENTRY.containing_type = _NODESTAGEVOLUMEREQUEST -_NODESTAGEVOLUMEREQUEST_SECRETSENTRY.containing_type = _NODESTAGEVOLUMEREQUEST -_NODESTAGEVOLUMEREQUEST_VOLUMECONTEXTENTRY.containing_type = _NODESTAGEVOLUMEREQUEST -_NODESTAGEVOLUMEREQUEST.fields_by_name['publish_context'].message_type = _NODESTAGEVOLUMEREQUEST_PUBLISHCONTEXTENTRY -_NODESTAGEVOLUMEREQUEST.fields_by_name['volume_capability'].message_type = _VOLUMECAPABILITY -_NODESTAGEVOLUMEREQUEST.fields_by_name['secrets'].message_type = _NODESTAGEVOLUMEREQUEST_SECRETSENTRY -_NODESTAGEVOLUMEREQUEST.fields_by_name['volume_context'].message_type = _NODESTAGEVOLUMEREQUEST_VOLUMECONTEXTENTRY -_NODEPUBLISHVOLUMEREQUEST_PUBLISHCONTEXTENTRY.containing_type = _NODEPUBLISHVOLUMEREQUEST -_NODEPUBLISHVOLUMEREQUEST_SECRETSENTRY.containing_type = _NODEPUBLISHVOLUMEREQUEST -_NODEPUBLISHVOLUMEREQUEST_VOLUMECONTEXTENTRY.containing_type = _NODEPUBLISHVOLUMEREQUEST -_NODEPUBLISHVOLUMEREQUEST.fields_by_name['publish_context'].message_type = _NODEPUBLISHVOLUMEREQUEST_PUBLISHCONTEXTENTRY -_NODEPUBLISHVOLUMEREQUEST.fields_by_name['volume_capability'].message_type = _VOLUMECAPABILITY -_NODEPUBLISHVOLUMEREQUEST.fields_by_name['secrets'].message_type = _NODEPUBLISHVOLUMEREQUEST_SECRETSENTRY -_NODEPUBLISHVOLUMEREQUEST.fields_by_name['volume_context'].message_type = _NODEPUBLISHVOLUMEREQUEST_VOLUMECONTEXTENTRY -_NODEGETVOLUMESTATSRESPONSE.fields_by_name['usage'].message_type = _VOLUMEUSAGE -_NODEGETVOLUMESTATSRESPONSE.fields_by_name['volume_condition'].message_type = _VOLUMECONDITION -_VOLUMEUSAGE.fields_by_name['unit'].enum_type = _VOLUMEUSAGE_UNIT -_VOLUMEUSAGE_UNIT.containing_type = _VOLUMEUSAGE -_NODEGETCAPABILITIESRESPONSE.fields_by_name['capabilities'].message_type = _NODESERVICECAPABILITY -_NODESERVICECAPABILITY_RPC.fields_by_name['type'].enum_type = _NODESERVICECAPABILITY_RPC_TYPE -_NODESERVICECAPABILITY_RPC.containing_type = _NODESERVICECAPABILITY -_NODESERVICECAPABILITY_RPC_TYPE.containing_type = _NODESERVICECAPABILITY_RPC -_NODESERVICECAPABILITY.fields_by_name['rpc'].message_type = _NODESERVICECAPABILITY_RPC -_NODESERVICECAPABILITY.oneofs_by_name['type'].fields.append( - _NODESERVICECAPABILITY.fields_by_name['rpc']) -_NODESERVICECAPABILITY.fields_by_name['rpc'].containing_oneof = _NODESERVICECAPABILITY.oneofs_by_name['type'] -_NODEGETINFORESPONSE.fields_by_name['accessible_topology'].message_type = _TOPOLOGY -_NODEEXPANDVOLUMEREQUEST_SECRETSENTRY.containing_type = _NODEEXPANDVOLUMEREQUEST -_NODEEXPANDVOLUMEREQUEST.fields_by_name['capacity_range'].message_type = _CAPACITYRANGE -_NODEEXPANDVOLUMEREQUEST.fields_by_name['volume_capability'].message_type = _VOLUMECAPABILITY -_NODEEXPANDVOLUMEREQUEST.fields_by_name['secrets'].message_type = _NODEEXPANDVOLUMEREQUEST_SECRETSENTRY -DESCRIPTOR.message_types_by_name['GetPluginInfoRequest'] = _GETPLUGININFOREQUEST -DESCRIPTOR.message_types_by_name['GetPluginInfoResponse'] = _GETPLUGININFORESPONSE -DESCRIPTOR.message_types_by_name['GetPluginCapabilitiesRequest'] = _GETPLUGINCAPABILITIESREQUEST -DESCRIPTOR.message_types_by_name['GetPluginCapabilitiesResponse'] = _GETPLUGINCAPABILITIESRESPONSE -DESCRIPTOR.message_types_by_name['PluginCapability'] = _PLUGINCAPABILITY -DESCRIPTOR.message_types_by_name['ProbeRequest'] = _PROBEREQUEST -DESCRIPTOR.message_types_by_name['ProbeResponse'] = _PROBERESPONSE -DESCRIPTOR.message_types_by_name['CreateVolumeRequest'] = _CREATEVOLUMEREQUEST -DESCRIPTOR.message_types_by_name['VolumeContentSource'] = _VOLUMECONTENTSOURCE -DESCRIPTOR.message_types_by_name['CreateVolumeResponse'] = _CREATEVOLUMERESPONSE -DESCRIPTOR.message_types_by_name['VolumeCapability'] = _VOLUMECAPABILITY -DESCRIPTOR.message_types_by_name['CapacityRange'] = _CAPACITYRANGE -DESCRIPTOR.message_types_by_name['Volume'] = _VOLUME -DESCRIPTOR.message_types_by_name['TopologyRequirement'] = _TOPOLOGYREQUIREMENT -DESCRIPTOR.message_types_by_name['Topology'] = _TOPOLOGY -DESCRIPTOR.message_types_by_name['DeleteVolumeRequest'] = _DELETEVOLUMEREQUEST -DESCRIPTOR.message_types_by_name['DeleteVolumeResponse'] = _DELETEVOLUMERESPONSE -DESCRIPTOR.message_types_by_name['ControllerPublishVolumeRequest'] = _CONTROLLERPUBLISHVOLUMEREQUEST -DESCRIPTOR.message_types_by_name['ControllerPublishVolumeResponse'] = _CONTROLLERPUBLISHVOLUMERESPONSE -DESCRIPTOR.message_types_by_name['ControllerUnpublishVolumeRequest'] = _CONTROLLERUNPUBLISHVOLUMEREQUEST -DESCRIPTOR.message_types_by_name['ControllerUnpublishVolumeResponse'] = _CONTROLLERUNPUBLISHVOLUMERESPONSE -DESCRIPTOR.message_types_by_name['ValidateVolumeCapabilitiesRequest'] = _VALIDATEVOLUMECAPABILITIESREQUEST -DESCRIPTOR.message_types_by_name['ValidateVolumeCapabilitiesResponse'] = _VALIDATEVOLUMECAPABILITIESRESPONSE -DESCRIPTOR.message_types_by_name['ListVolumesRequest'] = _LISTVOLUMESREQUEST -DESCRIPTOR.message_types_by_name['ListVolumesResponse'] = _LISTVOLUMESRESPONSE -DESCRIPTOR.message_types_by_name['ControllerGetVolumeRequest'] = _CONTROLLERGETVOLUMEREQUEST -DESCRIPTOR.message_types_by_name['ControllerGetVolumeResponse'] = _CONTROLLERGETVOLUMERESPONSE -DESCRIPTOR.message_types_by_name['GetCapacityRequest'] = _GETCAPACITYREQUEST -DESCRIPTOR.message_types_by_name['GetCapacityResponse'] = _GETCAPACITYRESPONSE -DESCRIPTOR.message_types_by_name['ControllerGetCapabilitiesRequest'] = _CONTROLLERGETCAPABILITIESREQUEST -DESCRIPTOR.message_types_by_name['ControllerGetCapabilitiesResponse'] = _CONTROLLERGETCAPABILITIESRESPONSE -DESCRIPTOR.message_types_by_name['ControllerServiceCapability'] = _CONTROLLERSERVICECAPABILITY -DESCRIPTOR.message_types_by_name['CreateSnapshotRequest'] = _CREATESNAPSHOTREQUEST -DESCRIPTOR.message_types_by_name['CreateSnapshotResponse'] = _CREATESNAPSHOTRESPONSE -DESCRIPTOR.message_types_by_name['Snapshot'] = _SNAPSHOT -DESCRIPTOR.message_types_by_name['DeleteSnapshotRequest'] = _DELETESNAPSHOTREQUEST -DESCRIPTOR.message_types_by_name['DeleteSnapshotResponse'] = _DELETESNAPSHOTRESPONSE -DESCRIPTOR.message_types_by_name['ListSnapshotsRequest'] = _LISTSNAPSHOTSREQUEST -DESCRIPTOR.message_types_by_name['ListSnapshotsResponse'] = _LISTSNAPSHOTSRESPONSE -DESCRIPTOR.message_types_by_name['ControllerExpandVolumeRequest'] = _CONTROLLEREXPANDVOLUMEREQUEST -DESCRIPTOR.message_types_by_name['ControllerExpandVolumeResponse'] = _CONTROLLEREXPANDVOLUMERESPONSE -DESCRIPTOR.message_types_by_name['NodeStageVolumeRequest'] = _NODESTAGEVOLUMEREQUEST -DESCRIPTOR.message_types_by_name['NodeStageVolumeResponse'] = _NODESTAGEVOLUMERESPONSE -DESCRIPTOR.message_types_by_name['NodeUnstageVolumeRequest'] = _NODEUNSTAGEVOLUMEREQUEST -DESCRIPTOR.message_types_by_name['NodeUnstageVolumeResponse'] = _NODEUNSTAGEVOLUMERESPONSE -DESCRIPTOR.message_types_by_name['NodePublishVolumeRequest'] = _NODEPUBLISHVOLUMEREQUEST -DESCRIPTOR.message_types_by_name['NodePublishVolumeResponse'] = _NODEPUBLISHVOLUMERESPONSE -DESCRIPTOR.message_types_by_name['NodeUnpublishVolumeRequest'] = _NODEUNPUBLISHVOLUMEREQUEST -DESCRIPTOR.message_types_by_name['NodeUnpublishVolumeResponse'] = _NODEUNPUBLISHVOLUMERESPONSE -DESCRIPTOR.message_types_by_name['NodeGetVolumeStatsRequest'] = _NODEGETVOLUMESTATSREQUEST -DESCRIPTOR.message_types_by_name['NodeGetVolumeStatsResponse'] = _NODEGETVOLUMESTATSRESPONSE -DESCRIPTOR.message_types_by_name['VolumeUsage'] = _VOLUMEUSAGE -DESCRIPTOR.message_types_by_name['VolumeCondition'] = _VOLUMECONDITION -DESCRIPTOR.message_types_by_name['NodeGetCapabilitiesRequest'] = _NODEGETCAPABILITIESREQUEST -DESCRIPTOR.message_types_by_name['NodeGetCapabilitiesResponse'] = _NODEGETCAPABILITIESRESPONSE -DESCRIPTOR.message_types_by_name['NodeServiceCapability'] = _NODESERVICECAPABILITY -DESCRIPTOR.message_types_by_name['NodeGetInfoRequest'] = _NODEGETINFOREQUEST -DESCRIPTOR.message_types_by_name['NodeGetInfoResponse'] = _NODEGETINFORESPONSE -DESCRIPTOR.message_types_by_name['NodeExpandVolumeRequest'] = _NODEEXPANDVOLUMEREQUEST -DESCRIPTOR.message_types_by_name['NodeExpandVolumeResponse'] = _NODEEXPANDVOLUMERESPONSE -DESCRIPTOR.extensions_by_name['alpha_enum'] = alpha_enum -DESCRIPTOR.extensions_by_name['alpha_enum_value'] = alpha_enum_value -DESCRIPTOR.extensions_by_name['csi_secret'] = csi_secret -DESCRIPTOR.extensions_by_name['alpha_field'] = alpha_field -DESCRIPTOR.extensions_by_name['alpha_message'] = alpha_message -DESCRIPTOR.extensions_by_name['alpha_method'] = alpha_method -DESCRIPTOR.extensions_by_name['alpha_service'] = alpha_service -_sym_db.RegisterFileDescriptor(DESCRIPTOR) - -GetPluginInfoRequest = _reflection.GeneratedProtocolMessageType('GetPluginInfoRequest', (_message.Message,), { - 'DESCRIPTOR' : _GETPLUGININFOREQUEST, - '__module__' : 'controller.csi_general.csi_pb2' - # @@protoc_insertion_point(class_scope:csi.v1.GetPluginInfoRequest) - }) -_sym_db.RegisterMessage(GetPluginInfoRequest) - -GetPluginInfoResponse = _reflection.GeneratedProtocolMessageType('GetPluginInfoResponse', (_message.Message,), { - - 'ManifestEntry' : _reflection.GeneratedProtocolMessageType('ManifestEntry', (_message.Message,), { - 'DESCRIPTOR' : _GETPLUGININFORESPONSE_MANIFESTENTRY, - '__module__' : 'controller.csi_general.csi_pb2' - # @@protoc_insertion_point(class_scope:csi.v1.GetPluginInfoResponse.ManifestEntry) - }) - , - 'DESCRIPTOR' : _GETPLUGININFORESPONSE, - '__module__' : 'controller.csi_general.csi_pb2' - # @@protoc_insertion_point(class_scope:csi.v1.GetPluginInfoResponse) - }) -_sym_db.RegisterMessage(GetPluginInfoResponse) -_sym_db.RegisterMessage(GetPluginInfoResponse.ManifestEntry) - -GetPluginCapabilitiesRequest = _reflection.GeneratedProtocolMessageType('GetPluginCapabilitiesRequest', (_message.Message,), { - 'DESCRIPTOR' : _GETPLUGINCAPABILITIESREQUEST, - '__module__' : 'controller.csi_general.csi_pb2' - # @@protoc_insertion_point(class_scope:csi.v1.GetPluginCapabilitiesRequest) - }) -_sym_db.RegisterMessage(GetPluginCapabilitiesRequest) - -GetPluginCapabilitiesResponse = _reflection.GeneratedProtocolMessageType('GetPluginCapabilitiesResponse', (_message.Message,), { - 'DESCRIPTOR' : _GETPLUGINCAPABILITIESRESPONSE, - '__module__' : 'controller.csi_general.csi_pb2' - # @@protoc_insertion_point(class_scope:csi.v1.GetPluginCapabilitiesResponse) - }) -_sym_db.RegisterMessage(GetPluginCapabilitiesResponse) - -PluginCapability = _reflection.GeneratedProtocolMessageType('PluginCapability', (_message.Message,), { - - 'Service' : _reflection.GeneratedProtocolMessageType('Service', (_message.Message,), { - 'DESCRIPTOR' : _PLUGINCAPABILITY_SERVICE, - '__module__' : 'controller.csi_general.csi_pb2' - # @@protoc_insertion_point(class_scope:csi.v1.PluginCapability.Service) - }) - , - - 'VolumeExpansion' : _reflection.GeneratedProtocolMessageType('VolumeExpansion', (_message.Message,), { - 'DESCRIPTOR' : _PLUGINCAPABILITY_VOLUMEEXPANSION, - '__module__' : 'controller.csi_general.csi_pb2' - # @@protoc_insertion_point(class_scope:csi.v1.PluginCapability.VolumeExpansion) - }) - , - 'DESCRIPTOR' : _PLUGINCAPABILITY, - '__module__' : 'controller.csi_general.csi_pb2' - # @@protoc_insertion_point(class_scope:csi.v1.PluginCapability) - }) -_sym_db.RegisterMessage(PluginCapability) -_sym_db.RegisterMessage(PluginCapability.Service) -_sym_db.RegisterMessage(PluginCapability.VolumeExpansion) - -ProbeRequest = _reflection.GeneratedProtocolMessageType('ProbeRequest', (_message.Message,), { - 'DESCRIPTOR' : _PROBEREQUEST, - '__module__' : 'controller.csi_general.csi_pb2' - # @@protoc_insertion_point(class_scope:csi.v1.ProbeRequest) - }) -_sym_db.RegisterMessage(ProbeRequest) - -ProbeResponse = _reflection.GeneratedProtocolMessageType('ProbeResponse', (_message.Message,), { - 'DESCRIPTOR' : _PROBERESPONSE, - '__module__' : 'controller.csi_general.csi_pb2' - # @@protoc_insertion_point(class_scope:csi.v1.ProbeResponse) - }) -_sym_db.RegisterMessage(ProbeResponse) - -CreateVolumeRequest = _reflection.GeneratedProtocolMessageType('CreateVolumeRequest', (_message.Message,), { - - 'ParametersEntry' : _reflection.GeneratedProtocolMessageType('ParametersEntry', (_message.Message,), { - 'DESCRIPTOR' : _CREATEVOLUMEREQUEST_PARAMETERSENTRY, - '__module__' : 'controller.csi_general.csi_pb2' - # @@protoc_insertion_point(class_scope:csi.v1.CreateVolumeRequest.ParametersEntry) - }) - , - - 'SecretsEntry' : _reflection.GeneratedProtocolMessageType('SecretsEntry', (_message.Message,), { - 'DESCRIPTOR' : _CREATEVOLUMEREQUEST_SECRETSENTRY, - '__module__' : 'controller.csi_general.csi_pb2' - # @@protoc_insertion_point(class_scope:csi.v1.CreateVolumeRequest.SecretsEntry) - }) - , - 'DESCRIPTOR' : _CREATEVOLUMEREQUEST, - '__module__' : 'controller.csi_general.csi_pb2' - # @@protoc_insertion_point(class_scope:csi.v1.CreateVolumeRequest) - }) -_sym_db.RegisterMessage(CreateVolumeRequest) -_sym_db.RegisterMessage(CreateVolumeRequest.ParametersEntry) -_sym_db.RegisterMessage(CreateVolumeRequest.SecretsEntry) - -VolumeContentSource = _reflection.GeneratedProtocolMessageType('VolumeContentSource', (_message.Message,), { - - 'SnapshotSource' : _reflection.GeneratedProtocolMessageType('SnapshotSource', (_message.Message,), { - 'DESCRIPTOR' : _VOLUMECONTENTSOURCE_SNAPSHOTSOURCE, - '__module__' : 'controller.csi_general.csi_pb2' - # @@protoc_insertion_point(class_scope:csi.v1.VolumeContentSource.SnapshotSource) - }) - , - - 'VolumeSource' : _reflection.GeneratedProtocolMessageType('VolumeSource', (_message.Message,), { - 'DESCRIPTOR' : _VOLUMECONTENTSOURCE_VOLUMESOURCE, - '__module__' : 'controller.csi_general.csi_pb2' - # @@protoc_insertion_point(class_scope:csi.v1.VolumeContentSource.VolumeSource) - }) - , - 'DESCRIPTOR' : _VOLUMECONTENTSOURCE, - '__module__' : 'controller.csi_general.csi_pb2' - # @@protoc_insertion_point(class_scope:csi.v1.VolumeContentSource) - }) -_sym_db.RegisterMessage(VolumeContentSource) -_sym_db.RegisterMessage(VolumeContentSource.SnapshotSource) -_sym_db.RegisterMessage(VolumeContentSource.VolumeSource) - -CreateVolumeResponse = _reflection.GeneratedProtocolMessageType('CreateVolumeResponse', (_message.Message,), { - 'DESCRIPTOR' : _CREATEVOLUMERESPONSE, - '__module__' : 'controller.csi_general.csi_pb2' - # @@protoc_insertion_point(class_scope:csi.v1.CreateVolumeResponse) - }) -_sym_db.RegisterMessage(CreateVolumeResponse) - -VolumeCapability = _reflection.GeneratedProtocolMessageType('VolumeCapability', (_message.Message,), { - - 'BlockVolume' : _reflection.GeneratedProtocolMessageType('BlockVolume', (_message.Message,), { - 'DESCRIPTOR' : _VOLUMECAPABILITY_BLOCKVOLUME, - '__module__' : 'controller.csi_general.csi_pb2' - # @@protoc_insertion_point(class_scope:csi.v1.VolumeCapability.BlockVolume) - }) - , - - 'MountVolume' : _reflection.GeneratedProtocolMessageType('MountVolume', (_message.Message,), { - 'DESCRIPTOR' : _VOLUMECAPABILITY_MOUNTVOLUME, - '__module__' : 'controller.csi_general.csi_pb2' - # @@protoc_insertion_point(class_scope:csi.v1.VolumeCapability.MountVolume) - }) - , - - 'AccessMode' : _reflection.GeneratedProtocolMessageType('AccessMode', (_message.Message,), { - 'DESCRIPTOR' : _VOLUMECAPABILITY_ACCESSMODE, - '__module__' : 'controller.csi_general.csi_pb2' - # @@protoc_insertion_point(class_scope:csi.v1.VolumeCapability.AccessMode) - }) - , - 'DESCRIPTOR' : _VOLUMECAPABILITY, - '__module__' : 'controller.csi_general.csi_pb2' - # @@protoc_insertion_point(class_scope:csi.v1.VolumeCapability) - }) -_sym_db.RegisterMessage(VolumeCapability) -_sym_db.RegisterMessage(VolumeCapability.BlockVolume) -_sym_db.RegisterMessage(VolumeCapability.MountVolume) -_sym_db.RegisterMessage(VolumeCapability.AccessMode) - -CapacityRange = _reflection.GeneratedProtocolMessageType('CapacityRange', (_message.Message,), { - 'DESCRIPTOR' : _CAPACITYRANGE, - '__module__' : 'controller.csi_general.csi_pb2' - # @@protoc_insertion_point(class_scope:csi.v1.CapacityRange) - }) -_sym_db.RegisterMessage(CapacityRange) - -Volume = _reflection.GeneratedProtocolMessageType('Volume', (_message.Message,), { - - 'VolumeContextEntry' : _reflection.GeneratedProtocolMessageType('VolumeContextEntry', (_message.Message,), { - 'DESCRIPTOR' : _VOLUME_VOLUMECONTEXTENTRY, - '__module__' : 'controller.csi_general.csi_pb2' - # @@protoc_insertion_point(class_scope:csi.v1.Volume.VolumeContextEntry) - }) - , - 'DESCRIPTOR' : _VOLUME, - '__module__' : 'controller.csi_general.csi_pb2' - # @@protoc_insertion_point(class_scope:csi.v1.Volume) - }) -_sym_db.RegisterMessage(Volume) -_sym_db.RegisterMessage(Volume.VolumeContextEntry) - -TopologyRequirement = _reflection.GeneratedProtocolMessageType('TopologyRequirement', (_message.Message,), { - 'DESCRIPTOR' : _TOPOLOGYREQUIREMENT, - '__module__' : 'controller.csi_general.csi_pb2' - # @@protoc_insertion_point(class_scope:csi.v1.TopologyRequirement) - }) -_sym_db.RegisterMessage(TopologyRequirement) - -Topology = _reflection.GeneratedProtocolMessageType('Topology', (_message.Message,), { - - 'SegmentsEntry' : _reflection.GeneratedProtocolMessageType('SegmentsEntry', (_message.Message,), { - 'DESCRIPTOR' : _TOPOLOGY_SEGMENTSENTRY, - '__module__' : 'controller.csi_general.csi_pb2' - # @@protoc_insertion_point(class_scope:csi.v1.Topology.SegmentsEntry) - }) - , - 'DESCRIPTOR' : _TOPOLOGY, - '__module__' : 'controller.csi_general.csi_pb2' - # @@protoc_insertion_point(class_scope:csi.v1.Topology) - }) -_sym_db.RegisterMessage(Topology) -_sym_db.RegisterMessage(Topology.SegmentsEntry) - -DeleteVolumeRequest = _reflection.GeneratedProtocolMessageType('DeleteVolumeRequest', (_message.Message,), { - - 'SecretsEntry' : _reflection.GeneratedProtocolMessageType('SecretsEntry', (_message.Message,), { - 'DESCRIPTOR' : _DELETEVOLUMEREQUEST_SECRETSENTRY, - '__module__' : 'controller.csi_general.csi_pb2' - # @@protoc_insertion_point(class_scope:csi.v1.DeleteVolumeRequest.SecretsEntry) - }) - , - 'DESCRIPTOR' : _DELETEVOLUMEREQUEST, - '__module__' : 'controller.csi_general.csi_pb2' - # @@protoc_insertion_point(class_scope:csi.v1.DeleteVolumeRequest) - }) -_sym_db.RegisterMessage(DeleteVolumeRequest) -_sym_db.RegisterMessage(DeleteVolumeRequest.SecretsEntry) - -DeleteVolumeResponse = _reflection.GeneratedProtocolMessageType('DeleteVolumeResponse', (_message.Message,), { - 'DESCRIPTOR' : _DELETEVOLUMERESPONSE, - '__module__' : 'controller.csi_general.csi_pb2' - # @@protoc_insertion_point(class_scope:csi.v1.DeleteVolumeResponse) - }) -_sym_db.RegisterMessage(DeleteVolumeResponse) - -ControllerPublishVolumeRequest = _reflection.GeneratedProtocolMessageType('ControllerPublishVolumeRequest', (_message.Message,), { - - 'SecretsEntry' : _reflection.GeneratedProtocolMessageType('SecretsEntry', (_message.Message,), { - 'DESCRIPTOR' : _CONTROLLERPUBLISHVOLUMEREQUEST_SECRETSENTRY, - '__module__' : 'controller.csi_general.csi_pb2' - # @@protoc_insertion_point(class_scope:csi.v1.ControllerPublishVolumeRequest.SecretsEntry) - }) - , - - 'VolumeContextEntry' : _reflection.GeneratedProtocolMessageType('VolumeContextEntry', (_message.Message,), { - 'DESCRIPTOR' : _CONTROLLERPUBLISHVOLUMEREQUEST_VOLUMECONTEXTENTRY, - '__module__' : 'controller.csi_general.csi_pb2' - # @@protoc_insertion_point(class_scope:csi.v1.ControllerPublishVolumeRequest.VolumeContextEntry) - }) - , - 'DESCRIPTOR' : _CONTROLLERPUBLISHVOLUMEREQUEST, - '__module__' : 'controller.csi_general.csi_pb2' - # @@protoc_insertion_point(class_scope:csi.v1.ControllerPublishVolumeRequest) - }) -_sym_db.RegisterMessage(ControllerPublishVolumeRequest) -_sym_db.RegisterMessage(ControllerPublishVolumeRequest.SecretsEntry) -_sym_db.RegisterMessage(ControllerPublishVolumeRequest.VolumeContextEntry) - -ControllerPublishVolumeResponse = _reflection.GeneratedProtocolMessageType('ControllerPublishVolumeResponse', (_message.Message,), { - - 'PublishContextEntry' : _reflection.GeneratedProtocolMessageType('PublishContextEntry', (_message.Message,), { - 'DESCRIPTOR' : _CONTROLLERPUBLISHVOLUMERESPONSE_PUBLISHCONTEXTENTRY, - '__module__' : 'controller.csi_general.csi_pb2' - # @@protoc_insertion_point(class_scope:csi.v1.ControllerPublishVolumeResponse.PublishContextEntry) - }) - , - 'DESCRIPTOR' : _CONTROLLERPUBLISHVOLUMERESPONSE, - '__module__' : 'controller.csi_general.csi_pb2' - # @@protoc_insertion_point(class_scope:csi.v1.ControllerPublishVolumeResponse) - }) -_sym_db.RegisterMessage(ControllerPublishVolumeResponse) -_sym_db.RegisterMessage(ControllerPublishVolumeResponse.PublishContextEntry) - -ControllerUnpublishVolumeRequest = _reflection.GeneratedProtocolMessageType('ControllerUnpublishVolumeRequest', (_message.Message,), { - - 'SecretsEntry' : _reflection.GeneratedProtocolMessageType('SecretsEntry', (_message.Message,), { - 'DESCRIPTOR' : _CONTROLLERUNPUBLISHVOLUMEREQUEST_SECRETSENTRY, - '__module__' : 'controller.csi_general.csi_pb2' - # @@protoc_insertion_point(class_scope:csi.v1.ControllerUnpublishVolumeRequest.SecretsEntry) - }) - , - 'DESCRIPTOR' : _CONTROLLERUNPUBLISHVOLUMEREQUEST, - '__module__' : 'controller.csi_general.csi_pb2' - # @@protoc_insertion_point(class_scope:csi.v1.ControllerUnpublishVolumeRequest) - }) -_sym_db.RegisterMessage(ControllerUnpublishVolumeRequest) -_sym_db.RegisterMessage(ControllerUnpublishVolumeRequest.SecretsEntry) - -ControllerUnpublishVolumeResponse = _reflection.GeneratedProtocolMessageType('ControllerUnpublishVolumeResponse', (_message.Message,), { - 'DESCRIPTOR' : _CONTROLLERUNPUBLISHVOLUMERESPONSE, - '__module__' : 'controller.csi_general.csi_pb2' - # @@protoc_insertion_point(class_scope:csi.v1.ControllerUnpublishVolumeResponse) - }) -_sym_db.RegisterMessage(ControllerUnpublishVolumeResponse) - -ValidateVolumeCapabilitiesRequest = _reflection.GeneratedProtocolMessageType('ValidateVolumeCapabilitiesRequest', (_message.Message,), { - - 'VolumeContextEntry' : _reflection.GeneratedProtocolMessageType('VolumeContextEntry', (_message.Message,), { - 'DESCRIPTOR' : _VALIDATEVOLUMECAPABILITIESREQUEST_VOLUMECONTEXTENTRY, - '__module__' : 'controller.csi_general.csi_pb2' - # @@protoc_insertion_point(class_scope:csi.v1.ValidateVolumeCapabilitiesRequest.VolumeContextEntry) - }) - , - - 'ParametersEntry' : _reflection.GeneratedProtocolMessageType('ParametersEntry', (_message.Message,), { - 'DESCRIPTOR' : _VALIDATEVOLUMECAPABILITIESREQUEST_PARAMETERSENTRY, - '__module__' : 'controller.csi_general.csi_pb2' - # @@protoc_insertion_point(class_scope:csi.v1.ValidateVolumeCapabilitiesRequest.ParametersEntry) - }) - , - - 'SecretsEntry' : _reflection.GeneratedProtocolMessageType('SecretsEntry', (_message.Message,), { - 'DESCRIPTOR' : _VALIDATEVOLUMECAPABILITIESREQUEST_SECRETSENTRY, - '__module__' : 'controller.csi_general.csi_pb2' - # @@protoc_insertion_point(class_scope:csi.v1.ValidateVolumeCapabilitiesRequest.SecretsEntry) - }) - , - 'DESCRIPTOR' : _VALIDATEVOLUMECAPABILITIESREQUEST, - '__module__' : 'controller.csi_general.csi_pb2' - # @@protoc_insertion_point(class_scope:csi.v1.ValidateVolumeCapabilitiesRequest) - }) -_sym_db.RegisterMessage(ValidateVolumeCapabilitiesRequest) -_sym_db.RegisterMessage(ValidateVolumeCapabilitiesRequest.VolumeContextEntry) -_sym_db.RegisterMessage(ValidateVolumeCapabilitiesRequest.ParametersEntry) -_sym_db.RegisterMessage(ValidateVolumeCapabilitiesRequest.SecretsEntry) - -ValidateVolumeCapabilitiesResponse = _reflection.GeneratedProtocolMessageType('ValidateVolumeCapabilitiesResponse', (_message.Message,), { - - 'Confirmed' : _reflection.GeneratedProtocolMessageType('Confirmed', (_message.Message,), { - - 'VolumeContextEntry' : _reflection.GeneratedProtocolMessageType('VolumeContextEntry', (_message.Message,), { - 'DESCRIPTOR' : _VALIDATEVOLUMECAPABILITIESRESPONSE_CONFIRMED_VOLUMECONTEXTENTRY, - '__module__' : 'controller.csi_general.csi_pb2' - # @@protoc_insertion_point(class_scope:csi.v1.ValidateVolumeCapabilitiesResponse.Confirmed.VolumeContextEntry) - }) - , - - 'ParametersEntry' : _reflection.GeneratedProtocolMessageType('ParametersEntry', (_message.Message,), { - 'DESCRIPTOR' : _VALIDATEVOLUMECAPABILITIESRESPONSE_CONFIRMED_PARAMETERSENTRY, - '__module__' : 'controller.csi_general.csi_pb2' - # @@protoc_insertion_point(class_scope:csi.v1.ValidateVolumeCapabilitiesResponse.Confirmed.ParametersEntry) - }) - , - 'DESCRIPTOR' : _VALIDATEVOLUMECAPABILITIESRESPONSE_CONFIRMED, - '__module__' : 'controller.csi_general.csi_pb2' - # @@protoc_insertion_point(class_scope:csi.v1.ValidateVolumeCapabilitiesResponse.Confirmed) - }) - , - 'DESCRIPTOR' : _VALIDATEVOLUMECAPABILITIESRESPONSE, - '__module__' : 'controller.csi_general.csi_pb2' - # @@protoc_insertion_point(class_scope:csi.v1.ValidateVolumeCapabilitiesResponse) - }) -_sym_db.RegisterMessage(ValidateVolumeCapabilitiesResponse) -_sym_db.RegisterMessage(ValidateVolumeCapabilitiesResponse.Confirmed) -_sym_db.RegisterMessage(ValidateVolumeCapabilitiesResponse.Confirmed.VolumeContextEntry) -_sym_db.RegisterMessage(ValidateVolumeCapabilitiesResponse.Confirmed.ParametersEntry) - -ListVolumesRequest = _reflection.GeneratedProtocolMessageType('ListVolumesRequest', (_message.Message,), { - 'DESCRIPTOR' : _LISTVOLUMESREQUEST, - '__module__' : 'controller.csi_general.csi_pb2' - # @@protoc_insertion_point(class_scope:csi.v1.ListVolumesRequest) - }) -_sym_db.RegisterMessage(ListVolumesRequest) - -ListVolumesResponse = _reflection.GeneratedProtocolMessageType('ListVolumesResponse', (_message.Message,), { - - 'VolumeStatus' : _reflection.GeneratedProtocolMessageType('VolumeStatus', (_message.Message,), { - 'DESCRIPTOR' : _LISTVOLUMESRESPONSE_VOLUMESTATUS, - '__module__' : 'controller.csi_general.csi_pb2' - # @@protoc_insertion_point(class_scope:csi.v1.ListVolumesResponse.VolumeStatus) - }) - , - - 'Entry' : _reflection.GeneratedProtocolMessageType('Entry', (_message.Message,), { - 'DESCRIPTOR' : _LISTVOLUMESRESPONSE_ENTRY, - '__module__' : 'controller.csi_general.csi_pb2' - # @@protoc_insertion_point(class_scope:csi.v1.ListVolumesResponse.Entry) - }) - , - 'DESCRIPTOR' : _LISTVOLUMESRESPONSE, - '__module__' : 'controller.csi_general.csi_pb2' - # @@protoc_insertion_point(class_scope:csi.v1.ListVolumesResponse) - }) -_sym_db.RegisterMessage(ListVolumesResponse) -_sym_db.RegisterMessage(ListVolumesResponse.VolumeStatus) -_sym_db.RegisterMessage(ListVolumesResponse.Entry) - -ControllerGetVolumeRequest = _reflection.GeneratedProtocolMessageType('ControllerGetVolumeRequest', (_message.Message,), { - 'DESCRIPTOR' : _CONTROLLERGETVOLUMEREQUEST, - '__module__' : 'controller.csi_general.csi_pb2' - # @@protoc_insertion_point(class_scope:csi.v1.ControllerGetVolumeRequest) - }) -_sym_db.RegisterMessage(ControllerGetVolumeRequest) - -ControllerGetVolumeResponse = _reflection.GeneratedProtocolMessageType('ControllerGetVolumeResponse', (_message.Message,), { - - 'VolumeStatus' : _reflection.GeneratedProtocolMessageType('VolumeStatus', (_message.Message,), { - 'DESCRIPTOR' : _CONTROLLERGETVOLUMERESPONSE_VOLUMESTATUS, - '__module__' : 'controller.csi_general.csi_pb2' - # @@protoc_insertion_point(class_scope:csi.v1.ControllerGetVolumeResponse.VolumeStatus) - }) - , - 'DESCRIPTOR' : _CONTROLLERGETVOLUMERESPONSE, - '__module__' : 'controller.csi_general.csi_pb2' - # @@protoc_insertion_point(class_scope:csi.v1.ControllerGetVolumeResponse) - }) -_sym_db.RegisterMessage(ControllerGetVolumeResponse) -_sym_db.RegisterMessage(ControllerGetVolumeResponse.VolumeStatus) - -GetCapacityRequest = _reflection.GeneratedProtocolMessageType('GetCapacityRequest', (_message.Message,), { - - 'ParametersEntry' : _reflection.GeneratedProtocolMessageType('ParametersEntry', (_message.Message,), { - 'DESCRIPTOR' : _GETCAPACITYREQUEST_PARAMETERSENTRY, - '__module__' : 'controller.csi_general.csi_pb2' - # @@protoc_insertion_point(class_scope:csi.v1.GetCapacityRequest.ParametersEntry) - }) - , - 'DESCRIPTOR' : _GETCAPACITYREQUEST, - '__module__' : 'controller.csi_general.csi_pb2' - # @@protoc_insertion_point(class_scope:csi.v1.GetCapacityRequest) - }) -_sym_db.RegisterMessage(GetCapacityRequest) -_sym_db.RegisterMessage(GetCapacityRequest.ParametersEntry) - -GetCapacityResponse = _reflection.GeneratedProtocolMessageType('GetCapacityResponse', (_message.Message,), { - 'DESCRIPTOR' : _GETCAPACITYRESPONSE, - '__module__' : 'controller.csi_general.csi_pb2' - # @@protoc_insertion_point(class_scope:csi.v1.GetCapacityResponse) - }) -_sym_db.RegisterMessage(GetCapacityResponse) - -ControllerGetCapabilitiesRequest = _reflection.GeneratedProtocolMessageType('ControllerGetCapabilitiesRequest', (_message.Message,), { - 'DESCRIPTOR' : _CONTROLLERGETCAPABILITIESREQUEST, - '__module__' : 'controller.csi_general.csi_pb2' - # @@protoc_insertion_point(class_scope:csi.v1.ControllerGetCapabilitiesRequest) - }) -_sym_db.RegisterMessage(ControllerGetCapabilitiesRequest) - -ControllerGetCapabilitiesResponse = _reflection.GeneratedProtocolMessageType('ControllerGetCapabilitiesResponse', (_message.Message,), { - 'DESCRIPTOR' : _CONTROLLERGETCAPABILITIESRESPONSE, - '__module__' : 'controller.csi_general.csi_pb2' - # @@protoc_insertion_point(class_scope:csi.v1.ControllerGetCapabilitiesResponse) - }) -_sym_db.RegisterMessage(ControllerGetCapabilitiesResponse) - -ControllerServiceCapability = _reflection.GeneratedProtocolMessageType('ControllerServiceCapability', (_message.Message,), { - - 'RPC' : _reflection.GeneratedProtocolMessageType('RPC', (_message.Message,), { - 'DESCRIPTOR' : _CONTROLLERSERVICECAPABILITY_RPC, - '__module__' : 'controller.csi_general.csi_pb2' - # @@protoc_insertion_point(class_scope:csi.v1.ControllerServiceCapability.RPC) - }) - , - 'DESCRIPTOR' : _CONTROLLERSERVICECAPABILITY, - '__module__' : 'controller.csi_general.csi_pb2' - # @@protoc_insertion_point(class_scope:csi.v1.ControllerServiceCapability) - }) -_sym_db.RegisterMessage(ControllerServiceCapability) -_sym_db.RegisterMessage(ControllerServiceCapability.RPC) - -CreateSnapshotRequest = _reflection.GeneratedProtocolMessageType('CreateSnapshotRequest', (_message.Message,), { - - 'SecretsEntry' : _reflection.GeneratedProtocolMessageType('SecretsEntry', (_message.Message,), { - 'DESCRIPTOR' : _CREATESNAPSHOTREQUEST_SECRETSENTRY, - '__module__' : 'controller.csi_general.csi_pb2' - # @@protoc_insertion_point(class_scope:csi.v1.CreateSnapshotRequest.SecretsEntry) - }) - , - - 'ParametersEntry' : _reflection.GeneratedProtocolMessageType('ParametersEntry', (_message.Message,), { - 'DESCRIPTOR' : _CREATESNAPSHOTREQUEST_PARAMETERSENTRY, - '__module__' : 'controller.csi_general.csi_pb2' - # @@protoc_insertion_point(class_scope:csi.v1.CreateSnapshotRequest.ParametersEntry) - }) - , - 'DESCRIPTOR' : _CREATESNAPSHOTREQUEST, - '__module__' : 'controller.csi_general.csi_pb2' - # @@protoc_insertion_point(class_scope:csi.v1.CreateSnapshotRequest) - }) -_sym_db.RegisterMessage(CreateSnapshotRequest) -_sym_db.RegisterMessage(CreateSnapshotRequest.SecretsEntry) -_sym_db.RegisterMessage(CreateSnapshotRequest.ParametersEntry) - -CreateSnapshotResponse = _reflection.GeneratedProtocolMessageType('CreateSnapshotResponse', (_message.Message,), { - 'DESCRIPTOR' : _CREATESNAPSHOTRESPONSE, - '__module__' : 'controller.csi_general.csi_pb2' - # @@protoc_insertion_point(class_scope:csi.v1.CreateSnapshotResponse) - }) -_sym_db.RegisterMessage(CreateSnapshotResponse) - -Snapshot = _reflection.GeneratedProtocolMessageType('Snapshot', (_message.Message,), { - 'DESCRIPTOR' : _SNAPSHOT, - '__module__' : 'controller.csi_general.csi_pb2' - # @@protoc_insertion_point(class_scope:csi.v1.Snapshot) - }) -_sym_db.RegisterMessage(Snapshot) - -DeleteSnapshotRequest = _reflection.GeneratedProtocolMessageType('DeleteSnapshotRequest', (_message.Message,), { - - 'SecretsEntry' : _reflection.GeneratedProtocolMessageType('SecretsEntry', (_message.Message,), { - 'DESCRIPTOR' : _DELETESNAPSHOTREQUEST_SECRETSENTRY, - '__module__' : 'controller.csi_general.csi_pb2' - # @@protoc_insertion_point(class_scope:csi.v1.DeleteSnapshotRequest.SecretsEntry) - }) - , - 'DESCRIPTOR' : _DELETESNAPSHOTREQUEST, - '__module__' : 'controller.csi_general.csi_pb2' - # @@protoc_insertion_point(class_scope:csi.v1.DeleteSnapshotRequest) - }) -_sym_db.RegisterMessage(DeleteSnapshotRequest) -_sym_db.RegisterMessage(DeleteSnapshotRequest.SecretsEntry) - -DeleteSnapshotResponse = _reflection.GeneratedProtocolMessageType('DeleteSnapshotResponse', (_message.Message,), { - 'DESCRIPTOR' : _DELETESNAPSHOTRESPONSE, - '__module__' : 'controller.csi_general.csi_pb2' - # @@protoc_insertion_point(class_scope:csi.v1.DeleteSnapshotResponse) - }) -_sym_db.RegisterMessage(DeleteSnapshotResponse) - -ListSnapshotsRequest = _reflection.GeneratedProtocolMessageType('ListSnapshotsRequest', (_message.Message,), { - - 'SecretsEntry' : _reflection.GeneratedProtocolMessageType('SecretsEntry', (_message.Message,), { - 'DESCRIPTOR' : _LISTSNAPSHOTSREQUEST_SECRETSENTRY, - '__module__' : 'controller.csi_general.csi_pb2' - # @@protoc_insertion_point(class_scope:csi.v1.ListSnapshotsRequest.SecretsEntry) - }) - , - 'DESCRIPTOR' : _LISTSNAPSHOTSREQUEST, - '__module__' : 'controller.csi_general.csi_pb2' - # @@protoc_insertion_point(class_scope:csi.v1.ListSnapshotsRequest) - }) -_sym_db.RegisterMessage(ListSnapshotsRequest) -_sym_db.RegisterMessage(ListSnapshotsRequest.SecretsEntry) - -ListSnapshotsResponse = _reflection.GeneratedProtocolMessageType('ListSnapshotsResponse', (_message.Message,), { - - 'Entry' : _reflection.GeneratedProtocolMessageType('Entry', (_message.Message,), { - 'DESCRIPTOR' : _LISTSNAPSHOTSRESPONSE_ENTRY, - '__module__' : 'controller.csi_general.csi_pb2' - # @@protoc_insertion_point(class_scope:csi.v1.ListSnapshotsResponse.Entry) - }) - , - 'DESCRIPTOR' : _LISTSNAPSHOTSRESPONSE, - '__module__' : 'controller.csi_general.csi_pb2' - # @@protoc_insertion_point(class_scope:csi.v1.ListSnapshotsResponse) - }) -_sym_db.RegisterMessage(ListSnapshotsResponse) -_sym_db.RegisterMessage(ListSnapshotsResponse.Entry) - -ControllerExpandVolumeRequest = _reflection.GeneratedProtocolMessageType('ControllerExpandVolumeRequest', (_message.Message,), { - - 'SecretsEntry' : _reflection.GeneratedProtocolMessageType('SecretsEntry', (_message.Message,), { - 'DESCRIPTOR' : _CONTROLLEREXPANDVOLUMEREQUEST_SECRETSENTRY, - '__module__' : 'controller.csi_general.csi_pb2' - # @@protoc_insertion_point(class_scope:csi.v1.ControllerExpandVolumeRequest.SecretsEntry) - }) - , - 'DESCRIPTOR' : _CONTROLLEREXPANDVOLUMEREQUEST, - '__module__' : 'controller.csi_general.csi_pb2' - # @@protoc_insertion_point(class_scope:csi.v1.ControllerExpandVolumeRequest) - }) -_sym_db.RegisterMessage(ControllerExpandVolumeRequest) -_sym_db.RegisterMessage(ControllerExpandVolumeRequest.SecretsEntry) - -ControllerExpandVolumeResponse = _reflection.GeneratedProtocolMessageType('ControllerExpandVolumeResponse', (_message.Message,), { - 'DESCRIPTOR' : _CONTROLLEREXPANDVOLUMERESPONSE, - '__module__' : 'controller.csi_general.csi_pb2' - # @@protoc_insertion_point(class_scope:csi.v1.ControllerExpandVolumeResponse) - }) -_sym_db.RegisterMessage(ControllerExpandVolumeResponse) - -NodeStageVolumeRequest = _reflection.GeneratedProtocolMessageType('NodeStageVolumeRequest', (_message.Message,), { - - 'PublishContextEntry' : _reflection.GeneratedProtocolMessageType('PublishContextEntry', (_message.Message,), { - 'DESCRIPTOR' : _NODESTAGEVOLUMEREQUEST_PUBLISHCONTEXTENTRY, - '__module__' : 'controller.csi_general.csi_pb2' - # @@protoc_insertion_point(class_scope:csi.v1.NodeStageVolumeRequest.PublishContextEntry) - }) - , - - 'SecretsEntry' : _reflection.GeneratedProtocolMessageType('SecretsEntry', (_message.Message,), { - 'DESCRIPTOR' : _NODESTAGEVOLUMEREQUEST_SECRETSENTRY, - '__module__' : 'controller.csi_general.csi_pb2' - # @@protoc_insertion_point(class_scope:csi.v1.NodeStageVolumeRequest.SecretsEntry) - }) - , - - 'VolumeContextEntry' : _reflection.GeneratedProtocolMessageType('VolumeContextEntry', (_message.Message,), { - 'DESCRIPTOR' : _NODESTAGEVOLUMEREQUEST_VOLUMECONTEXTENTRY, - '__module__' : 'controller.csi_general.csi_pb2' - # @@protoc_insertion_point(class_scope:csi.v1.NodeStageVolumeRequest.VolumeContextEntry) - }) - , - 'DESCRIPTOR' : _NODESTAGEVOLUMEREQUEST, - '__module__' : 'controller.csi_general.csi_pb2' - # @@protoc_insertion_point(class_scope:csi.v1.NodeStageVolumeRequest) - }) -_sym_db.RegisterMessage(NodeStageVolumeRequest) -_sym_db.RegisterMessage(NodeStageVolumeRequest.PublishContextEntry) -_sym_db.RegisterMessage(NodeStageVolumeRequest.SecretsEntry) -_sym_db.RegisterMessage(NodeStageVolumeRequest.VolumeContextEntry) - -NodeStageVolumeResponse = _reflection.GeneratedProtocolMessageType('NodeStageVolumeResponse', (_message.Message,), { - 'DESCRIPTOR' : _NODESTAGEVOLUMERESPONSE, - '__module__' : 'controller.csi_general.csi_pb2' - # @@protoc_insertion_point(class_scope:csi.v1.NodeStageVolumeResponse) - }) -_sym_db.RegisterMessage(NodeStageVolumeResponse) - -NodeUnstageVolumeRequest = _reflection.GeneratedProtocolMessageType('NodeUnstageVolumeRequest', (_message.Message,), { - 'DESCRIPTOR' : _NODEUNSTAGEVOLUMEREQUEST, - '__module__' : 'controller.csi_general.csi_pb2' - # @@protoc_insertion_point(class_scope:csi.v1.NodeUnstageVolumeRequest) - }) -_sym_db.RegisterMessage(NodeUnstageVolumeRequest) - -NodeUnstageVolumeResponse = _reflection.GeneratedProtocolMessageType('NodeUnstageVolumeResponse', (_message.Message,), { - 'DESCRIPTOR' : _NODEUNSTAGEVOLUMERESPONSE, - '__module__' : 'controller.csi_general.csi_pb2' - # @@protoc_insertion_point(class_scope:csi.v1.NodeUnstageVolumeResponse) - }) -_sym_db.RegisterMessage(NodeUnstageVolumeResponse) - -NodePublishVolumeRequest = _reflection.GeneratedProtocolMessageType('NodePublishVolumeRequest', (_message.Message,), { - - 'PublishContextEntry' : _reflection.GeneratedProtocolMessageType('PublishContextEntry', (_message.Message,), { - 'DESCRIPTOR' : _NODEPUBLISHVOLUMEREQUEST_PUBLISHCONTEXTENTRY, - '__module__' : 'controller.csi_general.csi_pb2' - # @@protoc_insertion_point(class_scope:csi.v1.NodePublishVolumeRequest.PublishContextEntry) - }) - , - - 'SecretsEntry' : _reflection.GeneratedProtocolMessageType('SecretsEntry', (_message.Message,), { - 'DESCRIPTOR' : _NODEPUBLISHVOLUMEREQUEST_SECRETSENTRY, - '__module__' : 'controller.csi_general.csi_pb2' - # @@protoc_insertion_point(class_scope:csi.v1.NodePublishVolumeRequest.SecretsEntry) - }) - , - - 'VolumeContextEntry' : _reflection.GeneratedProtocolMessageType('VolumeContextEntry', (_message.Message,), { - 'DESCRIPTOR' : _NODEPUBLISHVOLUMEREQUEST_VOLUMECONTEXTENTRY, - '__module__' : 'controller.csi_general.csi_pb2' - # @@protoc_insertion_point(class_scope:csi.v1.NodePublishVolumeRequest.VolumeContextEntry) - }) - , - 'DESCRIPTOR' : _NODEPUBLISHVOLUMEREQUEST, - '__module__' : 'controller.csi_general.csi_pb2' - # @@protoc_insertion_point(class_scope:csi.v1.NodePublishVolumeRequest) - }) -_sym_db.RegisterMessage(NodePublishVolumeRequest) -_sym_db.RegisterMessage(NodePublishVolumeRequest.PublishContextEntry) -_sym_db.RegisterMessage(NodePublishVolumeRequest.SecretsEntry) -_sym_db.RegisterMessage(NodePublishVolumeRequest.VolumeContextEntry) - -NodePublishVolumeResponse = _reflection.GeneratedProtocolMessageType('NodePublishVolumeResponse', (_message.Message,), { - 'DESCRIPTOR' : _NODEPUBLISHVOLUMERESPONSE, - '__module__' : 'controller.csi_general.csi_pb2' - # @@protoc_insertion_point(class_scope:csi.v1.NodePublishVolumeResponse) - }) -_sym_db.RegisterMessage(NodePublishVolumeResponse) - -NodeUnpublishVolumeRequest = _reflection.GeneratedProtocolMessageType('NodeUnpublishVolumeRequest', (_message.Message,), { - 'DESCRIPTOR' : _NODEUNPUBLISHVOLUMEREQUEST, - '__module__' : 'controller.csi_general.csi_pb2' - # @@protoc_insertion_point(class_scope:csi.v1.NodeUnpublishVolumeRequest) - }) -_sym_db.RegisterMessage(NodeUnpublishVolumeRequest) - -NodeUnpublishVolumeResponse = _reflection.GeneratedProtocolMessageType('NodeUnpublishVolumeResponse', (_message.Message,), { - 'DESCRIPTOR' : _NODEUNPUBLISHVOLUMERESPONSE, - '__module__' : 'controller.csi_general.csi_pb2' - # @@protoc_insertion_point(class_scope:csi.v1.NodeUnpublishVolumeResponse) - }) -_sym_db.RegisterMessage(NodeUnpublishVolumeResponse) - -NodeGetVolumeStatsRequest = _reflection.GeneratedProtocolMessageType('NodeGetVolumeStatsRequest', (_message.Message,), { - 'DESCRIPTOR' : _NODEGETVOLUMESTATSREQUEST, - '__module__' : 'controller.csi_general.csi_pb2' - # @@protoc_insertion_point(class_scope:csi.v1.NodeGetVolumeStatsRequest) - }) -_sym_db.RegisterMessage(NodeGetVolumeStatsRequest) - -NodeGetVolumeStatsResponse = _reflection.GeneratedProtocolMessageType('NodeGetVolumeStatsResponse', (_message.Message,), { - 'DESCRIPTOR' : _NODEGETVOLUMESTATSRESPONSE, - '__module__' : 'controller.csi_general.csi_pb2' - # @@protoc_insertion_point(class_scope:csi.v1.NodeGetVolumeStatsResponse) - }) -_sym_db.RegisterMessage(NodeGetVolumeStatsResponse) - -VolumeUsage = _reflection.GeneratedProtocolMessageType('VolumeUsage', (_message.Message,), { - 'DESCRIPTOR' : _VOLUMEUSAGE, - '__module__' : 'controller.csi_general.csi_pb2' - # @@protoc_insertion_point(class_scope:csi.v1.VolumeUsage) - }) -_sym_db.RegisterMessage(VolumeUsage) - -VolumeCondition = _reflection.GeneratedProtocolMessageType('VolumeCondition', (_message.Message,), { - 'DESCRIPTOR' : _VOLUMECONDITION, - '__module__' : 'controller.csi_general.csi_pb2' - # @@protoc_insertion_point(class_scope:csi.v1.VolumeCondition) - }) -_sym_db.RegisterMessage(VolumeCondition) - -NodeGetCapabilitiesRequest = _reflection.GeneratedProtocolMessageType('NodeGetCapabilitiesRequest', (_message.Message,), { - 'DESCRIPTOR' : _NODEGETCAPABILITIESREQUEST, - '__module__' : 'controller.csi_general.csi_pb2' - # @@protoc_insertion_point(class_scope:csi.v1.NodeGetCapabilitiesRequest) - }) -_sym_db.RegisterMessage(NodeGetCapabilitiesRequest) - -NodeGetCapabilitiesResponse = _reflection.GeneratedProtocolMessageType('NodeGetCapabilitiesResponse', (_message.Message,), { - 'DESCRIPTOR' : _NODEGETCAPABILITIESRESPONSE, - '__module__' : 'controller.csi_general.csi_pb2' - # @@protoc_insertion_point(class_scope:csi.v1.NodeGetCapabilitiesResponse) - }) -_sym_db.RegisterMessage(NodeGetCapabilitiesResponse) - -NodeServiceCapability = _reflection.GeneratedProtocolMessageType('NodeServiceCapability', (_message.Message,), { - - 'RPC' : _reflection.GeneratedProtocolMessageType('RPC', (_message.Message,), { - 'DESCRIPTOR' : _NODESERVICECAPABILITY_RPC, - '__module__' : 'controller.csi_general.csi_pb2' - # @@protoc_insertion_point(class_scope:csi.v1.NodeServiceCapability.RPC) - }) - , - 'DESCRIPTOR' : _NODESERVICECAPABILITY, - '__module__' : 'controller.csi_general.csi_pb2' - # @@protoc_insertion_point(class_scope:csi.v1.NodeServiceCapability) - }) -_sym_db.RegisterMessage(NodeServiceCapability) -_sym_db.RegisterMessage(NodeServiceCapability.RPC) - -NodeGetInfoRequest = _reflection.GeneratedProtocolMessageType('NodeGetInfoRequest', (_message.Message,), { - 'DESCRIPTOR' : _NODEGETINFOREQUEST, - '__module__' : 'controller.csi_general.csi_pb2' - # @@protoc_insertion_point(class_scope:csi.v1.NodeGetInfoRequest) - }) -_sym_db.RegisterMessage(NodeGetInfoRequest) - -NodeGetInfoResponse = _reflection.GeneratedProtocolMessageType('NodeGetInfoResponse', (_message.Message,), { - 'DESCRIPTOR' : _NODEGETINFORESPONSE, - '__module__' : 'controller.csi_general.csi_pb2' - # @@protoc_insertion_point(class_scope:csi.v1.NodeGetInfoResponse) - }) -_sym_db.RegisterMessage(NodeGetInfoResponse) - -NodeExpandVolumeRequest = _reflection.GeneratedProtocolMessageType('NodeExpandVolumeRequest', (_message.Message,), { - - 'SecretsEntry' : _reflection.GeneratedProtocolMessageType('SecretsEntry', (_message.Message,), { - 'DESCRIPTOR' : _NODEEXPANDVOLUMEREQUEST_SECRETSENTRY, - '__module__' : 'controller.csi_general.csi_pb2' - # @@protoc_insertion_point(class_scope:csi.v1.NodeExpandVolumeRequest.SecretsEntry) - }) - , - 'DESCRIPTOR' : _NODEEXPANDVOLUMEREQUEST, - '__module__' : 'controller.csi_general.csi_pb2' - # @@protoc_insertion_point(class_scope:csi.v1.NodeExpandVolumeRequest) - }) -_sym_db.RegisterMessage(NodeExpandVolumeRequest) -_sym_db.RegisterMessage(NodeExpandVolumeRequest.SecretsEntry) - -NodeExpandVolumeResponse = _reflection.GeneratedProtocolMessageType('NodeExpandVolumeResponse', (_message.Message,), { - 'DESCRIPTOR' : _NODEEXPANDVOLUMERESPONSE, - '__module__' : 'controller.csi_general.csi_pb2' - # @@protoc_insertion_point(class_scope:csi.v1.NodeExpandVolumeResponse) - }) -_sym_db.RegisterMessage(NodeExpandVolumeResponse) - -google_dot_protobuf_dot_descriptor__pb2.EnumOptions.RegisterExtension(alpha_enum) -google_dot_protobuf_dot_descriptor__pb2.EnumValueOptions.RegisterExtension(alpha_enum_value) -google_dot_protobuf_dot_descriptor__pb2.FieldOptions.RegisterExtension(csi_secret) -google_dot_protobuf_dot_descriptor__pb2.FieldOptions.RegisterExtension(alpha_field) -google_dot_protobuf_dot_descriptor__pb2.MessageOptions.RegisterExtension(alpha_message) -google_dot_protobuf_dot_descriptor__pb2.MethodOptions.RegisterExtension(alpha_method) -google_dot_protobuf_dot_descriptor__pb2.ServiceOptions.RegisterExtension(alpha_service) - -DESCRIPTOR._options = None -_GETPLUGININFORESPONSE_MANIFESTENTRY._options = None -_CREATEVOLUMEREQUEST_PARAMETERSENTRY._options = None -_CREATEVOLUMEREQUEST_SECRETSENTRY._options = None -_CREATEVOLUMEREQUEST.fields_by_name['secrets']._options = None -_VOLUMECAPABILITY_MOUNTVOLUME.fields_by_name['volume_mount_group']._options = None -_VOLUMECAPABILITY_ACCESSMODE_MODE.values_by_name["SINGLE_NODE_SINGLE_WRITER"]._options = None -_VOLUMECAPABILITY_ACCESSMODE_MODE.values_by_name["SINGLE_NODE_MULTI_WRITER"]._options = None -_VOLUME_VOLUMECONTEXTENTRY._options = None -_TOPOLOGY_SEGMENTSENTRY._options = None -_DELETEVOLUMEREQUEST_SECRETSENTRY._options = None -_DELETEVOLUMEREQUEST.fields_by_name['secrets']._options = None -_CONTROLLERPUBLISHVOLUMEREQUEST_SECRETSENTRY._options = None -_CONTROLLERPUBLISHVOLUMEREQUEST_VOLUMECONTEXTENTRY._options = None -_CONTROLLERPUBLISHVOLUMEREQUEST.fields_by_name['secrets']._options = None -_CONTROLLERPUBLISHVOLUMERESPONSE_PUBLISHCONTEXTENTRY._options = None -_CONTROLLERUNPUBLISHVOLUMEREQUEST_SECRETSENTRY._options = None -_CONTROLLERUNPUBLISHVOLUMEREQUEST.fields_by_name['secrets']._options = None -_VALIDATEVOLUMECAPABILITIESREQUEST_VOLUMECONTEXTENTRY._options = None -_VALIDATEVOLUMECAPABILITIESREQUEST_PARAMETERSENTRY._options = None -_VALIDATEVOLUMECAPABILITIESREQUEST_SECRETSENTRY._options = None -_VALIDATEVOLUMECAPABILITIESREQUEST.fields_by_name['secrets']._options = None -_VALIDATEVOLUMECAPABILITIESRESPONSE_CONFIRMED_VOLUMECONTEXTENTRY._options = None -_VALIDATEVOLUMECAPABILITIESRESPONSE_CONFIRMED_PARAMETERSENTRY._options = None -_LISTVOLUMESRESPONSE_VOLUMESTATUS.fields_by_name['volume_condition']._options = None -_CONTROLLERGETVOLUMEREQUEST._options = None -_CONTROLLERGETVOLUMERESPONSE._options = None -_GETCAPACITYREQUEST_PARAMETERSENTRY._options = None -_GETCAPACITYRESPONSE.fields_by_name['maximum_volume_size']._options = None -_GETCAPACITYRESPONSE.fields_by_name['minimum_volume_size']._options = None -_CONTROLLERSERVICECAPABILITY_RPC_TYPE.values_by_name["VOLUME_CONDITION"]._options = None -_CONTROLLERSERVICECAPABILITY_RPC_TYPE.values_by_name["GET_VOLUME"]._options = None -_CONTROLLERSERVICECAPABILITY_RPC_TYPE.values_by_name["SINGLE_NODE_MULTI_WRITER"]._options = None -_CREATESNAPSHOTREQUEST_SECRETSENTRY._options = None -_CREATESNAPSHOTREQUEST_PARAMETERSENTRY._options = None -_CREATESNAPSHOTREQUEST.fields_by_name['secrets']._options = None -_DELETESNAPSHOTREQUEST_SECRETSENTRY._options = None -_DELETESNAPSHOTREQUEST.fields_by_name['secrets']._options = None -_LISTSNAPSHOTSREQUEST_SECRETSENTRY._options = None -_LISTSNAPSHOTSREQUEST.fields_by_name['secrets']._options = None -_CONTROLLEREXPANDVOLUMEREQUEST_SECRETSENTRY._options = None -_CONTROLLEREXPANDVOLUMEREQUEST.fields_by_name['secrets']._options = None -_NODESTAGEVOLUMEREQUEST_PUBLISHCONTEXTENTRY._options = None -_NODESTAGEVOLUMEREQUEST_SECRETSENTRY._options = None -_NODESTAGEVOLUMEREQUEST_VOLUMECONTEXTENTRY._options = None -_NODESTAGEVOLUMEREQUEST.fields_by_name['secrets']._options = None -_NODEPUBLISHVOLUMEREQUEST_PUBLISHCONTEXTENTRY._options = None -_NODEPUBLISHVOLUMEREQUEST_SECRETSENTRY._options = None -_NODEPUBLISHVOLUMEREQUEST_VOLUMECONTEXTENTRY._options = None -_NODEPUBLISHVOLUMEREQUEST.fields_by_name['secrets']._options = None -_NODEGETVOLUMESTATSRESPONSE.fields_by_name['volume_condition']._options = None -_VOLUMECONDITION._options = None -_NODESERVICECAPABILITY_RPC_TYPE.values_by_name["VOLUME_CONDITION"]._options = None -_NODESERVICECAPABILITY_RPC_TYPE.values_by_name["SINGLE_NODE_MULTI_WRITER"]._options = None -_NODESERVICECAPABILITY_RPC_TYPE.values_by_name["VOLUME_MOUNT_GROUP"]._options = None -_NODEEXPANDVOLUMEREQUEST_SECRETSENTRY._options = None -_NODEEXPANDVOLUMEREQUEST.fields_by_name['secrets']._options = None - -_IDENTITY = _descriptor.ServiceDescriptor( - name='Identity', - full_name='csi.v1.Identity', - file=DESCRIPTOR, - index=0, - serialized_options=None, - create_key=_descriptor._internal_create_key, - serialized_start=10705, - serialized_end=10955, - methods=[ - _descriptor.MethodDescriptor( - name='GetPluginInfo', - full_name='csi.v1.Identity.GetPluginInfo', - index=0, - containing_service=None, - input_type=_GETPLUGININFOREQUEST, - output_type=_GETPLUGININFORESPONSE, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name='GetPluginCapabilities', - full_name='csi.v1.Identity.GetPluginCapabilities', - index=1, - containing_service=None, - input_type=_GETPLUGINCAPABILITIESREQUEST, - output_type=_GETPLUGINCAPABILITIESRESPONSE, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name='Probe', - full_name='csi.v1.Identity.Probe', - index=2, - containing_service=None, - input_type=_PROBEREQUEST, - output_type=_PROBERESPONSE, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), -]) -_sym_db.RegisterServiceDescriptor(_IDENTITY) - -DESCRIPTOR.services_by_name['Identity'] = _IDENTITY - - -_CONTROLLER = _descriptor.ServiceDescriptor( - name='Controller', - full_name='csi.v1.Controller', - file=DESCRIPTOR, - index=1, - serialized_options=None, - create_key=_descriptor._internal_create_key, - serialized_start=10958, - serialized_end=12187, - methods=[ - _descriptor.MethodDescriptor( - name='CreateVolume', - full_name='csi.v1.Controller.CreateVolume', - index=0, - containing_service=None, - input_type=_CREATEVOLUMEREQUEST, - output_type=_CREATEVOLUMERESPONSE, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name='DeleteVolume', - full_name='csi.v1.Controller.DeleteVolume', - index=1, - containing_service=None, - input_type=_DELETEVOLUMEREQUEST, - output_type=_DELETEVOLUMERESPONSE, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name='ControllerPublishVolume', - full_name='csi.v1.Controller.ControllerPublishVolume', - index=2, - containing_service=None, - input_type=_CONTROLLERPUBLISHVOLUMEREQUEST, - output_type=_CONTROLLERPUBLISHVOLUMERESPONSE, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name='ControllerUnpublishVolume', - full_name='csi.v1.Controller.ControllerUnpublishVolume', - index=3, - containing_service=None, - input_type=_CONTROLLERUNPUBLISHVOLUMEREQUEST, - output_type=_CONTROLLERUNPUBLISHVOLUMERESPONSE, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name='ValidateVolumeCapabilities', - full_name='csi.v1.Controller.ValidateVolumeCapabilities', - index=4, - containing_service=None, - input_type=_VALIDATEVOLUMECAPABILITIESREQUEST, - output_type=_VALIDATEVOLUMECAPABILITIESRESPONSE, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name='ListVolumes', - full_name='csi.v1.Controller.ListVolumes', - index=5, - containing_service=None, - input_type=_LISTVOLUMESREQUEST, - output_type=_LISTVOLUMESRESPONSE, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name='GetCapacity', - full_name='csi.v1.Controller.GetCapacity', - index=6, - containing_service=None, - input_type=_GETCAPACITYREQUEST, - output_type=_GETCAPACITYRESPONSE, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name='ControllerGetCapabilities', - full_name='csi.v1.Controller.ControllerGetCapabilities', - index=7, - containing_service=None, - input_type=_CONTROLLERGETCAPABILITIESREQUEST, - output_type=_CONTROLLERGETCAPABILITIESRESPONSE, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name='CreateSnapshot', - full_name='csi.v1.Controller.CreateSnapshot', - index=8, - containing_service=None, - input_type=_CREATESNAPSHOTREQUEST, - output_type=_CREATESNAPSHOTRESPONSE, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name='DeleteSnapshot', - full_name='csi.v1.Controller.DeleteSnapshot', - index=9, - containing_service=None, - input_type=_DELETESNAPSHOTREQUEST, - output_type=_DELETESNAPSHOTRESPONSE, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name='ListSnapshots', - full_name='csi.v1.Controller.ListSnapshots', - index=10, - containing_service=None, - input_type=_LISTSNAPSHOTSREQUEST, - output_type=_LISTSNAPSHOTSRESPONSE, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name='ControllerExpandVolume', - full_name='csi.v1.Controller.ControllerExpandVolume', - index=11, - containing_service=None, - input_type=_CONTROLLEREXPANDVOLUMEREQUEST, - output_type=_CONTROLLEREXPANDVOLUMERESPONSE, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name='ControllerGetVolume', - full_name='csi.v1.Controller.ControllerGetVolume', - index=12, - containing_service=None, - input_type=_CONTROLLERGETVOLUMEREQUEST, - output_type=_CONTROLLERGETVOLUMERESPONSE, - serialized_options=b'\240B\001', - create_key=_descriptor._internal_create_key, - ), -]) -_sym_db.RegisterServiceDescriptor(_CONTROLLER) - -DESCRIPTOR.services_by_name['Controller'] = _CONTROLLER - - -_NODE = _descriptor.ServiceDescriptor( - name='Node', - full_name='csi.v1.Node', - file=DESCRIPTOR, - index=2, - serialized_options=None, - create_key=_descriptor._internal_create_key, - serialized_start=12190, - serialized_end=12920, - methods=[ - _descriptor.MethodDescriptor( - name='NodeStageVolume', - full_name='csi.v1.Node.NodeStageVolume', - index=0, - containing_service=None, - input_type=_NODESTAGEVOLUMEREQUEST, - output_type=_NODESTAGEVOLUMERESPONSE, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name='NodeUnstageVolume', - full_name='csi.v1.Node.NodeUnstageVolume', - index=1, - containing_service=None, - input_type=_NODEUNSTAGEVOLUMEREQUEST, - output_type=_NODEUNSTAGEVOLUMERESPONSE, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name='NodePublishVolume', - full_name='csi.v1.Node.NodePublishVolume', - index=2, - containing_service=None, - input_type=_NODEPUBLISHVOLUMEREQUEST, - output_type=_NODEPUBLISHVOLUMERESPONSE, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name='NodeUnpublishVolume', - full_name='csi.v1.Node.NodeUnpublishVolume', - index=3, - containing_service=None, - input_type=_NODEUNPUBLISHVOLUMEREQUEST, - output_type=_NODEUNPUBLISHVOLUMERESPONSE, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name='NodeGetVolumeStats', - full_name='csi.v1.Node.NodeGetVolumeStats', - index=4, - containing_service=None, - input_type=_NODEGETVOLUMESTATSREQUEST, - output_type=_NODEGETVOLUMESTATSRESPONSE, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name='NodeExpandVolume', - full_name='csi.v1.Node.NodeExpandVolume', - index=5, - containing_service=None, - input_type=_NODEEXPANDVOLUMEREQUEST, - output_type=_NODEEXPANDVOLUMERESPONSE, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name='NodeGetCapabilities', - full_name='csi.v1.Node.NodeGetCapabilities', - index=6, - containing_service=None, - input_type=_NODEGETCAPABILITIESREQUEST, - output_type=_NODEGETCAPABILITIESRESPONSE, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name='NodeGetInfo', - full_name='csi.v1.Node.NodeGetInfo', - index=7, - containing_service=None, - input_type=_NODEGETINFOREQUEST, - output_type=_NODEGETINFORESPONSE, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), -]) -_sym_db.RegisterServiceDescriptor(_NODE) - -DESCRIPTOR.services_by_name['Node'] = _NODE - -# @@protoc_insertion_point(module_scope) diff --git a/controller/csi_general/csi_pb2_grpc.py b/controller/csi_general/csi_pb2_grpc.py deleted file mode 100644 index 9f4de3f67..000000000 --- a/controller/csi_general/csi_pb2_grpc.py +++ /dev/null @@ -1,881 +0,0 @@ -# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! -"""Client and server classes corresponding to protobuf-defined services.""" -import grpc - -from controller.csi_general import csi_pb2 as controller_dot_csi__general_dot_csi__pb2 - - -class IdentityStub(object): - """Missing associated documentation comment in .proto file.""" - - def __init__(self, channel): - """Constructor. - - Args: - channel: A grpc.Channel. - """ - self.GetPluginInfo = channel.unary_unary( - '/csi.v1.Identity/GetPluginInfo', - request_serializer=controller_dot_csi__general_dot_csi__pb2.GetPluginInfoRequest.SerializeToString, - response_deserializer=controller_dot_csi__general_dot_csi__pb2.GetPluginInfoResponse.FromString, - ) - self.GetPluginCapabilities = channel.unary_unary( - '/csi.v1.Identity/GetPluginCapabilities', - request_serializer=controller_dot_csi__general_dot_csi__pb2.GetPluginCapabilitiesRequest.SerializeToString, - response_deserializer=controller_dot_csi__general_dot_csi__pb2.GetPluginCapabilitiesResponse.FromString, - ) - self.Probe = channel.unary_unary( - '/csi.v1.Identity/Probe', - request_serializer=controller_dot_csi__general_dot_csi__pb2.ProbeRequest.SerializeToString, - response_deserializer=controller_dot_csi__general_dot_csi__pb2.ProbeResponse.FromString, - ) - - -class IdentityServicer(object): - """Missing associated documentation comment in .proto file.""" - - def GetPluginInfo(self, request, context): - """Missing associated documentation comment in .proto file.""" - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details('Method not implemented!') - raise NotImplementedError('Method not implemented!') - - def GetPluginCapabilities(self, request, context): - """Missing associated documentation comment in .proto file.""" - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details('Method not implemented!') - raise NotImplementedError('Method not implemented!') - - def Probe(self, request, context): - """Missing associated documentation comment in .proto file.""" - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details('Method not implemented!') - raise NotImplementedError('Method not implemented!') - - -def add_IdentityServicer_to_server(servicer, server): - rpc_method_handlers = { - 'GetPluginInfo': grpc.unary_unary_rpc_method_handler( - servicer.GetPluginInfo, - request_deserializer=controller_dot_csi__general_dot_csi__pb2.GetPluginInfoRequest.FromString, - response_serializer=controller_dot_csi__general_dot_csi__pb2.GetPluginInfoResponse.SerializeToString, - ), - 'GetPluginCapabilities': grpc.unary_unary_rpc_method_handler( - servicer.GetPluginCapabilities, - request_deserializer=controller_dot_csi__general_dot_csi__pb2.GetPluginCapabilitiesRequest.FromString, - response_serializer=controller_dot_csi__general_dot_csi__pb2.GetPluginCapabilitiesResponse.SerializeToString, - ), - 'Probe': grpc.unary_unary_rpc_method_handler( - servicer.Probe, - request_deserializer=controller_dot_csi__general_dot_csi__pb2.ProbeRequest.FromString, - response_serializer=controller_dot_csi__general_dot_csi__pb2.ProbeResponse.SerializeToString, - ), - } - generic_handler = grpc.method_handlers_generic_handler( - 'csi.v1.Identity', rpc_method_handlers) - server.add_generic_rpc_handlers((generic_handler,)) - - - # This class is part of an EXPERIMENTAL API. -class Identity(object): - """Missing associated documentation comment in .proto file.""" - - @staticmethod - def GetPluginInfo(request, - target, - options=(), - channel_credentials=None, - call_credentials=None, - insecure=False, - compression=None, - wait_for_ready=None, - timeout=None, - metadata=None): - return grpc.experimental.unary_unary(request, target, '/csi.v1.Identity/GetPluginInfo', - controller_dot_csi__general_dot_csi__pb2.GetPluginInfoRequest.SerializeToString, - controller_dot_csi__general_dot_csi__pb2.GetPluginInfoResponse.FromString, - options, channel_credentials, - insecure, call_credentials, compression, wait_for_ready, timeout, metadata) - - @staticmethod - def GetPluginCapabilities(request, - target, - options=(), - channel_credentials=None, - call_credentials=None, - insecure=False, - compression=None, - wait_for_ready=None, - timeout=None, - metadata=None): - return grpc.experimental.unary_unary(request, target, '/csi.v1.Identity/GetPluginCapabilities', - controller_dot_csi__general_dot_csi__pb2.GetPluginCapabilitiesRequest.SerializeToString, - controller_dot_csi__general_dot_csi__pb2.GetPluginCapabilitiesResponse.FromString, - options, channel_credentials, - insecure, call_credentials, compression, wait_for_ready, timeout, metadata) - - @staticmethod - def Probe(request, - target, - options=(), - channel_credentials=None, - call_credentials=None, - insecure=False, - compression=None, - wait_for_ready=None, - timeout=None, - metadata=None): - return grpc.experimental.unary_unary(request, target, '/csi.v1.Identity/Probe', - controller_dot_csi__general_dot_csi__pb2.ProbeRequest.SerializeToString, - controller_dot_csi__general_dot_csi__pb2.ProbeResponse.FromString, - options, channel_credentials, - insecure, call_credentials, compression, wait_for_ready, timeout, metadata) - - -class ControllerStub(object): - """Missing associated documentation comment in .proto file.""" - - def __init__(self, channel): - """Constructor. - - Args: - channel: A grpc.Channel. - """ - self.CreateVolume = channel.unary_unary( - '/csi.v1.Controller/CreateVolume', - request_serializer=controller_dot_csi__general_dot_csi__pb2.CreateVolumeRequest.SerializeToString, - response_deserializer=controller_dot_csi__general_dot_csi__pb2.CreateVolumeResponse.FromString, - ) - self.DeleteVolume = channel.unary_unary( - '/csi.v1.Controller/DeleteVolume', - request_serializer=controller_dot_csi__general_dot_csi__pb2.DeleteVolumeRequest.SerializeToString, - response_deserializer=controller_dot_csi__general_dot_csi__pb2.DeleteVolumeResponse.FromString, - ) - self.ControllerPublishVolume = channel.unary_unary( - '/csi.v1.Controller/ControllerPublishVolume', - request_serializer=controller_dot_csi__general_dot_csi__pb2.ControllerPublishVolumeRequest.SerializeToString, - response_deserializer=controller_dot_csi__general_dot_csi__pb2.ControllerPublishVolumeResponse.FromString, - ) - self.ControllerUnpublishVolume = channel.unary_unary( - '/csi.v1.Controller/ControllerUnpublishVolume', - request_serializer=controller_dot_csi__general_dot_csi__pb2.ControllerUnpublishVolumeRequest.SerializeToString, - response_deserializer=controller_dot_csi__general_dot_csi__pb2.ControllerUnpublishVolumeResponse.FromString, - ) - self.ValidateVolumeCapabilities = channel.unary_unary( - '/csi.v1.Controller/ValidateVolumeCapabilities', - request_serializer=controller_dot_csi__general_dot_csi__pb2.ValidateVolumeCapabilitiesRequest.SerializeToString, - response_deserializer=controller_dot_csi__general_dot_csi__pb2.ValidateVolumeCapabilitiesResponse.FromString, - ) - self.ListVolumes = channel.unary_unary( - '/csi.v1.Controller/ListVolumes', - request_serializer=controller_dot_csi__general_dot_csi__pb2.ListVolumesRequest.SerializeToString, - response_deserializer=controller_dot_csi__general_dot_csi__pb2.ListVolumesResponse.FromString, - ) - self.GetCapacity = channel.unary_unary( - '/csi.v1.Controller/GetCapacity', - request_serializer=controller_dot_csi__general_dot_csi__pb2.GetCapacityRequest.SerializeToString, - response_deserializer=controller_dot_csi__general_dot_csi__pb2.GetCapacityResponse.FromString, - ) - self.ControllerGetCapabilities = channel.unary_unary( - '/csi.v1.Controller/ControllerGetCapabilities', - request_serializer=controller_dot_csi__general_dot_csi__pb2.ControllerGetCapabilitiesRequest.SerializeToString, - response_deserializer=controller_dot_csi__general_dot_csi__pb2.ControllerGetCapabilitiesResponse.FromString, - ) - self.CreateSnapshot = channel.unary_unary( - '/csi.v1.Controller/CreateSnapshot', - request_serializer=controller_dot_csi__general_dot_csi__pb2.CreateSnapshotRequest.SerializeToString, - response_deserializer=controller_dot_csi__general_dot_csi__pb2.CreateSnapshotResponse.FromString, - ) - self.DeleteSnapshot = channel.unary_unary( - '/csi.v1.Controller/DeleteSnapshot', - request_serializer=controller_dot_csi__general_dot_csi__pb2.DeleteSnapshotRequest.SerializeToString, - response_deserializer=controller_dot_csi__general_dot_csi__pb2.DeleteSnapshotResponse.FromString, - ) - self.ListSnapshots = channel.unary_unary( - '/csi.v1.Controller/ListSnapshots', - request_serializer=controller_dot_csi__general_dot_csi__pb2.ListSnapshotsRequest.SerializeToString, - response_deserializer=controller_dot_csi__general_dot_csi__pb2.ListSnapshotsResponse.FromString, - ) - self.ControllerExpandVolume = channel.unary_unary( - '/csi.v1.Controller/ControllerExpandVolume', - request_serializer=controller_dot_csi__general_dot_csi__pb2.ControllerExpandVolumeRequest.SerializeToString, - response_deserializer=controller_dot_csi__general_dot_csi__pb2.ControllerExpandVolumeResponse.FromString, - ) - self.ControllerGetVolume = channel.unary_unary( - '/csi.v1.Controller/ControllerGetVolume', - request_serializer=controller_dot_csi__general_dot_csi__pb2.ControllerGetVolumeRequest.SerializeToString, - response_deserializer=controller_dot_csi__general_dot_csi__pb2.ControllerGetVolumeResponse.FromString, - ) - - -class ControllerServicer(object): - """Missing associated documentation comment in .proto file.""" - - def CreateVolume(self, request, context): - """Missing associated documentation comment in .proto file.""" - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details('Method not implemented!') - raise NotImplementedError('Method not implemented!') - - def DeleteVolume(self, request, context): - """Missing associated documentation comment in .proto file.""" - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details('Method not implemented!') - raise NotImplementedError('Method not implemented!') - - def ControllerPublishVolume(self, request, context): - """Missing associated documentation comment in .proto file.""" - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details('Method not implemented!') - raise NotImplementedError('Method not implemented!') - - def ControllerUnpublishVolume(self, request, context): - """Missing associated documentation comment in .proto file.""" - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details('Method not implemented!') - raise NotImplementedError('Method not implemented!') - - def ValidateVolumeCapabilities(self, request, context): - """Missing associated documentation comment in .proto file.""" - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details('Method not implemented!') - raise NotImplementedError('Method not implemented!') - - def ListVolumes(self, request, context): - """Missing associated documentation comment in .proto file.""" - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details('Method not implemented!') - raise NotImplementedError('Method not implemented!') - - def GetCapacity(self, request, context): - """Missing associated documentation comment in .proto file.""" - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details('Method not implemented!') - raise NotImplementedError('Method not implemented!') - - def ControllerGetCapabilities(self, request, context): - """Missing associated documentation comment in .proto file.""" - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details('Method not implemented!') - raise NotImplementedError('Method not implemented!') - - def CreateSnapshot(self, request, context): - """Missing associated documentation comment in .proto file.""" - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details('Method not implemented!') - raise NotImplementedError('Method not implemented!') - - def DeleteSnapshot(self, request, context): - """Missing associated documentation comment in .proto file.""" - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details('Method not implemented!') - raise NotImplementedError('Method not implemented!') - - def ListSnapshots(self, request, context): - """Missing associated documentation comment in .proto file.""" - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details('Method not implemented!') - raise NotImplementedError('Method not implemented!') - - def ControllerExpandVolume(self, request, context): - """Missing associated documentation comment in .proto file.""" - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details('Method not implemented!') - raise NotImplementedError('Method not implemented!') - - def ControllerGetVolume(self, request, context): - """Missing associated documentation comment in .proto file.""" - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details('Method not implemented!') - raise NotImplementedError('Method not implemented!') - - -def add_ControllerServicer_to_server(servicer, server): - rpc_method_handlers = { - 'CreateVolume': grpc.unary_unary_rpc_method_handler( - servicer.CreateVolume, - request_deserializer=controller_dot_csi__general_dot_csi__pb2.CreateVolumeRequest.FromString, - response_serializer=controller_dot_csi__general_dot_csi__pb2.CreateVolumeResponse.SerializeToString, - ), - 'DeleteVolume': grpc.unary_unary_rpc_method_handler( - servicer.DeleteVolume, - request_deserializer=controller_dot_csi__general_dot_csi__pb2.DeleteVolumeRequest.FromString, - response_serializer=controller_dot_csi__general_dot_csi__pb2.DeleteVolumeResponse.SerializeToString, - ), - 'ControllerPublishVolume': grpc.unary_unary_rpc_method_handler( - servicer.ControllerPublishVolume, - request_deserializer=controller_dot_csi__general_dot_csi__pb2.ControllerPublishVolumeRequest.FromString, - response_serializer=controller_dot_csi__general_dot_csi__pb2.ControllerPublishVolumeResponse.SerializeToString, - ), - 'ControllerUnpublishVolume': grpc.unary_unary_rpc_method_handler( - servicer.ControllerUnpublishVolume, - request_deserializer=controller_dot_csi__general_dot_csi__pb2.ControllerUnpublishVolumeRequest.FromString, - response_serializer=controller_dot_csi__general_dot_csi__pb2.ControllerUnpublishVolumeResponse.SerializeToString, - ), - 'ValidateVolumeCapabilities': grpc.unary_unary_rpc_method_handler( - servicer.ValidateVolumeCapabilities, - request_deserializer=controller_dot_csi__general_dot_csi__pb2.ValidateVolumeCapabilitiesRequest.FromString, - response_serializer=controller_dot_csi__general_dot_csi__pb2.ValidateVolumeCapabilitiesResponse.SerializeToString, - ), - 'ListVolumes': grpc.unary_unary_rpc_method_handler( - servicer.ListVolumes, - request_deserializer=controller_dot_csi__general_dot_csi__pb2.ListVolumesRequest.FromString, - response_serializer=controller_dot_csi__general_dot_csi__pb2.ListVolumesResponse.SerializeToString, - ), - 'GetCapacity': grpc.unary_unary_rpc_method_handler( - servicer.GetCapacity, - request_deserializer=controller_dot_csi__general_dot_csi__pb2.GetCapacityRequest.FromString, - response_serializer=controller_dot_csi__general_dot_csi__pb2.GetCapacityResponse.SerializeToString, - ), - 'ControllerGetCapabilities': grpc.unary_unary_rpc_method_handler( - servicer.ControllerGetCapabilities, - request_deserializer=controller_dot_csi__general_dot_csi__pb2.ControllerGetCapabilitiesRequest.FromString, - response_serializer=controller_dot_csi__general_dot_csi__pb2.ControllerGetCapabilitiesResponse.SerializeToString, - ), - 'CreateSnapshot': grpc.unary_unary_rpc_method_handler( - servicer.CreateSnapshot, - request_deserializer=controller_dot_csi__general_dot_csi__pb2.CreateSnapshotRequest.FromString, - response_serializer=controller_dot_csi__general_dot_csi__pb2.CreateSnapshotResponse.SerializeToString, - ), - 'DeleteSnapshot': grpc.unary_unary_rpc_method_handler( - servicer.DeleteSnapshot, - request_deserializer=controller_dot_csi__general_dot_csi__pb2.DeleteSnapshotRequest.FromString, - response_serializer=controller_dot_csi__general_dot_csi__pb2.DeleteSnapshotResponse.SerializeToString, - ), - 'ListSnapshots': grpc.unary_unary_rpc_method_handler( - servicer.ListSnapshots, - request_deserializer=controller_dot_csi__general_dot_csi__pb2.ListSnapshotsRequest.FromString, - response_serializer=controller_dot_csi__general_dot_csi__pb2.ListSnapshotsResponse.SerializeToString, - ), - 'ControllerExpandVolume': grpc.unary_unary_rpc_method_handler( - servicer.ControllerExpandVolume, - request_deserializer=controller_dot_csi__general_dot_csi__pb2.ControllerExpandVolumeRequest.FromString, - response_serializer=controller_dot_csi__general_dot_csi__pb2.ControllerExpandVolumeResponse.SerializeToString, - ), - 'ControllerGetVolume': grpc.unary_unary_rpc_method_handler( - servicer.ControllerGetVolume, - request_deserializer=controller_dot_csi__general_dot_csi__pb2.ControllerGetVolumeRequest.FromString, - response_serializer=controller_dot_csi__general_dot_csi__pb2.ControllerGetVolumeResponse.SerializeToString, - ), - } - generic_handler = grpc.method_handlers_generic_handler( - 'csi.v1.Controller', rpc_method_handlers) - server.add_generic_rpc_handlers((generic_handler,)) - - - # This class is part of an EXPERIMENTAL API. -class Controller(object): - """Missing associated documentation comment in .proto file.""" - - @staticmethod - def CreateVolume(request, - target, - options=(), - channel_credentials=None, - call_credentials=None, - insecure=False, - compression=None, - wait_for_ready=None, - timeout=None, - metadata=None): - return grpc.experimental.unary_unary(request, target, '/csi.v1.Controller/CreateVolume', - controller_dot_csi__general_dot_csi__pb2.CreateVolumeRequest.SerializeToString, - controller_dot_csi__general_dot_csi__pb2.CreateVolumeResponse.FromString, - options, channel_credentials, - insecure, call_credentials, compression, wait_for_ready, timeout, metadata) - - @staticmethod - def DeleteVolume(request, - target, - options=(), - channel_credentials=None, - call_credentials=None, - insecure=False, - compression=None, - wait_for_ready=None, - timeout=None, - metadata=None): - return grpc.experimental.unary_unary(request, target, '/csi.v1.Controller/DeleteVolume', - controller_dot_csi__general_dot_csi__pb2.DeleteVolumeRequest.SerializeToString, - controller_dot_csi__general_dot_csi__pb2.DeleteVolumeResponse.FromString, - options, channel_credentials, - insecure, call_credentials, compression, wait_for_ready, timeout, metadata) - - @staticmethod - def ControllerPublishVolume(request, - target, - options=(), - channel_credentials=None, - call_credentials=None, - insecure=False, - compression=None, - wait_for_ready=None, - timeout=None, - metadata=None): - return grpc.experimental.unary_unary(request, target, '/csi.v1.Controller/ControllerPublishVolume', - controller_dot_csi__general_dot_csi__pb2.ControllerPublishVolumeRequest.SerializeToString, - controller_dot_csi__general_dot_csi__pb2.ControllerPublishVolumeResponse.FromString, - options, channel_credentials, - insecure, call_credentials, compression, wait_for_ready, timeout, metadata) - - @staticmethod - def ControllerUnpublishVolume(request, - target, - options=(), - channel_credentials=None, - call_credentials=None, - insecure=False, - compression=None, - wait_for_ready=None, - timeout=None, - metadata=None): - return grpc.experimental.unary_unary(request, target, '/csi.v1.Controller/ControllerUnpublishVolume', - controller_dot_csi__general_dot_csi__pb2.ControllerUnpublishVolumeRequest.SerializeToString, - controller_dot_csi__general_dot_csi__pb2.ControllerUnpublishVolumeResponse.FromString, - options, channel_credentials, - insecure, call_credentials, compression, wait_for_ready, timeout, metadata) - - @staticmethod - def ValidateVolumeCapabilities(request, - target, - options=(), - channel_credentials=None, - call_credentials=None, - insecure=False, - compression=None, - wait_for_ready=None, - timeout=None, - metadata=None): - return grpc.experimental.unary_unary(request, target, '/csi.v1.Controller/ValidateVolumeCapabilities', - controller_dot_csi__general_dot_csi__pb2.ValidateVolumeCapabilitiesRequest.SerializeToString, - controller_dot_csi__general_dot_csi__pb2.ValidateVolumeCapabilitiesResponse.FromString, - options, channel_credentials, - insecure, call_credentials, compression, wait_for_ready, timeout, metadata) - - @staticmethod - def ListVolumes(request, - target, - options=(), - channel_credentials=None, - call_credentials=None, - insecure=False, - compression=None, - wait_for_ready=None, - timeout=None, - metadata=None): - return grpc.experimental.unary_unary(request, target, '/csi.v1.Controller/ListVolumes', - controller_dot_csi__general_dot_csi__pb2.ListVolumesRequest.SerializeToString, - controller_dot_csi__general_dot_csi__pb2.ListVolumesResponse.FromString, - options, channel_credentials, - insecure, call_credentials, compression, wait_for_ready, timeout, metadata) - - @staticmethod - def GetCapacity(request, - target, - options=(), - channel_credentials=None, - call_credentials=None, - insecure=False, - compression=None, - wait_for_ready=None, - timeout=None, - metadata=None): - return grpc.experimental.unary_unary(request, target, '/csi.v1.Controller/GetCapacity', - controller_dot_csi__general_dot_csi__pb2.GetCapacityRequest.SerializeToString, - controller_dot_csi__general_dot_csi__pb2.GetCapacityResponse.FromString, - options, channel_credentials, - insecure, call_credentials, compression, wait_for_ready, timeout, metadata) - - @staticmethod - def ControllerGetCapabilities(request, - target, - options=(), - channel_credentials=None, - call_credentials=None, - insecure=False, - compression=None, - wait_for_ready=None, - timeout=None, - metadata=None): - return grpc.experimental.unary_unary(request, target, '/csi.v1.Controller/ControllerGetCapabilities', - controller_dot_csi__general_dot_csi__pb2.ControllerGetCapabilitiesRequest.SerializeToString, - controller_dot_csi__general_dot_csi__pb2.ControllerGetCapabilitiesResponse.FromString, - options, channel_credentials, - insecure, call_credentials, compression, wait_for_ready, timeout, metadata) - - @staticmethod - def CreateSnapshot(request, - target, - options=(), - channel_credentials=None, - call_credentials=None, - insecure=False, - compression=None, - wait_for_ready=None, - timeout=None, - metadata=None): - return grpc.experimental.unary_unary(request, target, '/csi.v1.Controller/CreateSnapshot', - controller_dot_csi__general_dot_csi__pb2.CreateSnapshotRequest.SerializeToString, - controller_dot_csi__general_dot_csi__pb2.CreateSnapshotResponse.FromString, - options, channel_credentials, - insecure, call_credentials, compression, wait_for_ready, timeout, metadata) - - @staticmethod - def DeleteSnapshot(request, - target, - options=(), - channel_credentials=None, - call_credentials=None, - insecure=False, - compression=None, - wait_for_ready=None, - timeout=None, - metadata=None): - return grpc.experimental.unary_unary(request, target, '/csi.v1.Controller/DeleteSnapshot', - controller_dot_csi__general_dot_csi__pb2.DeleteSnapshotRequest.SerializeToString, - controller_dot_csi__general_dot_csi__pb2.DeleteSnapshotResponse.FromString, - options, channel_credentials, - insecure, call_credentials, compression, wait_for_ready, timeout, metadata) - - @staticmethod - def ListSnapshots(request, - target, - options=(), - channel_credentials=None, - call_credentials=None, - insecure=False, - compression=None, - wait_for_ready=None, - timeout=None, - metadata=None): - return grpc.experimental.unary_unary(request, target, '/csi.v1.Controller/ListSnapshots', - controller_dot_csi__general_dot_csi__pb2.ListSnapshotsRequest.SerializeToString, - controller_dot_csi__general_dot_csi__pb2.ListSnapshotsResponse.FromString, - options, channel_credentials, - insecure, call_credentials, compression, wait_for_ready, timeout, metadata) - - @staticmethod - def ControllerExpandVolume(request, - target, - options=(), - channel_credentials=None, - call_credentials=None, - insecure=False, - compression=None, - wait_for_ready=None, - timeout=None, - metadata=None): - return grpc.experimental.unary_unary(request, target, '/csi.v1.Controller/ControllerExpandVolume', - controller_dot_csi__general_dot_csi__pb2.ControllerExpandVolumeRequest.SerializeToString, - controller_dot_csi__general_dot_csi__pb2.ControllerExpandVolumeResponse.FromString, - options, channel_credentials, - insecure, call_credentials, compression, wait_for_ready, timeout, metadata) - - @staticmethod - def ControllerGetVolume(request, - target, - options=(), - channel_credentials=None, - call_credentials=None, - insecure=False, - compression=None, - wait_for_ready=None, - timeout=None, - metadata=None): - return grpc.experimental.unary_unary(request, target, '/csi.v1.Controller/ControllerGetVolume', - controller_dot_csi__general_dot_csi__pb2.ControllerGetVolumeRequest.SerializeToString, - controller_dot_csi__general_dot_csi__pb2.ControllerGetVolumeResponse.FromString, - options, channel_credentials, - insecure, call_credentials, compression, wait_for_ready, timeout, metadata) - - -class NodeStub(object): - """Missing associated documentation comment in .proto file.""" - - def __init__(self, channel): - """Constructor. - - Args: - channel: A grpc.Channel. - """ - self.NodeStageVolume = channel.unary_unary( - '/csi.v1.Node/NodeStageVolume', - request_serializer=controller_dot_csi__general_dot_csi__pb2.NodeStageVolumeRequest.SerializeToString, - response_deserializer=controller_dot_csi__general_dot_csi__pb2.NodeStageVolumeResponse.FromString, - ) - self.NodeUnstageVolume = channel.unary_unary( - '/csi.v1.Node/NodeUnstageVolume', - request_serializer=controller_dot_csi__general_dot_csi__pb2.NodeUnstageVolumeRequest.SerializeToString, - response_deserializer=controller_dot_csi__general_dot_csi__pb2.NodeUnstageVolumeResponse.FromString, - ) - self.NodePublishVolume = channel.unary_unary( - '/csi.v1.Node/NodePublishVolume', - request_serializer=controller_dot_csi__general_dot_csi__pb2.NodePublishVolumeRequest.SerializeToString, - response_deserializer=controller_dot_csi__general_dot_csi__pb2.NodePublishVolumeResponse.FromString, - ) - self.NodeUnpublishVolume = channel.unary_unary( - '/csi.v1.Node/NodeUnpublishVolume', - request_serializer=controller_dot_csi__general_dot_csi__pb2.NodeUnpublishVolumeRequest.SerializeToString, - response_deserializer=controller_dot_csi__general_dot_csi__pb2.NodeUnpublishVolumeResponse.FromString, - ) - self.NodeGetVolumeStats = channel.unary_unary( - '/csi.v1.Node/NodeGetVolumeStats', - request_serializer=controller_dot_csi__general_dot_csi__pb2.NodeGetVolumeStatsRequest.SerializeToString, - response_deserializer=controller_dot_csi__general_dot_csi__pb2.NodeGetVolumeStatsResponse.FromString, - ) - self.NodeExpandVolume = channel.unary_unary( - '/csi.v1.Node/NodeExpandVolume', - request_serializer=controller_dot_csi__general_dot_csi__pb2.NodeExpandVolumeRequest.SerializeToString, - response_deserializer=controller_dot_csi__general_dot_csi__pb2.NodeExpandVolumeResponse.FromString, - ) - self.NodeGetCapabilities = channel.unary_unary( - '/csi.v1.Node/NodeGetCapabilities', - request_serializer=controller_dot_csi__general_dot_csi__pb2.NodeGetCapabilitiesRequest.SerializeToString, - response_deserializer=controller_dot_csi__general_dot_csi__pb2.NodeGetCapabilitiesResponse.FromString, - ) - self.NodeGetInfo = channel.unary_unary( - '/csi.v1.Node/NodeGetInfo', - request_serializer=controller_dot_csi__general_dot_csi__pb2.NodeGetInfoRequest.SerializeToString, - response_deserializer=controller_dot_csi__general_dot_csi__pb2.NodeGetInfoResponse.FromString, - ) - - -class NodeServicer(object): - """Missing associated documentation comment in .proto file.""" - - def NodeStageVolume(self, request, context): - """Missing associated documentation comment in .proto file.""" - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details('Method not implemented!') - raise NotImplementedError('Method not implemented!') - - def NodeUnstageVolume(self, request, context): - """Missing associated documentation comment in .proto file.""" - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details('Method not implemented!') - raise NotImplementedError('Method not implemented!') - - def NodePublishVolume(self, request, context): - """Missing associated documentation comment in .proto file.""" - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details('Method not implemented!') - raise NotImplementedError('Method not implemented!') - - def NodeUnpublishVolume(self, request, context): - """Missing associated documentation comment in .proto file.""" - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details('Method not implemented!') - raise NotImplementedError('Method not implemented!') - - def NodeGetVolumeStats(self, request, context): - """Missing associated documentation comment in .proto file.""" - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details('Method not implemented!') - raise NotImplementedError('Method not implemented!') - - def NodeExpandVolume(self, request, context): - """Missing associated documentation comment in .proto file.""" - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details('Method not implemented!') - raise NotImplementedError('Method not implemented!') - - def NodeGetCapabilities(self, request, context): - """Missing associated documentation comment in .proto file.""" - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details('Method not implemented!') - raise NotImplementedError('Method not implemented!') - - def NodeGetInfo(self, request, context): - """Missing associated documentation comment in .proto file.""" - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details('Method not implemented!') - raise NotImplementedError('Method not implemented!') - - -def add_NodeServicer_to_server(servicer, server): - rpc_method_handlers = { - 'NodeStageVolume': grpc.unary_unary_rpc_method_handler( - servicer.NodeStageVolume, - request_deserializer=controller_dot_csi__general_dot_csi__pb2.NodeStageVolumeRequest.FromString, - response_serializer=controller_dot_csi__general_dot_csi__pb2.NodeStageVolumeResponse.SerializeToString, - ), - 'NodeUnstageVolume': grpc.unary_unary_rpc_method_handler( - servicer.NodeUnstageVolume, - request_deserializer=controller_dot_csi__general_dot_csi__pb2.NodeUnstageVolumeRequest.FromString, - response_serializer=controller_dot_csi__general_dot_csi__pb2.NodeUnstageVolumeResponse.SerializeToString, - ), - 'NodePublishVolume': grpc.unary_unary_rpc_method_handler( - servicer.NodePublishVolume, - request_deserializer=controller_dot_csi__general_dot_csi__pb2.NodePublishVolumeRequest.FromString, - response_serializer=controller_dot_csi__general_dot_csi__pb2.NodePublishVolumeResponse.SerializeToString, - ), - 'NodeUnpublishVolume': grpc.unary_unary_rpc_method_handler( - servicer.NodeUnpublishVolume, - request_deserializer=controller_dot_csi__general_dot_csi__pb2.NodeUnpublishVolumeRequest.FromString, - response_serializer=controller_dot_csi__general_dot_csi__pb2.NodeUnpublishVolumeResponse.SerializeToString, - ), - 'NodeGetVolumeStats': grpc.unary_unary_rpc_method_handler( - servicer.NodeGetVolumeStats, - request_deserializer=controller_dot_csi__general_dot_csi__pb2.NodeGetVolumeStatsRequest.FromString, - response_serializer=controller_dot_csi__general_dot_csi__pb2.NodeGetVolumeStatsResponse.SerializeToString, - ), - 'NodeExpandVolume': grpc.unary_unary_rpc_method_handler( - servicer.NodeExpandVolume, - request_deserializer=controller_dot_csi__general_dot_csi__pb2.NodeExpandVolumeRequest.FromString, - response_serializer=controller_dot_csi__general_dot_csi__pb2.NodeExpandVolumeResponse.SerializeToString, - ), - 'NodeGetCapabilities': grpc.unary_unary_rpc_method_handler( - servicer.NodeGetCapabilities, - request_deserializer=controller_dot_csi__general_dot_csi__pb2.NodeGetCapabilitiesRequest.FromString, - response_serializer=controller_dot_csi__general_dot_csi__pb2.NodeGetCapabilitiesResponse.SerializeToString, - ), - 'NodeGetInfo': grpc.unary_unary_rpc_method_handler( - servicer.NodeGetInfo, - request_deserializer=controller_dot_csi__general_dot_csi__pb2.NodeGetInfoRequest.FromString, - response_serializer=controller_dot_csi__general_dot_csi__pb2.NodeGetInfoResponse.SerializeToString, - ), - } - generic_handler = grpc.method_handlers_generic_handler( - 'csi.v1.Node', rpc_method_handlers) - server.add_generic_rpc_handlers((generic_handler,)) - - - # This class is part of an EXPERIMENTAL API. -class Node(object): - """Missing associated documentation comment in .proto file.""" - - @staticmethod - def NodeStageVolume(request, - target, - options=(), - channel_credentials=None, - call_credentials=None, - insecure=False, - compression=None, - wait_for_ready=None, - timeout=None, - metadata=None): - return grpc.experimental.unary_unary(request, target, '/csi.v1.Node/NodeStageVolume', - controller_dot_csi__general_dot_csi__pb2.NodeStageVolumeRequest.SerializeToString, - controller_dot_csi__general_dot_csi__pb2.NodeStageVolumeResponse.FromString, - options, channel_credentials, - insecure, call_credentials, compression, wait_for_ready, timeout, metadata) - - @staticmethod - def NodeUnstageVolume(request, - target, - options=(), - channel_credentials=None, - call_credentials=None, - insecure=False, - compression=None, - wait_for_ready=None, - timeout=None, - metadata=None): - return grpc.experimental.unary_unary(request, target, '/csi.v1.Node/NodeUnstageVolume', - controller_dot_csi__general_dot_csi__pb2.NodeUnstageVolumeRequest.SerializeToString, - controller_dot_csi__general_dot_csi__pb2.NodeUnstageVolumeResponse.FromString, - options, channel_credentials, - insecure, call_credentials, compression, wait_for_ready, timeout, metadata) - - @staticmethod - def NodePublishVolume(request, - target, - options=(), - channel_credentials=None, - call_credentials=None, - insecure=False, - compression=None, - wait_for_ready=None, - timeout=None, - metadata=None): - return grpc.experimental.unary_unary(request, target, '/csi.v1.Node/NodePublishVolume', - controller_dot_csi__general_dot_csi__pb2.NodePublishVolumeRequest.SerializeToString, - controller_dot_csi__general_dot_csi__pb2.NodePublishVolumeResponse.FromString, - options, channel_credentials, - insecure, call_credentials, compression, wait_for_ready, timeout, metadata) - - @staticmethod - def NodeUnpublishVolume(request, - target, - options=(), - channel_credentials=None, - call_credentials=None, - insecure=False, - compression=None, - wait_for_ready=None, - timeout=None, - metadata=None): - return grpc.experimental.unary_unary(request, target, '/csi.v1.Node/NodeUnpublishVolume', - controller_dot_csi__general_dot_csi__pb2.NodeUnpublishVolumeRequest.SerializeToString, - controller_dot_csi__general_dot_csi__pb2.NodeUnpublishVolumeResponse.FromString, - options, channel_credentials, - insecure, call_credentials, compression, wait_for_ready, timeout, metadata) - - @staticmethod - def NodeGetVolumeStats(request, - target, - options=(), - channel_credentials=None, - call_credentials=None, - insecure=False, - compression=None, - wait_for_ready=None, - timeout=None, - metadata=None): - return grpc.experimental.unary_unary(request, target, '/csi.v1.Node/NodeGetVolumeStats', - controller_dot_csi__general_dot_csi__pb2.NodeGetVolumeStatsRequest.SerializeToString, - controller_dot_csi__general_dot_csi__pb2.NodeGetVolumeStatsResponse.FromString, - options, channel_credentials, - insecure, call_credentials, compression, wait_for_ready, timeout, metadata) - - @staticmethod - def NodeExpandVolume(request, - target, - options=(), - channel_credentials=None, - call_credentials=None, - insecure=False, - compression=None, - wait_for_ready=None, - timeout=None, - metadata=None): - return grpc.experimental.unary_unary(request, target, '/csi.v1.Node/NodeExpandVolume', - controller_dot_csi__general_dot_csi__pb2.NodeExpandVolumeRequest.SerializeToString, - controller_dot_csi__general_dot_csi__pb2.NodeExpandVolumeResponse.FromString, - options, channel_credentials, - insecure, call_credentials, compression, wait_for_ready, timeout, metadata) - - @staticmethod - def NodeGetCapabilities(request, - target, - options=(), - channel_credentials=None, - call_credentials=None, - insecure=False, - compression=None, - wait_for_ready=None, - timeout=None, - metadata=None): - return grpc.experimental.unary_unary(request, target, '/csi.v1.Node/NodeGetCapabilities', - controller_dot_csi__general_dot_csi__pb2.NodeGetCapabilitiesRequest.SerializeToString, - controller_dot_csi__general_dot_csi__pb2.NodeGetCapabilitiesResponse.FromString, - options, channel_credentials, - insecure, call_credentials, compression, wait_for_ready, timeout, metadata) - - @staticmethod - def NodeGetInfo(request, - target, - options=(), - channel_credentials=None, - call_credentials=None, - insecure=False, - compression=None, - wait_for_ready=None, - timeout=None, - metadata=None): - return grpc.experimental.unary_unary(request, target, '/csi.v1.Node/NodeGetInfo', - controller_dot_csi__general_dot_csi__pb2.NodeGetInfoRequest.SerializeToString, - controller_dot_csi__general_dot_csi__pb2.NodeGetInfoResponse.FromString, - options, channel_credentials, - insecure, call_credentials, compression, wait_for_ready, timeout, metadata) diff --git a/controller/csi_general/replication_pb2.py b/controller/csi_general/replication_pb2.py deleted file mode 100644 index f80adb059..000000000 --- a/controller/csi_general/replication_pb2.py +++ /dev/null @@ -1,1092 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: controller/csi_general/replication.proto - -import sys -_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1')) -from google.protobuf import descriptor as _descriptor -from google.protobuf import message as _message -from google.protobuf import reflection as _reflection -from google.protobuf import symbol_database as _symbol_database -# @@protoc_insertion_point(imports) - -_sym_db = _symbol_database.Default() - - -from google.protobuf import descriptor_pb2 as google_dot_protobuf_dot_descriptor__pb2 - - -DESCRIPTOR = _descriptor.FileDescriptor( - name='controller/csi_general/replication.proto', - package='replication', - syntax='proto3', - serialized_options=_b('Z\r.;replication'), - serialized_pb=_b('\n(controller/csi_general/replication.proto\x12\x0breplication\x1a google/protobuf/descriptor.proto\"\xd4\x02\n\x1e\x45nableVolumeReplicationRequest\x12\x11\n\tvolume_id\x18\x01 \x01(\t\x12\x1b\n\x0ereplication_id\x18\x04 \x01(\tB\x03\xe0\x44\x01\x12O\n\nparameters\x18\x02 \x03(\x0b\x32;.replication.EnableVolumeReplicationRequest.ParametersEntry\x12N\n\x07secrets\x18\x03 \x03(\x0b\x32\x38.replication.EnableVolumeReplicationRequest.SecretsEntryB\x03\xd8\x44\x01\x1a\x31\n\x0fParametersEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\x1a.\n\x0cSecretsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"!\n\x1f\x45nableVolumeReplicationResponse\"\xd7\x02\n\x1f\x44isableVolumeReplicationRequest\x12\x11\n\tvolume_id\x18\x01 \x01(\t\x12\x1b\n\x0ereplication_id\x18\x04 \x01(\tB\x03\xe0\x44\x01\x12P\n\nparameters\x18\x02 \x03(\x0b\x32<.replication.DisableVolumeReplicationRequest.ParametersEntry\x12O\n\x07secrets\x18\x03 \x03(\x0b\x32\x39.replication.DisableVolumeReplicationRequest.SecretsEntryB\x03\xd8\x44\x01\x1a\x31\n\x0fParametersEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\x1a.\n\x0cSecretsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"\"\n DisableVolumeReplicationResponse\"\xc5\x02\n\x14PromoteVolumeRequest\x12\x11\n\tvolume_id\x18\x01 \x01(\t\x12\x1b\n\x0ereplication_id\x18\x05 \x01(\tB\x03\xe0\x44\x01\x12\r\n\x05\x66orce\x18\x02 \x01(\x08\x12\x45\n\nparameters\x18\x03 \x03(\x0b\x32\x31.replication.PromoteVolumeRequest.ParametersEntry\x12\x44\n\x07secrets\x18\x04 \x03(\x0b\x32..replication.PromoteVolumeRequest.SecretsEntryB\x03\xd8\x44\x01\x1a\x31\n\x0fParametersEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\x1a.\n\x0cSecretsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"\x17\n\x15PromoteVolumeResponse\"\xc2\x02\n\x13\x44\x65moteVolumeRequest\x12\x11\n\tvolume_id\x18\x01 \x01(\t\x12\x1b\n\x0ereplication_id\x18\x05 \x01(\tB\x03\xe0\x44\x01\x12\r\n\x05\x66orce\x18\x02 \x01(\x08\x12\x44\n\nparameters\x18\x03 \x03(\x0b\x32\x30.replication.DemoteVolumeRequest.ParametersEntry\x12\x43\n\x07secrets\x18\x04 \x03(\x0b\x32-.replication.DemoteVolumeRequest.SecretsEntryB\x03\xd8\x44\x01\x1a\x31\n\x0fParametersEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\x1a.\n\x0cSecretsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"\x16\n\x14\x44\x65moteVolumeResponse\"\xc2\x02\n\x13ResyncVolumeRequest\x12\x11\n\tvolume_id\x18\x01 \x01(\t\x12\x1b\n\x0ereplication_id\x18\x05 \x01(\tB\x03\xe0\x44\x01\x12\r\n\x05\x66orce\x18\x02 \x01(\x08\x12\x44\n\nparameters\x18\x03 \x03(\x0b\x32\x30.replication.ResyncVolumeRequest.ParametersEntry\x12\x43\n\x07secrets\x18\x04 \x03(\x0b\x32-.replication.ResyncVolumeRequest.SecretsEntryB\x03\xd8\x44\x01\x1a\x31\n\x0fParametersEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\x1a.\n\x0cSecretsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"%\n\x14ResyncVolumeResponse\x12\r\n\x05ready\x18\x01 \x01(\x08\x32\x87\x04\n\nController\x12v\n\x17\x45nableVolumeReplication\x12+.replication.EnableVolumeReplicationRequest\x1a,.replication.EnableVolumeReplicationResponse\"\x00\x12y\n\x18\x44isableVolumeReplication\x12,.replication.DisableVolumeReplicationRequest\x1a-.replication.DisableVolumeReplicationResponse\"\x00\x12X\n\rPromoteVolume\x12!.replication.PromoteVolumeRequest\x1a\".replication.PromoteVolumeResponse\"\x00\x12U\n\x0c\x44\x65moteVolume\x12 .replication.DemoteVolumeRequest\x1a!.replication.DemoteVolumeResponse\"\x00\x12U\n\x0cResyncVolume\x12 .replication.ResyncVolumeRequest\x1a!.replication.ResyncVolumeResponse\"\x00::\n\x12replication_secret\x12\x1d.google.protobuf.FieldOptions\x18\xcb\x08 \x01(\x08:3\n\x0b\x61lpha_field\x12\x1d.google.protobuf.FieldOptions\x18\xcc\x08 \x01(\x08\x42\x0fZ\r.;replicationb\x06proto3') - , - dependencies=[google_dot_protobuf_dot_descriptor__pb2.DESCRIPTOR,]) - - -REPLICATION_SECRET_FIELD_NUMBER = 1099 -replication_secret = _descriptor.FieldDescriptor( - name='replication_secret', full_name='replication.replication_secret', index=0, - number=1099, type=8, cpp_type=7, label=1, - has_default_value=False, default_value=False, - message_type=None, enum_type=None, containing_type=None, - is_extension=True, extension_scope=None, - serialized_options=None, file=DESCRIPTOR) -ALPHA_FIELD_FIELD_NUMBER = 1100 -alpha_field = _descriptor.FieldDescriptor( - name='alpha_field', full_name='replication.alpha_field', index=1, - number=1100, type=8, cpp_type=7, label=1, - has_default_value=False, default_value=False, - message_type=None, enum_type=None, containing_type=None, - is_extension=True, extension_scope=None, - serialized_options=None, file=DESCRIPTOR) - - -_ENABLEVOLUMEREPLICATIONREQUEST_PARAMETERSENTRY = _descriptor.Descriptor( - name='ParametersEntry', - full_name='replication.EnableVolumeReplicationRequest.ParametersEntry', - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name='key', full_name='replication.EnableVolumeReplicationRequest.ParametersEntry.key', index=0, - number=1, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=_b("").decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR), - _descriptor.FieldDescriptor( - name='value', full_name='replication.EnableVolumeReplicationRequest.ParametersEntry.value', index=1, - number=2, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=_b("").decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=_b('8\001'), - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=335, - serialized_end=384, -) - -_ENABLEVOLUMEREPLICATIONREQUEST_SECRETSENTRY = _descriptor.Descriptor( - name='SecretsEntry', - full_name='replication.EnableVolumeReplicationRequest.SecretsEntry', - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name='key', full_name='replication.EnableVolumeReplicationRequest.SecretsEntry.key', index=0, - number=1, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=_b("").decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR), - _descriptor.FieldDescriptor( - name='value', full_name='replication.EnableVolumeReplicationRequest.SecretsEntry.value', index=1, - number=2, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=_b("").decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=_b('8\001'), - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=386, - serialized_end=432, -) - -_ENABLEVOLUMEREPLICATIONREQUEST = _descriptor.Descriptor( - name='EnableVolumeReplicationRequest', - full_name='replication.EnableVolumeReplicationRequest', - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name='volume_id', full_name='replication.EnableVolumeReplicationRequest.volume_id', index=0, - number=1, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=_b("").decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR), - _descriptor.FieldDescriptor( - name='replication_id', full_name='replication.EnableVolumeReplicationRequest.replication_id', index=1, - number=4, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=_b("").decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=_b('\340D\001'), file=DESCRIPTOR), - _descriptor.FieldDescriptor( - name='parameters', full_name='replication.EnableVolumeReplicationRequest.parameters', index=2, - number=2, type=11, cpp_type=10, label=3, - has_default_value=False, default_value=[], - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR), - _descriptor.FieldDescriptor( - name='secrets', full_name='replication.EnableVolumeReplicationRequest.secrets', index=3, - number=3, type=11, cpp_type=10, label=3, - has_default_value=False, default_value=[], - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=_b('\330D\001'), file=DESCRIPTOR), - ], - extensions=[ - ], - nested_types=[_ENABLEVOLUMEREPLICATIONREQUEST_PARAMETERSENTRY, _ENABLEVOLUMEREPLICATIONREQUEST_SECRETSENTRY, ], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=92, - serialized_end=432, -) - - -_ENABLEVOLUMEREPLICATIONRESPONSE = _descriptor.Descriptor( - name='EnableVolumeReplicationResponse', - full_name='replication.EnableVolumeReplicationResponse', - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=434, - serialized_end=467, -) - - -_DISABLEVOLUMEREPLICATIONREQUEST_PARAMETERSENTRY = _descriptor.Descriptor( - name='ParametersEntry', - full_name='replication.DisableVolumeReplicationRequest.ParametersEntry', - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name='key', full_name='replication.DisableVolumeReplicationRequest.ParametersEntry.key', index=0, - number=1, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=_b("").decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR), - _descriptor.FieldDescriptor( - name='value', full_name='replication.DisableVolumeReplicationRequest.ParametersEntry.value', index=1, - number=2, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=_b("").decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=_b('8\001'), - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=335, - serialized_end=384, -) - -_DISABLEVOLUMEREPLICATIONREQUEST_SECRETSENTRY = _descriptor.Descriptor( - name='SecretsEntry', - full_name='replication.DisableVolumeReplicationRequest.SecretsEntry', - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name='key', full_name='replication.DisableVolumeReplicationRequest.SecretsEntry.key', index=0, - number=1, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=_b("").decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR), - _descriptor.FieldDescriptor( - name='value', full_name='replication.DisableVolumeReplicationRequest.SecretsEntry.value', index=1, - number=2, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=_b("").decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=_b('8\001'), - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=386, - serialized_end=432, -) - -_DISABLEVOLUMEREPLICATIONREQUEST = _descriptor.Descriptor( - name='DisableVolumeReplicationRequest', - full_name='replication.DisableVolumeReplicationRequest', - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name='volume_id', full_name='replication.DisableVolumeReplicationRequest.volume_id', index=0, - number=1, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=_b("").decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR), - _descriptor.FieldDescriptor( - name='replication_id', full_name='replication.DisableVolumeReplicationRequest.replication_id', index=1, - number=4, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=_b("").decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=_b('\340D\001'), file=DESCRIPTOR), - _descriptor.FieldDescriptor( - name='parameters', full_name='replication.DisableVolumeReplicationRequest.parameters', index=2, - number=2, type=11, cpp_type=10, label=3, - has_default_value=False, default_value=[], - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR), - _descriptor.FieldDescriptor( - name='secrets', full_name='replication.DisableVolumeReplicationRequest.secrets', index=3, - number=3, type=11, cpp_type=10, label=3, - has_default_value=False, default_value=[], - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=_b('\330D\001'), file=DESCRIPTOR), - ], - extensions=[ - ], - nested_types=[_DISABLEVOLUMEREPLICATIONREQUEST_PARAMETERSENTRY, _DISABLEVOLUMEREPLICATIONREQUEST_SECRETSENTRY, ], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=470, - serialized_end=813, -) - - -_DISABLEVOLUMEREPLICATIONRESPONSE = _descriptor.Descriptor( - name='DisableVolumeReplicationResponse', - full_name='replication.DisableVolumeReplicationResponse', - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=815, - serialized_end=849, -) - - -_PROMOTEVOLUMEREQUEST_PARAMETERSENTRY = _descriptor.Descriptor( - name='ParametersEntry', - full_name='replication.PromoteVolumeRequest.ParametersEntry', - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name='key', full_name='replication.PromoteVolumeRequest.ParametersEntry.key', index=0, - number=1, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=_b("").decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR), - _descriptor.FieldDescriptor( - name='value', full_name='replication.PromoteVolumeRequest.ParametersEntry.value', index=1, - number=2, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=_b("").decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=_b('8\001'), - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=335, - serialized_end=384, -) - -_PROMOTEVOLUMEREQUEST_SECRETSENTRY = _descriptor.Descriptor( - name='SecretsEntry', - full_name='replication.PromoteVolumeRequest.SecretsEntry', - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name='key', full_name='replication.PromoteVolumeRequest.SecretsEntry.key', index=0, - number=1, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=_b("").decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR), - _descriptor.FieldDescriptor( - name='value', full_name='replication.PromoteVolumeRequest.SecretsEntry.value', index=1, - number=2, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=_b("").decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=_b('8\001'), - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=386, - serialized_end=432, -) - -_PROMOTEVOLUMEREQUEST = _descriptor.Descriptor( - name='PromoteVolumeRequest', - full_name='replication.PromoteVolumeRequest', - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name='volume_id', full_name='replication.PromoteVolumeRequest.volume_id', index=0, - number=1, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=_b("").decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR), - _descriptor.FieldDescriptor( - name='replication_id', full_name='replication.PromoteVolumeRequest.replication_id', index=1, - number=5, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=_b("").decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=_b('\340D\001'), file=DESCRIPTOR), - _descriptor.FieldDescriptor( - name='force', full_name='replication.PromoteVolumeRequest.force', index=2, - number=2, type=8, cpp_type=7, label=1, - has_default_value=False, default_value=False, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR), - _descriptor.FieldDescriptor( - name='parameters', full_name='replication.PromoteVolumeRequest.parameters', index=3, - number=3, type=11, cpp_type=10, label=3, - has_default_value=False, default_value=[], - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR), - _descriptor.FieldDescriptor( - name='secrets', full_name='replication.PromoteVolumeRequest.secrets', index=4, - number=4, type=11, cpp_type=10, label=3, - has_default_value=False, default_value=[], - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=_b('\330D\001'), file=DESCRIPTOR), - ], - extensions=[ - ], - nested_types=[_PROMOTEVOLUMEREQUEST_PARAMETERSENTRY, _PROMOTEVOLUMEREQUEST_SECRETSENTRY, ], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=852, - serialized_end=1177, -) - - -_PROMOTEVOLUMERESPONSE = _descriptor.Descriptor( - name='PromoteVolumeResponse', - full_name='replication.PromoteVolumeResponse', - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=1179, - serialized_end=1202, -) - - -_DEMOTEVOLUMEREQUEST_PARAMETERSENTRY = _descriptor.Descriptor( - name='ParametersEntry', - full_name='replication.DemoteVolumeRequest.ParametersEntry', - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name='key', full_name='replication.DemoteVolumeRequest.ParametersEntry.key', index=0, - number=1, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=_b("").decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR), - _descriptor.FieldDescriptor( - name='value', full_name='replication.DemoteVolumeRequest.ParametersEntry.value', index=1, - number=2, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=_b("").decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=_b('8\001'), - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=335, - serialized_end=384, -) - -_DEMOTEVOLUMEREQUEST_SECRETSENTRY = _descriptor.Descriptor( - name='SecretsEntry', - full_name='replication.DemoteVolumeRequest.SecretsEntry', - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name='key', full_name='replication.DemoteVolumeRequest.SecretsEntry.key', index=0, - number=1, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=_b("").decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR), - _descriptor.FieldDescriptor( - name='value', full_name='replication.DemoteVolumeRequest.SecretsEntry.value', index=1, - number=2, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=_b("").decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=_b('8\001'), - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=386, - serialized_end=432, -) - -_DEMOTEVOLUMEREQUEST = _descriptor.Descriptor( - name='DemoteVolumeRequest', - full_name='replication.DemoteVolumeRequest', - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name='volume_id', full_name='replication.DemoteVolumeRequest.volume_id', index=0, - number=1, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=_b("").decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR), - _descriptor.FieldDescriptor( - name='replication_id', full_name='replication.DemoteVolumeRequest.replication_id', index=1, - number=5, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=_b("").decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=_b('\340D\001'), file=DESCRIPTOR), - _descriptor.FieldDescriptor( - name='force', full_name='replication.DemoteVolumeRequest.force', index=2, - number=2, type=8, cpp_type=7, label=1, - has_default_value=False, default_value=False, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR), - _descriptor.FieldDescriptor( - name='parameters', full_name='replication.DemoteVolumeRequest.parameters', index=3, - number=3, type=11, cpp_type=10, label=3, - has_default_value=False, default_value=[], - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR), - _descriptor.FieldDescriptor( - name='secrets', full_name='replication.DemoteVolumeRequest.secrets', index=4, - number=4, type=11, cpp_type=10, label=3, - has_default_value=False, default_value=[], - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=_b('\330D\001'), file=DESCRIPTOR), - ], - extensions=[ - ], - nested_types=[_DEMOTEVOLUMEREQUEST_PARAMETERSENTRY, _DEMOTEVOLUMEREQUEST_SECRETSENTRY, ], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=1205, - serialized_end=1527, -) - - -_DEMOTEVOLUMERESPONSE = _descriptor.Descriptor( - name='DemoteVolumeResponse', - full_name='replication.DemoteVolumeResponse', - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=1529, - serialized_end=1551, -) - - -_RESYNCVOLUMEREQUEST_PARAMETERSENTRY = _descriptor.Descriptor( - name='ParametersEntry', - full_name='replication.ResyncVolumeRequest.ParametersEntry', - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name='key', full_name='replication.ResyncVolumeRequest.ParametersEntry.key', index=0, - number=1, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=_b("").decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR), - _descriptor.FieldDescriptor( - name='value', full_name='replication.ResyncVolumeRequest.ParametersEntry.value', index=1, - number=2, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=_b("").decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=_b('8\001'), - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=335, - serialized_end=384, -) - -_RESYNCVOLUMEREQUEST_SECRETSENTRY = _descriptor.Descriptor( - name='SecretsEntry', - full_name='replication.ResyncVolumeRequest.SecretsEntry', - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name='key', full_name='replication.ResyncVolumeRequest.SecretsEntry.key', index=0, - number=1, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=_b("").decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR), - _descriptor.FieldDescriptor( - name='value', full_name='replication.ResyncVolumeRequest.SecretsEntry.value', index=1, - number=2, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=_b("").decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=_b('8\001'), - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=386, - serialized_end=432, -) - -_RESYNCVOLUMEREQUEST = _descriptor.Descriptor( - name='ResyncVolumeRequest', - full_name='replication.ResyncVolumeRequest', - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name='volume_id', full_name='replication.ResyncVolumeRequest.volume_id', index=0, - number=1, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=_b("").decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR), - _descriptor.FieldDescriptor( - name='replication_id', full_name='replication.ResyncVolumeRequest.replication_id', index=1, - number=5, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=_b("").decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=_b('\340D\001'), file=DESCRIPTOR), - _descriptor.FieldDescriptor( - name='force', full_name='replication.ResyncVolumeRequest.force', index=2, - number=2, type=8, cpp_type=7, label=1, - has_default_value=False, default_value=False, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR), - _descriptor.FieldDescriptor( - name='parameters', full_name='replication.ResyncVolumeRequest.parameters', index=3, - number=3, type=11, cpp_type=10, label=3, - has_default_value=False, default_value=[], - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR), - _descriptor.FieldDescriptor( - name='secrets', full_name='replication.ResyncVolumeRequest.secrets', index=4, - number=4, type=11, cpp_type=10, label=3, - has_default_value=False, default_value=[], - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=_b('\330D\001'), file=DESCRIPTOR), - ], - extensions=[ - ], - nested_types=[_RESYNCVOLUMEREQUEST_PARAMETERSENTRY, _RESYNCVOLUMEREQUEST_SECRETSENTRY, ], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=1554, - serialized_end=1876, -) - - -_RESYNCVOLUMERESPONSE = _descriptor.Descriptor( - name='ResyncVolumeResponse', - full_name='replication.ResyncVolumeResponse', - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name='ready', full_name='replication.ResyncVolumeResponse.ready', index=0, - number=1, type=8, cpp_type=7, label=1, - has_default_value=False, default_value=False, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=1878, - serialized_end=1915, -) - -_ENABLEVOLUMEREPLICATIONREQUEST_PARAMETERSENTRY.containing_type = _ENABLEVOLUMEREPLICATIONREQUEST -_ENABLEVOLUMEREPLICATIONREQUEST_SECRETSENTRY.containing_type = _ENABLEVOLUMEREPLICATIONREQUEST -_ENABLEVOLUMEREPLICATIONREQUEST.fields_by_name['parameters'].message_type = _ENABLEVOLUMEREPLICATIONREQUEST_PARAMETERSENTRY -_ENABLEVOLUMEREPLICATIONREQUEST.fields_by_name['secrets'].message_type = _ENABLEVOLUMEREPLICATIONREQUEST_SECRETSENTRY -_DISABLEVOLUMEREPLICATIONREQUEST_PARAMETERSENTRY.containing_type = _DISABLEVOLUMEREPLICATIONREQUEST -_DISABLEVOLUMEREPLICATIONREQUEST_SECRETSENTRY.containing_type = _DISABLEVOLUMEREPLICATIONREQUEST -_DISABLEVOLUMEREPLICATIONREQUEST.fields_by_name['parameters'].message_type = _DISABLEVOLUMEREPLICATIONREQUEST_PARAMETERSENTRY -_DISABLEVOLUMEREPLICATIONREQUEST.fields_by_name['secrets'].message_type = _DISABLEVOLUMEREPLICATIONREQUEST_SECRETSENTRY -_PROMOTEVOLUMEREQUEST_PARAMETERSENTRY.containing_type = _PROMOTEVOLUMEREQUEST -_PROMOTEVOLUMEREQUEST_SECRETSENTRY.containing_type = _PROMOTEVOLUMEREQUEST -_PROMOTEVOLUMEREQUEST.fields_by_name['parameters'].message_type = _PROMOTEVOLUMEREQUEST_PARAMETERSENTRY -_PROMOTEVOLUMEREQUEST.fields_by_name['secrets'].message_type = _PROMOTEVOLUMEREQUEST_SECRETSENTRY -_DEMOTEVOLUMEREQUEST_PARAMETERSENTRY.containing_type = _DEMOTEVOLUMEREQUEST -_DEMOTEVOLUMEREQUEST_SECRETSENTRY.containing_type = _DEMOTEVOLUMEREQUEST -_DEMOTEVOLUMEREQUEST.fields_by_name['parameters'].message_type = _DEMOTEVOLUMEREQUEST_PARAMETERSENTRY -_DEMOTEVOLUMEREQUEST.fields_by_name['secrets'].message_type = _DEMOTEVOLUMEREQUEST_SECRETSENTRY -_RESYNCVOLUMEREQUEST_PARAMETERSENTRY.containing_type = _RESYNCVOLUMEREQUEST -_RESYNCVOLUMEREQUEST_SECRETSENTRY.containing_type = _RESYNCVOLUMEREQUEST -_RESYNCVOLUMEREQUEST.fields_by_name['parameters'].message_type = _RESYNCVOLUMEREQUEST_PARAMETERSENTRY -_RESYNCVOLUMEREQUEST.fields_by_name['secrets'].message_type = _RESYNCVOLUMEREQUEST_SECRETSENTRY -DESCRIPTOR.message_types_by_name['EnableVolumeReplicationRequest'] = _ENABLEVOLUMEREPLICATIONREQUEST -DESCRIPTOR.message_types_by_name['EnableVolumeReplicationResponse'] = _ENABLEVOLUMEREPLICATIONRESPONSE -DESCRIPTOR.message_types_by_name['DisableVolumeReplicationRequest'] = _DISABLEVOLUMEREPLICATIONREQUEST -DESCRIPTOR.message_types_by_name['DisableVolumeReplicationResponse'] = _DISABLEVOLUMEREPLICATIONRESPONSE -DESCRIPTOR.message_types_by_name['PromoteVolumeRequest'] = _PROMOTEVOLUMEREQUEST -DESCRIPTOR.message_types_by_name['PromoteVolumeResponse'] = _PROMOTEVOLUMERESPONSE -DESCRIPTOR.message_types_by_name['DemoteVolumeRequest'] = _DEMOTEVOLUMEREQUEST -DESCRIPTOR.message_types_by_name['DemoteVolumeResponse'] = _DEMOTEVOLUMERESPONSE -DESCRIPTOR.message_types_by_name['ResyncVolumeRequest'] = _RESYNCVOLUMEREQUEST -DESCRIPTOR.message_types_by_name['ResyncVolumeResponse'] = _RESYNCVOLUMERESPONSE -DESCRIPTOR.extensions_by_name['replication_secret'] = replication_secret -DESCRIPTOR.extensions_by_name['alpha_field'] = alpha_field -_sym_db.RegisterFileDescriptor(DESCRIPTOR) - -EnableVolumeReplicationRequest = _reflection.GeneratedProtocolMessageType('EnableVolumeReplicationRequest', (_message.Message,), dict( - - ParametersEntry = _reflection.GeneratedProtocolMessageType('ParametersEntry', (_message.Message,), dict( - DESCRIPTOR = _ENABLEVOLUMEREPLICATIONREQUEST_PARAMETERSENTRY, - __module__ = 'controller.csi_general.replication_pb2' - # @@protoc_insertion_point(class_scope:replication.EnableVolumeReplicationRequest.ParametersEntry) - )) - , - - SecretsEntry = _reflection.GeneratedProtocolMessageType('SecretsEntry', (_message.Message,), dict( - DESCRIPTOR = _ENABLEVOLUMEREPLICATIONREQUEST_SECRETSENTRY, - __module__ = 'controller.csi_general.replication_pb2' - # @@protoc_insertion_point(class_scope:replication.EnableVolumeReplicationRequest.SecretsEntry) - )) - , - DESCRIPTOR = _ENABLEVOLUMEREPLICATIONREQUEST, - __module__ = 'controller.csi_general.replication_pb2' - # @@protoc_insertion_point(class_scope:replication.EnableVolumeReplicationRequest) - )) -_sym_db.RegisterMessage(EnableVolumeReplicationRequest) -_sym_db.RegisterMessage(EnableVolumeReplicationRequest.ParametersEntry) -_sym_db.RegisterMessage(EnableVolumeReplicationRequest.SecretsEntry) - -EnableVolumeReplicationResponse = _reflection.GeneratedProtocolMessageType('EnableVolumeReplicationResponse', (_message.Message,), dict( - DESCRIPTOR = _ENABLEVOLUMEREPLICATIONRESPONSE, - __module__ = 'controller.csi_general.replication_pb2' - # @@protoc_insertion_point(class_scope:replication.EnableVolumeReplicationResponse) - )) -_sym_db.RegisterMessage(EnableVolumeReplicationResponse) - -DisableVolumeReplicationRequest = _reflection.GeneratedProtocolMessageType('DisableVolumeReplicationRequest', (_message.Message,), dict( - - ParametersEntry = _reflection.GeneratedProtocolMessageType('ParametersEntry', (_message.Message,), dict( - DESCRIPTOR = _DISABLEVOLUMEREPLICATIONREQUEST_PARAMETERSENTRY, - __module__ = 'controller.csi_general.replication_pb2' - # @@protoc_insertion_point(class_scope:replication.DisableVolumeReplicationRequest.ParametersEntry) - )) - , - - SecretsEntry = _reflection.GeneratedProtocolMessageType('SecretsEntry', (_message.Message,), dict( - DESCRIPTOR = _DISABLEVOLUMEREPLICATIONREQUEST_SECRETSENTRY, - __module__ = 'controller.csi_general.replication_pb2' - # @@protoc_insertion_point(class_scope:replication.DisableVolumeReplicationRequest.SecretsEntry) - )) - , - DESCRIPTOR = _DISABLEVOLUMEREPLICATIONREQUEST, - __module__ = 'controller.csi_general.replication_pb2' - # @@protoc_insertion_point(class_scope:replication.DisableVolumeReplicationRequest) - )) -_sym_db.RegisterMessage(DisableVolumeReplicationRequest) -_sym_db.RegisterMessage(DisableVolumeReplicationRequest.ParametersEntry) -_sym_db.RegisterMessage(DisableVolumeReplicationRequest.SecretsEntry) - -DisableVolumeReplicationResponse = _reflection.GeneratedProtocolMessageType('DisableVolumeReplicationResponse', (_message.Message,), dict( - DESCRIPTOR = _DISABLEVOLUMEREPLICATIONRESPONSE, - __module__ = 'controller.csi_general.replication_pb2' - # @@protoc_insertion_point(class_scope:replication.DisableVolumeReplicationResponse) - )) -_sym_db.RegisterMessage(DisableVolumeReplicationResponse) - -PromoteVolumeRequest = _reflection.GeneratedProtocolMessageType('PromoteVolumeRequest', (_message.Message,), dict( - - ParametersEntry = _reflection.GeneratedProtocolMessageType('ParametersEntry', (_message.Message,), dict( - DESCRIPTOR = _PROMOTEVOLUMEREQUEST_PARAMETERSENTRY, - __module__ = 'controller.csi_general.replication_pb2' - # @@protoc_insertion_point(class_scope:replication.PromoteVolumeRequest.ParametersEntry) - )) - , - - SecretsEntry = _reflection.GeneratedProtocolMessageType('SecretsEntry', (_message.Message,), dict( - DESCRIPTOR = _PROMOTEVOLUMEREQUEST_SECRETSENTRY, - __module__ = 'controller.csi_general.replication_pb2' - # @@protoc_insertion_point(class_scope:replication.PromoteVolumeRequest.SecretsEntry) - )) - , - DESCRIPTOR = _PROMOTEVOLUMEREQUEST, - __module__ = 'controller.csi_general.replication_pb2' - # @@protoc_insertion_point(class_scope:replication.PromoteVolumeRequest) - )) -_sym_db.RegisterMessage(PromoteVolumeRequest) -_sym_db.RegisterMessage(PromoteVolumeRequest.ParametersEntry) -_sym_db.RegisterMessage(PromoteVolumeRequest.SecretsEntry) - -PromoteVolumeResponse = _reflection.GeneratedProtocolMessageType('PromoteVolumeResponse', (_message.Message,), dict( - DESCRIPTOR = _PROMOTEVOLUMERESPONSE, - __module__ = 'controller.csi_general.replication_pb2' - # @@protoc_insertion_point(class_scope:replication.PromoteVolumeResponse) - )) -_sym_db.RegisterMessage(PromoteVolumeResponse) - -DemoteVolumeRequest = _reflection.GeneratedProtocolMessageType('DemoteVolumeRequest', (_message.Message,), dict( - - ParametersEntry = _reflection.GeneratedProtocolMessageType('ParametersEntry', (_message.Message,), dict( - DESCRIPTOR = _DEMOTEVOLUMEREQUEST_PARAMETERSENTRY, - __module__ = 'controller.csi_general.replication_pb2' - # @@protoc_insertion_point(class_scope:replication.DemoteVolumeRequest.ParametersEntry) - )) - , - - SecretsEntry = _reflection.GeneratedProtocolMessageType('SecretsEntry', (_message.Message,), dict( - DESCRIPTOR = _DEMOTEVOLUMEREQUEST_SECRETSENTRY, - __module__ = 'controller.csi_general.replication_pb2' - # @@protoc_insertion_point(class_scope:replication.DemoteVolumeRequest.SecretsEntry) - )) - , - DESCRIPTOR = _DEMOTEVOLUMEREQUEST, - __module__ = 'controller.csi_general.replication_pb2' - # @@protoc_insertion_point(class_scope:replication.DemoteVolumeRequest) - )) -_sym_db.RegisterMessage(DemoteVolumeRequest) -_sym_db.RegisterMessage(DemoteVolumeRequest.ParametersEntry) -_sym_db.RegisterMessage(DemoteVolumeRequest.SecretsEntry) - -DemoteVolumeResponse = _reflection.GeneratedProtocolMessageType('DemoteVolumeResponse', (_message.Message,), dict( - DESCRIPTOR = _DEMOTEVOLUMERESPONSE, - __module__ = 'controller.csi_general.replication_pb2' - # @@protoc_insertion_point(class_scope:replication.DemoteVolumeResponse) - )) -_sym_db.RegisterMessage(DemoteVolumeResponse) - -ResyncVolumeRequest = _reflection.GeneratedProtocolMessageType('ResyncVolumeRequest', (_message.Message,), dict( - - ParametersEntry = _reflection.GeneratedProtocolMessageType('ParametersEntry', (_message.Message,), dict( - DESCRIPTOR = _RESYNCVOLUMEREQUEST_PARAMETERSENTRY, - __module__ = 'controller.csi_general.replication_pb2' - # @@protoc_insertion_point(class_scope:replication.ResyncVolumeRequest.ParametersEntry) - )) - , - - SecretsEntry = _reflection.GeneratedProtocolMessageType('SecretsEntry', (_message.Message,), dict( - DESCRIPTOR = _RESYNCVOLUMEREQUEST_SECRETSENTRY, - __module__ = 'controller.csi_general.replication_pb2' - # @@protoc_insertion_point(class_scope:replication.ResyncVolumeRequest.SecretsEntry) - )) - , - DESCRIPTOR = _RESYNCVOLUMEREQUEST, - __module__ = 'controller.csi_general.replication_pb2' - # @@protoc_insertion_point(class_scope:replication.ResyncVolumeRequest) - )) -_sym_db.RegisterMessage(ResyncVolumeRequest) -_sym_db.RegisterMessage(ResyncVolumeRequest.ParametersEntry) -_sym_db.RegisterMessage(ResyncVolumeRequest.SecretsEntry) - -ResyncVolumeResponse = _reflection.GeneratedProtocolMessageType('ResyncVolumeResponse', (_message.Message,), dict( - DESCRIPTOR = _RESYNCVOLUMERESPONSE, - __module__ = 'controller.csi_general.replication_pb2' - # @@protoc_insertion_point(class_scope:replication.ResyncVolumeResponse) - )) -_sym_db.RegisterMessage(ResyncVolumeResponse) - -google_dot_protobuf_dot_descriptor__pb2.FieldOptions.RegisterExtension(replication_secret) -google_dot_protobuf_dot_descriptor__pb2.FieldOptions.RegisterExtension(alpha_field) - -DESCRIPTOR._options = None -_ENABLEVOLUMEREPLICATIONREQUEST_PARAMETERSENTRY._options = None -_ENABLEVOLUMEREPLICATIONREQUEST_SECRETSENTRY._options = None -_ENABLEVOLUMEREPLICATIONREQUEST.fields_by_name['replication_id']._options = None -_ENABLEVOLUMEREPLICATIONREQUEST.fields_by_name['secrets']._options = None -_DISABLEVOLUMEREPLICATIONREQUEST_PARAMETERSENTRY._options = None -_DISABLEVOLUMEREPLICATIONREQUEST_SECRETSENTRY._options = None -_DISABLEVOLUMEREPLICATIONREQUEST.fields_by_name['replication_id']._options = None -_DISABLEVOLUMEREPLICATIONREQUEST.fields_by_name['secrets']._options = None -_PROMOTEVOLUMEREQUEST_PARAMETERSENTRY._options = None -_PROMOTEVOLUMEREQUEST_SECRETSENTRY._options = None -_PROMOTEVOLUMEREQUEST.fields_by_name['replication_id']._options = None -_PROMOTEVOLUMEREQUEST.fields_by_name['secrets']._options = None -_DEMOTEVOLUMEREQUEST_PARAMETERSENTRY._options = None -_DEMOTEVOLUMEREQUEST_SECRETSENTRY._options = None -_DEMOTEVOLUMEREQUEST.fields_by_name['replication_id']._options = None -_DEMOTEVOLUMEREQUEST.fields_by_name['secrets']._options = None -_RESYNCVOLUMEREQUEST_PARAMETERSENTRY._options = None -_RESYNCVOLUMEREQUEST_SECRETSENTRY._options = None -_RESYNCVOLUMEREQUEST.fields_by_name['replication_id']._options = None -_RESYNCVOLUMEREQUEST.fields_by_name['secrets']._options = None - -_CONTROLLER = _descriptor.ServiceDescriptor( - name='Controller', - full_name='replication.Controller', - file=DESCRIPTOR, - index=0, - serialized_options=None, - serialized_start=1918, - serialized_end=2437, - methods=[ - _descriptor.MethodDescriptor( - name='EnableVolumeReplication', - full_name='replication.Controller.EnableVolumeReplication', - index=0, - containing_service=None, - input_type=_ENABLEVOLUMEREPLICATIONREQUEST, - output_type=_ENABLEVOLUMEREPLICATIONRESPONSE, - serialized_options=None, - ), - _descriptor.MethodDescriptor( - name='DisableVolumeReplication', - full_name='replication.Controller.DisableVolumeReplication', - index=1, - containing_service=None, - input_type=_DISABLEVOLUMEREPLICATIONREQUEST, - output_type=_DISABLEVOLUMEREPLICATIONRESPONSE, - serialized_options=None, - ), - _descriptor.MethodDescriptor( - name='PromoteVolume', - full_name='replication.Controller.PromoteVolume', - index=2, - containing_service=None, - input_type=_PROMOTEVOLUMEREQUEST, - output_type=_PROMOTEVOLUMERESPONSE, - serialized_options=None, - ), - _descriptor.MethodDescriptor( - name='DemoteVolume', - full_name='replication.Controller.DemoteVolume', - index=3, - containing_service=None, - input_type=_DEMOTEVOLUMEREQUEST, - output_type=_DEMOTEVOLUMERESPONSE, - serialized_options=None, - ), - _descriptor.MethodDescriptor( - name='ResyncVolume', - full_name='replication.Controller.ResyncVolume', - index=4, - containing_service=None, - input_type=_RESYNCVOLUMEREQUEST, - output_type=_RESYNCVOLUMERESPONSE, - serialized_options=None, - ), -]) -_sym_db.RegisterServiceDescriptor(_CONTROLLER) - -DESCRIPTOR.services_by_name['Controller'] = _CONTROLLER - -# @@protoc_insertion_point(module_scope) diff --git a/controller/csi_general/replication_pb2_grpc.py b/controller/csi_general/replication_pb2_grpc.py deleted file mode 100644 index 982ed2200..000000000 --- a/controller/csi_general/replication_pb2_grpc.py +++ /dev/null @@ -1,116 +0,0 @@ -# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! -import grpc - -from controller.csi_general import replication_pb2 as controller_dot_csi__general_dot_replication__pb2 - - -class ControllerStub(object): - """Controller holds the RPC Methods for replication and all the methods it - exposes should be idempotent. - """ - - def __init__(self, channel): - """Constructor. - - Args: - channel: A grpc.Channel. - """ - self.EnableVolumeReplication = channel.unary_unary( - '/replication.Controller/EnableVolumeReplication', - request_serializer=controller_dot_csi__general_dot_replication__pb2.EnableVolumeReplicationRequest.SerializeToString, - response_deserializer=controller_dot_csi__general_dot_replication__pb2.EnableVolumeReplicationResponse.FromString, - ) - self.DisableVolumeReplication = channel.unary_unary( - '/replication.Controller/DisableVolumeReplication', - request_serializer=controller_dot_csi__general_dot_replication__pb2.DisableVolumeReplicationRequest.SerializeToString, - response_deserializer=controller_dot_csi__general_dot_replication__pb2.DisableVolumeReplicationResponse.FromString, - ) - self.PromoteVolume = channel.unary_unary( - '/replication.Controller/PromoteVolume', - request_serializer=controller_dot_csi__general_dot_replication__pb2.PromoteVolumeRequest.SerializeToString, - response_deserializer=controller_dot_csi__general_dot_replication__pb2.PromoteVolumeResponse.FromString, - ) - self.DemoteVolume = channel.unary_unary( - '/replication.Controller/DemoteVolume', - request_serializer=controller_dot_csi__general_dot_replication__pb2.DemoteVolumeRequest.SerializeToString, - response_deserializer=controller_dot_csi__general_dot_replication__pb2.DemoteVolumeResponse.FromString, - ) - self.ResyncVolume = channel.unary_unary( - '/replication.Controller/ResyncVolume', - request_serializer=controller_dot_csi__general_dot_replication__pb2.ResyncVolumeRequest.SerializeToString, - response_deserializer=controller_dot_csi__general_dot_replication__pb2.ResyncVolumeResponse.FromString, - ) - - -class ControllerServicer(object): - """Controller holds the RPC Methods for replication and all the methods it - exposes should be idempotent. - """ - - def EnableVolumeReplication(self, request, context): - """EnableVolumeReplication RPC call to enable the volume replication. - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details('Method not implemented!') - raise NotImplementedError('Method not implemented!') - - def DisableVolumeReplication(self, request, context): - """DisableVolumeReplication RPC call to disable the volume replication. - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details('Method not implemented!') - raise NotImplementedError('Method not implemented!') - - def PromoteVolume(self, request, context): - """PromoteVolume RPC call to promote the volume. - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details('Method not implemented!') - raise NotImplementedError('Method not implemented!') - - def DemoteVolume(self, request, context): - """DemoteVolume RPC call to demote the volume. - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details('Method not implemented!') - raise NotImplementedError('Method not implemented!') - - def ResyncVolume(self, request, context): - """ResyncVolume RPC call to resync the volume. - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details('Method not implemented!') - raise NotImplementedError('Method not implemented!') - - -def add_ControllerServicer_to_server(servicer, server): - rpc_method_handlers = { - 'EnableVolumeReplication': grpc.unary_unary_rpc_method_handler( - servicer.EnableVolumeReplication, - request_deserializer=controller_dot_csi__general_dot_replication__pb2.EnableVolumeReplicationRequest.FromString, - response_serializer=controller_dot_csi__general_dot_replication__pb2.EnableVolumeReplicationResponse.SerializeToString, - ), - 'DisableVolumeReplication': grpc.unary_unary_rpc_method_handler( - servicer.DisableVolumeReplication, - request_deserializer=controller_dot_csi__general_dot_replication__pb2.DisableVolumeReplicationRequest.FromString, - response_serializer=controller_dot_csi__general_dot_replication__pb2.DisableVolumeReplicationResponse.SerializeToString, - ), - 'PromoteVolume': grpc.unary_unary_rpc_method_handler( - servicer.PromoteVolume, - request_deserializer=controller_dot_csi__general_dot_replication__pb2.PromoteVolumeRequest.FromString, - response_serializer=controller_dot_csi__general_dot_replication__pb2.PromoteVolumeResponse.SerializeToString, - ), - 'DemoteVolume': grpc.unary_unary_rpc_method_handler( - servicer.DemoteVolume, - request_deserializer=controller_dot_csi__general_dot_replication__pb2.DemoteVolumeRequest.FromString, - response_serializer=controller_dot_csi__general_dot_replication__pb2.DemoteVolumeResponse.SerializeToString, - ), - 'ResyncVolume': grpc.unary_unary_rpc_method_handler( - servicer.ResyncVolume, - request_deserializer=controller_dot_csi__general_dot_replication__pb2.ResyncVolumeRequest.FromString, - response_serializer=controller_dot_csi__general_dot_replication__pb2.ResyncVolumeResponse.SerializeToString, - ), - } - generic_handler = grpc.method_handlers_generic_handler( - 'replication.Controller', rpc_method_handlers) - server.add_generic_rpc_handlers((generic_handler,)) diff --git a/controller/requirements.txt b/controller/requirements.txt index a166d396c..3167ac7d5 100644 --- a/controller/requirements.txt +++ b/controller/requirements.txt @@ -1,6 +1,6 @@ grpcio==1.41.1 grpcio-tools==1.41.1 -protobuf==3.13.0 +protobuf==3.15.0 pyyaml==5.4 munch==2.3.2 retry==0.9.2 diff --git a/controller/scripts/csi_pb2.sh b/controller/scripts/csi_general/csi_pb2.sh old mode 100644 new mode 100755 similarity index 91% rename from controller/scripts/csi_pb2.sh rename to controller/scripts/csi_general/csi_pb2.sh index fa878d82f..c21d51b0c --- a/controller/scripts/csi_pb2.sh +++ b/controller/scripts/csi_general/csi_pb2.sh @@ -3,7 +3,7 @@ set -x CSI_VERSION="v1.5.0" ADDONS_VERSION="v0.1.1" -PB2_DIR="controller/csi_general" +PB2_DIR="csi_general" mkdir -p ./proto/${PB2_DIR} cd ./proto/${PB2_DIR} @@ -19,3 +19,4 @@ python -m grpc_tools.protoc --proto_path=proto \ proto/${PB2_DIR}/*.proto rm -rf ./proto/ +touch ${PB2_DIR}/__init__.py diff --git a/controller/scripts/csi_general/setup.py b/controller/scripts/csi_general/setup.py new file mode 100644 index 000000000..56b50203d --- /dev/null +++ b/controller/scripts/csi_general/setup.py @@ -0,0 +1,3 @@ +import setuptools + +setuptools.setup(name='csi_general', packages=['csi_general']) diff --git a/controller/scripts/lint.ini b/controller/scripts/lint.ini index 59d72cbcf..b31f69a1f 100644 --- a/controller/scripts/lint.ini +++ b/controller/scripts/lint.ini @@ -24,10 +24,8 @@ ignore-patterns=.*_pb2.*[.]py disable= # easy: raise-missing-from, # W - happened only on Jenkins, add "from" after some of the "raise" - super-init-not-called, # W - always call parent init (to allow valid inheritance in future code) - invalid-name, redefined-builtin, redefined-outer-name, # C, W, W - bad/colliding names: e.g. lower-case const, e.g. id + redefined-builtin, redefined-outer-name, # W, W - colliding names: e.g. type, e.g. config no-self-use, # R - some functions should be made static - arguments-differ, signature-differs, # W - bad method override: keep same args num+names, keep same args default values protected-access, # W - convert private-methods UTs to public. some might require to add mocks no-member, # E - fix easy ones (_AssertRaisesContext,Base*Exception,Abstract*Test), disable the rest in code (protobuf) diff --git a/controller/tests/array_action/ds8k/test_array_mediator_ds8k.py b/controller/tests/array_action/ds8k/test_array_mediator_ds8k.py index 6ee1c07dd..3d6df3306 100644 --- a/controller/tests/array_action/ds8k/test_array_mediator_ds8k.py +++ b/controller/tests/array_action/ds8k/test_array_mediator_ds8k.py @@ -70,6 +70,7 @@ def setUp(self): ) self.array = DS8KArrayMediator("user", "password", self.endpoint) + self.array.volume_cache = Mock() def test_connect_with_incorrect_credentials(self): self.client_mock.get_system.side_effect = \ @@ -111,6 +112,31 @@ def test_get_volume_with_no_pool(self): with self.assertRaises(array_errors.PoolParameterIsMissing): self.array.get_volume("fake_name") + def _test_get_volume(self, with_cache=False): + if with_cache: + self.array.volume_cache.get.return_value = self.volume_response.id + self.client_mock.get_volume.return_value = self.volume_response + else: + self.array.volume_cache.get.return_value = None + self.client_mock.get_volumes_by_pool.return_value = [self.volume_response] + volume = self.array.get_volume( + self.volume_response.name, + pool=self.volume_response.pool + ) + + self.assertEqual(volume.name, self.volume_response.name) + self.array.volume_cache.add_or_delete.assert_called_once_with(self.volume_response.name, + self.volume_response.id) + + def test_get_volume_with_empty_cache(self, ): + self._test_get_volume() + self.client_mock.get_volumes_by_pool.assert_called_once_with(self.volume_response.pool) + + def test_get_volume_with_volume_in_cache(self): + self._test_get_volume(with_cache=True) + self.client_mock.get_volume.assert_called_once_with(self.volume_response.id) + self.client_mock.get_volumes_by_pool.assert_not_called() + def test_get_volume_with_pool_context(self): self.client_mock.get_volumes_by_pool.return_value = [ self.volume_response, @@ -120,6 +146,7 @@ def test_get_volume_with_pool_context(self): pool=self.volume_response.pool ) self.assertEqual(volume.name, self.volume_response.name) + self.client_mock.get_volumes_by_pool.assert_called_once_with(self.volume_response.pool) def test_get_volume_with_pool_context_not_found(self): self.client_mock.get_volumes_by_pool.return_value = [ @@ -132,22 +159,26 @@ def test_get_volume_with_pool_context_not_found(self): ) def test_create_volume_with_default_space_efficiency_success(self): - self._test_create_volume_with_space_efficiency_success('none') + self._test_create_volume_success(space_efficiency='none') def test_create_volume_with_thin_space_efficiency_success(self): - self._test_create_volume_with_space_efficiency_success('thin') + self._test_create_volume_success(space_efficiency='thin') def test_create_volume_with_empty_space_efficiency_success(self): - self._test_create_volume_with_space_efficiency_success('') + self._test_create_volume_success(space_efficiency='') - def _test_create_volume_with_space_efficiency_success(self, space_efficiency): + def test_create_volume_with_empty_cache(self): + self._test_create_volume_success() + self.array.volume_cache.add.assert_called_once_with(self.volume_response.name, self.volume_response.id) + + def _test_create_volume_success(self, space_efficiency=''): self.client_mock.create_volume.return_value = self.volume_response self.client_mock.get_volume.return_value = self.volume_response name = self.volume_response.name size_in_bytes = self.volume_response.cap pool_id = self.volume_response.pool volume = self.array.create_volume( - name, size_in_bytes, space_efficiency, pool_id, + name, size_in_bytes, space_efficiency, pool_id, None ) if space_efficiency == 'thin': space_efficiency = 'ese' @@ -156,50 +187,48 @@ def _test_create_volume_with_space_efficiency_success(self, space_efficiency): self.client_mock.create_volume.assert_called_once_with( pool_id=pool_id, capacity_in_bytes=self.volume_response.cap, - tp=space_efficiency, + thin_provisioning=space_efficiency, name='test_name', ) self.assertEqual(volume.name, self.volume_response.name) - def test_create_volume_raise_already_exists(self): - self.client_mock.get_volumes_by_pool.return_value = [ - self.volume_response, - ] - pool_id = self.volume_response.pool - with self.assertRaises(array_errors.VolumeAlreadyExists): - self.array.create_volume(self.volume_response.name, "1", 'thin', pool_id) - - def test_create_volume_fail_with_ClientException(self): + def test_create_volume_fail_with_client_exception(self): self.client_mock.create_volume.side_effect = ClientException("500") with self.assertRaises(array_errors.VolumeCreationError): - self.array.create_volume("fake_name", 1, 'thin', "fake_pool") + self.array.create_volume("fake_name", 1, 'thin', "fake_pool", None) def test_create_volume_fail_with_pool_not_found(self): self.client_mock.create_volume.side_effect = NotFound("404", message="BE7A0001") with self.assertRaises(array_errors.PoolDoesNotExist): - self.array.create_volume("fake_name", 1, 'thin', "fake_pool") + self.array.create_volume("fake_name", 1, 'thin', "fake_pool", None) def test_create_volume_fail_with_incorrect_id(self): - self.client_mock.get_volumes_by_pool.side_effect = InternalServerError("500", message="BE7A0005") + self.client_mock.create_volume.side_effect = InternalServerError("500", message="BE7A0005") with self.assertRaises(array_errors.PoolDoesNotExist): - self.array.create_volume("fake_name", 1, 'thin', "fake_pool") + self.array.create_volume("fake_name", 1, 'thin', "fake_pool", None) def test_create_volume_fail_with_no_space_in_pool(self): - self.client_mock.get_volumes_by_pool.side_effect = InternalServerError("500", message="BE534459") + self.client_mock.create_volume.side_effect = InternalServerError("500", message="BE534459") with self.assertRaises(array_errors.NotEnoughSpaceInPool): - self.array.create_volume("fake_name", 1, 'thin', "fake_pool") + self.array.create_volume("fake_name", 1, 'thin', "fake_pool", None) def test_delete_volume(self): - scsi_id = "6005076306FFD3010000000000000001" + scsi_id = "volume_scsi_id_{}".format(self.volume_response.id) + self.array.delete_volume(scsi_id) + self.client_mock.delete_volume.assert_called_once_with(volume_id=self.volume_response.id) + + def test_delete_volume_with_remove_from_cache(self): + self.client_mock.get_volume.return_value = self.volume_response + scsi_id = "volume_scsi_id_{}".format(self.volume_response.id) self.array.delete_volume(scsi_id) - self.client_mock.delete_volume.assert_called_once_with(volume_id=scsi_id[-4:]) + self.array.volume_cache.remove.assert_called_once_with(self.volume_response.name) - def test_delete_volume_fail_with_ClientException(self): + def test_delete_volume_fail_with_client_exception(self): self.client_mock.delete_volume.side_effect = ClientException("500") with self.assertRaises(array_errors.VolumeDeletionError): self.array.delete_volume("fake_id") - def test_delete_volume_fail_with_NotFound(self): + def test_delete_volume_fail_with_not_found(self): self.client_mock.delete_volume.side_effect = NotFound("404") with self.assertRaises(array_errors.ObjectNotFoundError): self.array.delete_volume("fake_id") @@ -266,7 +295,7 @@ def test_delete_volume_with_flashcopy_as_target_success(self): self.client_mock.delete_flashcopy.assert_called_once_with("0001:0002") self.client_mock.delete_volume.assert_called_once_with(volume_id="0001") - def test_get_volume_mappings_fail_with_ClientException(self): + def test_get_volume_mappings_fail_with_client_exception(self): self.client_mock.get_hosts.side_effect = ClientException("500") with self.assertRaises(ClientException): self.array.get_volume_mappings("fake_name") @@ -315,7 +344,7 @@ def test_map_volume_no_available_lun(self): with self.assertRaises(array_errors.NoAvailableLunError): self.array.map_volume("fake_name", "fake_host", "fake_connectivity_type") - def test_map_volume_fail_with_ClientException(self): + def test_map_volume_fail_with_client_exception(self): self.client_mock.map_volume_to_host.side_effect = ClientException("500") with self.assertRaises(array_errors.MappingError): self.array.map_volume("fake_name", "fake_host", "fake_connectivity_type") @@ -344,7 +373,7 @@ def test_unmap_volume_volume_not_found(self): with self.assertRaises(array_errors.ObjectNotFoundError): self.array.unmap_volume("fake_name", "fake_host") - def test_unmap_volume_fail_with_ClientException(self): + def test_unmap_volume_fail_with_client_exception(self): volume_id = "0001" lunid = "1" host_name = "test_host" @@ -374,10 +403,10 @@ def test_unmap_volume(self): self.client_mock.unmap_volume_from_host.assert_called_once_with(host_name=host_name, lunid=lunid) - def test_get_array_fc_wwns_fail_with_ClientException(self): + def test_get_array_fc_wwns_fail_with_client_exception(self): self.client_mock.get_host.side_effect = ClientException("500") with self.assertRaises(ClientException): - self.array.get_array_fc_wwns() + self.array.get_array_fc_wwns(None) def test_get_array_fc_wwns_skip_offline_port(self): wwpn1 = "fake_wwpn" @@ -393,7 +422,7 @@ def test_get_array_fc_wwns_skip_offline_port(self): LOGIN_PORT_STATE: "offline", } ]}) - self.assertListEqual(self.array.get_array_fc_wwns(), [wwpn1]) + self.assertListEqual(self.array.get_array_fc_wwns(None), [wwpn1]) def test_get_array_fc_wwns(self): wwpn = "fake_wwpn" @@ -404,7 +433,7 @@ def test_get_array_fc_wwns(self): LOGIN_PORT_STATE: LOGIN_PORT_STATE_ONLINE } ]}) - self.assertListEqual(self.array.get_array_fc_wwns(), [wwpn]) + self.assertListEqual(self.array.get_array_fc_wwns(None), [wwpn]) def test_get_host_by_identifiers(self): host_name = "test_host" @@ -470,17 +499,32 @@ def test_get_snapshot_failed_with_incorrect_id(self): with self.assertRaises(array_errors.IllegalObjectID): self.array.get_snapshot("volume_id", "test_name", pool=None) - def test_get_snapshot_success(self): + def _test_get_snapshot_success(self, with_cache=False): + if with_cache: + self.array.volume_cache.get.return_value = self.snapshot_response.id + else: + self.array.volume_cache.get.return_value = None target_volume = self._prepare_mocks_for_snapshot() volume = self.array.get_snapshot("volume_id", "test_name", pool=self.volume_response.pool) self.assertEqual(volume.name, target_volume.name) + self.array.volume_cache.add_or_delete.assert_called_once_with(target_volume.name, + target_volume.id) + + def test_get_snapshot_with_empty_cache(self): + self._test_get_snapshot_success() + self.client_mock.get_volumes_by_pool.assert_called_once_with(self.snapshot_response.pool) + + def test_get_snapshot_with_volume_in_cache(self): + self._test_get_snapshot_success(with_cache=True) + self.client_mock.get_volume.assert_called_once_with(self.snapshot_response.id) + self.client_mock.get_volumes_by_pool.assert_not_called() def test_get_snapshot_no_pool_success(self): target_volume = self._prepare_mocks_for_snapshot() volume = self.array.get_snapshot("volume_id", "test_name", pool=None) self.assertEqual(volume.name, target_volume.name) - def _prepare_mocks_for_create_snapshot(self, tp="none"): + def _prepare_mocks_for_create_snapshot(self, thin_provisioning="none"): self.client_mock.create_volume = Mock() self.client_mock.get_volume.side_effect = [ Munch( @@ -488,7 +532,7 @@ def _prepare_mocks_for_create_snapshot(self, tp="none"): "id": "0001", "name": "source_volume", "pool": "fake_pool", - "tp": tp, + "tp": thin_provisioning, } ), Mock(), @@ -549,7 +593,14 @@ def test_create_snapshot_success(self): self.assertEqual(snapshot.name, snapshot_response.name) self.assertEqual(snapshot.id, self.array._generate_volume_scsi_identifier(snapshot_response.id)) self.client_mock.create_volume.assert_called_once_with(name='target_volume', capacity_in_bytes=1073741824, - pool_id='fake_pool', tp='none') + pool_id='fake_pool', thin_provisioning='none') + + def test_create_snapshot_with_empty_cache(self): + self._prepare_mocks_for_create_snapshot() + + self.array.create_snapshot("volume_id", "target_volume", space_efficiency=None, pool=None) + + self.array.volume_cache.add.assert_called_once_with(self.snapshot_response.name, self.snapshot_response.id) def test_create_snapshot_with_different_pool_success(self): self._prepare_mocks_for_create_snapshot() @@ -557,11 +608,11 @@ def test_create_snapshot_with_different_pool_success(self): self.array.create_snapshot("volume_id", "target_volume", space_efficiency=None, pool="different_pool") self.client_mock.create_volume.assert_called_once_with(name='target_volume', capacity_in_bytes=1073741824, - pool_id='different_pool', tp='none') + pool_id='different_pool', thin_provisioning='none') def _test_create_snapshot_with_space_efficiency_success(self, source_volume_space_efficiency, space_efficiency_called, space_efficiency_parameter=None): - self._prepare_mocks_for_create_snapshot(tp=source_volume_space_efficiency) + self._prepare_mocks_for_create_snapshot(thin_provisioning=source_volume_space_efficiency) if space_efficiency_parameter is None: self.array.create_snapshot("volume_id", "target_volume", space_efficiency=None, pool=None) @@ -570,7 +621,8 @@ def _test_create_snapshot_with_space_efficiency_success(self, source_volume_spac pool=None) self.client_mock.create_volume.assert_called_with(name='target_volume', capacity_in_bytes=1073741824, - pool_id='fake_pool', tp=space_efficiency_called) + pool_id='fake_pool', + thin_provisioning=space_efficiency_called) def test_create_snapshot_with_specified_source_volume_space_efficiency_success(self): self._test_create_snapshot_with_space_efficiency_success(source_volume_space_efficiency="none", @@ -615,20 +667,26 @@ def test_delete_snapshot(self): self.client_mock.delete_volume.assert_called_once() self.client_mock.delete_flashcopy.assert_called_once_with(self.flashcopy_response.id) - def test_delete_snapshot_flashcopy_fail_with_ClientException(self): + def test_delete_snapshot_with_remove_from_cache(self): + self._prepare_mocks_for_snapshot() + self.array.delete_snapshot(self.snapshot_response.id) + + self.array.volume_cache.remove.assert_called_once_with(self.snapshot_response.name) + + def test_delete_snapshot_flashcopy_fail_with_client_exception(self): self._prepare_mocks_for_snapshot() self.client_mock.delete_flashcopy.side_effect = ClientException("500") self.client_mock.get_volume.return_value = self.snapshot_response with self.assertRaises(ClientException): self.array.delete_snapshot("fake_name") - def test_delete_snapshot_fail_with_ClientException(self): + def test_delete_snapshot_fail_with_client_exception(self): self._prepare_mocks_for_snapshot() self.client_mock.delete_volume.side_effect = ClientException("500") with self.assertRaises(array_errors.VolumeDeletionError): self.array.delete_snapshot("fake_id") - def test_delete_snapshot_fail_with_NotFound(self): + def test_delete_snapshot_fail_with_not_found(self): self.client_mock.get_volume.side_effect = NotFound("404") with self.assertRaises(array_errors.ObjectNotFoundError): self.array.delete_snapshot("fake_id") diff --git a/controller/tests/array_action/svc/array_mediator_svc_test.py b/controller/tests/array_action/svc/array_mediator_svc_test.py index af32ffa2f..af9db22c2 100644 --- a/controller/tests/array_action/svc/array_mediator_svc_test.py +++ b/controller/tests/array_action/svc/array_mediator_svc_test.py @@ -1,16 +1,14 @@ import unittest -from mock import patch, Mock, call +from mock import patch, Mock, call, PropertyMock from munch import Munch from pysvc import errors as svc_errors -from pysvc.unified.response import CLIFailureError +from pysvc.unified.response import CLIFailureError, SVCResponse import controller.array_action.config as config import controller.array_action.errors as array_errors from controller.array_action.array_mediator_svc import SVCArrayMediator, build_kwargs_from_parameters, \ - HOST_ID_PARAM, HOST_NAME_PARAM, HOST_NQN_PARAM, HOST_WWPNS_PARAM, HOST_ISCSI_NAMES_PARAM, FCMAP_STATUS_DONE, YES, \ - HOST_PORTSET_ID -from controller.array_action.svc_cli_result_reader import SVCListResultsElement + FCMAP_STATUS_DONE, YES from controller.common.node_info import Initiators EMPTY_BYTES = b'' @@ -23,7 +21,8 @@ def setUp(self): with patch("controller.array_action.array_mediator_svc.SVCArrayMediator._connect"): self.svc = SVCArrayMediator("user", "password", self.endpoint) self.svc.client = Mock() - self.svc.client.svcinfo.lssystem.return_value = [Munch({'location': 'local', 'id_alias': 'fake_identifier'})] + self.svc.client.svcinfo.lssystem.return_value = [Munch({'location': 'local', + 'id_alias': 'fake_identifier'})] node = Munch({'id': '1', 'name': 'node1', 'iscsi_name': 'iqn.1986-03.com.ibm:2145.v7k1.node1', 'status': 'online'}) self.svc.client.svcinfo.lsnode.return_value = [node] @@ -45,7 +44,17 @@ def _create_dummy_fcmap(self, source_name, id_value): 'copy_rate': 'non_zero_value', 'rc_controlled': 'no'}) - def test_raise_ManagementIPsNotSupportError_in_init(self): + @patch("controller.array_action.array_mediator_svc.connect") + def test_init_unsupported_system_version(self, connect_mock): + code_level_below_min_supported = '7.7.77.77 (build 777.77.7777777777777)' + svc_mock = Mock() + svc_mock.svcinfo.lssystem.return_value = [Munch({'location': 'local', + 'code_level': code_level_below_min_supported})] + connect_mock.return_value = svc_mock + with self.assertRaises(array_errors.UnsupportedStorageVersionError): + SVCArrayMediator("user", "password", self.endpoint) + + def test_raise_management_ips_not_support_error_in_init(self): self.endpoint = ["IP_1", "IP_2"] with self.assertRaises( array_errors.StorageManagementIPsNotSupportError): @@ -56,9 +65,9 @@ def test_raise_ManagementIPsNotSupportError_in_init(self): array_errors.StorageManagementIPsNotSupportError): SVCArrayMediator("user", "password", self.endpoint) - @patch("pysvc.unified.client.connect") - def test_connect_errors(self, mock_connect): - mock_connect.side_effect = [ + @patch("controller.array_action.array_mediator_svc.connect") + def test_connect_errors(self, connect_mock): + connect_mock.side_effect = [ svc_errors.IncorrectCredentials('Failed_a')] with self.assertRaises(array_errors.CredentialsError): self.svc._connect() @@ -113,6 +122,17 @@ def test_get_volume_hyperswap_has_no_source(self): self.assertIsNone(volume.copy_source_id) + def _prepare_stretched_volume_mock(self): + cli_volume = self._get_cli_volume(pool_name=['many', 'pool1', 'pool2']) + self.svc.client.svcinfo.lsvdisk.return_value = Mock(as_single_element=cli_volume) + + def test_get_volume_stretched_return_correct_pools(self): + self._prepare_stretched_volume_mock() + + volume = self.svc.get_volume("volume_name") + + self.assertEqual(volume.pool, 'pool1:pool2') + def test_get_volume_raise_exception(self): self._test_mediator_method_client_error(self.svc.get_volume, ("volume",), self.svc.client.svcinfo.lsvdisk, Exception, Exception) @@ -124,12 +144,13 @@ def test_get_volume_returns_nothing(self): self.svc.get_volume("volume") def _test_create_volume_mkvolume_cli_failure_error(self, error_message_id, expected_error, volume_name="volume"): - self._test_mediator_method_client_cli_failure_error(self.svc.create_volume, (volume_name, 10, "thin", "pool"), + self._test_mediator_method_client_cli_failure_error(self.svc.create_volume, + (volume_name, 10, "thin", "pool", None), self.svc.client.svctask.mkvolume, error_message_id, expected_error) def test_create_volume_raise_exceptions(self): - self._test_mediator_method_client_error(self.svc.create_volume, ("volume", 10, "thin", "pool"), + self._test_mediator_method_client_error(self.svc.create_volume, ("volume", 10, "thin", "pool", None), self.svc.client.svctask.mkvolume, Exception, Exception) self._test_create_volume_mkvolume_cli_failure_error("Failed", CLIFailureError) self._test_create_volume_mkvolume_cli_failure_error("CMMVC8710E", array_errors.NotEnoughSpaceInPool) @@ -145,7 +166,7 @@ def _test_create_volume_success(self, space_efficiency): self.svc.client.svctask.mkvolume.return_value = Mock() vol_ret = Mock(as_single_element=self._get_cli_volume()) self.svc.client.svcinfo.lsvdisk.return_value = vol_ret - volume = self.svc.create_volume("test_volume", 1024, space_efficiency, "pool_name") + volume = self.svc.create_volume("test_volume", 1024, space_efficiency, "pool_name", None) self.assertEqual(volume.capacity_bytes, 1024) self.assertEqual(volume.array_type, 'SVC') @@ -300,6 +321,7 @@ def _get_cli_volume(with_deduplicated_copy=True, name='source_volume', pool_name 'name': name, 'capacity': '1024', 'mdisk_grp_name': pool_name, + 'IO_group_name': 'iogrp0', 'FC_id': '', 'se_copy': se_copy, 'deduplicated_copy': deduplicated_copy, @@ -419,38 +441,46 @@ def test_get_object_by_id_volume_success(self): volume = self.svc.get_object_by_id("volume_id", "volume") self.assertEqual(volume.name, "volume_id") - def _get_custom_dedup_cli_volume(self, support_deduplicated_copy, with_deduplicated_copy, name='source_volume', - pool_name='pool_name'): + def _get_custom_cli_volume(self, support_deduplicated_copy, with_deduplicated_copy, name='source_volume', + pool_name='pool_name'): volume = self._get_cli_volume(with_deduplicated_copy, name=name, pool_name=pool_name) if not support_deduplicated_copy: del volume.deduplicated_copy return volume def _prepare_mocks_for_create_snapshot(self, support_deduplicated_copy=True, source_has_deduplicated_copy=False, - different_pool_site=False): + different_pool_site=False, is_source_stretched=False): self.svc.client.svctask.mkvolume.return_value = Mock() self.svc.client.svctask.mkfcmap.return_value = Mock() - source_volume_to_copy_from = self._get_custom_dedup_cli_volume(support_deduplicated_copy, - source_has_deduplicated_copy) + pool = ['many', 'pool1', 'pool2'] if is_source_stretched else 'pool_name' + source_volume_to_copy_from = self._get_custom_cli_volume(support_deduplicated_copy, + source_has_deduplicated_copy, + pool_name=pool) volumes_to_return = [source_volume_to_copy_from, source_volume_to_copy_from] if different_pool_site: - pools_to_return = [Munch({'site_name': 'pool_site'}), - Munch({'site_name': 'source_volume_site'}), - Munch({'site_name': 'other_volume_site'}), - Munch({'site_name': 'pool_site'})] - self.svc.client.svcinfo.lsmdiskgrp.side_effect = self._mock_cli_objects(pools_to_return) - - auxiliary_volumes = [self._get_cli_volume(name='other_volume', pool_name='other_volume_pool'), - self._get_custom_dedup_cli_volume(support_deduplicated_copy, - source_has_deduplicated_copy, - name='relevant_volume', - pool_name='relevant_volume_pool')] - volumes_to_return.extend(auxiliary_volumes) - - rcrelationships_to_return = [Munch({'aux_vdisk_name': 'other_volume'}), - Munch({'aux_vdisk_name': 'relevant_volume'})] - self.svc.client.svcinfo.lsrcrelationship.return_value = Mock(as_list=rcrelationships_to_return) + if is_source_stretched: + pools_to_return = [Munch({'site_name': 'pool_site'}), + Munch({'site_name': 'source_volume_site'}), + Munch({'site_name': 'pool_site'})] + self.svc.client.svcinfo.lsmdiskgrp.side_effect = self._mock_cli_objects(pools_to_return) + else: + pools_to_return = [Munch({'site_name': 'pool_site'}), + Munch({'site_name': 'source_volume_site'}), + Munch({'site_name': 'other_volume_site'}), + Munch({'site_name': 'pool_site'})] + self.svc.client.svcinfo.lsmdiskgrp.side_effect = self._mock_cli_objects(pools_to_return) + + auxiliary_volumes = [self._get_cli_volume(name='other_volume', pool_name='other_volume_pool'), + self._get_custom_cli_volume(support_deduplicated_copy, + source_has_deduplicated_copy, + name='relevant_volume', + pool_name='relevant_volume_pool')] + volumes_to_return.extend(auxiliary_volumes) + + rcrelationships_to_return = [Munch({'aux_vdisk_name': 'other_volume'}), + Munch({'aux_vdisk_name': 'relevant_volume'})] + self.svc.client.svcinfo.lsrcrelationship.return_value = Mock(as_list=rcrelationships_to_return) target_volume_after_creation = self._get_mapless_target_cli_volume() target_volume_after_mapping = self._get_mapped_target_cli_volume() @@ -524,28 +554,55 @@ def test_create_snapshot_with_different_pool_success(self): self.svc.create_snapshot("source_volume_id", "test_snapshot", space_efficiency=None, pool="different_pool") self.svc.client.svctask.mkvolume.assert_called_once_with(name='test_snapshot', unit='b', size=1024, - pool='different_pool', thin=True) + pool='different_pool', iogrp='iogrp0', + thin=True) - def test_create_snapshot_with_different_site_success(self): + def test_create_snapshot_for_hyperswap_volume_with_different_site_success(self): self._prepare_mocks_for_create_snapshot(different_pool_site=True) self.svc.create_snapshot("source_volume_id", "test_snapshot", space_efficiency=None, pool="different_pool") self.svc.client.svctask.mkfcmap.assert_called_once_with(source="relevant_volume", target="test_snapshot", copyrate=0) + def test_create_snapshot_for_stretched_volume_with_different_site_success(self): + self._prepare_mocks_for_create_snapshot(different_pool_site=True, is_source_stretched=True) + + self.svc.create_snapshot("source_volume_id", "test_snapshot", space_efficiency=None, pool="different_pool") + self.svc.client.svctask.mkfcmap.assert_called_once_with(source="source_volume", target="test_snapshot", + copyrate=0) + + def test_create_snapshot_for_stretched_volume_implicit_pool_success(self): + self._prepare_mocks_for_create_snapshot(is_source_stretched=True) + + self.svc.create_snapshot("source_volume_id", "test_snapshot", space_efficiency=None, pool=None) + self.svc.client.svctask.mkvolume.assert_called_once_with(name='test_snapshot', unit='b', size=1024, + pool='pool1', iogrp='iogrp0', thin=True) + self.svc.client.svctask.mkfcmap.assert_called_once_with(source="source_volume", target="test_snapshot", + copyrate=0) + + def test_create_snapshot_as_stretched_success(self): + self._prepare_mocks_for_create_snapshot() + + self.svc.create_snapshot("source_volume_id", "test_snapshot", space_efficiency=None, pool="pool1:pool2") + self.svc.client.svctask.mkvolume.assert_called_once_with(name='test_snapshot', unit='b', size=1024, + pool='pool1:pool2', iogrp='iogrp0', thin=True) + self.svc.client.svctask.mkfcmap.assert_called_once_with(source="source_volume", target="test_snapshot", + copyrate=0) + def test_create_snapshot_with_specified_source_volume_space_efficiency_success(self): self._prepare_mocks_for_create_snapshot(source_has_deduplicated_copy=True) self.svc.create_snapshot("source_volume_id", "test_snapshot", space_efficiency=None, pool=None) self.svc.client.svctask.mkvolume.assert_called_once_with(name='test_snapshot', unit='b', size=1024, - pool='pool_name', compressed=True, deduplicated=True) + pool='pool_name', iogrp='iogrp0', + compressed=True, deduplicated=True) def test_create_snapshot_with_different_space_efficiency_success(self): self._prepare_mocks_for_create_snapshot(source_has_deduplicated_copy=True) self.svc.create_snapshot("source_volume_id", "test_snapshot", space_efficiency="thin", pool=None) self.svc.client.svctask.mkvolume.assert_called_once_with(name='test_snapshot', unit='b', size=1024, - pool='pool_name', thin=True) + pool='pool_name', iogrp='iogrp0', thin=True) def test_create_snapshot_no_deduplicated_copy_success(self): self._prepare_mocks_for_create_snapshot(support_deduplicated_copy=False) @@ -648,22 +705,25 @@ def test_validate_supported_space_efficiency_success(self): deduplicated_compressed_space_efficiency = config.SPACE_EFFICIENCY_DEDUPLICATED_COMPRESSED self.svc.validate_supported_space_efficiency(deduplicated_compressed_space_efficiency) - def _test_build_kwargs_from_parameters(self, space_efficiency, pool, name, size, expected_space_efficiency_kwargs): + def _test_build_kwargs_from_parameters(self, space_efficiency, pool, io_group, name, size, + expected_space_efficiency_kwargs): expected_kwargs = {'name': name, 'unit': 'b', 'size': size, 'pool': pool} expected_kwargs.update(expected_space_efficiency_kwargs) - actual_kwargs = build_kwargs_from_parameters(space_efficiency, pool, name, size) + if io_group: + expected_kwargs['iogrp'] = io_group + actual_kwargs = build_kwargs_from_parameters(space_efficiency, pool, io_group, name, size) self.assertDictEqual(actual_kwargs, expected_kwargs) def test_build_kwargs_from_parameters(self): size = self.svc._convert_size_bytes(1000) - - self._test_build_kwargs_from_parameters('Thin', 'P1', 'V1', size, {'thin': True}) - self._test_build_kwargs_from_parameters('compressed', 'P2', 'V2', size, {'compressed': True}) - self._test_build_kwargs_from_parameters('dedup_thin', 'P3', 'V3', self.svc._convert_size_bytes(2048), - {'thin': True, 'deduplicated': True}) - self._test_build_kwargs_from_parameters('dedup_compressed', 'P3', 'V3', self.svc._convert_size_bytes(2048), + second_size = self.svc._convert_size_bytes(2048) + self._test_build_kwargs_from_parameters('Thin', 'P1', None, 'V1', size, {'thin': True}) + self._test_build_kwargs_from_parameters('compressed', 'P2', None, 'V2', size, {'compressed': True}) + self._test_build_kwargs_from_parameters('dedup_thin', 'P3', 'IOGRP1', 'V3', second_size, + {'iogrp': 'IOGRP1', 'thin': True, 'deduplicated': True}) + self._test_build_kwargs_from_parameters('dedup_compressed', 'P3', None, 'V3', second_size, {'compressed': True, 'deduplicated': True}) - self._test_build_kwargs_from_parameters('Deduplicated', 'P3', 'V3', self.svc._convert_size_bytes(2048), + self._test_build_kwargs_from_parameters('Deduplicated', 'P3', None, 'V3', second_size, {'compressed': True, 'deduplicated': True}) def test_properties(self): @@ -674,26 +734,26 @@ def test_properties(self): self.assertEqual(SVCArrayMediator.max_connections, 2) self.assertEqual(SVCArrayMediator.max_lun_retries, 10) - def _prepare_mocks_for_get_host_by_identifiers(self, result_reader_iter, custom_host=None): - host_1 = self._get_host_as_dictionary('host_id_1', 'test_host_1', nqn_list=['nqn.test.1'], wwpns_list=['wwn1'], - iscsi_names_list=['iqn.test.1']) - host_2 = self._get_host_as_dictionary('host_id_2', 'test_host_2', nqn_list=['nqn.test.2'], wwpns_list=['wwn2'], - iscsi_names_list=['iqn.test.2']) + def _prepare_mocks_for_get_host_by_identifiers(self, svc_response, custom_host=None): + host_1 = self._get_host_as_munch('host_id_1', 'test_host_1', nqn_list=['nqn.test.1'], wwpns_list=['wwn1'], + iscsi_names_list=['iqn.test.1']) + host_2 = self._get_host_as_munch('host_id_2', 'test_host_2', nqn_list=['nqn.test.2'], wwpns_list=['wwn2'], + iscsi_names_list=['iqn.test.2']) if custom_host: host_3 = custom_host else: - host_3 = self._get_host_as_dictionary('host_id_3', 'test_host_3', nqn_list=['nqn.test.3'], - wwpns_list=['wwn3'], iscsi_names_list=['iqn.test.3']) + host_3 = self._get_host_as_munch('host_id_3', 'test_host_3', nqn_list=['nqn.test.3'], + wwpns_list=['wwn3'], iscsi_names_list=['iqn.test.3']) hosts = [host_1, host_2, host_3] self.svc.client.svcinfo.lshost = Mock() self.svc.client.svcinfo.lshost.return_value = self._get_hosts_list_result(hosts) self.svc.client.send_raw_command = Mock() self.svc.client.send_raw_command.return_value = EMPTY_BYTES, EMPTY_BYTES - result_reader_iter.return_value = self._get_detailed_hosts_list_result(hosts) + svc_response.return_value = hosts - @patch("controller.array_action.svc_cli_result_reader.SVCListResultsReader.__iter__") - def test_get_host_by_identifiers_returns_host_not_found(self, result_reader_iter): - self._prepare_mocks_for_get_host_by_identifiers(result_reader_iter) + @patch.object(SVCResponse, 'as_list', new_callable=PropertyMock) + def test_get_host_by_identifiers_returns_host_not_found(self, svc_response): + self._prepare_mocks_for_get_host_by_identifiers(svc_response) with self.assertRaises(array_errors.HostNotFoundError): self.svc.get_host_by_host_identifiers(Initiators('Test_nqn', ['Test_wwn'], 'Test_iqn')) @@ -704,104 +764,104 @@ def test_get_host_by_identifier_return_host_not_found_when_no_hosts_exist(self): with self.assertRaises(array_errors.HostNotFoundError): self.svc.get_host_by_host_identifiers(Initiators('Test_nqn', ['Test_wwn'], 'Test_iqn')) - @patch("controller.array_action.svc_cli_result_reader.SVCListResultsReader.__iter__") - def test_get_host_by_identifiers_raise_multiplehostsfounderror(self, result_reader_iter): - self._prepare_mocks_for_get_host_by_identifiers(result_reader_iter) + @patch.object(SVCResponse, 'as_list', new_callable=PropertyMock) + def test_get_host_by_identifiers_raise_multiplehostsfounderror(self, svc_response): + self._prepare_mocks_for_get_host_by_identifiers(svc_response) with self.assertRaises(array_errors.MultipleHostsFoundError): self.svc.get_host_by_host_identifiers(Initiators('Test_nqn', ['wwn2'], 'iqn.test.3')) - @patch("controller.array_action.svc_cli_result_reader.SVCListResultsReader.__iter__") - def test_get_host_by_identifiers_return_iscsi_host(self, result_reader_iter): - self._prepare_mocks_for_get_host_by_identifiers(result_reader_iter) + @patch.object(SVCResponse, 'as_list', new_callable=PropertyMock) + def test_get_host_by_identifiers_return_iscsi_host(self, svc_response): + self._prepare_mocks_for_get_host_by_identifiers(svc_response) hostname, connectivity_types = self.svc.get_host_by_host_identifiers( Initiators('Test_nqn', ['Test_wwn'], 'iqn.test.2')) self.assertEqual('test_host_2', hostname) self.assertEqual([config.ISCSI_CONNECTIVITY_TYPE], connectivity_types) - @patch("controller.array_action.svc_cli_result_reader.SVCListResultsReader.__iter__") - def test_get_host_by_identifiers_no_other_ports_return_iscsi_host(self, result_reader_iter): - host_with_iqn = self._get_host_as_dictionary('costume_host_id', 'test_costume_host', - iscsi_names_list=['iqn.test.costume']) - self._prepare_mocks_for_get_host_by_identifiers(result_reader_iter, custom_host=host_with_iqn) + @patch.object(SVCResponse, 'as_list', new_callable=PropertyMock) + def test_get_host_by_identifiers_no_other_ports_return_iscsi_host(self, svc_response): + host_with_iqn = self._get_host_as_munch('costume_host_id', 'test_costume_host', + iscsi_names_list=['iqn.test.costume']) + self._prepare_mocks_for_get_host_by_identifiers(svc_response, custom_host=host_with_iqn) hostname, connectivity_types = self.svc.get_host_by_host_identifiers( Initiators('Test_nqn', ['Test_wwn'], 'iqn.test.costume')) self.assertEqual('test_costume_host', hostname) self.assertEqual([config.ISCSI_CONNECTIVITY_TYPE], connectivity_types) - @patch("controller.array_action.svc_cli_result_reader.SVCListResultsReader.__iter__") - def test_get_host_by_identifiers_return_iscsi_host_with_list_iqn(self, result_reader_iter): - host_with_iqn_list = self._get_host_as_dictionary('costume_host_id', 'test_costume_host', wwpns_list=['wwns'], - iscsi_names_list=['iqn.test.s1', 'iqn.test.s2']) - self._prepare_mocks_for_get_host_by_identifiers(result_reader_iter, custom_host=host_with_iqn_list) + @patch.object(SVCResponse, 'as_list', new_callable=PropertyMock) + def test_get_host_by_identifiers_return_iscsi_host_with_list_iqn(self, svc_response): + host_with_iqn_list = self._get_host_as_munch('costume_host_id', 'test_costume_host', wwpns_list=['wwns'], + iscsi_names_list=['iqn.test.s1', 'iqn.test.s2']) + self._prepare_mocks_for_get_host_by_identifiers(svc_response, custom_host=host_with_iqn_list) hostname, connectivity_types = self.svc.get_host_by_host_identifiers( Initiators('Test_nqn', ['Test_wwn'], 'iqn.test.s1')) self.assertEqual('test_costume_host', hostname) self.assertEqual([config.ISCSI_CONNECTIVITY_TYPE], connectivity_types) - @patch("controller.array_action.svc_cli_result_reader.SVCListResultsReader.__iter__") - def test_get_host_by_identifiers_return_nvme_host(self, result_reader_iter): - self._prepare_mocks_for_get_host_by_identifiers(result_reader_iter) + @patch.object(SVCResponse, 'as_list', new_callable=PropertyMock) + def test_get_host_by_identifiers_return_nvme_host(self, svc_response): + self._prepare_mocks_for_get_host_by_identifiers(svc_response) hostname, connectivity_types = self.svc.get_host_by_host_identifiers( Initiators('nqn.test.3', ['Test_wwn'], 'iqn.test.6')) self.assertEqual('test_host_3', hostname) self.assertEqual([config.NVME_OVER_FC_CONNECTIVITY_TYPE], connectivity_types) - @patch("controller.array_action.svc_cli_result_reader.SVCListResultsReader.__iter__") - def test_get_host_by_identifiers_no_other_ports_return_nvme_host(self, result_reader_iter): - host_with_nqn = self._get_host_as_dictionary('costume_host_id', 'test_costume_host', - nqn_list=['nqn.test.costume']) - self._prepare_mocks_for_get_host_by_identifiers(result_reader_iter, custom_host=host_with_nqn) + @patch.object(SVCResponse, 'as_list', new_callable=PropertyMock) + def test_get_host_by_identifiers_no_other_ports_return_nvme_host(self, svc_response): + host_with_nqn = self._get_host_as_munch('costume_host_id', 'test_costume_host', + nqn_list=['nqn.test.costume']) + self._prepare_mocks_for_get_host_by_identifiers(svc_response, custom_host=host_with_nqn) hostname, connectivity_types = self.svc.get_host_by_host_identifiers( Initiators('nqn.test.costume', ['Test_wwn'], 'Test_iqn')) self.assertEqual('test_costume_host', hostname) self.assertEqual([config.NVME_OVER_FC_CONNECTIVITY_TYPE], connectivity_types) - @patch("controller.array_action.svc_cli_result_reader.SVCListResultsReader.__iter__") - def test_get_host_by_identifiers_return_fc_host(self, result_reader_iter): - host_1 = self._get_host_as_dictionary('host_id_1', 'test_host_1', wwpns_list=['wwn1'], iscsi_names_list=[]) - host_2 = self._get_host_as_dictionary('host_id_2', 'test_host_2', wwpns_list=['wwn2'], iscsi_names_list=['']) - host_3 = self._get_host_as_dictionary('host_id_3', 'test_host_3', wwpns_list=['wwn3', 'wwn4'], - iscsi_names_list=['iqn.test.3']) + @patch.object(SVCResponse, 'as_list', new_callable=PropertyMock) + def test_get_host_by_identifiers_return_fc_host(self, svc_response): + host_1 = self._get_host_as_munch('host_id_1', 'test_host_1', wwpns_list=['wwn1'], iscsi_names_list=[]) + host_2 = self._get_host_as_munch('host_id_2', 'test_host_2', wwpns_list=['wwn2'], iscsi_names_list=['']) + host_3 = self._get_host_as_munch('host_id_3', 'test_host_3', wwpns_list=['wwn3', 'wwn4'], + iscsi_names_list=['iqn.test.3']) hosts = [host_1, host_2, host_3] - self._prepare_mocks_for_get_host_by_identifiers(result_reader_iter) + self._prepare_mocks_for_get_host_by_identifiers(svc_response) hostname, connectivity_types = self.svc.get_host_by_host_identifiers( Initiators('Test_nqn', ['wwn4', 'WWN3'], 'iqn.test.6')) self.assertEqual('test_host_3', hostname) self.assertEqual([config.FC_CONNECTIVITY_TYPE], connectivity_types) - result_reader_iter.return_value = self._get_detailed_hosts_list_result(hosts) + svc_response.return_value = hosts hostname, connectivity_types = self.svc.get_host_by_host_identifiers( Initiators('Test_nqn', ['wwn3'], 'iqn.test.6')) self.assertEqual('test_host_3', hostname) self.assertEqual([config.FC_CONNECTIVITY_TYPE], connectivity_types) - @patch("controller.array_action.svc_cli_result_reader.SVCListResultsReader.__iter__") - def test_get_host_by_identifiers_no_other_ports_return_fc_host(self, result_reader_iter): - host_with_wwpn = self._get_host_as_dictionary('costume_host_id', 'test_costume_host', wwpns_list=['WWNs']) - self._prepare_mocks_for_get_host_by_identifiers(result_reader_iter, custom_host=host_with_wwpn) + @patch.object(SVCResponse, 'as_list', new_callable=PropertyMock) + def test_get_host_by_identifiers_no_other_ports_return_fc_host(self, svc_response): + host_with_wwpn = self._get_host_as_munch('costume_host_id', 'test_costume_host', wwpns_list=['WWNs']) + self._prepare_mocks_for_get_host_by_identifiers(svc_response, custom_host=host_with_wwpn) hostname, connectivity_types = self.svc.get_host_by_host_identifiers( Initiators('Test_nqn', ['Test_wwn', 'WWNs'], 'Test_iqn')) self.assertEqual('test_costume_host', hostname) self.assertEqual([config.FC_CONNECTIVITY_TYPE], connectivity_types) - @patch("controller.array_action.svc_cli_result_reader.SVCListResultsReader.__iter__") - def test_get_host_by_identifiers_with_wrong_fc_iscsi_raise_not_found(self, result_reader_iter): - host_1 = self._get_host_as_dictionary('host_id_1', 'test_host_1', wwpns_list=['wwn1'], iscsi_names_list=[]) - host_2 = self._get_host_as_dictionary('host_id_2', 'test_host_2', wwpns_list=['wwn3'], - iscsi_names_list=['iqn.test.2']) - host_3 = self._get_host_as_dictionary('host_id_3', 'test_host_3', wwpns_list=['wwn3'], - iscsi_names_list=['iqn.test.3']) + @patch.object(SVCResponse, 'as_list', new_callable=PropertyMock) + def test_get_host_by_identifiers_with_wrong_fc_iscsi_raise_not_found(self, svc_response): + host_1 = self._get_host_as_munch('host_id_1', 'test_host_1', wwpns_list=['wwn1'], iscsi_names_list=[]) + host_2 = self._get_host_as_munch('host_id_2', 'test_host_2', wwpns_list=['wwn3'], + iscsi_names_list=['iqn.test.2']) + host_3 = self._get_host_as_munch('host_id_3', 'test_host_3', wwpns_list=['wwn3'], + iscsi_names_list=['iqn.test.3']) hosts = [host_1, host_2, host_3] - self._prepare_mocks_for_get_host_by_identifiers(result_reader_iter) + self._prepare_mocks_for_get_host_by_identifiers(svc_response) with self.assertRaises(array_errors.HostNotFoundError): self.svc.get_host_by_host_identifiers(Initiators('Test_nqn', [], '')) - result_reader_iter.return_value = self._get_detailed_hosts_list_result(hosts) + svc_response.return_value = hosts with self.assertRaises(array_errors.HostNotFoundError): self.svc.get_host_by_host_identifiers(Initiators('Test_nqn', ['a', 'b'], '123')) - @patch("controller.array_action.svc_cli_result_reader.SVCListResultsReader.__iter__") - def test_get_host_by_identifiers_return_nvme_fc_and_iscsi(self, result_reader_iter): - self._prepare_mocks_for_get_host_by_identifiers(result_reader_iter) + @patch.object(SVCResponse, 'as_list', new_callable=PropertyMock) + def test_get_host_by_identifiers_return_nvme_fc_and_iscsi(self, svc_response): + self._prepare_mocks_for_get_host_by_identifiers(svc_response) hostname, connectivity_types = self.svc.get_host_by_host_identifiers( Initiators('nqn.test.2', ['WWN2'], 'iqn.test.2')) self.assertEqual('test_host_2', hostname) @@ -809,40 +869,22 @@ def test_get_host_by_identifiers_return_nvme_fc_and_iscsi(self, result_reader_it {config.NVME_OVER_FC_CONNECTIVITY_TYPE, config.FC_CONNECTIVITY_TYPE, config.ISCSI_CONNECTIVITY_TYPE}, set(connectivity_types)) - def _get_host_as_dictionary(self, id, name, nqn_list=None, wwpns_list=None, iscsi_names_list=None, portset_id=None): - res = {HOST_ID_PARAM: id, HOST_NAME_PARAM: name} - if iscsi_names_list: - res[HOST_ISCSI_NAMES_PARAM] = iscsi_names_list + def _get_host_as_munch(self, host_id, host_name, nqn_list=None, wwpns_list=None, iscsi_names_list=None, + portset_id=None): + host = Munch(id=host_id, name=host_name) + if nqn_list: + host.nqn = nqn_list if wwpns_list: - res[HOST_WWPNS_PARAM] = wwpns_list + host.WWPN = wwpns_list + if iscsi_names_list: + host.iscsi_name = iscsi_names_list if portset_id: - res[HOST_PORTSET_ID] = portset_id - if nqn_list: - res[HOST_NQN_PARAM] = nqn_list - return res + host.portset_id = portset_id + return host def _get_hosts_list_result(self, hosts_dict): return [Munch(host_dict) for host_dict in hosts_dict] - def _get_detailed_hosts_list_result(self, hosts_dict): - detailed_hosts_list = [] - for host_dict in hosts_dict: - current_element = SVCListResultsElement() - current_element.add(HOST_ID_PARAM, host_dict.get(HOST_ID_PARAM)) - current_element.add(HOST_NAME_PARAM, host_dict.get(HOST_NAME_PARAM)) - nvme_nqn_list = host_dict.get(HOST_NQN_PARAM, []) - for nqn in nvme_nqn_list: - current_element.add(HOST_NQN_PARAM, nqn) - wwpns_list = host_dict.get(HOST_WWPNS_PARAM, []) - for wwpn in wwpns_list: - current_element.add(HOST_WWPNS_PARAM, wwpn) - iscsi_names_list = host_dict.get(HOST_ISCSI_NAMES_PARAM, []) - for iscsi_name in iscsi_names_list: - current_element.add(HOST_ISCSI_NAMES_PARAM, iscsi_name) - current_element.add(HOST_PORTSET_ID, host_dict.get(HOST_PORTSET_ID)) - detailed_hosts_list.append(current_element) - return iter(detailed_hosts_list) - def test_get_volume_mappings_empty_mapping_list(self): self.svc.client.svcinfo.lsvdiskhostmap.return_value = [] mappings = self.svc.get_volume_mappings("volume") @@ -976,8 +1018,8 @@ def test_unmap_volume_success(self): self.svc.unmap_volume("volume", "host") def _prepare_mocks_for_get_iscsi_targets(self, portset_id=None): - host = self._get_host_as_dictionary('host_id', 'test_host', wwpns_list=['wwn0'], - iscsi_names_list=['iqn.test.0', 'iqn.test.00'], portset_id=portset_id) + host = self._get_host_as_munch('host_id', 'test_host', wwpns_list=['wwn0'], + iscsi_names_list=['iqn.test.0', 'iqn.test.00'], portset_id=portset_id) self.svc.client.svcinfo.lshost = Mock() self.svc.client.svcinfo.lshost.return_value = Mock(as_single_element=host) diff --git a/controller/tests/array_action/svc/svc_cli_result_reader_test.py b/controller/tests/array_action/svc/svc_cli_result_reader_test.py deleted file mode 100644 index 9c08a759e..000000000 --- a/controller/tests/array_action/svc/svc_cli_result_reader_test.py +++ /dev/null @@ -1,62 +0,0 @@ -import unittest - -from controller.array_action import errors -from controller.array_action.svc_cli_result_reader import SVCListResultsReader - -host_1 = "\n".join(("id 1", "name host_1", "WWPN wwpn1", "protocol fc", "WWPN wwpn2")) -host_2 = "\n".join(("id 2", "name host_2", "", " ", "iscsi", "status not active")) -host_3 = "\n".join(("id 3", "name host_3", "iscsi iscsi1")) - - -class TestSVCListReader(unittest.TestCase): - - def test_single_host_success(self): - hosts_reader = SVCListResultsReader(host_1) - hosts_list = list(hosts_reader) - self.assertEqual(len(hosts_list), 1) - self._assert_host_1(hosts_list[0]) - - def test_multiple_hosts_success(self): - hosts_count = 3 - hosts_raw_input = "\n".join((host_1, "\n \n", host_2, host_3, " ")) - assert_methods = [self._assert_host_1, self._assert_host_2, self._assert_host_3] - hosts_reader = SVCListResultsReader(hosts_raw_input) - hosts_list = list(hosts_reader) - self.assertEqual(len(hosts_list), hosts_count) - for i in range(hosts_count): - assert_methods[i](hosts_list[i]) - - def test_no_hosts_empty_input(self): - hosts_reader = SVCListResultsReader("") - hosts_list = list(hosts_reader) - self.assertFalse(hosts_list) - - def test_no_hosts_whitespace_input(self): - hosts_reader = SVCListResultsReader("\n\n\n") - hosts_list = list(hosts_reader) - self.assertFalse(hosts_list) - - def test_illegal_input(self): - illegal_input = "\n".join(("name host_3", "id 3")) - with self.assertRaises(errors.InvalidCliResponseError): - SVCListResultsReader(illegal_input) - - def _assert_host_1(self, host): - self.assertEqual(host.get("id"), "1") - self.assertEqual(host.get("name"), "host_1") - self.assertEqual(host.get_as_list("WWPN"), ["wwpn1", "wwpn2"]) - self.assertEqual(host.get("protocol"), "fc") - self.assertEqual(host.get_as_list("protocol"), ["fc"]) - self.assertEqual(host.get("non_existing_value", "no-value"), "no-value") - self.assertEqual(host.get_as_list("non_existing_value"), []) - - def _assert_host_2(self, host): - self.assertEqual(host.get("id"), "2") - self.assertEqual(host.get("name"), "host_2") - self.assertEqual(host.get("iscsi"), "") - self.assertEqual(host.get("status"), "not active") - - def _assert_host_3(self, host): - self.assertEqual(host.get("id"), "3") - self.assertEqual(host.get("name"), "host_3") - self.assertEqual(host.get("iscsi"), "iscsi1") diff --git a/controller/tests/array_action/test_storage_agent.py b/controller/tests/array_action/test_storage_agent.py index d2bdab090..e7415e3c6 100644 --- a/controller/tests/array_action/test_storage_agent.py +++ b/controller/tests/array_action/test_storage_agent.py @@ -1,6 +1,5 @@ import unittest -from queue import Queue -from threading import Thread +from threading import Lock, Thread from time import sleep from mock import patch, NonCallableMagicMock, Mock @@ -29,6 +28,20 @@ def _fake_socket_connect_test(host, port): return 1 +class Counter: + def __init__(self): + self._value = 0 + self._lock = Lock() + + def increment(self): + with self._lock: + self._value += 1 + + def get_value(self): + with self._lock: + return self._value + + class TestStorageAgent(unittest.TestCase): def setUp(self): @@ -114,7 +127,7 @@ def test_detect_array_type(self, _): with self.assertRaises(FailedToFindStorageSystemType): detect_array_type(["unknown_host", ]) - def test_init_StorageAgent_prepopulates_one_mediator(self): + def test_init_storage_agent_prepopulates_one_mediator(self): # one mediator client is already initialized. self.client_mock.get_system.assert_called_once_with() @@ -160,7 +173,14 @@ def test_get_mediator_find_one_inactive(self): # After some iteration, the inactive client is disconnected and removed. self.assertEqual(self.agent.conn_pool.current_size, 1) - def test_get_multiple_mediators_parallelly_in_different_threads(self): + @staticmethod + def _wait_for_count(count, target_count): + while count.get_value() != target_count: + sleep(0.1) + + def test_get_multiple_mediators_parallely_in_different_threads(self): + keep_alive_lock = Lock() + count = Counter() def verify_mediator(current_size): agent = get_agent(ArrayConnectionInfo(array_addresses=["ds8k_host", ], user="test", password="test")) @@ -169,15 +189,23 @@ def verify_mediator(current_size): self.assertEqual(agent.conn_pool.current_size, current_size) # get_system is called in setUp() too. self.assertEqual(self.client_mock.get_system.call_count, current_size + 1) - sleep(0.2) + + count.increment() + with keep_alive_lock: + pass t1 = Thread(target=verify_mediator, args=(1,)) t2 = Thread(target=verify_mediator, args=(2,)) t3 = Thread(target=verify_mediator, args=(3,)) - t1.start() - t2.start() - t3.start() + with keep_alive_lock: + t1.start() + self._wait_for_count(count, 1) + t2.start() + self._wait_for_count(count, 2) + t3.start() + self._wait_for_count(count, 3) + t1.join() t2.join() t3.join() @@ -193,40 +221,31 @@ def test_get_mediator_find_available_one_before_timeout(self): self._test_get_mediator_timeout(False) def _test_get_mediator_timeout(self, is_timeout=True): - + keep_alive_lock = Lock() timeout = 0.3 - if is_timeout: - timeout = 0.1 def blocking_action(): with get_agent( ArrayConnectionInfo(array_addresses=["ds8k_host", ], user="test", password="test")).get_mediator(): - sleep(0.2) - - def new_action(in_q): - if is_timeout: - with self.assertRaises(array_errors.NoConnectionAvailableException): - with get_agent(ArrayConnectionInfo(array_addresses=["ds8k_host", ], user="test", - password="test")).get_mediator(timeout=timeout): - in_q.put(True) - else: - with get_agent(ArrayConnectionInfo(array_addresses=["ds8k_host", ], user="test", - password="test")).get_mediator(timeout=timeout): - in_q.put(True) + with keep_alive_lock: + pass + + keep_alive_lock.acquire() # max_size for ds8k is 10 for _ in range(10): - t = Thread(target=blocking_action) - t.start() - - # all the clients are in use, the new action waits for an available one. - q = Queue() - new_thread = Thread(target=new_action, args=(q,)) - new_thread.start() - new_thread.join() + thread = Thread(target=blocking_action) + thread.start() + # all the clients are in use, the next section waits for an available one. if is_timeout: - self.assertTrue(q.empty()) - else: - self.assertFalse(q.empty()) - self.assertTrue(q.get() is True) + with self.assertRaises(array_errors.NoConnectionAvailableException): + with get_agent(ArrayConnectionInfo(array_addresses=["ds8k_host", ], user="test", + password="test")).get_mediator(timeout=timeout): + pass + + keep_alive_lock.release() + if not is_timeout: + with get_agent(ArrayConnectionInfo(array_addresses=["ds8k_host", ], user="test", + password="test")).get_mediator(): + pass diff --git a/controller/tests/array_action/xiv/array_mediator_xiv_tests.py b/controller/tests/array_action/xiv/array_mediator_xiv_tests.py index 0e65f1a6a..50099d946 100644 --- a/controller/tests/array_action/xiv/array_mediator_xiv_tests.py +++ b/controller/tests/array_action/xiv/array_mediator_xiv_tests.py @@ -30,12 +30,12 @@ def test_get_volume_raise_correct_errors(self): self.assertIn(error_msg, str(ex.exception)) def test_get_volume_return_correct_value(self): - volume = utils.get_mock_xiv_volume(10, "volume_name", "wwn") - self.mediator.client.cmd.vol_list.return_value = Mock(as_single_element=volume) - res = self.mediator.get_volume("some name") + xcli_volume = utils.get_mock_xiv_volume(10, "volume_name", "wwn") + self.mediator.client.cmd.vol_list.return_value = Mock(as_single_element=xcli_volume) + volume = self.mediator.get_volume("some name") - self.assertEqual(res.capacity_bytes, volume.capacity * 512) - self.assertEqual(res.capacity_bytes, volume.capacity * 512) + self.assertEqual(volume.capacity_bytes, xcli_volume.capacity * 512) + self.assertEqual(volume.capacity_bytes, xcli_volume.capacity * 512) def test_get_volume_raise_illegal_object_name(self): self.mediator.client.cmd.vol_list.side_effect = [xcli_errors.IllegalNameForObjectError("", "volume", "")] @@ -80,7 +80,7 @@ def _get_cli_volume(name='mock_volume', wwn='123'): def _test_create_volume_with_space_efficiency_success(self, space_efficiency): self.mediator.client.cmd.vol_create = Mock() self.mediator.client.cmd.vol_create.return_value = Mock(as_single_element=self._get_cli_volume()) - volume = self.mediator.create_volume("mock_volume", 512, space_efficiency, "fake_pool") + volume = self.mediator.create_volume("mock_volume", 512, space_efficiency, "fake_pool", None) self.mediator.client.cmd.vol_create.assert_called_once_with(vol='mock_volume', size_blocks=1, pool='fake_pool') self.assertEqual(volume.name, "mock_volume") @@ -96,36 +96,36 @@ def test_create_volume_with_not_available_wwn(self): self.mediator.client.cmd.vol_create = Mock() self.mediator.client.cmd.vol_create.return_value = Mock( as_single_element=self._get_cli_volume(wwn="Not Available")) - volume = self.mediator.create_volume("mock_volume", 512, None, "fake_pool") + volume = self.mediator.create_volume("mock_volume", 512, None, "fake_pool", None) self.assertIsNone(volume.copy_source_id) def test_create_volume_raise_illegal_name_for_object(self): self.mediator.client.cmd.vol_create.side_effect = [xcli_errors.IllegalNameForObjectError("", "volume", "")] with self.assertRaises(array_errors.IllegalObjectName): - self.mediator.create_volume("volume", 10, None, "pool1") + self.mediator.create_volume("volume", 10, None, "pool1", None) def test_create_volume_raise_volume_exists_error(self): self.mediator.client.cmd.vol_create.side_effect = [xcli_errors.VolumeExistsError("", "volume", "")] with self.assertRaises(array_errors.VolumeAlreadyExists): - self.mediator.create_volume("volume", 10, None, "pool1") + self.mediator.create_volume("volume", 10, None, "pool1", None) def test_create_volume_raise_pool_does_not_exists_error(self): self.mediator.client.cmd.vol_create.side_effect = [xcli_errors.PoolDoesNotExistError("", "pool", "")] with self.assertRaises(array_errors.PoolDoesNotExist): - self.mediator.create_volume("volume", 10, None, "pool1") + self.mediator.create_volume("volume", 10, None, "pool1", None) def test_create_volume_raise_no_space_error(self): self.mediator.client.cmd.vol_create.side_effect = [ xcli_errors.CommandFailedRuntimeError("", "No space to allocate to the volume", "")] with self.assertRaises(array_errors.NotEnoughSpaceInPool): - self.mediator.create_volume("volume", 10, None, "pool1") + self.mediator.create_volume("volume", 10, None, "pool1", None) def test_create_volume_raise_runtime_error(self): self.mediator.client.cmd.vol_create.side_effect = [ xcli_errors.CommandFailedRuntimeError("", "other error", "")] with self.assertRaises(xcli_errors.CommandFailedRuntimeError): - self.mediator.create_volume("volume", 10, None, "pool1") + self.mediator.create_volume("volume", 10, None, "pool1", None) @patch.object(XIVArrayMediator, "_generate_volume_response") def test_create_volume__generate_volume_response_raise_exception(self, response): @@ -133,36 +133,36 @@ def test_create_volume__generate_volume_response_raise_exception(self, response) with self.assertRaises(Exception): self.mediator.create_volume("volume", 10, None, "pool1") - def _test_copy_to_existing_volume_from_snapshot(self, src_snapshot_capacity_in_bytes, + def _test_copy_to_existing_volume_from_snapshot(self, source_snapshot_capacity_in_bytes, min_volume_size_in_bytes): volume_id = "volume_id" source_id = "source_id" volume_name = "volume" - src_snapshot_name = "snapshot" + source_snapshot_name = "snapshot" self.mediator.client.cmd.vol_format = Mock() self.mediator.client.cmd.vol_copy = Mock() self.mediator.client.cmd.vol_resize = Mock() target_volume = self._get_cli_volume(name=volume_name) - source_volume = self._get_cli_volume(name=src_snapshot_name) + source_volume = self._get_cli_volume(name=source_snapshot_name) self.mediator.client.cmd.vol_list.side_effect = [Mock(as_single_element=target_volume), Mock(as_single_element=source_volume)] self.mediator.copy_to_existing_volume_from_source(volume_id, source_id, - src_snapshot_capacity_in_bytes, min_volume_size_in_bytes) + source_snapshot_capacity_in_bytes, min_volume_size_in_bytes) calls = [call(wwn=volume_id), call(wwn=source_id)] self.mediator.client.cmd.vol_list.assert_has_calls(calls, any_order=False) self.mediator.client.cmd.vol_format.assert_called_once_with(vol=volume_name) - self.mediator.client.cmd.vol_copy.assert_called_once_with(vol_src=src_snapshot_name, vol_trg=volume_name) + self.mediator.client.cmd.vol_copy.assert_called_once_with(vol_src=source_snapshot_name, vol_trg=volume_name) def test_copy_to_existing_volume_from_snapshot_succeeds_with_resize(self): volume_size_in_blocks = 1 volume_name = "volume" - self._test_copy_to_existing_volume_from_snapshot(src_snapshot_capacity_in_bytes=500, + self._test_copy_to_existing_volume_from_snapshot(source_snapshot_capacity_in_bytes=500, min_volume_size_in_bytes=1000) self.mediator.client.cmd.vol_resize.assert_called_once_with(vol=volume_name, size_blocks=volume_size_in_blocks) def test_copy_to_existing_volume_from_snapshot_succeeds_without_resize(self): - self._test_copy_to_existing_volume_from_snapshot(src_snapshot_capacity_in_bytes=1000, + self._test_copy_to_existing_volume_from_snapshot(source_snapshot_capacity_in_bytes=1000, min_volume_size_in_bytes=500) self.mediator.client.cmd.vol_resize.assert_not_called() @@ -239,9 +239,9 @@ def test_get_snapshot_return_correct_value(self): snapshot_volume_wwn = "123456789" xcli_snapshot = self._get_single_snapshot_result_mock(snapshot_name, snapshot_volume_name) self.mediator.client.cmd.vol_list.return_value = xcli_snapshot - res = self.mediator.get_snapshot(snapshot_volume_wwn, snapshot_name) - self.assertEqual(res.name, snapshot_name) - self.assertEqual(res.source_volume_id, snapshot_volume_wwn) + snapshot = self.mediator.get_snapshot(snapshot_volume_wwn, snapshot_name) + self.assertEqual(snapshot.name, snapshot_name) + self.assertEqual(snapshot.source_volume_id, snapshot_volume_wwn) def test_get_snapshot_same_name_volume_exists_error(self): snapshot_name = "snapshot" @@ -268,11 +268,11 @@ def test_create_snapshot_succeeds(self): xcli_snapshot = self._get_single_snapshot_result_mock(snapshot_name, snapshot_volume_name, snapshot_capacity=size_in_blocks_string) self.mediator.client.cmd.snapshot_create.return_value = xcli_snapshot - res = self.mediator.create_snapshot(snapshot_volume_wwn, snapshot_name, space_efficiency=None, pool=None) - self.assertEqual(res.name, snapshot_name) - self.assertEqual(res.source_volume_id, snapshot_volume_wwn) - self.assertEqual(res.capacity_bytes, size_in_bytes) - self.assertEqual(res.capacity_bytes, size_in_bytes) + snapshot = self.mediator.create_snapshot(snapshot_volume_wwn, snapshot_name, space_efficiency=None, pool=None) + self.assertEqual(snapshot.name, snapshot_name) + self.assertEqual(snapshot.source_volume_id, snapshot_volume_wwn) + self.assertEqual(snapshot.capacity_bytes, size_in_bytes) + self.assertEqual(snapshot.capacity_bytes, size_in_bytes) def test_create_snapshot_raise_snapshot_source_pool_mismatch(self): snapshot_name = "snapshot" @@ -352,17 +352,17 @@ def test_get_object_by_id_return_correct_snapshot(self): snapshot_volume_wwn = "123456789" xcli_snapshot = self._get_single_snapshot_result_mock(snapshot_name, snapshot_volume_name) self.mediator.client.cmd.vol_list.return_value = xcli_snapshot - res = self.mediator.get_object_by_id("1235678", "snapshot") - self.assertEqual(res.name, snapshot_name) - self.assertEqual(res.source_volume_id, snapshot_volume_wwn) + snapshot = self.mediator.get_object_by_id("1235678", "snapshot") + self.assertEqual(snapshot.name, snapshot_name) + self.assertEqual(snapshot.source_volume_id, snapshot_volume_wwn) def test_get_object_by_id_return_correct_volume(self): volume_name = "volume_name" volume_wwn = "wwn" volume = utils.get_mock_xiv_volume(10, volume_name, volume_wwn) self.mediator.client.cmd.vol_list.return_value = Mock(as_single_element=volume) - res = self.mediator.get_object_by_id(volume_wwn, "volume") - self.assertEqual(res.name, volume_name) + volume = self.mediator.get_object_by_id(volume_wwn, "volume") + self.assertEqual(volume.name, volume_name) def test_get_object_by_id_same_name_volume_exists_error(self): snapshot_name = "snapshot" diff --git a/controller/tests/controller_server/addons_server_test.py b/controller/tests/controller_server/addons_server_test.py index ab12ef0df..c60b7a0fb 100644 --- a/controller/tests/controller_server/addons_server_test.py +++ b/controller/tests/controller_server/addons_server_test.py @@ -1,13 +1,13 @@ import grpc +from csi_general import replication_pb2 as pb2 from mock import patch, Mock from controller.controller_server.addons_server import ReplicationControllerServicer -from controller.csi_general import replication_pb2 as pb2 +from controller.controller_server.config import PARAMETERS_SYSTEM_ID, PARAMETERS_COPY_TYPE +from controller.controller_server.test_settings import VOLUME_NAME, VOLUME_WWN, OBJECT_INTERNAL_ID, \ + OTHER_OBJECT_INTERNAL_ID, REPLICATION_NAME, SYSTEM_ID, COPY_TYPE from controller.tests import utils from controller.tests.controller_server.csi_controller_server_test import BaseControllerSetUp, CommonControllerTest -from controller.controller_server.config import PARAMETERS_SYSTEM_ID, PARAMETERS_COPY_TYPE -from controller.controller_server.test_settings import volume_name, volume_wwn, object_internal_id, \ - other_object_internal_id, replication_name, system_id, copy_type class TestControllerServicerEnableVolumeReplication(BaseControllerSetUp, CommonControllerTest): @@ -20,17 +20,17 @@ def get_tested_method_response_class(self): def setUp(self): super().setUp() self.servicer = ReplicationControllerServicer() - self.request.volume_id = "{}:{};{}".format("A9000", object_internal_id, volume_wwn) - self.request.replication_id = "{}:{};{}".format("A9000", other_object_internal_id, volume_wwn) - self.request.parameters.update({PARAMETERS_SYSTEM_ID: system_id, - PARAMETERS_COPY_TYPE: copy_type}) + self.request.volume_id = "{}:{};{}".format("A9000", OBJECT_INTERNAL_ID, VOLUME_WWN) + self.request.replication_id = "{}:{};{}".format("A9000", OTHER_OBJECT_INTERNAL_ID, VOLUME_WWN) + self.request.parameters.update({PARAMETERS_SYSTEM_ID: SYSTEM_ID, + PARAMETERS_COPY_TYPE: COPY_TYPE}) self.mediator.get_object_by_id = Mock() - self.mediator.get_object_by_id.return_value = utils.get_mock_mediator_response_volume(10, volume_name, - volume_wwn, "xiv") + self.mediator.get_object_by_id.return_value = utils.get_mock_mediator_response_volume(10, VOLUME_NAME, + VOLUME_WWN, "xiv") self.mediator.get_replication = Mock() - replication_mock = utils.get_mock_mediator_response_replication(replication_name, - object_internal_id, - other_object_internal_id) + replication_mock = utils.get_mock_mediator_response_replication(REPLICATION_NAME, + OBJECT_INTERNAL_ID, + OTHER_OBJECT_INTERNAL_ID) self.mediator.get_replication.return_value = replication_mock def _prepare_enable_replication_mocks(self, storage_agent): @@ -46,9 +46,13 @@ def test_enable_replication_succeeds(self, storage_agent): self.servicer.EnableVolumeReplication(self.request, self.context) self.assertEqual(self.context.code, grpc.StatusCode.OK) - self.mediator.get_replication.assert_called_once_with(object_internal_id, other_object_internal_id, system_id) - self.mediator.create_replication.assert_called_once_with(object_internal_id, other_object_internal_id, - system_id, copy_type) + self.mediator.get_replication.assert_called_once_with(OBJECT_INTERNAL_ID, OTHER_OBJECT_INTERNAL_ID, SYSTEM_ID) + self.mediator.create_replication.assert_called_once_with(OBJECT_INTERNAL_ID, OTHER_OBJECT_INTERNAL_ID, + SYSTEM_ID, COPY_TYPE) + + @patch("controller.controller_server.addons_server.get_agent") + def test_enable_replication_already_processing(self, storage_agent): + self._test_request_already_processing(storage_agent, "volume_id", self.request.volume_id) @patch("controller.controller_server.addons_server.get_agent") def test_enable_replication_with_wrong_secrets(self, storage_agent): diff --git a/controller/tests/controller_server/csi_controller_server_test.py b/controller/tests/controller_server/csi_controller_server_test.py index fd1276e01..59d3c040c 100644 --- a/controller/tests/controller_server/csi_controller_server_test.py +++ b/controller/tests/controller_server/csi_controller_server_test.py @@ -4,6 +4,7 @@ # from unittest import mock as umock import grpc +from csi_general import csi_pb2 from mock import patch, Mock, MagicMock, call import controller.array_action.errors as array_errors @@ -11,9 +12,9 @@ import controller.controller_server.errors as controller_errors from controller.array_action.array_mediator_xiv import XIVArrayMediator from controller.controller_server.csi_controller_server import CSIControllerServicer -from controller.controller_server.test_settings import volume_name, snapshot_name, snapshot_volume_name, \ - clone_volume_name, snapshot_volume_wwn, pool, space_efficiency, object_internal_id -from controller.csi_general import csi_pb2 +from controller.controller_server.sync_lock import SyncLock +from controller.controller_server.test_settings import VOLUME_NAME, SNAPSHOT_NAME, SNAPSHOT_VOLUME_NAME, \ + CLONE_VOLUME_NAME, SNAPSHOT_VOLUME_WWN, POOL, SPACE_EFFICIENCY, OBJECT_INTERNAL_ID from controller.tests import utils from controller.tests.utils import ProtoBufMock @@ -63,10 +64,10 @@ def _test_create_object_with_empty_name(self, storage_agent): storage_agent.return_value = self.storage_agent self.request.name = "" context = utils.FakeContext() - res = self.get_tested_method()(self.request, context) + response = self.get_tested_method()(self.request, context) self.assertEqual(context.code, grpc.StatusCode.INVALID_ARGUMENT) self.assertIn("name", context.details) - self.assertEqual(res, self.get_tested_method_response_class()()) + self.assertEqual(response, self.get_tested_method_response_class()()) def _test_request_with_wrong_secrets_parameters(self, secrets, message="secret"): context = utils.FakeContext() @@ -93,6 +94,13 @@ def _test_request_with_wrong_secrets(self, storage_agent): self.request.secrets = [] + def _test_request_already_processing(self, storage_agent, request_attribute, object_id): + storage_agent.side_effect = self.storage_agent + with SyncLock(request_attribute, object_id, "test_request_already_processing"): + response = self.get_tested_method()(self.request, self.context) + self.assertEqual(self.context.code, grpc.StatusCode.ABORTED) + self.assertEqual(type(response), self.get_tested_method_response_class()) + def _test_request_with_array_connection_exception(self, storage_agent): storage_agent.side_effect = [Exception("error")] context = utils.FakeContext() @@ -134,10 +142,10 @@ def setUp(self): self.mediator.get_snapshot = Mock() self.mediator.get_snapshot.return_value = None - self.request.name = snapshot_name - self.request.source_volume_id = "{}:{};{}".format("A9000", object_internal_id, snapshot_volume_wwn) + self.request.name = SNAPSHOT_NAME + self.request.source_volume_id = "{}:{};{}".format("A9000", OBJECT_INTERNAL_ID, SNAPSHOT_VOLUME_WWN) self.mediator.get_object_by_id = Mock() - self.mediator.get_object_by_id.return_value = utils.get_mock_mediator_response_volume(10, snapshot_volume_name, + self.mediator.get_object_by_id.return_value = utils.get_mock_mediator_response_volume(10, SNAPSHOT_VOLUME_NAME, "wwn", "xiv") self.context = utils.FakeContext() @@ -150,8 +158,8 @@ def _prepare_create_snapshot_mocks(self, storage_agent): self.mediator.get_snapshot = Mock() self.mediator.get_snapshot.return_value = None self.mediator.create_snapshot = Mock() - self.mediator.create_snapshot.return_value = utils.get_mock_mediator_response_snapshot(10, snapshot_name, "wwn", - snapshot_volume_name, + self.mediator.create_snapshot.return_value = utils.get_mock_mediator_response_snapshot(10, SNAPSHOT_NAME, "wwn", + SNAPSHOT_VOLUME_NAME, "xiv") def _test_create_snapshot_succeeds(self, storage_agent, expected_space_efficiency=None, expected_pool=None, @@ -161,8 +169,8 @@ def _test_create_snapshot_succeeds(self, storage_agent, expected_space_efficienc response_snapshot = self.servicer.CreateSnapshot(self.request, self.context) self.assertEqual(self.context.code, grpc.StatusCode.OK) - self.mediator.get_snapshot.assert_called_once_with(snapshot_volume_wwn, snapshot_name, pool=expected_pool) - self.mediator.create_snapshot.assert_called_once_with(snapshot_volume_wwn, snapshot_name, + self.mediator.get_snapshot.assert_called_once_with(SNAPSHOT_VOLUME_WWN, SNAPSHOT_NAME, pool=expected_pool) + self.mediator.create_snapshot.assert_called_once_with(SNAPSHOT_VOLUME_WWN, SNAPSHOT_NAME, expected_space_efficiency, expected_pool) system_id_part = ':{}'.format(system_id) if system_id else '' snapshot_id = 'xiv{}:0;wwn'.format(system_id_part) @@ -174,25 +182,29 @@ def test_create_snapshot_succeeds(self, storage_agent): @patch("controller.controller_server.csi_controller_server.get_agent") def test_create_snapshot_with_pool_parameter_succeeds(self, storage_agent): - self.request.parameters = {config.PARAMETERS_POOL: pool} - self._test_create_snapshot_succeeds(storage_agent, expected_pool=pool) + self.request.parameters = {config.PARAMETERS_POOL: POOL} + self._test_create_snapshot_succeeds(storage_agent, expected_pool=POOL) @patch("controller.controller_server.csi_controller_server.get_agent") def test_create_snapshot_with_space_efficiency_parameter_succeeds(self, storage_agent): self.mediator.validate_supported_space_efficiency = Mock() - self.request.parameters = {config.PARAMETERS_SPACE_EFFICIENCY: space_efficiency} - self._test_create_snapshot_succeeds(storage_agent, expected_space_efficiency=space_efficiency) + self.request.parameters = {config.PARAMETERS_SPACE_EFFICIENCY: SPACE_EFFICIENCY} + self._test_create_snapshot_succeeds(storage_agent, expected_space_efficiency=SPACE_EFFICIENCY) + + @patch("controller.controller_server.csi_controller_server.get_agent") + def test_create_snapshot_already_processing(self, storage_agent): + self._test_request_already_processing(storage_agent, "name", self.request.name) def _test_create_snapshot_with_by_system_id_parameter(self, storage_agent, system_id, expected_pool): system_id_part = ':{}'.format(system_id) if system_id else '' - self.request.source_volume_id = "{}{}:{}".format("A9000", system_id_part, snapshot_volume_wwn) + self.request.source_volume_id = "{}{}:{}".format("A9000", system_id_part, SNAPSHOT_VOLUME_WWN) self.request.parameters = {config.PARAMETERS_BY_SYSTEM: json.dumps( - {"u1": {config.PARAMETERS_POOL: pool}, "u2": {config.PARAMETERS_POOL: "other_pool"}})} + {"u1": {config.PARAMETERS_POOL: POOL}, "u2": {config.PARAMETERS_POOL: "other_pool"}})} self._test_create_snapshot_succeeds(storage_agent, expected_pool=expected_pool, system_id=system_id) @patch("controller.controller_server.csi_controller_server.get_agent") def test_create_snapshot_with_by_system_id_parameter_succeeds(self, storage_agent): - self._test_create_snapshot_with_by_system_id_parameter(storage_agent, "u1", pool) + self._test_create_snapshot_with_by_system_id_parameter(storage_agent, "u1", POOL) self._test_create_snapshot_with_by_system_id_parameter(storage_agent, "u2", "other_pool") self._test_create_snapshot_with_by_system_id_parameter(storage_agent, None, None) @@ -200,7 +212,7 @@ def test_create_snapshot_with_by_system_id_parameter_succeeds(self, storage_agen def test_create_snapshot_belongs_to_wrong_volume(self, storage_agent): storage_agent.return_value = self.storage_agent self.mediator.create_snapshot = Mock() - self.mediator.get_snapshot.return_value = utils.get_mock_mediator_response_snapshot(10, snapshot_name, "wwn", + self.mediator.get_snapshot.return_value = utils.get_mock_mediator_response_snapshot(10, SNAPSHOT_NAME, "wwn", "wrong_volume_name", "xiv") self.servicer.CreateSnapshot(self.request, self.context) @@ -231,7 +243,7 @@ def _test_create_snapshot_get_snapshot_raise_error(self, storage_agent, exceptio self.assertEqual(self.context.code, grpc_status) self.assertIn(str(exception), self.context.details) - self.mediator.get_snapshot.assert_called_once_with(snapshot_volume_wwn, snapshot_name, pool=None) + self.mediator.get_snapshot.assert_called_once_with(SNAPSHOT_VOLUME_WWN, SNAPSHOT_NAME, pool=None) def test_create_snapshot_get_snapshot_exception(self): self._test_create_snapshot_get_snapshot_raise_error(exception=Exception("error"), @@ -274,8 +286,8 @@ def create_snapshot_returns_error(self, storage_agent, create_snapshot, return_c self.assertEqual(self.context.code, return_code) self.assertIn(msg, self.context.details) - self.mediator.get_snapshot.assert_called_once_with(snapshot_volume_wwn, snapshot_name, pool=None) - self.mediator.create_snapshot.assert_called_once_with(snapshot_volume_wwn, snapshot_name, None, None) + self.mediator.get_snapshot.assert_called_once_with(SNAPSHOT_VOLUME_WWN, SNAPSHOT_NAME, pool=None) + self.mediator.create_snapshot.assert_called_once_with(SNAPSHOT_VOLUME_WWN, SNAPSHOT_NAME, None, None) def test_create_snapshot_with_not_found_exception(self): self.create_snapshot_returns_error(return_code=grpc.StatusCode.NOT_FOUND, @@ -315,14 +327,14 @@ def test_create_snapshot_with_name_prefix(self, storage_agent): self.request.name = "some_name" self.request.parameters[config.PARAMETERS_SNAPSHOT_NAME_PREFIX] = "prefix" self.mediator.create_snapshot = Mock() - self.mediator.create_snapshot.return_value = utils.get_mock_mediator_response_snapshot(10, snapshot_name, "wwn", - snapshot_volume_name, + self.mediator.create_snapshot.return_value = utils.get_mock_mediator_response_snapshot(10, SNAPSHOT_NAME, "wwn", + SNAPSHOT_VOLUME_NAME, "xiv") self.servicer.CreateSnapshot(self.request, self.context) self.assertEqual(self.context.code, grpc.StatusCode.OK) - self.mediator.create_snapshot.assert_called_once_with(snapshot_volume_wwn, "prefix_some_name", None, None) + self.mediator.create_snapshot.assert_called_once_with(SNAPSHOT_VOLUME_WWN, "prefix_some_name", None, None) class TestDeleteSnapshot(BaseControllerSetUp, CommonControllerTest): @@ -368,6 +380,10 @@ def test_delete_snapshot_bad_id_succeeds(self): self._test_delete_snapshot_succeeds("xiv:a:a:volume-id") self.mediator.delete_snapshot.assert_not_called() + @patch("controller.controller_server.csi_controller_server.get_agent") + def test_delete_snapshot_already_processing(self, storage_agent): + self._test_request_already_processing(storage_agent, "snapshot_id", self.request.snapshot_id) + @patch("controller.controller_server.csi_controller_server.get_agent") def test_delete_snapshot_with_wrong_secrets(self, storage_agent): self._test_request_with_wrong_secrets(storage_agent) @@ -400,9 +416,9 @@ def setUp(self): self.mediator.get_volume = Mock() self.mediator.get_volume.side_effect = array_errors.ObjectNotFoundError("vol") - self.request.parameters = {config.PARAMETERS_POOL: pool} + self.request.parameters = {config.PARAMETERS_POOL: POOL} self.request.volume_capabilities = [self.volume_capability] - self.request.name = volume_name + self.request.name = VOLUME_NAME self.request.volume_content_source = None @patch("controller.controller_server.csi_controller_server.get_agent") @@ -415,17 +431,21 @@ def _prepare_create_volume_mocks(self, storage_agent): self.mediator.create_volume = Mock() self.mediator.create_volume.return_value = utils.get_mock_mediator_response_volume(10, "volume", "wwn", "xiv") - def _test_create_volume_succeeds(self, storage_agent, expected_volume_id, expected_pool=pool): + def _test_create_volume_succeeds(self, storage_agent, expected_volume_id, expected_pool=POOL): self._prepare_create_volume_mocks(storage_agent) response_volume = self.servicer.CreateVolume(self.request, self.context) self.assertEqual(self.context.code, grpc.StatusCode.OK) - self.mediator.get_volume.assert_called_once_with(volume_name, pool=expected_pool) - self.mediator.create_volume.assert_called_once_with(volume_name, 10, None, expected_pool) + self.mediator.get_volume.assert_called_once_with(VOLUME_NAME, pool=expected_pool) + self.mediator.create_volume.assert_called_once_with(VOLUME_NAME, 10, None, expected_pool, None) self.assertEqual(response_volume.volume.content_source.volume.volume_id, '') self.assertEqual(response_volume.volume.content_source.snapshot.snapshot_id, '') self.assertEqual(response_volume.volume.volume_id, expected_volume_id) + @patch("controller.controller_server.csi_controller_server.get_agent") + def test_create_volume_already_processing(self, storage_agent): + self._test_request_already_processing(storage_agent, "name", self.request.name) + @patch("controller.controller_server.csi_controller_server.get_agent") def test_create_volume_succeeds(self, storage_agent): self._test_create_volume_succeeds(storage_agent, 'xiv:0;wwn') @@ -438,7 +458,7 @@ def test_create_volume_with_topologies_succeeds(self, storage_agent): ProtoBufMock(segments={"topology.block.csi.ibm.com/test": "topology_value", "topology.block.csi.ibm.com/test2": "topology_value2"})] self.request.parameters = {config.PARAMETERS_BY_SYSTEM: json.dumps( - {"u1": {config.PARAMETERS_POOL: pool}, "u2": {config.PARAMETERS_POOL: "other_pool"}})} + {"u1": {config.PARAMETERS_POOL: POOL}, "u2": {config.PARAMETERS_POOL: "other_pool"}})} self._test_create_volume_succeeds(storage_agent, 'xiv:u2:0;wwn', expected_pool="other_pool") @patch("controller.controller_server.csi_controller_server.get_agent") @@ -450,18 +470,18 @@ def test_create_volume_with_space_efficiency_succeeds(self, storage_agent): self.servicer.CreateVolume(self.request, self.context) self.assertEqual(self.context.code, grpc.StatusCode.OK) - self.mediator.get_volume.assert_called_once_with(volume_name, pool=pool) - self.mediator.create_volume.assert_called_once_with(volume_name, 10, "not_none", pool) + self.mediator.get_volume.assert_called_once_with(VOLUME_NAME, pool=POOL) + self.mediator.create_volume.assert_called_once_with(VOLUME_NAME, 10, "not_none", POOL, None) @patch("controller.controller_server.csi_controller_server.get_agent") def test_create_volume_idempotent_no_source_succeeds(self, storage_agent): self._prepare_create_volume_mocks(storage_agent) self.mediator.get_volume = Mock() - self.mediator.get_volume.return_value = utils.get_mock_mediator_response_volume(10, volume_name, "wwn", "xiv") + self.mediator.get_volume.return_value = utils.get_mock_mediator_response_volume(10, VOLUME_NAME, "wwn", "xiv") response_volume = self.servicer.CreateVolume(self.request, self.context) self.assertEqual(self.context.code, grpc.StatusCode.OK) - self.mediator.get_volume.assert_called_once_with(volume_name, pool=pool) + self.mediator.get_volume.assert_called_once_with(VOLUME_NAME, pool=POOL) self.mediator.create_volume.assert_not_called() self.assertEqual(response_volume.volume.content_source.volume.volume_id, '') self.assertEqual(response_volume.volume.content_source.snapshot.snapshot_id, '') @@ -473,7 +493,7 @@ def test_create_volume_with_wrong_secrets(self, a_enter): @patch("controller.controller_server.csi_controller_server.get_agent") def test_create_volume_no_pool(self, storage_agent): self._prepare_create_volume_mocks(storage_agent) - self.request.parameters = {"by_system_id": json.dumps({"u1": pool, "u2": "other_pool"})} + self.request.parameters = {"by_system_id": json.dumps({"u1": POOL, "u2": "other_pool"})} self.servicer.CreateVolume(self.request, self.context) self.assertEqual(self.context.code, grpc.StatusCode.INVALID_ARGUMENT) @@ -523,7 +543,7 @@ def test_create_volume_get_volume_exception(self, storage_agent): self.servicer.CreateVolume(self.request, self.context) self.assertEqual(self.context.code, grpc.StatusCode.INTERNAL) self.assertIn("error", self.context.details) - self.mediator.get_volume.assert_called_once_with(volume_name, pool=pool) + self.mediator.get_volume.assert_called_once_with(VOLUME_NAME, pool=POOL) @patch("controller.controller_server.csi_controller_server.get_agent") def test_create_volume_with_get_volume_illegal_object_name_exception(self, storage_agent): @@ -535,7 +555,7 @@ def test_create_volume_with_get_volume_illegal_object_name_exception(self, stora self.assertEqual(self.context.code, grpc.StatusCode.INVALID_ARGUMENT) self.assertIn(msg, self.context.details) - self.mediator.get_volume.assert_called_once_with(volume_name, pool=pool) + self.mediator.get_volume.assert_called_once_with(VOLUME_NAME, pool=POOL) @patch("controller.controller_server.csi_controller_server.get_agent") def test_create_volume_with_prefix_too_long_exception(self, storage_agent): @@ -565,8 +585,8 @@ def create_volume_returns_error(self, storage_agent, create_volume, return_code, self.assertEqual(self.context.code, return_code) self.assertIn(msg, self.context.details) - self.mediator.get_volume.assert_called_once_with(volume_name, pool=pool) - self.mediator.create_volume.assert_called_once_with(volume_name, self.capacity_bytes, None, pool) + self.mediator.get_volume.assert_called_once_with(VOLUME_NAME, pool=POOL) + self.mediator.create_volume.assert_called_once_with(VOLUME_NAME, self.capacity_bytes, None, POOL, None) def test_create_volume_with_illegal_object_name_exception(self): self.create_volume_returns_error(return_code=grpc.StatusCode.INVALID_ARGUMENT, @@ -578,7 +598,7 @@ def test_create_volume_with_volume_exists_exception(self): def test_create_volume_with_pool_does_not_exist_exception(self): self.create_volume_returns_error(return_code=grpc.StatusCode.INVALID_ARGUMENT, - err=array_errors.PoolDoesNotExist(pool, "endpoint")) + err=array_errors.PoolDoesNotExist(POOL, "endpoint")) def test_create_volume_with_pool_does_not_match_space_efficiency_exception(self): self.create_volume_returns_error(return_code=grpc.StatusCode.INVALID_ARGUMENT, @@ -600,7 +620,7 @@ def _test_create_volume_parameters(self, final_name="default_some_name", space_e self.mediator.validate_supported_space_efficiency = Mock() self.servicer.CreateVolume(self.request, self.context) self.assertEqual(self.context.code, grpc.StatusCode.OK) - self.mediator.create_volume.assert_called_once_with(final_name, 10, space_efficiency, pool) + self.mediator.create_volume.assert_called_once_with(final_name, 10, space_efficiency, POOL, None) @patch("controller.controller_server.csi_controller_server.get_agent") def test_create_volume_with_name_prefix(self, storage_agent): @@ -619,7 +639,7 @@ def _test_create_volume_with_parameters_by_system_prefix(self, get_array_connect space_efficiency=None): get_array_connection_info_from_secrets.side_effect = [utils.get_fake_array_connection_info()] self.request.parameters = {config.PARAMETERS_BY_SYSTEM: json.dumps( - {"u1": {config.PARAMETERS_VOLUME_NAME_PREFIX: prefix, config.PARAMETERS_POOL: pool, + {"u1": {config.PARAMETERS_VOLUME_NAME_PREFIX: prefix, config.PARAMETERS_POOL: POOL, config.PARAMETERS_SPACE_EFFICIENCY: space_efficiency}})} self._test_create_volume_parameters(final_name, space_efficiency) @@ -653,7 +673,7 @@ def test_create_volume_with_required_bytes_zero(self, storage_agent): self.servicer.CreateVolume(self.request, self.context) self.assertEqual(self.context.code, grpc.StatusCode.OK) - self.mediator.create_volume.assert_called_once_with(self.request.name, 2, None, pool) + self.mediator.create_volume.assert_called_once_with(self.request.name, 2, None, POOL, None) @patch("controller.controller_server.csi_controller_server.get_agent") def test_create_volume_with_required_bytes_too_large_fail(self, storage_agent): @@ -679,7 +699,7 @@ def test_create_volume_idempotent_with_source_succeed(self, storage_agent): self._prepare_idempotent_tests() storage_agent.return_value = self.storage_agent snapshot_id = "wwn1" - self.mediator.get_volume.return_value = utils.get_mock_mediator_response_volume(10, volume_name, "wwn2", "a9k", + self.mediator.get_volume.return_value = utils.get_mock_mediator_response_volume(10, VOLUME_NAME, "wwn2", "a9k", copy_source_id=snapshot_id) response = self.servicer.CreateVolume(self.request, self.context) @@ -692,7 +712,7 @@ def test_create_volume_idempotent_with_source_succeed(self, storage_agent): def test_create_volume_idempotent_with_source_volume_have_no_source(self, storage_agent): self._prepare_idempotent_tests() storage_agent.return_value = self.storage_agent - self.mediator.get_volume.return_value = utils.get_mock_mediator_response_volume(10, volume_name, "wwn2", + self.mediator.get_volume.return_value = utils.get_mock_mediator_response_volume(10, VOLUME_NAME, "wwn2", "a9k") response = self.servicer.CreateVolume(self.request, self.context) @@ -706,7 +726,7 @@ def test_create_volume_idempotent_source_not_requested_but_found_in_volume(self, storage_agent.return_value = self.storage_agent snapshot_id = "wwn1" self.request.volume_content_source = None - self.mediator.get_volume.return_value = utils.get_mock_mediator_response_volume(10, volume_name, "wwn2", "a9k", + self.mediator.get_volume.return_value = utils.get_mock_mediator_response_volume(10, VOLUME_NAME, "wwn2", "a9k", copy_source_id=snapshot_id) response = self.servicer.CreateVolume(self.request, self.context) @@ -729,7 +749,7 @@ def test_create_volume_idempotent_with_source_volume_got_other_source(self, stor def test_create_volume_idempotent_with_size_not_matched(self, storage_agent): storage_agent.return_value = self.storage_agent self.mediator.get_volume = Mock() - self.mediator.get_volume.return_value = utils.get_mock_mediator_response_volume(100, volume_name, "wwn2", "a9k") + self.mediator.get_volume.return_value = utils.get_mock_mediator_response_volume(100, VOLUME_NAME, "wwn2", "a9k") self.servicer.CreateVolume(self.request, self.context) @@ -737,7 +757,7 @@ def test_create_volume_idempotent_with_size_not_matched(self, storage_agent): def _prepare_mocks_for_copy_from_source(self): self.mediator.create_volume = Mock() - self.mediator.create_volume.return_value = utils.get_mock_mediator_response_volume(10, volume_name, "wwn2", + self.mediator.create_volume.return_value = utils.get_mock_mediator_response_volume(10, VOLUME_NAME, "wwn2", "a9k") self.mediator.get_object_by_id = Mock() self.mediator.copy_to_existing_volume_from_source = Mock() @@ -750,9 +770,9 @@ def test_create_volume_from_snapshot_success(self, storage_agent): snapshot_capacity_bytes = 100 self.request.volume_content_source = self._get_source_snapshot(snapshot_id) self.mediator.get_object_by_id.return_value = utils.get_mock_mediator_response_snapshot(snapshot_capacity_bytes, - snapshot_name, + SNAPSHOT_NAME, snapshot_id, - volume_name, + VOLUME_NAME, "a9k") response_volume = self.servicer.CreateVolume(self.request, self.context) self.assertEqual(self.context.code, grpc.StatusCode.OK) @@ -830,9 +850,9 @@ def _test_create_volume_from_snapshot_error(self, storage_agent, copy_exception, self.mediator.get_object_by_id.side_effect = [get_exception] self.storage_agent.get_mediator.return_value.__exit__.side_effect = [get_exception] else: - self.mediator.get_object_by_id.return_value = utils.get_mock_mediator_response_snapshot(1000, snapshot_name, + self.mediator.get_object_by_id.return_value = utils.get_mock_mediator_response_snapshot(1000, SNAPSHOT_NAME, target_volume_id, - volume_name, "a9k") + VOLUME_NAME, "a9k") self.mediator.copy_to_existing_volume_from_source.side_effect = [copy_exception] self.storage_agent.get_mediator.return_value.__exit__.side_effect = [copy_exception] @@ -851,7 +871,7 @@ def test_clone_volume_success(self, storage_agent): volume_capacity_bytes = 100 self.request.volume_content_source = self._get_source_volume(volume_id) self.mediator.get_object_by_id.return_value = utils.get_mock_mediator_response_volume(volume_capacity_bytes, - clone_volume_name, + CLONE_VOLUME_NAME, volume_id, "a9k") response_volume = self.servicer.CreateVolume(self.request, self.context) @@ -901,6 +921,10 @@ def setUp(self): self.request.volume_id = "xiv:0;volume-id" + @patch("controller.controller_server.csi_controller_server.get_agent") + def test_delete_volume_already_processing(self, storage_agent): + self._test_request_already_processing(storage_agent, "volume_id", self.request.volume_id) + @patch("controller.controller_server.csi_controller_server.get_agent") def test_delete_volume_with_wrong_secrets(self, storage_agent): self._test_request_with_wrong_secrets(storage_agent) @@ -944,7 +968,7 @@ def test_delete_volume_with_delete_volume_other_exception(self): self.delete_volume_returns_error(error=Exception("error"), return_code=grpc.StatusCode.INTERNAL) def test_delete_volume_has_snapshots(self): - self.delete_volume_returns_error(error=array_errors.ObjectIsStillInUseError("a", "b"), + self.delete_volume_returns_error(error=array_errors.ObjectIsStillInUseError("a", ["b"]), return_code=grpc.StatusCode.FAILED_PRECONDITION) @patch("controller.array_action.array_mediator_xiv.XIVArrayMediator.delete_volume") @@ -1010,6 +1034,10 @@ def test_publish_volume_success(self, storage_agent): self.assertEqual(self.context.code, grpc.StatusCode.OK) + @patch("controller.controller_server.csi_controller_server.get_agent") + def test_publish_volume_already_processing(self, storage_agent): + self._test_request_already_processing(storage_agent, "volume_id", self.request.volume_id) + @patch("controller.controller_server.utils.validate_publish_volume_request") def test_publish_volume_validateion_exception(self, publish_validation): publish_validation.side_effect = [controller_errors.ValidationException("msg")] @@ -1059,11 +1087,11 @@ def test_publish_volume_get_volume_mappings_one_map_for_existing_host(self, stor self.mediator.get_volume_mappings.return_value = {self.hostname: 2} storage_agent.return_value = self.storage_agent - res = self.servicer.ControllerPublishVolume(self.request, self.context) + response = self.servicer.ControllerPublishVolume(self.request, self.context) self.assertEqual(self.context.code, grpc.StatusCode.OK) - self.assertEqual(res.publish_context["PUBLISH_CONTEXT_LUN"], '2') - self.assertEqual(res.publish_context["PUBLISH_CONTEXT_CONNECTIVITY"], "iscsi") + self.assertEqual(response.publish_context["PUBLISH_CONTEXT_LUN"], '2') + self.assertEqual(response.publish_context["PUBLISH_CONTEXT_CONNECTIVITY"], "iscsi") @patch("controller.controller_server.csi_controller_server.get_agent") def test_publish_volume_with_connectivity_type_fc(self, storage_agent): @@ -1072,12 +1100,12 @@ def test_publish_volume_with_connectivity_type_fc(self, storage_agent): self.mediator.get_array_fc_wwns.return_value = ["500143802426baf4"] storage_agent.return_value = self.storage_agent - res = self.servicer.ControllerPublishVolume(self.request, self.context) + response = self.servicer.ControllerPublishVolume(self.request, self.context) self.assertEqual(self.context.code, grpc.StatusCode.OK) - self.assertEqual(res.publish_context["PUBLISH_CONTEXT_LUN"], '1') - self.assertEqual(res.publish_context["PUBLISH_CONTEXT_CONNECTIVITY"], "fc") - self.assertEqual(res.publish_context["PUBLISH_CONTEXT_ARRAY_FC_INITIATORS"], "500143802426baf4") + self.assertEqual(response.publish_context["PUBLISH_CONTEXT_LUN"], '1') + self.assertEqual(response.publish_context["PUBLISH_CONTEXT_CONNECTIVITY"], "fc") + self.assertEqual(response.publish_context["PUBLISH_CONTEXT_ARRAY_FC_INITIATORS"], "500143802426baf4") @patch("controller.controller_server.csi_controller_server.get_agent") def test_publish_volume_with_connectivity_type_iscsi(self, storage_agent): @@ -1086,17 +1114,17 @@ def test_publish_volume_with_connectivity_type_iscsi(self, storage_agent): self.mediator.get_array_fc_wwns.return_value = ["500143802426baf4"] storage_agent.return_value = self.storage_agent - res = self.servicer.ControllerPublishVolume(self.request, self.context) + response = self.servicer.ControllerPublishVolume(self.request, self.context) self.assertEqual(self.context.code, grpc.StatusCode.OK) - self.assertEqual(res.publish_context["PUBLISH_CONTEXT_LUN"], '1') - self.assertEqual(res.publish_context["PUBLISH_CONTEXT_CONNECTIVITY"], + self.assertEqual(response.publish_context["PUBLISH_CONTEXT_LUN"], '1') + self.assertEqual(response.publish_context["PUBLISH_CONTEXT_CONNECTIVITY"], "iscsi") - self.assertEqual(res.publish_context["PUBLISH_CONTEXT_ARRAY_IQN"], + self.assertEqual(response.publish_context["PUBLISH_CONTEXT_ARRAY_IQN"], "iqn1,iqn2") - self.assertEqual(res.publish_context["iqn1"], + self.assertEqual(response.publish_context["iqn1"], "1.1.1.1,2.2.2.2") - self.assertEqual(res.publish_context["iqn2"], + self.assertEqual(response.publish_context["iqn2"], "[::1]") @patch("controller.controller_server.csi_controller_server.get_agent") @@ -1105,17 +1133,17 @@ def test_publish_volume_with_node_id_only_has_iqns(self, storage_agent): self.mediator.get_host_by_host_identifiers.return_value = self.hostname, ["iscsi"] storage_agent.return_value = self.storage_agent - res = self.servicer.ControllerPublishVolume(self.request, self.context) + response = self.servicer.ControllerPublishVolume(self.request, self.context) self.assertEqual(self.context.code, grpc.StatusCode.OK) - self.assertEqual(res.publish_context["PUBLISH_CONTEXT_LUN"], '1') - self.assertEqual(res.publish_context["PUBLISH_CONTEXT_CONNECTIVITY"], + self.assertEqual(response.publish_context["PUBLISH_CONTEXT_LUN"], '1') + self.assertEqual(response.publish_context["PUBLISH_CONTEXT_CONNECTIVITY"], "iscsi") - self.assertEqual(res.publish_context["PUBLISH_CONTEXT_ARRAY_IQN"], + self.assertEqual(response.publish_context["PUBLISH_CONTEXT_ARRAY_IQN"], "iqn1,iqn2") - self.assertEqual(res.publish_context["iqn1"], + self.assertEqual(response.publish_context["iqn1"], "1.1.1.1,2.2.2.2") - self.assertEqual(res.publish_context["iqn2"], + self.assertEqual(response.publish_context["iqn2"], "[::1]") @patch("controller.controller_server.csi_controller_server.get_agent") @@ -1127,14 +1155,14 @@ def test_publish_volume_with_node_id_only_has_wwns(self, storage_agent): self.mediator.get_iscsi_targets_by_iqn.return_value = {} storage_agent.return_value = self.storage_agent - res = self.servicer.ControllerPublishVolume(self.request, self.context) + response = self.servicer.ControllerPublishVolume(self.request, self.context) self.assertEqual(self.context.code, grpc.StatusCode.OK) - self.assertEqual(res.publish_context["PUBLISH_CONTEXT_LUN"], '1') - self.assertEqual(res.publish_context["PUBLISH_CONTEXT_CONNECTIVITY"], + self.assertEqual(response.publish_context["PUBLISH_CONTEXT_LUN"], '1') + self.assertEqual(response.publish_context["PUBLISH_CONTEXT_CONNECTIVITY"], "fc") self.assertEqual( - res.publish_context["PUBLISH_CONTEXT_ARRAY_FC_INITIATORS"], + response.publish_context["PUBLISH_CONTEXT_ARRAY_FC_INITIATORS"], "500143802426baf4") self.request.node_id = "hostname;;500143802426baf4:500143806626bae2" @@ -1144,14 +1172,14 @@ def test_publish_volume_with_node_id_only_has_wwns(self, storage_agent): "500143806626bae2"] storage_agent.return_value = self.storage_agent - res = self.servicer.ControllerPublishVolume(self.request, self.context) + response = self.servicer.ControllerPublishVolume(self.request, self.context) self.assertEqual(self.context.code, grpc.StatusCode.OK) - self.assertEqual(res.publish_context["PUBLISH_CONTEXT_LUN"], '1') - self.assertEqual(res.publish_context["PUBLISH_CONTEXT_CONNECTIVITY"], + self.assertEqual(response.publish_context["PUBLISH_CONTEXT_LUN"], '1') + self.assertEqual(response.publish_context["PUBLISH_CONTEXT_CONNECTIVITY"], "fc") self.assertEqual( - res.publish_context["PUBLISH_CONTEXT_ARRAY_FC_INITIATORS"], + response.publish_context["PUBLISH_CONTEXT_ARRAY_FC_INITIATORS"], "500143802426baf4,500143806626bae2") @patch("controller.controller_server.csi_controller_server.get_agent") @@ -1206,11 +1234,11 @@ def test_publish_volume_map_volume_lun_already_in_use(self, storage_agent): self.mediator.map_volume.side_effect = [array_errors.LunAlreadyInUseError("", ""), 2] storage_agent.return_value = self.storage_agent - res = self.servicer.ControllerPublishVolume(self.request, self.context) + response = self.servicer.ControllerPublishVolume(self.request, self.context) self.assertEqual(self.context.code, grpc.StatusCode.OK) - self.assertEqual(res.publish_context["PUBLISH_CONTEXT_LUN"], '2') - self.assertEqual(res.publish_context["PUBLISH_CONTEXT_CONNECTIVITY"], "iscsi") + self.assertEqual(response.publish_context["PUBLISH_CONTEXT_LUN"], '2') + self.assertEqual(response.publish_context["PUBLISH_CONTEXT_CONNECTIVITY"], "iscsi") self.mediator.map_volume.side_effect = [ array_errors.LunAlreadyInUseError("", ""), 2] @@ -1220,11 +1248,11 @@ def test_publish_volume_map_volume_lun_already_in_use(self, storage_agent): self.mediator.get_array_fc_wwns.return_value = ["500143802426baf4"] storage_agent.return_value = self.storage_agent - res = self.servicer.ControllerPublishVolume(self.request, self.context) + response = self.servicer.ControllerPublishVolume(self.request, self.context) self.assertEqual(self.context.code, grpc.StatusCode.OK) - self.assertEqual(res.publish_context["PUBLISH_CONTEXT_LUN"], '2') - self.assertEqual(res.publish_context["PUBLISH_CONTEXT_CONNECTIVITY"], + self.assertEqual(response.publish_context["PUBLISH_CONTEXT_LUN"], '2') + self.assertEqual(response.publish_context["PUBLISH_CONTEXT_CONNECTIVITY"], "fc") self.mediator.map_volume.side_effect = [array_errors.LunAlreadyInUseError("", ""), @@ -1234,8 +1262,8 @@ def test_publish_volume_map_volume_lun_already_in_use(self, storage_agent): self.servicer.ControllerPublishVolume(self.request, self.context) self.assertEqual(self.context.code, grpc.StatusCode.OK) - self.assertEqual(res.publish_context["PUBLISH_CONTEXT_LUN"], '2') - self.assertEqual(res.publish_context["PUBLISH_CONTEXT_CONNECTIVITY"], "fc") + self.assertEqual(response.publish_context["PUBLISH_CONTEXT_LUN"], '2') + self.assertEqual(response.publish_context["PUBLISH_CONTEXT_CONNECTIVITY"], "fc") self.mediator.map_volume.side_effect = [ array_errors.LunAlreadyInUseError("", "")] * ( @@ -1297,6 +1325,10 @@ def test_unpublish_volume_success(self, storage_agent): self.assertEqual(self.context.code, grpc.StatusCode.OK) + @patch("controller.controller_server.csi_controller_server.get_agent") + def test_unpublish_volume_already_processing(self, storage_agent): + self._test_request_already_processing(storage_agent, "volume_id", self.request.volume_id) + @patch("controller.controller_server.utils.validate_unpublish_volume_request") def test_unpublish_volume_validation_exception(self, publish_validation): publish_validation.side_effect = [controller_errors.ValidationException("msg")] @@ -1322,10 +1354,10 @@ def test_unpublish_volume_wrong_node_id(self): self.servicer.ControllerUnpublishVolume(self.request, self.context) - self.assertEqual(self.context.code, grpc.StatusCode.NOT_FOUND) + self.assertEqual(self.context.code, grpc.StatusCode.OK) @patch("controller.controller_server.csi_controller_server.get_agent") - def test_unpublish_volume_get_host_by_host_identifiers_exception(self, storage_agent): + def test_unpublish_volume_get_host_by_host_identifiers_multiple_hosts_found_error(self, storage_agent): self.mediator.get_host_by_host_identifiers = Mock() self.mediator.get_host_by_host_identifiers.side_effect = [array_errors.MultipleHostsFoundError("", "")] storage_agent.return_value = self.storage_agent @@ -1334,38 +1366,45 @@ def test_unpublish_volume_get_host_by_host_identifiers_exception(self, storage_a self.assertTrue("Multiple hosts" in self.context.details) self.assertEqual(self.context.code, grpc.StatusCode.INTERNAL) + @patch("controller.controller_server.csi_controller_server.get_agent") + def test_unpublish_volume_get_host_by_host_identifiers_host_not_found_error(self, storage_agent): + self.mediator.get_host_by_host_identifiers = Mock() self.mediator.get_host_by_host_identifiers.side_effect = [array_errors.HostNotFoundError("")] storage_agent.return_value = self.storage_agent - self.servicer.ControllerUnpublishVolume(self.request, self.context) - self.assertEqual(self.context.code, grpc.StatusCode.NOT_FOUND) - - @patch("controller.controller_server.csi_controller_server.get_agent") - def test_unpublish_volume_unmap_volume_excpetions(self, storage_agent): - self.mediator.unmap_volume.side_effect = [array_errors.ObjectNotFoundError("volume")] - storage_agent.return_value = self.storage_agent self.servicer.ControllerUnpublishVolume(self.request, self.context) self.assertEqual(self.context.code, grpc.StatusCode.OK) - self.mediator.unmap_volume.side_effect = [array_errors.VolumeAlreadyUnmappedError("")] + def _test_unpublish_volume_unmap_volume_with_error(self, storage_agent, array_error, status_code): + self.mediator.unmap_volume.side_effect = [array_error] storage_agent.return_value = self.storage_agent self.servicer.ControllerUnpublishVolume(self.request, self.context) - self.assertEqual(self.context.code, grpc.StatusCode.OK) + self.assertEqual(self.context.code, status_code) - self.mediator.unmap_volume.side_effect = [array_errors.PermissionDeniedError("msg")] - storage_agent.return_value = self.storage_agent - self.servicer.ControllerUnpublishVolume(self.request, self.context) - self.assertEqual(self.context.code, grpc.StatusCode.PERMISSION_DENIED) + @patch("controller.controller_server.csi_controller_server.get_agent") + def test_unpublish_volume_unmap_volume_object_not_found_error(self, storage_agent): + self._test_unpublish_volume_unmap_volume_with_error(storage_agent, array_errors.ObjectNotFoundError("volume"), + grpc.StatusCode.OK) - self.mediator.unmap_volume.side_effect = [array_errors.HostNotFoundError("host")] - storage_agent.return_value = self.storage_agent - self.servicer.ControllerUnpublishVolume(self.request, self.context) - self.assertEqual(self.context.code, grpc.StatusCode.NOT_FOUND) + @patch("controller.controller_server.csi_controller_server.get_agent") + def test_unpublish_volume_unmap_volume_volume_already_unmapped_error(self, storage_agent): + self._test_unpublish_volume_unmap_volume_with_error(storage_agent, array_errors.VolumeAlreadyUnmappedError(""), + grpc.StatusCode.OK) - self.mediator.unmap_volume.side_effect = [array_errors.UnmappingError("", "", "")] - storage_agent.return_value = self.storage_agent - self.servicer.ControllerUnpublishVolume(self.request, self.context) - self.assertEqual(self.context.code, grpc.StatusCode.INTERNAL) + @patch("controller.controller_server.csi_controller_server.get_agent") + def test_unpublish_volume_unmap_volume_permission_denied_error(self, storage_agent): + self._test_unpublish_volume_unmap_volume_with_error(storage_agent, array_errors.PermissionDeniedError("msg"), + grpc.StatusCode.PERMISSION_DENIED) + + @patch("controller.controller_server.csi_controller_server.get_agent") + def test_unpublish_volume_unmap_volume_host_not_found_error(self, storage_agent): + self._test_unpublish_volume_unmap_volume_with_error(storage_agent, array_errors.HostNotFoundError("host"), + grpc.StatusCode.OK) + + @patch("controller.controller_server.csi_controller_server.get_agent") + def test_unpublish_volume_unmap_volume_unmapping_error(self, storage_agent): + self._test_unpublish_volume_unmap_volume_with_error(storage_agent, array_errors.UnmappingError("", "", ""), + grpc.StatusCode.INTERNAL) class TestGetCapabilities(BaseControllerSetUp): @@ -1391,11 +1430,11 @@ def setUp(self): self.request.volume_content_source = None self.mediator.get_object_by_id = Mock() self.volume_before_expand = utils.get_mock_mediator_response_volume(2, - volume_name, + VOLUME_NAME, self.volume_id, "a9k") self.volume_after_expand = utils.get_mock_mediator_response_volume(self.capacity_bytes, - volume_name, + VOLUME_NAME, self.volume_id, "a9k") self.mediator.get_object_by_id.side_effect = [self.volume_before_expand, self.volume_after_expand] @@ -1405,6 +1444,10 @@ def _prepare_expand_volume_mocks(self, storage_agent): storage_agent.return_value = self.storage_agent self.mediator.expand_volume = Mock() + @patch("controller.controller_server.csi_controller_server.get_agent") + def test_expand_volume_already_processing(self, storage_agent): + self._test_request_already_processing(storage_agent, "volume_id", self.request.volume_id) + @patch("controller.controller_server.csi_controller_server.get_agent") def test_expand_volume_with_required_bytes_too_large_fail(self, storage_agent): self._prepare_expand_volume_mocks(storage_agent) @@ -1515,7 +1558,11 @@ def test_expand_volume_with_object_not_found_exception(self): self._expand_volume_returns_error(return_code=grpc.StatusCode.NOT_FOUND, err=array_errors.ObjectNotFoundError("name")) - def test_expand_volume_with_create_volume_with_other_exception(self): + def test_expand_volume_with_object_in_use_exception(self): + self._expand_volume_returns_error(return_code=grpc.StatusCode.INTERNAL, + err=array_errors.ObjectIsStillInUseError("a", ["b"])) + + def test_expand_volume_with_other_exception(self): self._expand_volume_returns_error(return_code=grpc.StatusCode.INTERNAL, err=Exception("error")) @@ -1534,8 +1581,8 @@ def test_identity_plugin_get_info_succeeds(self, identity_config): request = Mock() context = Mock() request.volume_capabilities = [] - res = self.servicer.GetPluginInfo(request, context) - self.assertEqual(res, csi_pb2.GetPluginInfoResponse(name=plugin_name, vendor_version=version)) + response = self.servicer.GetPluginInfo(request, context) + self.assertEqual(response, csi_pb2.GetPluginInfoResponse(name=plugin_name, vendor_version=version)) @patch.object(CSIControllerServicer, "get_identity_config") def test_identity_plugin_get_info_fails_when_attributes_from_config_are_missing(self, identity_config): @@ -1544,12 +1591,12 @@ def test_identity_plugin_get_info_fails_when_attributes_from_config_are_missing( identity_config.side_effect = ["name", Exception(), Exception(), "1.1.0"] - res = self.servicer.GetPluginInfo(request, context) + response = self.servicer.GetPluginInfo(request, context) context.set_code.assert_called_once_with(grpc.StatusCode.INTERNAL) - self.assertEqual(res, csi_pb2.GetPluginInfoResponse()) + self.assertEqual(response, csi_pb2.GetPluginInfoResponse()) - res = self.servicer.GetPluginInfo(request, context) - self.assertEqual(res, csi_pb2.GetPluginInfoResponse()) + response = self.servicer.GetPluginInfo(request, context) + self.assertEqual(response, csi_pb2.GetPluginInfoResponse()) context.set_code.assert_called_with(grpc.StatusCode.INTERNAL) @patch.object(CSIControllerServicer, "get_identity_config") @@ -1559,12 +1606,12 @@ def test_identity_plugin_get_info_fails_when_name_or_value_are_empty(self, ident identity_config.side_effect = ["", "1.1.0", "name", ""] - res = self.servicer.GetPluginInfo(request, context) + response = self.servicer.GetPluginInfo(request, context) context.set_code.assert_called_once_with(grpc.StatusCode.INTERNAL) - self.assertEqual(res, csi_pb2.GetPluginInfoResponse()) + self.assertEqual(response, csi_pb2.GetPluginInfoResponse()) - res = self.servicer.GetPluginInfo(request, context) - self.assertEqual(res, csi_pb2.GetPluginInfoResponse()) + response = self.servicer.GetPluginInfo(request, context) + self.assertEqual(response, csi_pb2.GetPluginInfoResponse()) self.assertEqual(context.set_code.call_args_list, [call(grpc.StatusCode.INTERNAL), call(grpc.StatusCode.INTERNAL)]) @@ -1598,10 +1645,14 @@ def setUp(self): self.mediator.get_object_by_id.return_value = utils.get_mock_mediator_response_volume(10, "vol", "wwn2", "a9k") self.request.volume_capabilities = [self.volume_capability] - def _assertResponse(self, expected_status_code, expected_details_substring): + def _assert_response(self, expected_status_code, expected_details_substring): self.assertEqual(self.context.code, expected_status_code) self.assertTrue(expected_details_substring in self.context.details) + @patch("controller.controller_server.csi_controller_server.get_agent") + def test_validate_volume_capabilities_already_processing(self, storage_agent): + self._test_request_already_processing(storage_agent, "volume_id", self.request.volume_id) + @patch("controller.controller_server.csi_controller_server.get_agent") def test_validate_volume_capabilities_success(self, storage_agent): storage_agent.return_value = self.storage_agent @@ -1617,7 +1668,7 @@ def test_validate_volume_capabilities_with_empty_id(self, storage_agent): self.servicer.ValidateVolumeCapabilities(self.request, self.context) - self._assertResponse(grpc.StatusCode.INVALID_ARGUMENT, "volume id") + self._assert_response(grpc.StatusCode.INVALID_ARGUMENT, "volume id") @patch("controller.controller_server.csi_controller_server.get_agent") def test_validate_volume_capabilities_with_wrong_secrets(self, storage_agent): @@ -1630,7 +1681,7 @@ def test_validate_volume_capabilities_with_unsupported_access_mode(self, storage self.servicer.ValidateVolumeCapabilities(self.request, self.context) - self._assertResponse(grpc.StatusCode.INVALID_ARGUMENT, "unsupported access mode") + self._assert_response(grpc.StatusCode.INVALID_ARGUMENT, "unsupported access mode") @patch("controller.controller_server.csi_controller_server.get_agent") def test_validate_volume_capabilities_with_unsupported_fs_type(self, storage_agent): @@ -1641,7 +1692,7 @@ def test_validate_volume_capabilities_with_unsupported_fs_type(self, storage_age self.servicer.ValidateVolumeCapabilities(self.request, self.context) - self._assertResponse(grpc.StatusCode.INVALID_ARGUMENT, "fs_type") + self._assert_response(grpc.StatusCode.INVALID_ARGUMENT, "fs_type") @patch("controller.controller_server.csi_controller_server.get_agent") def test_validate_volume_capabilities_with_no_capabilities(self, storage_agent): @@ -1650,7 +1701,7 @@ def test_validate_volume_capabilities_with_no_capabilities(self, storage_agent): self.servicer.ValidateVolumeCapabilities(self.request, self.context) - self._assertResponse(grpc.StatusCode.INVALID_ARGUMENT, "not set") + self._assert_response(grpc.StatusCode.INVALID_ARGUMENT, "not set") @patch("controller.controller_server.csi_controller_server.get_agent") def test_validate_volume_capabilities_with_bad_id(self, storage_agent): @@ -1659,7 +1710,7 @@ def test_validate_volume_capabilities_with_bad_id(self, storage_agent): self.servicer.ValidateVolumeCapabilities(self.request, self.context) - self._assertResponse(grpc.StatusCode.NOT_FOUND, "id format") + self._assert_response(grpc.StatusCode.NOT_FOUND, "id format") @patch("controller.controller_server.csi_controller_server.get_agent") def test_validate_volume_capabilities_with_volume_not_found(self, storage_agent): @@ -1668,7 +1719,7 @@ def test_validate_volume_capabilities_with_volume_not_found(self, storage_agent) self.servicer.ValidateVolumeCapabilities(self.request, self.context) - self._assertResponse(grpc.StatusCode.NOT_FOUND, "wwn") + self._assert_response(grpc.StatusCode.NOT_FOUND, "wwn") @patch("controller.controller_server.csi_controller_server.get_agent") def test_validate_volume_capabilities_with_volume_context_not_match(self, storage_agent): @@ -1677,7 +1728,7 @@ def test_validate_volume_capabilities_with_volume_context_not_match(self, storag self.servicer.ValidateVolumeCapabilities(self.request, self.context) - self._assertResponse(grpc.StatusCode.INVALID_ARGUMENT, "volume context") + self._assert_response(grpc.StatusCode.INVALID_ARGUMENT, "volume context") @patch("controller.controller_server.csi_controller_server.get_agent") def test_validate_volume_capabilities_with_space_efficiency_not_match(self, storage_agent): @@ -1687,7 +1738,7 @@ def test_validate_volume_capabilities_with_space_efficiency_not_match(self, stor self.servicer.ValidateVolumeCapabilities(self.request, self.context) - self._assertResponse(grpc.StatusCode.INVALID_ARGUMENT, "space efficiency") + self._assert_response(grpc.StatusCode.INVALID_ARGUMENT, "space efficiency") @patch("controller.controller_server.csi_controller_server.get_agent") def test_validate_volume_capabilities_with_pool_not_match(self, storage_agent): @@ -1696,7 +1747,7 @@ def test_validate_volume_capabilities_with_pool_not_match(self, storage_agent): self.servicer.ValidateVolumeCapabilities(self.request, self.context) - self._assertResponse(grpc.StatusCode.INVALID_ARGUMENT, "pool") + self._assert_response(grpc.StatusCode.INVALID_ARGUMENT, "pool") @patch("controller.controller_server.csi_controller_server.get_agent") def test_validate_volume_capabilities_with_prefix_not_match(self, storage_agent): @@ -1705,7 +1756,7 @@ def test_validate_volume_capabilities_with_prefix_not_match(self, storage_agent) self.servicer.ValidateVolumeCapabilities(self.request, self.context) - self._assertResponse(grpc.StatusCode.INVALID_ARGUMENT, "prefix") + self._assert_response(grpc.StatusCode.INVALID_ARGUMENT, "prefix") @patch("controller.controller_server.csi_controller_server.get_agent") def test_validate_volume_capabilities_parameters_success(self, storage_agent): diff --git a/controller/tests/controller_server/utils_test.py b/controller/tests/controller_server/utils_test.py index 2f91981c8..934b03b5a 100644 --- a/controller/tests/controller_server/utils_test.py +++ b/controller/tests/controller_server/utils_test.py @@ -1,18 +1,17 @@ import json import unittest +from csi_general import csi_pb2 from mock import patch, Mock -import controller.array_action.errors as array_errors import controller.controller_server.utils as utils from controller.array_action import config as array_config from controller.array_action.config import NVME_OVER_FC_CONNECTIVITY_TYPE, FC_CONNECTIVITY_TYPE, ISCSI_CONNECTIVITY_TYPE from controller.common.node_info import NodeIdInfo from controller.controller_server import config as controller_config from controller.controller_server.csi_controller_server import CSIControllerServicer -from controller.controller_server.errors import ObjectIdError, ValidationException -from controller.controller_server.test_settings import pool, user, password, array -from controller.csi_general import csi_pb2 +from controller.controller_server.errors import ObjectIdError, ValidationException, InvalidNodeId +from controller.controller_server.test_settings import POOL, USER, PASSWORD, ARRAY from controller.tests import utils as test_utils from controller.tests.controller_server.csi_controller_server_test import ProtoBufMock from controller.tests.utils import get_fake_secret_config @@ -29,32 +28,52 @@ def setUp(self): "publish_context_fc_initiators": "fc_wwns"} } - def _test_validate_secrets_validation_errors(self, secrets): - with self.assertRaises(ValidationException): - utils.validate_secrets(secrets) + def _test_validation_exception(self, util_function, function_arg, str_in_msg="", raised_error=ValidationException): + with self.assertRaises(raised_error) as context: + util_function(function_arg) + if str_in_msg: + self.assertIn(str_in_msg, str(context.exception)) + + def _test_validate_node_id_validation_exception(self, node_id): + self._test_validation_exception(utils._validate_node_id, node_id, raised_error=InvalidNodeId) + + def test_validate_node_id_success(self): + node_id = "test-host;nqn;fc" + utils._validate_node_id(node_id) + + def test_validate_node_id_too_long(self): + node_id = "test-host;nqn;fc;iqn;extra" + self._test_validate_node_id_validation_exception(node_id) + + def test_validate_node_id_too_short(self): + node_id = "test-host" + self._test_validate_node_id_validation_exception(node_id) + + def _test_validate_secrets_validation_exception(self, secrets): + self._test_validation_exception(utils.validate_secrets, secrets) def test_validate_secrets_success(self): - secrets = {"username": user, "password": password, "management_address": array} + secrets = {"username": USER, "password": PASSWORD, "management_address": ARRAY} utils.validate_secrets(secrets) def test_validate_secrets_with_no_secret(self): - self._test_validate_secrets_validation_errors(None) + self._test_validate_secrets_validation_exception(None) def test_validate_secrets_with_no_management_address(self): - secrets = {"username": user, "password": password} - self._test_validate_secrets_validation_errors(secrets) + secrets = {"username": USER, "password": PASSWORD} + self._test_validate_secrets_validation_exception(secrets) def test_validate_secrets_with_no_password(self): - secrets = {"username": user, "management_address": array} - self._test_validate_secrets_validation_errors(secrets) + secrets = {"username": USER, "management_address": ARRAY} + self._test_validate_secrets_validation_exception(secrets) def test_validate_secrets_with_no_username(self): - secrets = {"password": password, "management_address": array} - self._test_validate_secrets_validation_errors(secrets) + secrets = {"password": PASSWORD, "management_address": ARRAY} + self._test_validate_secrets_validation_exception(secrets) def test_validate_secrets_with_empty_dict(self): secrets = {} - self._test_validate_secrets_validation_errors(secrets) + self._test_validate_secrets_validation_exception(secrets) def test_validate_secrets_with_config(self): secrets = get_fake_secret_config() @@ -62,15 +81,15 @@ def test_validate_secrets_with_config(self): def test_validate_secrets_with_config_invalid_secret(self): secrets = get_fake_secret_config(password=None) - self._test_validate_secrets_validation_errors(secrets) + self._test_validate_secrets_validation_exception(secrets) def test_validate_secrets_with_config_no_topologies(self): secrets = get_fake_secret_config(supported_topologies=None) - self._test_validate_secrets_validation_errors(secrets) + self._test_validate_secrets_validation_exception(secrets) secrets = get_fake_secret_config(supported_topologies=[]) - self._test_validate_secrets_validation_errors(secrets) + self._test_validate_secrets_validation_exception(secrets) secrets = get_fake_secret_config(supported_topologies=[{}]) - self._test_validate_secrets_validation_errors(secrets) + self._test_validate_secrets_validation_exception(secrets) def _test_validate_secrets_with_config_valid_system_id(self, system_id): secrets = get_fake_secret_config(system_id=system_id) @@ -82,7 +101,7 @@ def test_validate_secrets_with_config_valid_system_id(self): def _test_validate_secrets_with_config_invalid_system_id(self, system_id): secrets = get_fake_secret_config(system_id=system_id) - self._test_validate_secrets_validation_errors(secrets) + self._test_validate_secrets_validation_exception(secrets) def test_validate_secrets_with_config_invalid_parameters(self): system_ids = ["-u1", "u:1", "u1+", "u1*", "u-1(", "u/1", "u=1", " ", "", @@ -95,9 +114,9 @@ def _test_get_array_connection_info_from_secrets(self, secrets, topologies=None, secrets=secrets, topologies=topologies, system_id=system_id) - self.assertEqual(array_connection_info.user, user) - self.assertEqual(array_connection_info.password, password) - self.assertEqual(array_connection_info.array_addresses[0], array) + self.assertEqual(array_connection_info.user, USER) + self.assertEqual(array_connection_info.password, PASSWORD) + self.assertEqual(array_connection_info.array_addresses[0], ARRAY) if topologies or system_id: self.assertIsNotNone(array_connection_info.system_id) else: @@ -106,44 +125,44 @@ def _test_get_array_connection_info_from_secrets(self, secrets, topologies=None, def test_get_array_connection_info_from_secrets(self): secrets = get_fake_secret_config() self._test_get_array_connection_info_from_secrets(secrets, system_id="u1") - secrets = {"username": user, "password": password, "management_address": array} + secrets = {"username": USER, "password": PASSWORD, "management_address": ARRAY} self._test_get_array_connection_info_from_secrets(secrets) secrets = get_fake_secret_config(supported_topologies=[{"topology.block.csi.ibm.com/test1": "zone1"}]) self._test_get_array_connection_info_from_secrets(secrets, topologies={"topology.block.csi.ibm.com/test1": "zone1", "topology.block.csi.ibm.com/test2": "dev1"}) - def _test_get_pool_from_parameters(self, parameters, expected_pool=pool, system_id=None): + def _test_get_pool_from_parameters(self, parameters, expected_pool=POOL, system_id=None): volume_parameters = utils.get_volume_parameters(parameters, system_id) self.assertEqual(volume_parameters.pool, expected_pool) def test_get_pool_from_parameters(self): - parameters = {controller_config.PARAMETERS_POOL: pool} + parameters = {controller_config.PARAMETERS_POOL: POOL} self._test_get_pool_from_parameters(parameters) self._test_get_pool_from_parameters(parameters, system_id="u1") parameters = {controller_config.PARAMETERS_BY_SYSTEM: json.dumps( - {"u1": {controller_config.PARAMETERS_POOL: pool}, "u2": {controller_config.PARAMETERS_POOL: "other_pool"}})} + {"u1": {controller_config.PARAMETERS_POOL: POOL}, "u2": {controller_config.PARAMETERS_POOL: "other_pool"}})} self._test_get_pool_from_parameters(parameters, system_id="u1") self._test_get_pool_from_parameters(parameters, expected_pool="other_pool", system_id="u2") self._test_get_pool_from_parameters(parameters, expected_pool=None) + def _test_validate_csi_volume_capabilities_validation_exception(self, capabilities): + self._test_validation_exception(utils.validate_csi_volume_capabilities, capabilities) + def test_validate_file_system_volume_capabilities(self): access_mode = csi_pb2.VolumeCapability.AccessMode cap = test_utils.get_mock_volume_capability() utils.validate_csi_volume_capabilities([cap]) - with self.assertRaises(ValidationException): - utils.validate_csi_volume_capabilities([]) + self._test_validate_csi_volume_capabilities_validation_exception([]) cap.mount.fs_type = "ext4dummy" - with self.assertRaises(ValidationException): - utils.validate_csi_volume_capabilities([cap]) + self._test_validate_csi_volume_capabilities_validation_exception([cap]) cap.mount.fs_type = "ext4" cap.access_mode.mode = access_mode.SINGLE_NODE_READER_ONLY - with self.assertRaises(ValidationException): - utils.validate_csi_volume_capabilities([cap]) + self._test_validate_csi_volume_capabilities_validation_exception([cap]) def test_validate_create_volume_source_empty(self): request = Mock() @@ -176,66 +195,54 @@ def test_validate_raw_block_volume_capabilities(self): utils.validate_csi_volume_capabilities([caps]) + def _test_validate_create_volume_request_validation_exception(self, request, msg): + self._test_validation_exception(utils.validate_create_volume_request, request, str_in_msg=msg) + @patch('controller.controller_server.utils.validate_secrets') @patch('controller.controller_server.utils.validate_csi_volume_capabilities') def test_validate_create_volume_request(self, validate_capabilities, validate_secrets): request = Mock() request.name = "" - - with self.assertRaises(ValidationException) as ex: - utils.validate_create_volume_request(request) - self.assertTrue("name" in str(ex)) + self._test_validate_create_volume_request_validation_exception(request, "name") request.name = "name" request.capacity_range.required_bytes = -1 - with self.assertRaises(ValidationException) as ex: - utils.validate_create_volume_request(request) - self.assertTrue("size" in str(ex)) + self._test_validate_create_volume_request_validation_exception(request, "size") request.capacity_range.required_bytes = 10 validate_capabilities.side_effect = ValidationException("msg") - with self.assertRaises(ValidationException) as ex: - utils.validate_create_volume_request(request) - self.assertTrue("msg" in str(ex)) + self._test_validate_create_volume_request_validation_exception(request, "msg") validate_capabilities.side_effect = None validate_secrets.side_effect = ValidationException(" other msg") - with self.assertRaises(ValidationException) as ex: - utils.validate_create_volume_request(request) - self.assertTrue("other msg" in str(ex)) + self._test_validate_create_volume_request_validation_exception(request, "other msg") validate_secrets.side_effect = None request.parameters = {"capabilities": ""} - with self.assertRaises(ValidationException) as ex: - utils.validate_create_volume_request(request) - self.assertTrue("parameters" in str(ex)) + self._test_validate_create_volume_request_validation_exception(request, "parameter") request.parameters = {} - with self.assertRaises(ValidationException) as ex: - utils.validate_create_volume_request(request) - self.assertTrue("parameters" in str(ex)) + self._test_validate_create_volume_request_validation_exception(request, "parameter") request.parameters = None - with self.assertRaises(ValidationException) as ex: - utils.validate_create_volume_request(request) - self.assertTrue("parameters" in str(ex)) + self._test_validate_create_volume_request_validation_exception(request, "parameter") - request.parameters = {controller_config.PARAMETERS_POOL: pool, + request.parameters = {controller_config.PARAMETERS_POOL: POOL, controller_config.PARAMETERS_SPACE_EFFICIENCY: "thin "} request.volume_content_source = None utils.validate_create_volume_request(request) - request.parameters = {controller_config.PARAMETERS_POOL: pool} + request.parameters = {controller_config.PARAMETERS_POOL: POOL} utils.validate_create_volume_request(request) request.capacity_range.required_bytes = 0 @@ -246,8 +253,7 @@ def test_validate_delete_snapshot_request(self): request = Mock() request.snapshot_id = "" - with self.assertRaises(ValidationException): - utils.validate_delete_snapshot_request(request) + self._test_validation_exception(utils.validate_delete_snapshot_request, request) @patch("controller.controller_server.utils.get_volume_id") def test_get_create_volume_response(self, get_volume_id): @@ -255,15 +261,15 @@ def test_get_create_volume_response(self, get_volume_id): new_volume.name = "name" new_volume.array_address = ["fqdn1", "fqdn2"] - new_volume.pool = pool + new_volume.pool = POOL new_volume.array_type = "a9k" new_volume.capacity_bytes = 10 new_volume.copy_source_id = None get_volume_id.return_value = "a9k:name" - res = utils.generate_csi_create_volume_response(new_volume) + response = utils.generate_csi_create_volume_response(new_volume) - self.assertEqual(10, res.volume.capacity_bytes) + self.assertEqual(10, response.volume.capacity_bytes) get_volume_id.side_effect = [Exception("err")] @@ -271,85 +277,95 @@ def test_get_create_volume_response(self, get_volume_id): utils.generate_csi_create_volume_response(new_volume) @patch("controller.controller_server.utils.get_volume_id") - def test_get_create_volume_response_with_single_IP(self, get_volume_id): + def test_get_create_volume_response_with_single_ip(self, get_volume_id): new_volume = Mock() new_volume.name = "name" new_volume.array_address = "9.1.1.1" - new_volume.pool = pool + new_volume.pool = POOL new_volume.array_type = "svc" new_volume.capacity_bytes = 10 new_volume.copy_source_id = None get_volume_id.return_value = "svc:name" - res = utils.generate_csi_create_volume_response(new_volume) + response = utils.generate_csi_create_volume_response(new_volume) - self.assertEqual(10, res.volume.capacity_bytes) - self.assertEqual("9.1.1.1", res.volume.volume_context['array_address']) + self.assertEqual(10, response.volume.capacity_bytes) + self.assertEqual("9.1.1.1", response.volume.volume_context['array_address']) @patch("controller.controller_server.utils.get_volume_id") - def test_get_create_volume_response_with_Multiple_IP(self, get_volume_id): + def test_get_create_volume_response_with_multiple_ip(self, get_volume_id): new_volume = Mock() new_volume.name = "name" new_volume.array_address = ["9.1.1.1", "9.1.1.2"] - new_volume.pool = pool + new_volume.pool = POOL new_volume.array_type = "svc" new_volume.capacity_bytes = 10 new_volume.copy_source_id = None get_volume_id.return_value = "svc:name" - res = utils.generate_csi_create_volume_response(new_volume) + response = utils.generate_csi_create_volume_response(new_volume) - self.assertEqual(10, res.volume.capacity_bytes) - self.assertEqual("9.1.1.1,9.1.1.2", res.volume.volume_context['array_address']) + self.assertEqual(10, response.volume.capacity_bytes) + self.assertEqual("9.1.1.1,9.1.1.2", response.volume.volume_context['array_address']) + + def _test_validate_publish_volume_request_validation_exception(self, request, msg): + self._test_validation_exception(utils.validate_publish_volume_request, request, str_in_msg=msg) @patch('controller.controller_server.utils.validate_secrets') @patch('controller.controller_server.utils.validate_csi_volume_capability') - def test_validate_publish_volume_request(self, validate_capabilities, validate_secrets): + @patch('controller.controller_server.utils._validate_node_id') + def test_validate_publish_volume_request(self, validate_node_id, validate_capabilities, validate_secrets): request = Mock() request.readonly = True - with self.assertRaises(ValidationException) as ex: - utils.validate_publish_volume_request(request) - self.assertTrue("readonly" in str(ex)) + self._test_validate_publish_volume_request_validation_exception(request, "readonly") request.readonly = False validate_capabilities.side_effect = [ValidationException("msg1")] - with self.assertRaises(ValidationException) as ex: - utils.validate_publish_volume_request(request) - self.assertTrue("msg1" in str(ex)) + self._test_validate_publish_volume_request_validation_exception(request, "msg1") validate_capabilities.side_effect = None validate_secrets.side_effect = [ValidationException("secrets")] - with self.assertRaises(ValidationException) as ex: - utils.validate_publish_volume_request(request) - self.assertTrue("secrets" in ex.message) + self._test_validate_publish_volume_request_validation_exception(request, "secrets") validate_secrets.side_effect = None + validate_node_id.side_effect = [ValidationException("node id")] + + self._test_validate_publish_volume_request_validation_exception(request, "node id") + + validate_node_id.side_effect = None utils.validate_publish_volume_request(request) + def _test_validate_unpublish_volume_request_validation_exception(self, request, str_in_msg, + raised_error=ValidationException): + self._test_validation_exception(utils.validate_unpublish_volume_request, request, str_in_msg=str_in_msg, + raised_error=raised_error) + + @patch('controller.controller_server.utils._validate_node_id') @patch('controller.controller_server.utils.validate_secrets') - def test_validate_unpublish_volume_request(self, validate_secrets): + def test_validate_unpublish_volume_request(self, validate_secrets, validate_node_id): request = Mock() request.volume_id = "somebadvolumename" - with self.assertRaises(ObjectIdError) as ex: - utils.validate_unpublish_volume_request(request) - self.assertTrue("volume" in str(ex)) + self._test_validate_unpublish_volume_request_validation_exception(request, "volume", raised_error=ObjectIdError) request.volume_id = "xiv:volume" validate_secrets.side_effect = [ValidationException("secret")] - with self.assertRaises(ValidationException) as ex: - utils.validate_unpublish_volume_request(request) - self.assertTrue("msg2" in str(ex)) + self._test_validate_unpublish_volume_request_validation_exception(request, "secret") validate_secrets.side_effect = None + validate_node_id.side_effect = [ValidationException("node id")] + + self._test_validate_unpublish_volume_request_validation_exception(request, "node id") + + validate_node_id.side_effect = None utils.validate_unpublish_volume_request(request) @@ -375,15 +391,17 @@ def test_get_volume_id_info_with_internal_id(self): def test_get_volume_id_info_with_internal_id_system_id(self): self._test_get_volume_id_info(object_id="volume-id", system_id="system_id", internal_id="0") + def _test_get_volume_id_info_validation_exception(self, node_id, str_in_msg, raised_error): + self._test_validation_exception(utils.get_volume_id_info, node_id, str_in_msg=str_in_msg, + raised_error=raised_error) + def test_get_volume_id_info_too_many_semicolons_fail(self): - with self.assertRaises(ObjectIdError) as ex: - utils.get_volume_id_info("xiv:0;volume;id") - self.assertIn("Wrong volume id format", str(ex.exception)) + self._test_get_volume_id_info_validation_exception("xiv:0;volume;id", str_in_msg="Wrong volume id format", + raised_error=ObjectIdError) def test_get_volume_id_info_no_id_fail(self): - with self.assertRaises(ObjectIdError) as ex: - utils.get_volume_id_info("badvolumeformat") - self.assertIn("Wrong volume id format", str(ex.exception)) + self._test_get_volume_id_info_validation_exception("badvolumeformat", str_in_msg="Wrong volume id format", + raised_error=ObjectIdError) def _check_node_id_parameters(self, node_id_info, nvme_nqn, fc_wwns, iscsi_iqn): self.assertEqual(node_id_info.node_name, "host-name") @@ -392,9 +410,8 @@ def _check_node_id_parameters(self, node_id_info, nvme_nqn, fc_wwns, iscsi_iqn): self.assertEqual(node_id_info.initiators.iscsi_iqn, iscsi_iqn) def test_get_node_id_info(self): - with self.assertRaises(array_errors.HostNotFoundError) as ex: - utils.get_node_id_info("bad-node-format") - self.assertTrue("node" in str(ex)) + self._test_validation_exception(utils.get_node_id_info, "bad-node-format", str_in_msg="node", + raised_error=ValueError) host_name = "host-name" nvme_nqn = "nqn.ibm" fc_wwns = "wwn1:wwn2" diff --git a/controller/tests/utils.py b/controller/tests/utils.py index 42e0d7549..84ac45ca1 100644 --- a/controller/tests/utils.py +++ b/controller/tests/utils.py @@ -4,11 +4,11 @@ from mock import Mock, MagicMock from controller.controller_server.controller_types import ArrayConnectionInfo -from controller.controller_server.test_settings import user as test_user, password as test_password, array as test_array +from controller.controller_server.test_settings import USER as test_user, PASSWORD as test_password, ARRAY as test_array class ProtoBufMock(MagicMock): - def HasField(self, field): + def HasField(self, field): # pylint: disable=invalid-name return hasattr(self, field) diff --git a/deploy/kubernetes/examples/demo-storageclass-config-secret.yaml b/deploy/kubernetes/examples/demo-storageclass-config-secret.yaml index b3283036d..85bcfea30 100644 --- a/deploy/kubernetes/examples/demo-storageclass-config-secret.yaml +++ b/deploy/kubernetes/examples/demo-storageclass-config-secret.yaml @@ -8,7 +8,7 @@ parameters: # non-csi.storage.k8s.io parameters may be specified in by_management_id per system and/or outside by_management_id as the cross-system default. by_management_id: '{"demo-management-id-1":{"pool":"demo-pool-1","SpaceEfficiency":"dedup_compressed","volume_name_prefix":"demo-prefix-1"}, - "demo-management-id-2":{"pool":"demo-pool-2","volume_name_prefix":"demo-prefix-2"}}' # Optional. + "demo-management-id-2":{"pool":"demo-pool-2","volume_name_prefix":"demo-prefix-2", "io_group": "demo-iogrp"}}' # Optional. pool: demo-pool SpaceEfficiency: thin # Optional. volume_name_prefix: demo-prefix # Optional. diff --git a/deploy/kubernetes/examples/demo-storageclass.yaml b/deploy/kubernetes/examples/demo-storageclass.yaml index 1d13b26e3..a78bbf4dc 100644 --- a/deploy/kubernetes/examples/demo-storageclass.yaml +++ b/deploy/kubernetes/examples/demo-storageclass.yaml @@ -5,6 +5,7 @@ metadata: provisioner: block.csi.ibm.com parameters: pool: demo-pool + io_group: demo-iogrp # Optional. SpaceEfficiency: thin # Optional. volume_name_prefix: demo-prefix # Optional. diff --git a/docs/SUMMARY.md b/docs/SUMMARY.md index 08cee4759..04ad19850 100644 --- a/docs/SUMMARY.md +++ b/docs/SUMMARY.md @@ -3,12 +3,13 @@ * [Welcome](book_files/csi_block_storage_kc_welcome.md) * [What's new](book_files/csi_block_storage_kc_whatsnew.md) * [Release notes](book_files/csi_block_storage_kc_rn.md) - * [What's new in 1.8.0](content/release_notes/whats_new.md) + * [What's new in 1.9.0](content/release_notes/whats_new.md) * [Compatibility and requirements](content/release_notes/compatibility_requirements.md) * [Supported storage systems](content/release_notes/supported_storage.md) * [Supported operating systems](content/release_notes/supported_os.md) * [Supported orchestration platforms](content/release_notes/supported_orchestration.md) * [Change log](content/release_notes/change_log.md) + * [1.9.0 (March 2022)](content/release_notes/changelog_1.9.0.md) * [1.8.0 (December 2021)](content/release_notes/changelog_1.8.0.md) * [1.7.0 (September 2021)](content/release_notes/changelog_1.7.0.md) * [1.6.0 (June 2021)](content/release_notes/changelog_1.6.0.md) @@ -25,7 +26,7 @@ * [Installing](content/installation/installation.md) * [Compatibility and requirements](content/installation/install_compatibility_requirements.md) * [Installing the operator and driver](content/installation/install_operator_driver.md) - * [Installing the driver with OpenShift web console](content/installation/install_driver_openshift_web.md) + * [Installing the driver with the OpenShift web console](content/installation/install_driver_openshift_web.md) * [Installing the driver with GitHub](content/installation/install_driver_github.md) * [Installing the driver with OperatorHub.io](content/installation/install_driver_operatorhub.md) * [Uninstalling the operator and driver](content/installation/uninstalling.md) @@ -51,7 +52,7 @@ * [Creating a VolumeSnapshotClass with topology awareness](content/configuration/creating_volumesnapshotclass_topology_aware.md) * [Advanced configuration](content/configuration/advanced_configuration.md) * [Importing an existing volume](content/configuration/importing_existing_volume.md) -* [Using IBM block storage CSI driver](content/using/using.md) +* [Using](content/using/using.md) * [Sample configurations for running a stateful container](content/using/sample_stateful_container.md) * [Troubleshooting](content/troubleshooting/troubleshooting.md) * [Log and status collection](content/troubleshooting/log_status_collect.md) diff --git a/docs/book_files/csi_block_storage_kc_rn.md b/docs/book_files/csi_block_storage_kc_rn.md index 583de3fa6..ec5e0ce9f 100644 --- a/docs/book_files/csi_block_storage_kc_rn.md +++ b/docs/book_files/csi_block_storage_kc_rn.md @@ -1,4 +1,4 @@ # Release notes -The following release information is available for version 1.8.0 of the IBM® block storage CSI driver. +The following release information is available for version 1.9.0 of the IBM® block storage CSI driver. diff --git a/docs/book_files/csi_block_storage_kc_welcome.md b/docs/book_files/csi_block_storage_kc_welcome.md index 876c9b6df..8fc33c519 100644 --- a/docs/book_files/csi_block_storage_kc_welcome.md +++ b/docs/book_files/csi_block_storage_kc_welcome.md @@ -1,4 +1,4 @@ -# IBM block storage CSI driver 1.8.0 welcome page +# IBM block storage CSI driver 1.9.0 welcome page IBM block storage CSI driver is based on an open-source IBM project, included as a part of IBM Storage orchestration for containers. IBM Storage orchestration for containers enables enterprises to implement a modern container-driven hybrid multicloud environment that can diff --git a/docs/book_files/csi_block_storage_kc_whatsnew.md b/docs/book_files/csi_block_storage_kc_whatsnew.md index 311cb200b..75d26a6da 100644 --- a/docs/book_files/csi_block_storage_kc_whatsnew.md +++ b/docs/book_files/csi_block_storage_kc_whatsnew.md @@ -1,8 +1,8 @@ # What's new -This topic lists the dates and nature of updates to the published information of IBM® block storage CSI driver 1.8.0. +This topic lists the dates and nature of updates to the published information of IBM® block storage CSI driver 1.9.0. |Date|Nature of updates to the published information| |----|----------------------------------------------| -|15 December 2021|The version information was added to the IBM Documentation.
For more information about this version, see the [What's new in 1.8.0](../content/release_notes/whats_new.md) section in the release notes.| +|17 March 2022|The version information was added to the IBM Documentation.
For more information about this version, see the [What's new in 1.9.0](../content/release_notes/whats_new.md) section in the release notes.| diff --git a/docs/content/configuration/creating_storageclass_topology_aware.md b/docs/content/configuration/creating_storageclass_topology_aware.md index 76ab3d7d2..703b26daf 100644 --- a/docs/content/configuration/creating_storageclass_topology_aware.md +++ b/docs/content/configuration/creating_storageclass_topology_aware.md @@ -24,7 +24,7 @@ The various `by_management_id` parameters are chosen within the following hierar # non-csi.storage.k8s.io parameters may be specified in by_management_id per system and/or outside by_management_id as the cross-system default. by_management_id: '{"demo-management-id-1":{"pool":"demo-pool-1","SpaceEfficiency":"dedup_compressed","volume_name_prefix":"demo-prefix-1"}, - "demo-management-id-2":{"pool":"demo-pool-2","volume_name_prefix":"demo-prefix-2"}}' # Optional. + "demo-management-id-2":{"pool":"demo-pool-2","volume_name_prefix":"demo-prefix-2", "io_group": "demo-iogrp"}}' # Optional. pool: demo-pool SpaceEfficiency: thin # Optional. volume_name_prefix: demo-prefix # Optional. diff --git a/docs/content/configuration/creating_volumereplicationclass.md b/docs/content/configuration/creating_volumereplicationclass.md index 839f6aa76..648a78496 100644 --- a/docs/content/configuration/creating_volumereplicationclass.md +++ b/docs/content/configuration/creating_volumereplicationclass.md @@ -8,7 +8,7 @@ In order to enable volume replication for your storage system, create a VolumeRe When configuring the file, be sure to use the same array secret and array secret namespace as defined in [Creating a Secret](creating_secret.md). -For information on obtaining your storage system `system_id`, see [Finding a `system_id`](finding_systemid.md). +Use the `system_id` of the storage system containing the `replicationHandle` volumes. For information on obtaining your storage system `system_id`, see [Finding a `system_id`](finding_systemid.md). ``` apiVersion: replication.storage.openshift.io/v1alpha1 diff --git a/docs/content/configuration/creating_volumesnapshot.md b/docs/content/configuration/creating_volumesnapshot.md index 7801dc55e..53edca078 100644 --- a/docs/content/configuration/creating_volumesnapshot.md +++ b/docs/content/configuration/creating_volumesnapshot.md @@ -43,5 +43,3 @@ When creating volume snapshots, be sure to follow all of the snapshot configurat - **Creation Time:** Indicates when the snapshot was created. - **Ready to Use:** Indicates the volume snapshot is ready to use. - **Restore Size:** Indicates the minimum volume size required when restoring (provisioning) a volume from this snapshot. - - diff --git a/docs/content/configuration/creating_volumesnapshotclass.md b/docs/content/configuration/creating_volumesnapshotclass.md index 2cda4e3a6..f662d95b3 100644 --- a/docs/content/configuration/creating_volumesnapshotclass.md +++ b/docs/content/configuration/creating_volumesnapshotclass.md @@ -12,6 +12,15 @@ When configuring the file, be sure to use the same array secret and array secret **Note:** For IBM DS8000® family, the maximum prefix length is five characters.
The maximum prefix length for other systems is 20 characters.
For storage systems that use Spectrum Virtualize, the `CSI` prefix is added as default if not specified by the user. +- To create a stretched snapshot on SAN Volume Controller storage systems, put a colon (:) between the two pools within the `pool` value. For example: + + ``` + pool: demo-pool1:demo-pool2 + ``` + **Important:** The two pools must be from different sites. + + For more information about stretched snapshot limitations and requirements, see [Limitations](../release_notes/limitations.md) and [Compatibility and requirements](../installation/install_compatibility_requirements.md). + - The `pool` parameter is not available on IBM FlashSystem A9000 and A9000R storage systems. For these storage systems, the snapshot must be created on the same pool as the source. ``` diff --git a/docs/content/configuration/creating_volumestorageclass.md b/docs/content/configuration/creating_volumestorageclass.md index 6f41a2ee8..76b42f890 100644 --- a/docs/content/configuration/creating_volumestorageclass.md +++ b/docs/content/configuration/creating_volumestorageclass.md @@ -12,26 +12,28 @@ Create a storage class YAML file, similar to the following `demo-storageclass.ya When configuring the file, be sure to use the same array secret and array secret namespace as defined in [Creating a Secret](creating_secret.md). -Use the `SpaceEfficiency` parameters for each storage system, as defined in [the following table](#spaceefficiency). These values are not case-sensitive. +Use the `SpaceEfficiency` parameters for each storage system, as defined in the following table. These values are not case-sensitive. #### `SpaceEfficiency` parameter definitions per storage system type |Storage system type|SpaceEfficiency parameter options| |-------------------|---------------------------------| |IBM FlashSystem® A9000 and A9000R|Always includes deduplication and compression. No need to specify during configuration.| -|IBM Spectrum® Virtualize family|- `thick` (default value)
- `thin`
- `compressed`
- `dedup_thin` (creates volumes that are deduplicated with thin-provisioning)
- `dedup_compressed` (creates deduplicated and compressed volumes)

**Note:**
- The `deduplicated` value is deprecated. Use `dedup_compressed`, if possible. When used, `deduplicated` provide the same results as `dedup_compressed`.
- If not specified, the default value is `thick`.| +|IBM Spectrum® Virtualize family|- `thick` (default value)
- `thin`
- `compressed`
- `dedup_thin` (creates volumes that are deduplicated with thin-provisioning)
- `dedup_compressed` (creates deduplicated and compressed volumes)

**Note:**
- The `deduplicated` value is deprecated. Use `dedup_compressed`, if possible. When used, `deduplicated` provides the same results as `dedup_compressed`.
- If not specified, the default value is `thick`.| |IBM® DS8000® family| - `none` (default value)
- `thin`

**Note:** If not specified, the default value is `none`.| - The IBM DS8000 family `pool` value is the pool ID and not the pool name as is used in other storage systems. - Be sure that the `pool` value is the name of an existing pool on the storage system. -- To create a volume with HyperSwap on IBM Spectrum Virtualize storage systems, put a colon (:) between the two pools within the `pool` value. For example: +- To create a volume with high availability (HA) (HyperSwap or stretched topology) on IBM Spectrum Virtualize storage systems, put a colon (:) between the two pools within the `pool` value. For example: ``` pool: demo-pool1:demo-pool2 ``` **Important:** The two pools must be from different sites. - For more information about the HyperSwap limitations and requirements, see [Limitations](../release_notes/limitations.md) within the release notes and [Compatibility and requirements](../installation/install_compatibility_requirements.md) within this guide. + For more information about high availability limitations, see [Limitations](../release_notes/limitations.md). + + For more information about high availability requirements, see [Compatibility and requirements](../installation/install_compatibility_requirements.md). - The `allowVolumeExpansion` parameter is optional but is necessary for using volume expansion. The default value is _false_. @@ -39,6 +41,7 @@ Use the `SpaceEfficiency` parameters for each storage system, as defined in [the - The `csi.storage.k8s.io/fstype` parameter is optional. The values that are allowed are _ext4_ or _xfs_. The default value is _ext4_. - The `volume_name_prefix` parameter is optional. +- The `io_group` parameter is only available on Spectrum Virtualize storage systems. For more information about I/O groups, see **Product overview** > **Technical overview** > **I/O group** within your product documentation on [IBM Documentation](https://www.ibm.com/docs). **Note:** For IBM DS8000 family, the maximum prefix length is five characters. The maximum prefix length for other systems is 20 characters.

For storage systems that use Spectrum Virtualize, the `CSI` prefix is added as default if not specified by the user. @@ -51,6 +54,7 @@ Use the `SpaceEfficiency` parameters for each storage system, as defined in [the provisioner: block.csi.ibm.com parameters: pool: demo-pool + io_group: demo-iogrp # Optional. SpaceEfficiency: thin # Optional. volume_name_prefix: demo-prefix # Optional. diff --git a/docs/content/configuration/finding_systemid.md b/docs/content/configuration/finding_systemid.md index 1e314e308..247ec7441 100644 --- a/docs/content/configuration/finding_systemid.md +++ b/docs/content/configuration/finding_systemid.md @@ -4,5 +4,5 @@ Find the remote storage system `system_id` parameter on your storage system in o For finding the `system_id` parameter on your Spectrum Virtualize storage system, use the `lspartnership` command. -For more information, see **Command-line interface** > **Copy Service commands** > **lspartnership** within your specific product documentation on [IBM Docs](https://www.ibm.com/docs/en). +For more information, see **Command-line interface** > **Copy Service commands** > **lspartnership** within your specific product documentation on [IBM Docs](https://www.ibm.com/docs/). diff --git a/docs/content/configuration/importing_existing_volume.md b/docs/content/configuration/importing_existing_volume.md index fc7c9942c..e9b318548 100644 --- a/docs/content/configuration/importing_existing_volume.md +++ b/docs/content/configuration/importing_existing_volume.md @@ -22,7 +22,7 @@ To find the `volumeHandle`, use one of the following procedures: - Through command line: Find both the `id` and `vdisk_UID` attributes, by using the `lsvdisk` command. - For more information, see **Command-line interface** > **Volume commands** > **lsvdisk** within your specific product documentation on [IBM Documentation](https://www.ibm.com/docs/en). + For more information, see **Command-line interface** > **Volume commands** > **lsvdisk** within your specific product documentation on [IBM Documentation](https://www.ibm.com/docs/). - Through the management GUI: @@ -44,7 +44,7 @@ To find the `volumeHandle`, use one of the following procedures: Find the `id` and `WWN` for the volume, by using the `vol_list -f` command. - For more information, see **Reference** > **Command-line reference (12.3.2.x)** > **Volume management commands** > **Listing volumes** within your specific product documentation on [IBM Documentation](https://www.ibm.com/docs/en). + For more information, see **Reference** > **Command-line reference (12.3.2.x)** > **Volume management commands** > **Listing volumes** within your specific product documentation on [IBM Documentation](https://www.ibm.com/docs/). - Through the Hyper-Scale Management user interface: @@ -69,7 +69,7 @@ To find the `volumeHandle`, use one of the following procedures: Find the `GUID` for the volume, by using the `lsfbvol` command. - For more information, see **Reference** > **Command-line interface** > **CLI commands** > **Storage configuration commands** > **Fixed block logical volume specific commands** > **lsfbvol** within your specific product documentation on [IBM Documentation](https://www.ibm.com/docs/en). + For more information, see **Reference** > **Command-line interface** > **CLI commands** > **Storage configuration commands** > **Fixed block logical volume specific commands** > **lsfbvol** within your specific product documentation on [IBM Documentation](https://www.ibm.com/docs/). - Through the DS8000 Storage Management GUI: @@ -140,6 +140,6 @@ Use this procedure to help build a PV YAML file for your volumes. resources: requests: storage: 1Gi - storageClassName: ibmc-block-gold + storageClassName: demo-storageclass volumeName: demo-pv ``` \ No newline at end of file diff --git a/docs/content/installation/install_compatibility_requirements.md b/docs/content/installation/install_compatibility_requirements.md index 23937a586..683565c31 100644 --- a/docs/content/installation/install_compatibility_requirements.md +++ b/docs/content/installation/install_compatibility_requirements.md @@ -2,7 +2,7 @@ For the complete and up-to-date information about the compatibility and requirements for using the IBM® block storage CSI driver, refer to its latest release notes. The release notes detail supported operating system and container platform versions, and microcode versions of the supported storage systems. -Before beginning the installation of the CSI (Container Storage Interface) driver, be sure to verify that you comply with the following prerequisites. +Be sure to verify that you comply with all of the following prerequisites before beginning the installation of the CSI (Container Storage Interface) driver. For IBM Cloud® Satellite users, see [cloud.ibm.com/docs/satellite](https://cloud.ibm.com/docs/satellite) for full system requirements. @@ -17,7 +17,7 @@ The CSI driver requires the following ports to be opened on the worker nodes OS Port 7778 - - **IBM Spectrum® Virtualize family includes IBM® SAN Volume Controller and IBM FlashSystem® family members that are built with IBM Spectrum® Virtualize (including FlashSystem 5xxx, 7200, 9100, 9200, 9200R)** + - **IBM Spectrum® Virtualize family includes IBM® SAN Volume Controller and IBM FlashSystem® family members that are built with IBM Spectrum® Virtualize (including FlashSystem 5xxx, 7xxx, 9xxx)** Port 22 @@ -25,13 +25,13 @@ The CSI driver requires the following ports to be opened on the worker nodes OS Port 8452 -Complete these steps for each worker node in Kubernetes cluster to prepare your environment for installing the CSI (Container Storage Interface) driver. +Complete these steps to prepare your environment for installing the CSI (Container Storage Interface) driver. -1. Configure Linux® multipath devices on the host. +1. Configure Linux® multipath devices, per worker node. **Important:** Be sure to configure each worker with storage connectivity according to your storage system instructions. For more information, find your storage system documentation in [IBM Documentation](http://www.ibm.com/docs/). - **Additional configuration steps for OpenShift® Container Platform users (RHEL and RHCOS).** Other users can skip these additional configuration steps. + **Additional configuration steps for Red Hat OpenShift Container Platform users (RHEL and RHCOS).** Other users can skip these additional configuration steps. Download and save the following YAML file: @@ -49,7 +49,7 @@ Complete these steps for each worker node in Kubernetes cluster to prepare your `oc apply -f 99-ibm-attach.yaml` -2. Configure your storage system host attachment. +2. Configure your storage system host attachment, per worker node. **Important:** The CSI driver does not define hosts on your storage system. @@ -64,9 +64,9 @@ Complete these steps for each worker node in Kubernetes cluster to prepare your For more information, find your storage system documentation in [IBM Documentation](http://www.ibm.com/docs/). -3. **For RHEL OS users:** Ensure that the following packages are installed. +3. **For RHEL OS users:** Ensure that the following packages are installed per worker node. - If using RHCOS or if the packages are already installed, this step may be skipped. + If using RHCOS or if the packages are already installed, this step can be skipped. - sg3_utils - iscsi-initiator-utils @@ -95,10 +95,16 @@ Complete these steps for each worker node in Kubernetes cluster to prepare your 2. To enable support on your storage system, see the following section within your Spectrum Virtualize product documentation on [IBM Documentation](https://www.ibm.com/docs/en/): **Administering** > **Managing Copy Services** > **Managing remote-copy partnerships**. -6. (Optional) To use CSI Topology, at least one node in the cluster must have the label-prefix of `topology.block.csi.ibm.com` to introduce topology awareness: +6. (Optional) To use CSI Topology, at least one node in the cluster must have the label-prefix of `topology.block.csi.ibm.com` to introduce topology awareness. **Important:** This label-prefix must be found on the nodes in the cluster **before** installing the IBM® block storage CSI driver. If the nodes do not have the proper label-prefix before installation, CSI Topology cannot be used with the CSI driver. For more information, see [Configuring for CSI Topology](../configuration/configuring_topology.md). -7. (Optional) If planning on using HyperSwap on your storage system, see the following section within your Spectrum Virtualize product documentation on [IBM Documentation](https://www.ibm.com/docs/en/): **Planning** > **Planning for high availability** > **Planning for a HyperSwap topology system**. \ No newline at end of file +7. (Optional) If planning on using an HA feature (either HyperSwap or stretched topology) on your storage system, see the appropriate sections within your Spectrum Virtualize product documentation on [IBM Documentation](https://www.ibm.com/docs/en/): + - HyperSwap topology planning and configuration + - **Planning** > **Planning for high availability** > **Planning for a HyperSwap topology system** + - **Configuring** > **Configuration details** > **HyperSwap system configuration details** + - Stretched topology planning and configuration ([SAN Volume Controller](https://www.ibm.com/docs/en/sanvolumecontroller) only): + - **Planning** > **Planning for high availability** > **Planning for a stretched topology system** + - **Configuring** > **Configuration details** > **Stretched system configuration details** \ No newline at end of file diff --git a/docs/content/installation/install_driver_github.md b/docs/content/installation/install_driver_github.md index 3bd8fbdc8..8bddf3fdd 100644 --- a/docs/content/installation/install_driver_github.md +++ b/docs/content/installation/install_driver_github.md @@ -2,7 +2,7 @@ The operator for IBM® block storage CSI driver can be installed directly with GitHub. Installing the CSI (Container Storage Interface) driver is part of the operator installation process. -Use the following steps to install the operator and driver, with [GitHub](https://github.com/IBM/ibm-block-csi-operator) (github.com/IBM/ibm-block-csi-operator). +Use the following steps to install the operator and driver, with [GitHub](https://github.com/IBM/ibm-block-csi-operator). **Note:** Before you begin, it is best practice to create a user-defined namespace. Create the project namespace, using the `kubectl create ns ` command. @@ -11,7 +11,7 @@ Use the following steps to install the operator and driver, with [GitHub](https: 1. Download the manifest from GitHub. ``` - curl https://raw.githubusercontent.com/IBM/ibm-block-csi-operator/v1.8.0/deploy/installer/generated/ibm-block-csi-operator.yaml > ibm-block-csi-operator.yaml + curl https://raw.githubusercontent.com/IBM/ibm-block-csi-operator/v1.9.0/deploy/installer/generated/ibm-block-csi-operator.yaml > ibm-block-csi-operator.yaml ``` 2. (Optional) Update the image fields in the `ibm-block-csi-operator.yaml`. @@ -37,7 +37,7 @@ Use the following steps to install the operator and driver, with [GitHub](https: 1. Download the manifest from GitHub. ``` - curl https://raw.githubusercontent.com/IBM/ibm-block-csi-operator/v1.8.0/config/samples/csi.ibm.com_v1_ibmblockcsi_cr.yaml > csi.ibm.com_v1_ibmblockcsi_cr.yaml + curl https://raw.githubusercontent.com/IBM/ibm-block-csi-operator/v1.9.0/config/samples/csi.ibm.com_v1_ibmblockcsi_cr.yaml > csi.ibm.com_v1_ibmblockcsi_cr.yaml ``` 2. (Optional) Update the image repository field, tag field, or both in the `csi.ibm.com_v1_ibmblockcsi_cr.yaml`. diff --git a/docs/content/installation/install_driver_openshift_web.md b/docs/content/installation/install_driver_openshift_web.md index b9a95dfaa..5c3791a94 100644 --- a/docs/content/installation/install_driver_openshift_web.md +++ b/docs/content/installation/install_driver_openshift_web.md @@ -18,7 +18,7 @@ The Red Hat OpenShift Container Platform uses the following `SecurityContextCons 3. Search for IBM block storage CSI driver. -4. Select the **Operator for IBM block storage CSI driver** and click **Install**.

The **Operator Installation** form appears. +4. Select the **IBM block storage CSI driver operator** and click **Install**.

The **Operator Installation** form appears. 5. Set the **Installation Mode** to the project namespace selected previously, in step 2, under **A specific namespace on the cluster**. @@ -28,13 +28,13 @@ The Red Hat OpenShift Container Platform uses the following `SecurityContextCons 7. Click **Install**. -8. From **Operators** > **Installed Operators**, check the status of the Operator for IBM block storage CSI driver. +8. From **Operators** > **Installed Operators**, check the status of the IBM block storage CSI driver operator. Wait until the **Status** is _Up to date_ and then _Succeeded_. **Note:** While waiting for the **Status** to change from _Up to date_ to _Succeeded_, you can check the pod progress and readiness status from **Workloads** > **Pods**. -9. After the operator installation progress is complete, click the installed Operator for IBM block storage CSI driver. +9. After the operator installation progress is complete, click the installed IBM block storage CSI driver operator. 10. Click **Create Instance** to create the IBM block storage CSI driver (`IBMBlockCSI`). diff --git a/docs/content/installation/uninstall_driver_openshift_web.md b/docs/content/installation/uninstall_driver_openshift_web.md index aff25eda3..dac277d2e 100644 --- a/docs/content/installation/uninstall_driver_openshift_web.md +++ b/docs/content/installation/uninstall_driver_openshift_web.md @@ -5,7 +5,7 @@ Use this information to uninstall the IBM® CSI (Container Storage Interface) op Perform the following steps in order to uninstall the CSI driver and operator through Red Hat OpenShift Container Platform web console. 1. From the web console go to **Operators** > **Installed Operators**. Select the Project namespace, where installed, from `Projects: `. -2. Select **Operator for IBM block storage CSI driver**. +2. Select **IBM block storage CSI driver operator**. 3. Select **IBM block storage CSI driver**. @@ -15,8 +15,8 @@ Perform the following steps in order to uninstall the CSI driver and operator th Wait for the controller and node pods to terminate. - This deletes the CSI driver. Continue to step [5](#operator) to delete the operator for IBM block storage CSI driver. + This deletes the CSI driver. Continue to the next step to delete the Operator for IBM block storage CSI driver. -5. From the **Installed Operators** page, click on the **more** menu for the **Operator for IBM block storage CSI driver** and select **Uninstall Operator**. +5. From the **Installed Operators** page, click on the **more** menu for the **IBM block storage CSI driver operator** and select **Uninstall Operator**. diff --git a/docs/content/installation/upgrade.md b/docs/content/installation/upgrade.md index a02ba6d0a..41ff3063f 100644 --- a/docs/content/installation/upgrade.md +++ b/docs/content/installation/upgrade.md @@ -5,7 +5,7 @@ Use this information to upgrade the IBM® block storage CSI driver. - The OpenShift web console and OperatorHub.io both automatically upgrade the CSI (Container Storage Interface) driver when a new version is released. - With OpenShift web console, the **Approval Strategy** must be set to **Automatic**. - To check if your operator is running at the latest release level, from the OpenShift web console, browse to **Operators** > **Installed Operators**. Check the status of the Operator for IBM block storage CSI driver. Ensure that the **Upgrade Status** is _Up to date_. + To check if your operator is running at the latest release level, from the OpenShift web console, browse to **Operators** > **Installed Operators**. Check the status of the IBM block storage CSI driver operator. Ensure that the **Upgrade Status** is _Up to date_. **Note:** For more information about automatic upgrades, see https://olm.operatorframework.io/docs/concepts/crds/subscription/. diff --git a/docs/content/installation/upgrade_manual_openshift.md b/docs/content/installation/upgrade_manual_openshift.md index 1db4acbb3..0b445a717 100644 --- a/docs/content/installation/upgrade_manual_openshift.md +++ b/docs/content/installation/upgrade_manual_openshift.md @@ -16,7 +16,7 @@ When using the Red Hat® OpenShift® Container Platform, the CSI (Container Stor 5. From the **Subscription** tab, check the upgrade status and the installed version. -6. From **Operators** > **Installed Operators** > **Operator for IBM block storage CSI driver**, click **Create Instance**. +6. From **Operators** > **Installed Operators** > **IBM block storage CSI driver operator**, click **Create Instance**. 7. Check the **Subscriptions** > **Subscription Overview** tab see the Operator status. diff --git a/docs/content/release_notes/changelog_1.4.0.md b/docs/content/release_notes/changelog_1.4.0.md index dd74d645e..7dc7c874f 100644 --- a/docs/content/release_notes/changelog_1.4.0.md +++ b/docs/content/release_notes/changelog_1.4.0.md @@ -4,7 +4,7 @@ IBM® block storage CSI driver 1.4.0 provided a range of enhancements and resolv - New IBM Power Systems™ architecture support for Red Hat® OpenShift® 4.4 and 4.5 - Additional support for Kubernetes 1.19 and Red Hat OpenShift 4.4 and 4.5 with x86 architecture -- Supports for IBM Z® for Red Hat OpenShift 4.5 +- Added support for IBM Z® for Red Hat OpenShift 4.5 - Enhanced volume functionality |Ticket ID|Severity|Description| diff --git a/docs/content/release_notes/changelog_1.8.0.md b/docs/content/release_notes/changelog_1.8.0.md index bdd121b86..dcbe1b86b 100644 --- a/docs/content/release_notes/changelog_1.8.0.md +++ b/docs/content/release_notes/changelog_1.8.0.md @@ -1,6 +1,6 @@ # 1.8.0 (December 2021) -IBM® block storage CSI driver 1.8.0 adds new support and enhancements: +IBM® block storage CSI driver 1.8.0 added new support and enhancements: - New support and enhancements for IBM Spectrum Virtualize family storage systems: - New HyperSwap support - New NVMe®/FC support diff --git a/docs/content/release_notes/changelog_1.9.0.md b/docs/content/release_notes/changelog_1.9.0.md new file mode 100644 index 000000000..ade0bc561 --- /dev/null +++ b/docs/content/release_notes/changelog_1.9.0.md @@ -0,0 +1,8 @@ +# 1.9.0 (March 2022) + +IBM® block storage CSI driver 1.9.0 adds new support and enhancements: +- New stretched topology support for SAN Volume Controller storage systems +- New Call Home support for Spectrum Virtualize storage systems +- Now enables I/O group configuration for Spectrum Virtualize storage systems +- New RHEL 8.x support for x86 architecture +- Additional orchestration platform support for OpenShift 4.10 and Kubernetes 1.23 diff --git a/docs/content/release_notes/compatibility_requirements.md b/docs/content/release_notes/compatibility_requirements.md index 537392b82..4daa58486 100644 --- a/docs/content/release_notes/compatibility_requirements.md +++ b/docs/content/release_notes/compatibility_requirements.md @@ -1,3 +1,3 @@ # Compatibility and requirements -This section specifies the compatibility and requirements of version 1.8.0 of IBM® block storage CSI driver. +This section specifies the compatibility and requirements of version 1.9.0 of IBM® block storage CSI driver. diff --git a/docs/content/release_notes/known_issues.md b/docs/content/release_notes/known_issues.md index 86a42d1f4..1240ce18c 100644 --- a/docs/content/release_notes/known_issues.md +++ b/docs/content/release_notes/known_issues.md @@ -1,6 +1,6 @@ # Known issues -This section details the known issues in IBM® block storage CSI driver 1.8.0, along with possible solutions or workarounds (if available). +This section details the known issues in IBM® block storage CSI driver 1.9.0, along with possible solutions or workarounds (if available). The following severity levels apply to known issues: @@ -12,8 +12,8 @@ The following severity levels apply to known issues: **Important:** -- **The issues listed below apply to IBM block storage CSI driver 1.8.0**. As long as a newer version has not yet been released, a newer release notes edition for IBM block storage CSI driver 1.8.0 might be issued to provide a more updated list of known issues and workarounds. -- When a newer version is released for general availability, the release notes of this version will no longer be updated. Accordingly, check the release notes of the newer version to learn whether any newly discovered issues affect IBM block storage CSI driver 1.8.0 or whether the newer version resolves any of the issues listed below. +- **The issues listed below apply to IBM block storage CSI driver 1.9.0**. As long as a newer version has not yet been released, a newer release notes edition for IBM block storage CSI driver 1.9.0 might be issued to provide a more updated list of known issues and workarounds. +- When a newer version is released for general availability, the release notes of this version will no longer be updated. Accordingly, check the release notes of the newer version to learn whether any newly discovered issues affect IBM block storage CSI driver 1.9.0 or whether the newer version resolves any of the issues listed below. |Ticket ID|Severity|Description| |---------|--------|-----------| diff --git a/docs/content/release_notes/limitations.md b/docs/content/release_notes/limitations.md index ff5c16309..2d44831ee 100644 --- a/docs/content/release_notes/limitations.md +++ b/docs/content/release_notes/limitations.md @@ -13,7 +13,7 @@ The following limitations apply when using volume snapshots with the IBM block s - When deleting a PersistentVolumeClaim (PVC), the persistent volume (PV) remains until all snapshots of the specific PV are deleted. - When using the CSI (Container Storage Interface) driver with IBM Spectrum® Virtualize family products, a snapshot can only be used to provision a new volume of equal size. -**Note:** For volume snapshot limitations pertaining specifically to HyperSwap usage, see [HyperSwap usage limitations](#hyperSwap-usage-limitations). +**Note:** For volume snapshot limitations pertaining specifically to HyperSwap usage, see [HyperSwap volume limitations](#hyperswap-volume-limitations). ## Volume clone limitations @@ -25,7 +25,7 @@ The following limitations apply when using volume clones with the IBM block stor - A PVC and its clone need to both have the same volume mode (**Filesystem** or **Block**). -**Note:** For volume clone limitations pertaining specifically to HyperSwap usage, see [HyperSwap usage limitations](#hyperSwap-usage-limitations). +**Note:** For high availability volume clone limitations, see [High availability (HA) limitations](#high-availability-ha-limitations). ## Volume expansion limitations @@ -47,10 +47,12 @@ When a role switch is conducted, this is not reflected within the other orchestr For more information, see the [Change the Reclaim Policy of a PersistentVolume](https://kubernetes.io/docs/tasks/administer-cluster/change-pv-reclaim-policy/) information in the Kubernetes documentation. -## HyperSwap usage limitations - -**Important:** The HyperSwap feature is only supported for use with IBM Spectrum Virtualize family storage systems. +## High availability (HA) limitations +**Note:** +- HyperSwap topology is only supported for use with IBM Spectrum Virtualize family storage systems. +- Stretched topology is only supported by SAN Volume Controller storage systems. +### HyperSwap volume limitations The following IBM block storage CSI driver features are not supported on volumes where HyperSwap is used: - A HyperSwap volume cannot be created from a snapshot. @@ -58,6 +60,9 @@ The following IBM block storage CSI driver features are not supported on volumes **Note:** A snapshot can be created from a HyperSwap volume. - Volume cloning. +### Stretched volume limitations + When conducting volume cloning, both volumes must use stretched topology. + ## NVMe®/FC usage limitations Red Hat® Enterprise Linux CoreOS (RHCOS) does not support NVMe®/FC. @@ -71,4 +76,8 @@ The following IBM block storage CSI driver features are not supported on volumes This limitation is tracked in the following places: - Red Hat Bug [2022328](https://bugzilla.redhat.com/show_bug.cgi?id=2022328) -- Kubernetes Issue [106710](https://github.com/kubernetes/kubernetes/issues/106710) \ No newline at end of file +- Kubernetes Issue [106710](https://github.com/kubernetes/kubernetes/issues/106710) + +## I/O group limitations + +**Note:** I/O group configuration is only supported for use with IBM Spectrum Virtualize family storage systems. \ No newline at end of file diff --git a/docs/content/release_notes/supported_orchestration.md b/docs/content/release_notes/supported_orchestration.md index 888ce5a56..354564865 100644 --- a/docs/content/release_notes/supported_orchestration.md +++ b/docs/content/release_notes/supported_orchestration.md @@ -4,11 +4,11 @@ The following table details orchestration platforms suitable for deployment of t |Orchestration platform|Version|Architecture| |----------------------|-------|------------| -|Kubernetes|1.21|x86| |Kubernetes|1.22|x86| -|Red Hat OpenShift|4.7|x86, IBM Z, IBM Power Systems1| +|Kubernetes|1.23|x86| |Red Hat OpenShift|4.8|x86, IBM Z, IBM Power Systems1| |Red Hat OpenShift|4.9|x86, IBM Z, IBM Power Systems1| +|Red Hat OpenShift|4.10|x86, IBM Z, IBM Power Systems1| 1IBM Power Systems architecture is only supported on Spectrum Virtualize and DS8000 family storage systems. diff --git a/docs/content/release_notes/supported_os.md b/docs/content/release_notes/supported_os.md index e85dcdb2c..40ae63abc 100644 --- a/docs/content/release_notes/supported_os.md +++ b/docs/content/release_notes/supported_os.md @@ -5,6 +5,7 @@ The following table lists operating systems required for deployment of the IBM® |Operating system|Architecture| |----------------|------------| |Red Hat® Enterprise Linux® (RHEL) 7.x|x86, IBM Z®| +|Red Hat® Enterprise Linux® (RHEL) 8.x|x86| |Red Hat Enterprise Linux CoreOS (RHCOS)|x86, IBM Z, IBM Power Systems™1| 1IBM Power Systems architecture is only supported on Spectrum Virtualize and DS8000 family storage systems. diff --git a/docs/content/release_notes/supported_storage.md b/docs/content/release_notes/supported_storage.md index 18eaf327e..2ab56a68b 100644 --- a/docs/content/release_notes/supported_storage.md +++ b/docs/content/release_notes/supported_storage.md @@ -1,18 +1,17 @@ # Supported storage systems -IBM® block storage CSI driver 1.8.0 supports different IBM storage systems as listed in the following table. +IBM® block storage CSI driver 1.9.0 supports different IBM storage systems as listed in the following table. |Storage system|Microcode version| |--------------|-----------------| -|IBM FlashSystem™ A9000|12.3.2.b or later| -|IBM FlashSystem A9000R|12.3.2.b or later| -|IBM Spectrum Virtualize™ family including IBM SAN Volume Controller (SVC) and IBM FlashSystem® family members built with IBM Spectrum® Virtualize (including FlashSystem 5xxx, 7200, 9100, 9200, 9200R)|7.8 and above, 8.x| -|IBM Spectrum Virtualize as software only|7.8 and above, 8.x| -|IBM DS8000® family|8.x and higher with same API interface| +|FlashSystem™ A9000|12.3.2.b or later| +|FlashSystem A9000R|12.3.2.b or later| +|Spectrum Virtualize™ family including Spectrum Virtualize as software only, Spectrum Virtualize for Public Cloud, SAN Volume Controller (SVC), and FlashSystem® family members built with Spectrum® Virtualize (including FlashSystem 5xxx, 7xxx, 9xxx)|7.8 and above, 8.x| +|DS8000® family|8.x and higher with same API interface| **Note:** - For the latest microcode storage support information, see the [Lifecycle and support matrix](https://www.ibm.com/docs/en/stg-block-csi-driver?topic=SSRQ8T/landing/csi_lifecycle_support_matrix.html). -- The IBM Spectrum Virtualize family and IBM SAN Volume Controller storage systems run the IBM Spectrum Virtualize software. In addition, IBM Spectrum Virtualize package is available as a deployable solution that can be run on any compatible hardware. +- The Spectrum Virtualize family and SAN Volume Controller storage systems run the Spectrum Virtualize software. In addition, the Spectrum Virtualize package is available as a deployable solution that can be run on any compatible hardware. diff --git a/docs/content/release_notes/whats_new.md b/docs/content/release_notes/whats_new.md index 6e8e2b057..7e32ce1e2 100644 --- a/docs/content/release_notes/whats_new.md +++ b/docs/content/release_notes/whats_new.md @@ -1,25 +1,27 @@ -# What's new in 1.8.0 +# What's new in 1.9.0 -IBM® block storage CSI driver 1.8.0 introduces the enhancements that are detailed in the following section. +IBM® block storage CSI driver 1.9.0 introduces the enhancements that are detailed in the following section. -**General availability date:** 17 December 2021 +**General availability date:** 18 March 2022 -## New HyperSwap support for IBM Spectrum Virtualize family storage systems +## Additional high availability (HA) feature -IBM® block storage CSI driver 1.8.0 now supports HyperSwap implementation, when using IBM Spectrum Virtualize family storage systems. +Stretched volumes and stretched snapshots (FlashCopy) are now supported on SAN Volume Controller storage systems. Stretched storage topology enables disaster recovery and high availability between nodes in I/O groups at different locations. For more information, see **Product overview** > **Technical overview** > **Systems** > **Stretched systems** within the [SAN Volume Controller documentation](https://www.ibm.com/docs/en/sanvolumecontroller). -## New NVMe® over Fibre Channel protocol for IBM Spectrum Virtualize family storage systems +## New Call Home support -This version adds NVMe®/FC support for supported IBM Spectrum Virtualize family storage systems using Red Hat® Enterprise Linux® (RHEL) operating systems. +Call Home is now supported on Spectrum Virtualize family storage systems. For more information about Call Home on your storage system, see **Product overview** > **Technical overview** > **Call Home** within your product documentation on [IBM Documentation](https://www.ibm.com/docs). -## Increased StorageClass `SpaceEfficiency` parameter capabilities +## Now enables I/O group configuration -Version 1.8.0 increases the `SpaceEfficiency` deduplication parameter options for IBM Spectrum Virtualize family storage systems. For more information, see [Creating a StorageClass](../configuration/creating_volumestorageclass.md). +The CSI driver now enables I/O group configuration when creating a new volume for Spectrum Virtualize family systems. -## Added custom resource configurability for the CSI driver health port +For more information about I/O groups, see **Product overview** > **Technical overview** > **I/O group** within your product documentation on [IBM Documentation](https://www.ibm.com/docs). -This version allows you to configure the health port (9808) for the CSI driver through the custom resource. Configure using the `healthPort` parameter. +## New Red Hat® Enterprise Linux® (RHEL) 8.x support -## Additional orchestration support for OpenShift 4.7 and 4.9 for deployment +IBM® block storage CSI driver 1.9.0 now supports RHEL 8.x systems for x86 architecture. -This version reintroduces Red Hat® OpenShift 4.7 and adds new support for orchestration platform Red Hat OpenShift 4.9, suitable for deployment of the CSI (Container Storage Interface) driver. \ No newline at end of file +## Additional supported orchestration platforms for deployment + +This version adds support for orchestration platforms Kubernetes 1.23 and Red Hat® OpenShift 4.10, suitable for deployment of the CSI (Container Storage Interface) driver. \ No newline at end of file diff --git a/docs/content/troubleshooting/log_status_collect.md b/docs/content/troubleshooting/log_status_collect.md index a50e06aa4..f10f94b98 100644 --- a/docs/content/troubleshooting/log_status_collect.md +++ b/docs/content/troubleshooting/log_status_collect.md @@ -32,7 +32,7 @@ mkdir logs ``` Save logs and status reports directly to the created directory by adding in the following string at the end of the collection command: `> logs/.log`. -**Important:** Be sure that the logs cover any relevant time frames for the specific issues that you are trying to debug when gathering logs from the storage system. +**Important:** Be sure that the logs cover any relevant timeframes for the specific issues that you are trying to debug when gathering logs from the storage system. **Note:** All commands here are listed with the collection command with the `logs` folder name example. Change the folder name according as needed. @@ -53,7 +53,7 @@ Be sure to run the following steps and copy the output to an external file, when `PVC NAME: demo-pvc-file-system PVC STATUS: Bound` - **Note:** If the PVCs are not in the _Bound_ state collect the events of all unbound PVCs. (See [Log collection for unbound PVCs](#log-collection-for-unbound-pvcs).) + **Note:** If the PVCs are not in the _Bound_ state, collect the events of all unbound PVCs. (See [Details collection for unbound PVCs](#Details-collection-for-unbound-pvcs).) #### Log collection for all CSI driver node pods and their containers diff --git a/docs/content/troubleshooting/recovering_vol_attach_crashed_k8s.md b/docs/content/troubleshooting/recovering_vol_attach_crashed_k8s.md index 7f18f3cb4..05d2e8692 100644 --- a/docs/content/troubleshooting/recovering_vol_attach_crashed_k8s.md +++ b/docs/content/troubleshooting/recovering_vol_attach_crashed_k8s.md @@ -1,4 +1,4 @@ -# Recovering a pod volume attachment from a crashed Kubernetes node +# Recovering from a crashed Kubernetes node This section details a manual operation required to revive Kubernetes pods that reside on a crashed node due to an existing Kubernetes limitation. @@ -24,9 +24,9 @@ default sanity-statefulset-0 1/1 Terminating 0 19m 10.244.2.37 k8s-node2 **Attention:** In order to avoid data loss, before continuing, verify that there are no pods connected to this volume. -Follow the following procedure to recover from a crashed node (see a [full example](#full_example) at the end of the procedure): +Follow the following procedure to recover from a crashed node (see a [full example](#for-example) at the end of the procedure): -1. Find for the `volumeattachment` of the created pod: +1. Find the `volumeattachment` of the created pod: ``` kubectl get volumeattachment @@ -47,7 +47,7 @@ Follow the following procedure to recover from a crashed node (see a [full examp 5. Verify that the pod is now in a _Running_ state and that the pod has moved to a _Ready_ node. -For example: +### For example: $> kubectl get nodes NAME STATUS ROLES AGE VERSION diff --git a/docs/content/using/using.md b/docs/content/using/using.md index 25f7c59b9..505ea503c 100644 --- a/docs/content/using/using.md +++ b/docs/content/using/using.md @@ -1,4 +1,4 @@ -# Using IBM block storage CSI driver +# Using Use this information for further usage information for the CSI (Container Storage Interface) driver. diff --git a/go.mod b/go.mod index 4d364c348..6b65efd50 100644 --- a/go.mod +++ b/go.mod @@ -7,6 +7,7 @@ require ( github.com/golang/mock v1.3.1 github.com/sirupsen/logrus v1.4.2 golang.org/x/sync v0.0.0-20190423024810-112230192c58 + golang.org/x/sys v0.0.0-20191022100944-742c48ecaeb7 google.golang.org/grpc v1.27.1 gopkg.in/yaml.v2 v2.2.8 k8s.io/apimachinery v0.18.0 diff --git a/node/pkg/driver/device_connectivity/device_connectivity_fc.go b/node/pkg/driver/device_connectivity/device_connectivity_fc.go index 74ba11f3a..511d1e040 100644 --- a/node/pkg/driver/device_connectivity/device_connectivity_fc.go +++ b/node/pkg/driver/device_connectivity/device_connectivity_fc.go @@ -54,3 +54,7 @@ func (r OsDeviceConnectivityFc) FlushMultipathDevice(mpathDevice string) error { func (r OsDeviceConnectivityFc) RemovePhysicalDevice(sysDevices []string) error { return r.HelperScsiGeneric.RemovePhysicalDevice(sysDevices) } + +func (r OsDeviceConnectivityFc) ValidateLun(lun int, sysDevices []string) error { + return r.HelperScsiGeneric.ValidateLun(lun, sysDevices) +} diff --git a/node/pkg/driver/device_connectivity/device_connectivity_helper_scsigeneric.go b/node/pkg/driver/device_connectivity/device_connectivity_helper_scsigeneric.go index 8ec8cafc6..5518a7656 100644 --- a/node/pkg/driver/device_connectivity/device_connectivity_helper_scsigeneric.go +++ b/node/pkg/driver/device_connectivity/device_connectivity_helper_scsigeneric.go @@ -43,6 +43,7 @@ type OsDeviceConnectivityHelperScsiGenericInterface interface { GetMpathDevice(volumeId string) (string, error) FlushMultipathDevice(mpathDevice string) error RemovePhysicalDevice(sysDevices []string) error + ValidateLun(lun int, sysDevices []string) error } type OsDeviceConnectivityHelperScsiGeneric struct { @@ -72,7 +73,10 @@ const ( WaitForMpathWaitIntervalSec = 1 FcHostSysfsPath = "/sys/class/fc_remote_ports/rport-*/port_name" IscsiHostRexExPath = "/sys/class/iscsi_host/host*/device/session*/iscsi_session/session*/targetname" + sysDeviceSymLinkFormat = "/sys/block/%s/device" + sysDeviceDeletePathFormat = sysDeviceSymLinkFormat + "/delete" blockDevCmd = "blockdev" + flushBufsFlag = "--flushbufs" mpathdSeparator = "," multipathdCmd = "multipathd" multipathCmd = "multipath" @@ -92,7 +96,7 @@ func NewOsDeviceConnectivityHelperScsiGeneric(executer executer.ExecuterInterfac func (r OsDeviceConnectivityHelperScsiGeneric) RescanDevices(lunId int, arrayIdentifiers []string) error { logger.Debugf("Rescan : Start rescan on specific lun, on lun : {%v}, with array identifiers : {%v}", lunId, arrayIdentifiers) - var hostIDs []int + var hostIDs = make(map[int]bool) var errStrings []string if len(arrayIdentifiers) == 0 { e := &ErrorNotFoundArrayIdentifiers{lunId} @@ -106,13 +110,15 @@ func (r OsDeviceConnectivityHelperScsiGeneric) RescanDevices(lunId int, arrayIde logger.Errorf(e.Error()) errStrings = append(errStrings, e.Error()) } - hostIDs = append(hostIDs, hostsId...) + for _, hostId := range hostsId { + hostIDs[hostId] = true + } } if len(hostIDs) == 0 && len(errStrings) != 0 { err := errors.New(strings.Join(errStrings, ",")) return err } - for _, hostNumber := range hostIDs { + for hostNumber := range hostIDs { filename := fmt.Sprintf("/sys/class/scsi_host/host%d/scan", hostNumber) f, err := r.Executer.OsOpenFile(filename, os.O_APPEND|os.O_WRONLY, 0200) @@ -195,9 +201,9 @@ func (r OsDeviceConnectivityHelperScsiGeneric) GetMpathDevice(volumeId string) ( func (r OsDeviceConnectivityHelperScsiGeneric) flushDeviceBuffers(deviceName string) error { devicePath := filepath.Join(DevPath, deviceName) - _, err := r.Executer.ExecuteWithTimeout(TimeOutBlockDevCmd, blockDevCmd, []string{"--flushbufs", devicePath}) + _, err := r.Executer.ExecuteWithTimeoutSilently(TimeOutBlockDevCmd, blockDevCmd, []string{flushBufsFlag, devicePath}) if err != nil { - logger.Errorf("blockdev --flushbufs {%v} did not succeed to flush the device buffers. err={%v}", devicePath, + logger.Errorf("%v %v {%v} did not succeed to flush the device buffers. err={%v}", blockDevCmd, flushBufsFlag, devicePath, err.Error()) return err } @@ -205,12 +211,14 @@ func (r OsDeviceConnectivityHelperScsiGeneric) flushDeviceBuffers(deviceName str } func (r OsDeviceConnectivityHelperScsiGeneric) flushDevicesBuffers(deviceNames []string) error { + logger.Debugf("executing commands : {%v %v} on devices : {%v} and timeout : {%v} mseconds", blockDevCmd, flushBufsFlag, deviceNames, TimeOutBlockDevCmd) for _, deviceName := range deviceNames { err := r.flushDeviceBuffers(deviceName) if err != nil { return err } } + logger.Debugf("Finished executing commands: {%v %v}", blockDevCmd, flushBufsFlag) return nil } @@ -251,7 +259,7 @@ func (r OsDeviceConnectivityHelperScsiGeneric) RemovePhysicalDevice(sysDevices [ } // sysDevices = sdb, sda,... - logger.Debugf("Removing scsi device : {%v}", sysDevices) + logger.Debugf(`Removing scsi device : {%v} by writing "1" to the delete file of each device: {%v}`, sysDevices, fmt.Sprintf(sysDeviceDeletePathFormat, "")) // NOTE: this func could be also relevant for SCSI (not only for iSCSI) var ( f *os.File @@ -263,8 +271,7 @@ func (r OsDeviceConnectivityHelperScsiGeneric) RemovePhysicalDevice(sysDevices [ continue } - filename := fmt.Sprintf("/sys/block/%s/device/delete", deviceName) - logger.Debugf("Delete scsi device by open the device delete file : {%v}", filename) + filename := fmt.Sprintf(sysDeviceDeletePathFormat, deviceName) if f, err = os.OpenFile(filename, os.O_APPEND|os.O_WRONLY, 0200); err != nil { if os.IsNotExist(err) { @@ -287,6 +294,27 @@ func (r OsDeviceConnectivityHelperScsiGeneric) RemovePhysicalDevice(sysDevices [ return nil } +func (r OsDeviceConnectivityHelperScsiGeneric) ValidateLun(lun int, sysDevices []string) error { + logger.Debugf("Validating lun {%v} on devices: {%v}", lun, sysDevices) + for _, sysDevice := range sysDevices { + sysDeviceParts := strings.Split(sysDevice, "/") + device := sysDeviceParts[len(sysDeviceParts)-1] + + symLinkPath := fmt.Sprintf(sysDeviceSymLinkFormat, device) + destinationPath, err := filepath.EvalSymlinks(symLinkPath) + if err != nil { + return err + } + + if !strings.HasSuffix(destinationPath, strconv.Itoa(lun)) { + return fmt.Errorf("lun not valid, storage lun: %v, linkedPath: %v to device: %v", lun, destinationPath, device) + } + } + logger.Debugf("Finished lun validation") + return nil + +} + // ============== OsDeviceConnectivityHelperInterface ========================== //go:generate mockgen -destination=../../../mocks/mock_OsDeviceConnectivityHelperInterface.go -package=mocks github.com/ibm/ibm-block-csi-driver/node/pkg/driver/device_connectivity OsDeviceConnectivityHelperInterface @@ -343,10 +371,10 @@ func (o OsDeviceConnectivityHelperGeneric) GetHostsIdByArrayIdentifier(arrayIden return nil, err } - logger.Debugf("targetname files matches were found : {%v}", matches) + logger.Debugf("{%v} targetname files matches were found", len(matches)) re := regexp.MustCompile(regexpValue) - logger.Debugf("Check if any match is relevant for storage target (%s).", arrayIdentifier) + logger.Debugf("Check if any match is relevant for storage target (%s)", arrayIdentifier) for _, targetPath := range matches { targetName, err := o.Executer.IoutilReadFile(targetPath) if err != nil { @@ -375,7 +403,7 @@ func (o OsDeviceConnectivityHelperGeneric) GetHostsIdByArrayIdentifier(arrayIden } HostIDs = append(HostIDs, hostNumber) - logger.Debugf("portState path (%s) was found. Adding host ID {%v} to the id list.", targetPath, hostNumber) + logger.Debugf("portState path (%s) was found. Adding host ID {%v} to the id list", targetPath, hostNumber) } } @@ -460,7 +488,7 @@ func (o OsDeviceConnectivityHelperGeneric) GetWwnByScsiInq(dev string) (string, return "", &ErrorNoRegexWwnMatchInScsiInq{dev, line} } wwn = matches[1] - logger.Debugf("Found the expected Wwn [%s] in sg_inq.", wwn) + logger.Debugf("Found the expected Wwn [%s] in sg_inq", wwn) return wwn, nil } if regex.MatchString(line) { @@ -560,6 +588,7 @@ func (o GetDmsPathHelperGeneric) WaitForDmToExist(volumeUuid string, volumeNguid formatTemplate := strings.Join([]string{"%d", "%w"}, mpathdSeparator) args := []string{"show", "maps", "raw", "format", "\"", formatTemplate, "\""} var err error + logger.Debugf("Waiting for dm to exist") for i := 0; i < maxRetries; i++ { err = nil out, err := o.executer.ExecuteWithTimeout(TimeOutMultipathdCmd, multipathdCmd, args) diff --git a/node/pkg/driver/device_connectivity/device_connectivity_interface.go b/node/pkg/driver/device_connectivity/device_connectivity_interface.go index d4a8f665f..1b6a96f56 100644 --- a/node/pkg/driver/device_connectivity/device_connectivity_interface.go +++ b/node/pkg/driver/device_connectivity/device_connectivity_interface.go @@ -24,4 +24,5 @@ type OsDeviceConnectivityInterface interface { GetMpathDevice(volumeId string) (string, error) FlushMultipathDevice(mpathDevice string) error RemovePhysicalDevice(sysDevices []string) error + ValidateLun(lun int, sysDevices []string) error } diff --git a/node/pkg/driver/device_connectivity/device_connectivity_iscsi.go b/node/pkg/driver/device_connectivity/device_connectivity_iscsi.go index e206ff6a2..566eebc55 100644 --- a/node/pkg/driver/device_connectivity/device_connectivity_iscsi.go +++ b/node/pkg/driver/device_connectivity/device_connectivity_iscsi.go @@ -20,16 +20,15 @@ import ( "errors" "github.com/ibm/ibm-block-csi-driver/node/logger" "github.com/ibm/ibm-block-csi-driver/node/pkg/driver/executer" - "os/exec" "strconv" "strings" "time" ) const ( - iscsiCmdTimeout = 30 * time.Second + IscsiCmdTimeout = 30 * time.Second iscsiPort = 3260 - iSCSIErrNoObjsFound = 21 + ISCSIErrNoObjsFound = 21 ) type OsDeviceConnectivityIscsi struct { @@ -45,7 +44,7 @@ func NewOsDeviceConnectivityIscsi(executer executer.ExecuterInterface) OsDeviceC } func (r OsDeviceConnectivityIscsi) iscsiCmd(args ...string) (string, error) { - out, err := r.Executer.ExecuteWithTimeout(int(iscsiCmdTimeout.Seconds()*1000), "iscsiadm", args) + out, err := r.Executer.ExecuteWithTimeout(int(IscsiCmdTimeout.Seconds()*1000), "iscsiadm", args) return string(out), err } @@ -69,11 +68,11 @@ func (r OsDeviceConnectivityIscsi) iscsiLogin(targetName, portal string) { func (r OsDeviceConnectivityIscsi) iscsiGetRawSessions() ([]string, error) { output, err := r.iscsiCmd("-m", "session") if err != nil { - if exitError, isExitError := err.(*exec.ExitError); isExitError && exitError.ExitCode() == iSCSIErrNoObjsFound { - logger.Debug("No active iSCSI sessions.") + if exitCode, isExitError := r.Executer.GetExitCode(err); isExitError && exitCode == ISCSIErrNoObjsFound { + logger.Debug("No active iSCSI sessions") return []string{}, nil } - logger.Error("Failed to check iSCSI sessions.") + logger.Error("Failed to check iSCSI sessions") return nil, err } lines := strings.Split(strings.TrimSpace(output), "\n") @@ -169,3 +168,7 @@ func (r OsDeviceConnectivityIscsi) FlushMultipathDevice(mpathDevice string) erro func (r OsDeviceConnectivityIscsi) RemovePhysicalDevice(sysDevices []string) error { return r.HelperScsiGeneric.RemovePhysicalDevice(sysDevices) } + +func (r OsDeviceConnectivityIscsi) ValidateLun(lun int, sysDevices []string) error { + return r.HelperScsiGeneric.ValidateLun(lun, sysDevices) +} diff --git a/node/pkg/driver/device_connectivity/device_connectivity_iscsi_test.go b/node/pkg/driver/device_connectivity/device_connectivity_iscsi_test.go new file mode 100644 index 000000000..5142d914a --- /dev/null +++ b/node/pkg/driver/device_connectivity/device_connectivity_iscsi_test.go @@ -0,0 +1,203 @@ +/** + * Copyright 2019 IBM Corp. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package device_connectivity_test + +import ( + "errors" + "fmt" + "github.com/golang/mock/gomock" + "github.com/ibm/ibm-block-csi-driver/node/mocks" + "github.com/ibm/ibm-block-csi-driver/node/pkg/driver/device_connectivity" + "github.com/ibm/ibm-block-csi-driver/node/pkg/driver/executer" + "testing" +) + +var ( + iscsiCmdTimeoutMsec = int(device_connectivity.IscsiCmdTimeout.Seconds() * 1000) + iscsiCmd = "iscsiadm" + iSCSIErrNoObjsFound = device_connectivity.ISCSIErrNoObjsFound + iscsiSessionArgs = []string{"-m", "session"} + iscsiDiscoverPortal1Args = []string{"-m", "discoverydb", "-t", "sendtargets", "-p", "portal1", "--discover"} + iscsiDiscoverPortal2Args = []string{"-m", "discoverydb", "-t", "sendtargets", "-p", "portal2", "--discover"} + iscsiLoginPortal1Args = []string{"-m", "node", "-p", "portal1:3260", "-T", "target", "--login"} + iscsiLoginPortal2Args = []string{"-m", "node", "-p", "portal2:3260", "-T", "target", "--login"} +) + +func NewOsDeviceConnectivityIscsiForTest( + executer executer.ExecuterInterface, + helper device_connectivity.OsDeviceConnectivityHelperScsiGenericInterface, +) device_connectivity.OsDeviceConnectivityInterface { + return &device_connectivity.OsDeviceConnectivityIscsi{ + Executer: executer, + HelperScsiGeneric: helper, + } +} + +type ExecuteWithTimeoutArguments struct { + mSeconds int + command string + commandArguments []string +} + +type ExecuteWithTimeoutReturn struct { + stdOut []byte + err error + exitCode int +} + +type ExecuteWithTimeoutCall struct { + input ExecuteWithTimeoutArguments + output ExecuteWithTimeoutReturn +} + +func getExecuteWithTimeoutArguments(args []string) ExecuteWithTimeoutArguments { + return ExecuteWithTimeoutArguments{ + mSeconds: iscsiCmdTimeoutMsec, + command: iscsiCmd, + commandArguments: args, + } +} + +func TestEnsureLogin(t *testing.T) { + portalsByTarget := map[string][]string{"target": {"portal1", "portal2"}} + + executeIscsiSessionArguments := getExecuteWithTimeoutArguments(iscsiSessionArgs) + executeIscsiDiscoverPortal1Arguments := getExecuteWithTimeoutArguments(iscsiDiscoverPortal1Args) + executeIscsiDiscoverPortal2Arguments := getExecuteWithTimeoutArguments(iscsiDiscoverPortal2Args) + executeIscsiLoginPortal1Arguments := getExecuteWithTimeoutArguments(iscsiLoginPortal1Args) + executeIscsiLoginPortal2Arguments := getExecuteWithTimeoutArguments(iscsiLoginPortal2Args) + + singlePortalIscsiSessionOutput := "tcp: [1] portal1:3260,2 target (non-flash)" + twoPortalsIscsiSessionOutput := fmt.Sprintf("%s\ntcp: [2] portal2:3260,2 target (non-flash)", + singlePortalIscsiSessionOutput) + + testCases := []struct { + name string + portalsByTarget map[string][]string + executeWithTimeoutCalls []ExecuteWithTimeoutCall + }{ + { + name: "Should not login when session command fails", + portalsByTarget: portalsByTarget, + executeWithTimeoutCalls: []ExecuteWithTimeoutCall{ + { + input: executeIscsiSessionArguments, + output: ExecuteWithTimeoutReturn{ + stdOut: []byte("session command failure details"), + err: errors.New("session command failed"), + exitCode: -1, + }, + }, + }, + }, + { + name: "Should not login when session output is invalid", + portalsByTarget: portalsByTarget, + executeWithTimeoutCalls: []ExecuteWithTimeoutCall{ + { + input: executeIscsiSessionArguments, + output: ExecuteWithTimeoutReturn{ + stdOut: []byte("invalid session output"), + }, + }, + }, + }, + { + name: "Should not login when all relevant portals are already in session output", + portalsByTarget: portalsByTarget, + executeWithTimeoutCalls: []ExecuteWithTimeoutCall{ + { + input: executeIscsiSessionArguments, + output: ExecuteWithTimeoutReturn{ + stdOut: []byte(twoPortalsIscsiSessionOutput), + }, + }, + }, + }, + { + name: "Should not login when the only discover call fails", + portalsByTarget: portalsByTarget, + executeWithTimeoutCalls: []ExecuteWithTimeoutCall{ + { + input: executeIscsiSessionArguments, + output: ExecuteWithTimeoutReturn{ + stdOut: []byte(singlePortalIscsiSessionOutput), + }, + }, + { + input: executeIscsiDiscoverPortal2Arguments, + output: ExecuteWithTimeoutReturn{ + stdOut: []byte("error"), + err: errors.New("discover failed"), + }, + }, + }, + }, + { + name: "Should login all portals not in session when a target discover call succeeds", + portalsByTarget: portalsByTarget, + executeWithTimeoutCalls: []ExecuteWithTimeoutCall{ + { + input: executeIscsiSessionArguments, + output: ExecuteWithTimeoutReturn{ + stdOut: []byte{}, + err: errors.New("no sessions"), + exitCode: iSCSIErrNoObjsFound, + }, + }, + { + input: executeIscsiDiscoverPortal1Arguments, + output: ExecuteWithTimeoutReturn{ + stdOut: []byte("error"), + err: errors.New("discover failed"), + }, + }, + { + input: executeIscsiDiscoverPortal2Arguments, + }, + { + input: executeIscsiLoginPortal1Arguments, + }, + { + input: executeIscsiLoginPortal2Arguments, + }, + }, + }, + } + + for _, tc := range testCases { + + t.Run(tc.name, func(t *testing.T) { + mockCtrl := gomock.NewController(t) + defer mockCtrl.Finish() + + fakeExecuter := mocks.NewMockExecuterInterface(mockCtrl) + fakeHelper := mocks.NewMockOsDeviceConnectivityHelperScsiGenericInterface(mockCtrl) + + for _, c := range tc.executeWithTimeoutCalls { + fakeExecuter.EXPECT().ExecuteWithTimeout(c.input.mSeconds, c.input.command, c.input.commandArguments).Return( + c.output.stdOut, c.output.err) + if c.output.err != nil && c.output.exitCode != 0 { + fakeExecuter.EXPECT().GetExitCode(gomock.Any()).Return(c.output.exitCode, true) + } + } + + o := NewOsDeviceConnectivityIscsiForTest(fakeExecuter, fakeHelper) + o.EnsureLogin(tc.portalsByTarget) + }) + } +} diff --git a/node/pkg/driver/device_connectivity/device_connectivity_nvmeofc.go b/node/pkg/driver/device_connectivity/device_connectivity_nvmeofc.go index 2dea2068a..d7331b194 100644 --- a/node/pkg/driver/device_connectivity/device_connectivity_nvmeofc.go +++ b/node/pkg/driver/device_connectivity/device_connectivity_nvmeofc.go @@ -50,3 +50,7 @@ func (r OsDeviceConnectivityNvmeOFc) FlushMultipathDevice(mpathDevice string) er func (r OsDeviceConnectivityNvmeOFc) RemovePhysicalDevice(sysDevices []string) error { return r.HelperScsiGeneric.RemovePhysicalDevice(sysDevices) } + +func (r OsDeviceConnectivityNvmeOFc) ValidateLun(_ int, _ []string) error { + return nil +} diff --git a/node/pkg/driver/device_connectivity/device_path_amd64.go b/node/pkg/driver/device_connectivity/device_path_amd64.go deleted file mode 100644 index c67310d70..000000000 --- a/node/pkg/driver/device_connectivity/device_path_amd64.go +++ /dev/null @@ -1,3 +0,0 @@ -package device_connectivity - -const fcSubsystemPrefix = "pci-*-" diff --git a/node/pkg/driver/device_connectivity/device_path_ppc64le.go b/node/pkg/driver/device_connectivity/device_path_ppc64le.go deleted file mode 100644 index 61c70fd09..000000000 --- a/node/pkg/driver/device_connectivity/device_path_ppc64le.go +++ /dev/null @@ -1,3 +0,0 @@ -package device_connectivity - -const fcSubsystemPrefix = "" diff --git a/node/pkg/driver/device_connectivity/device_path_s390x.go b/node/pkg/driver/device_connectivity/device_path_s390x.go deleted file mode 100644 index cbc9346fd..000000000 --- a/node/pkg/driver/device_connectivity/device_path_s390x.go +++ /dev/null @@ -1,3 +0,0 @@ -package device_connectivity - -const fcSubsystemPrefix = "ccw-*-" diff --git a/node/pkg/driver/driver.go b/node/pkg/driver/driver.go index acc5ed75c..aa133d957 100644 --- a/node/pkg/driver/driver.go +++ b/node/pkg/driver/driver.go @@ -132,7 +132,7 @@ func ReadConfigFile(configFilePath string) (ConfigFile, error) { configYamlPath := configFilePath if configYamlPath == "" { configYamlPath = DefualtConfigFile - logger.Debugf("Not found config file environment variable %s. Set default value %s.", EnvNameDriverConfFile, configYamlPath) + logger.Debugf("Not found config file environment variable %s. Set default value %s", EnvNameDriverConfFile, configYamlPath) } else { logger.Debugf("Config file environment variable %s=%s", EnvNameDriverConfFile, configYamlPath) logger.Info(logger.GetLevel()) diff --git a/node/pkg/driver/executer/executer.go b/node/pkg/driver/executer/executer.go index 78d494e96..810356b83 100644 --- a/node/pkg/driver/executer/executer.go +++ b/node/pkg/driver/executer/executer.go @@ -22,6 +22,7 @@ import ( "os" "os/exec" "path/filepath" + "strings" "time" "github.com/ibm/ibm-block-csi-driver/node/logger" @@ -30,6 +31,7 @@ import ( //go:generate mockgen -destination=../../../mocks/mock_executer.go -package=mocks github.com/ibm/ibm-block-csi-driver/node/pkg/driver/executer ExecuterInterface type ExecuterInterface interface { // basic host dependent functions ExecuteWithTimeout(mSeconds int, command string, args []string) ([]byte, error) + ExecuteWithTimeoutSilently(mSeconds int, command string, args []string) ([]byte, error) OsOpenFile(name string, flag int, perm os.FileMode) (*os.File, error) OsReadlink(name string) (string, error) FilepathGlob(pattern string) (matches []string, err error) @@ -37,14 +39,13 @@ type ExecuterInterface interface { // basic host dependent functions IoutilReadFile(filename string) ([]byte, error) FileWriteString(f *os.File, s string) (n int, err error) IsExecutable(path string) error + GetExitCode(err error) (int, bool) } type Executer struct { } -func (e *Executer) ExecuteWithTimeout(mSeconds int, command string, args []string) ([]byte, error) { - logger.Debugf("Executing command : {%v} with args : {%v}. and timeout : {%v} mseconds", command, args, mSeconds) - +func (e *Executer) ExecuteWithTimeoutSilently(mSeconds int, command string, args []string) ([]byte, error) { // Create a new context and add a timeout to it ctx, cancel := context.WithTimeout(context.Background(), time.Duration(mSeconds)*time.Millisecond) defer cancel() // The cancel should be deferred so resources are cleaned up @@ -64,12 +65,25 @@ func (e *Executer) ExecuteWithTimeout(mSeconds int, command string, args []strin } // If there's no context error, we know the command completed (or errored). - logger.Debugf("Output from command: %s", string(out)) if err != nil { logger.Debugf("Non-zero exit code: %s", err) } + return out, err +} - logger.Debugf("Finished executing command") +func (e *Executer) ExecuteWithTimeout(mSeconds int, command string, args []string) ([]byte, error) { + logger.Debugf("Executing command : {%v} with args : {%v}. and timeout : {%v} mseconds", command, args, mSeconds) + + out, err := e.ExecuteWithTimeoutSilently(mSeconds, command, args) + + outAsStr := string(out) + noOutputMessage := "" + if strings.TrimSpace(outAsStr) != "" { + logger.Debugf("Output from command: %s", outAsStr) + } else { + noOutputMessage = " (no output)" + } + logger.Debugf("Finished executing command" + noOutputMessage) return out, err } @@ -101,3 +115,11 @@ func (e *Executer) IsExecutable(path string) error { _, err := exec.LookPath(path) return err } + +func (e *Executer) GetExitCode(err error) (int, bool) { + if exitError, isExitError := err.(*exec.ExitError); isExitError { + logger.Debug("No active iSCSI sessions") + return exitError.ExitCode(), true + } + return 0, false +} diff --git a/node/pkg/driver/node.go b/node/pkg/driver/node.go index e2992c9c1..9228910d3 100644 --- a/node/pkg/driver/node.go +++ b/node/pkg/driver/node.go @@ -36,6 +36,7 @@ var ( nodeCaps = []csi.NodeServiceCapability_RPC_Type{ csi.NodeServiceCapability_RPC_STAGE_UNSTAGE_VOLUME, csi.NodeServiceCapability_RPC_EXPAND_VOLUME, + csi.NodeServiceCapability_RPC_GET_VOLUME_STATS, } // volumeCaps represents how the volume could be accessed. @@ -85,6 +86,11 @@ type NodeService struct { OsDeviceConnectivityHelper device_connectivity.OsDeviceConnectivityHelperScsiGenericInterface } +type VolumeStatistics struct { + AvailableBytes, TotalBytes, UsedBytes int64 + AvailableInodes, TotalInodes, UsedInodes int64 +} + // newNodeService creates a new node service // it panics if failed to create the service func NewNodeService(configYaml ConfigFile, hostname string, nodeUtils NodeUtilsInterface, @@ -122,7 +128,7 @@ func (d *NodeService) NodeStageVolume(ctx context.Context, req *csi.NodeStageVol volId := req.VolumeId err = d.VolumeIdLocksMap.AddVolumeLock(volId, "NodeStageVolume") if err != nil { - logger.Errorf("Another operation is being performed on volume : {%s}.", volId) + logger.Errorf("Another operation is being performed on volume : {%s}", volId) return nil, status.Error(codes.Aborted, err.Error()) } @@ -156,9 +162,20 @@ func (d *NodeService) NodeStageVolume(ctx context.Context, req *csi.NodeStageVol volumeCap := req.GetVolumeCapability() switch volumeCap.GetAccessType().(type) { case *csi.VolumeCapability_Block: - logger.Debugf("NodeStageVolume Finished: multipath device [%s] is ready to be mounted by NodePublishVolume API.", mpathDevice) + logger.Debugf("NodeStageVolume Finished: multipath device [%s] is ready to be mounted by NodePublishVolume API", mpathDevice) return &csi.NodeStageVolumeResponse{}, nil } + baseDevice := path.Base(mpathDevice) + sysDevices, err := d.NodeUtils.GetSysDevicesFromMpath(baseDevice) + if err != nil { + logger.Errorf("Error while trying to get sys devices : {%v}", err.Error()) + return nil, status.Error(codes.Internal, err.Error()) + } + err = osDeviceConnectivity.ValidateLun(lun, sysDevices) + if err != nil { + logger.Errorf("Error while trying to validate lun : {%v}", err.Error()) + return nil, status.Error(codes.Internal, err.Error()) + } existingFormat, err := d.Mounter.GetDiskFormat(mpathDevice) if err != nil { @@ -191,7 +208,7 @@ func (d *NodeService) NodeStageVolume(ctx context.Context, req *csi.NodeStageVol return nil, status.Error(codes.Internal, err.Error()) } - logger.Debugf("NodeStageVolume Finished: staging path [%s] is ready to be mounted by NodePublishVolume API.", stagingPath) + logger.Debugf("NodeStageVolume Finished: staging path [%s] is ready to be mounted by NodePublishVolume API", stagingPath) return &csi.NodeStageVolumeResponse{}, nil } @@ -326,7 +343,7 @@ func (d *NodeService) NodeUnstageVolume(ctx context.Context, req *csi.NodeUnstag logger.Debugf("Check if staging path {%s} is mounted", stagingPathWithHostPrefix) isNotMounted, err := d.NodeUtils.IsNotMountPoint(stagingPathWithHostPrefix) if err != nil { - logger.Warningf("Failed to check if (%s), is mounted.", stagingPathWithHostPrefix) + logger.Warningf("Failed to check if (%s), is mounted", stagingPathWithHostPrefix) return nil, status.Error(codes.Internal, err.Error()) } if !isNotMounted { @@ -351,14 +368,12 @@ func (d *NodeService) NodeUnstageVolume(ctx context.Context, req *csi.NodeUnstag baseDevice := path.Base(mpathDevice) - rawSysDevices, err := d.NodeUtils.GetSysDevicesFromMpath(baseDevice) + sysDevices, err := d.NodeUtils.GetSysDevicesFromMpath(baseDevice) if err != nil { logger.Errorf("Error while trying to get sys devices : {%v}", err.Error()) return nil, status.Error(codes.Internal, err.Error()) } - sysDevices := strings.Split(rawSysDevices, ",") - err = d.OsDeviceConnectivityHelper.FlushMultipathDevice(baseDevice) if err != nil { return nil, status.Errorf(codes.Internal, "Multipath -f command failed with error: %v", err) @@ -471,7 +486,7 @@ func (d *NodeService) NodePublishVolume(ctx context.Context, req *csi.NodePublis if err != nil { return nil, status.Error(codes.Internal, err.Error()) } - logger.Debugf("NodePublishVolume Finished: targetPath {%v} is now a mount point.", targetPath) + logger.Debugf("NodePublishVolume Finished: targetPath {%v} is now a mount point", targetPath) return &csi.NodePublishVolumeResponse{}, nil } @@ -495,7 +510,7 @@ func (d *NodeService) isTargetMounted(targetPathWithHostPrefix string, isFSVolum logger.Debugf("Check if target {%s} is mounted", targetPathWithHostPrefix) isNotMounted, err := d.NodeUtils.IsNotMountPoint(targetPathWithHostPrefix) if err != nil { - logger.Warningf("Failed to check if (%s), is mounted.", targetPathWithHostPrefix) + logger.Warningf("Failed to check if (%s), is mounted", targetPathWithHostPrefix) return false, status.Error(codes.Internal, err.Error()) } if isNotMounted { @@ -507,7 +522,7 @@ func (d *NodeService) isTargetMounted(targetPathWithHostPrefix string, isFSVolum } else if !isFSVolume && targetIsDir { return true, status.Errorf(codes.AlreadyExists, "Required raw block volume but target {%s} is mounted and it is a directory.", targetPathWithHostPrefix) } - logger.Warningf("Idempotent case : targetPath already mounted (%s), so no need to mount again. Finish NodePublishVolume.", targetPathWithHostPrefix) + logger.Warningf("Idempotent case : targetPath already mounted (%s), so no need to mount again. Finish NodePublishVolume", targetPathWithHostPrefix) return true, nil } } @@ -604,9 +619,81 @@ func (d *NodeService) NodeUnpublishVolume(ctx context.Context, req *csi.NodeUnpu } func (d *NodeService) NodeGetVolumeStats(ctx context.Context, req *csi.NodeGetVolumeStatsRequest) (*csi.NodeGetVolumeStatsResponse, error) { - goid_info.SetAdditionalIDInfo(req.VolumeId) + volumeId := req.VolumeId + goid_info.SetAdditionalIDInfo(volumeId) defer goid_info.DeleteAdditionalIDInfo() - return nil, status.Error(codes.Unimplemented, "NodeGetVolumeStats is not implemented yet") + volumePath := req.VolumePath + volumePathWithHostPrefix := d.NodeUtils.GetPodPath(volumePath) + + err := d.nodeGetVolumeStatsRequestValidation(volumeId, volumePath) + if err != nil { + return nil, err + } + + isPathExists := d.NodeUtils.IsPathExists(volumePathWithHostPrefix) + if !isPathExists { + return nil, status.Errorf(codes.NotFound, "volume path %q does not exist", volumePath) + } + + volumeStats, err := d.getVolumeStats(volumePathWithHostPrefix, volumeId) + if err != nil { + return nil, err + } + return &csi.NodeGetVolumeStatsResponse{ + Usage: []*csi.VolumeUsage{ + { + Unit: csi.VolumeUsage_BYTES, + Available: volumeStats.AvailableBytes, + Total: volumeStats.TotalBytes, + Used: volumeStats.UsedBytes, + }, + { + Unit: csi.VolumeUsage_INODES, + Available: volumeStats.AvailableInodes, + Total: volumeStats.TotalInodes, + Used: volumeStats.UsedInodes, + }, + }, + }, nil +} + +func (d *NodeService) nodeGetVolumeStatsRequestValidation(volumeId string, volumePath string) error { + if volumeId == "" { + return status.Error(codes.InvalidArgument, "NodeGetVolumeStats Volume ID must be provided") + } + if volumePath == "" { + return status.Error(codes.InvalidArgument, "NodeGetVolumeStats Volume Path must be provided") + } + + return nil +} + +func (d *NodeService) getVolumeStats(path string, volumeId string) (VolumeStatistics, error) { + var volumeStats VolumeStatistics + isBlock, err := d.NodeUtils.IsBlock(path) + if err != nil { + return VolumeStatistics{}, status.Errorf(codes.Internal, "Failed to determine if %q is block device: %s", path, err) + } + + if isBlock { + mpathDevice, err := d.OsDeviceConnectivityHelper.GetMpathDevice(volumeId) + if err != nil { + switch err.(type) { + case *device_connectivity.MultipathDeviceNotFoundForVolumeError: + return VolumeStatistics{}, status.Errorf(codes.NotFound, "Multipath device of volume id %q does not exist", volumeId) + default: + return VolumeStatistics{}, status.Errorf(codes.Internal, "Error while discovering the device : %s", err) + } + } + volumeStats, err = d.NodeUtils.GetBlockVolumeStats(mpathDevice) + } else { + volumeStats, err = d.NodeUtils.GetFileSystemVolumeStats(path) + } + + if err != nil { + return VolumeStatistics{}, status.Errorf(codes.Internal, "Failed to get statistics: %s", err) + } + return volumeStats, nil } func (d *NodeService) NodeExpandVolume(ctx context.Context, req *csi.NodeExpandVolumeRequest) (*csi.NodeExpandVolumeResponse, error) { @@ -636,13 +723,12 @@ func (d *NodeService) NodeExpandVolume(ctx context.Context, req *csi.NodeExpandV baseDevice := path.Base(device) - rawSysDevices, err := d.NodeUtils.GetSysDevicesFromMpath(baseDevice) + sysDevices, err := d.NodeUtils.GetSysDevicesFromMpath(baseDevice) if err != nil { logger.Errorf("Error while trying to get sys devices : {%v}", err.Error()) return nil, status.Error(codes.Internal, err.Error()) } - sysDevices := strings.Split(rawSysDevices, ",") devicesAreNvme, err := d.NodeUtils.DevicesAreNvme(sysDevices) if err != nil { logger.Errorf("Error while trying to check if sys devices are nvme devices : {%v}", err.Error()) diff --git a/node/pkg/driver/node_test.go b/node/pkg/driver/node_test.go index 141d93367..6768939d0 100644 --- a/node/pkg/driver/node_test.go +++ b/node/pkg/driver/node_test.go @@ -78,6 +78,7 @@ func TestNodeStageVolume(t *testing.T) { lun := 10 mpathDeviceName := "dm-2" mpathDevice := "/dev/" + mpathDeviceName + sysDevices := []string{"/dev/sda", "/dev/sdb"} fsType := "ext4" ipsByArrayInitiator := map[string][]string{"iqn.1994-05.com.redhat:686358c930fe": {"1.2.3.4", "[::1]"}} arrayInitiators := []string{"iqn.1994-05.com.redhat:686358c930fe"} @@ -287,6 +288,8 @@ func TestNodeStageVolume(t *testing.T) { mockOsDeviceCon.EXPECT().EnsureLogin(ipsByArrayInitiator) mockOsDeviceCon.EXPECT().RescanDevices(lun, arrayInitiators).Return(nil) mockOsDeviceCon.EXPECT().GetMpathDevice(volId).Return(mpathDevice, nil) + mockNodeUtils.EXPECT().GetSysDevicesFromMpath(mpathDeviceName).Return(sysDevices, nil) + mockOsDeviceCon.EXPECT().ValidateLun(lun, sysDevices).Return(nil) mockMounter.EXPECT().GetDiskFormat(mpathDevice).Return("", dummyError) _, err := node.NodeStageVolume(context.TODO(), stagingRequest) @@ -310,6 +313,8 @@ func TestNodeStageVolume(t *testing.T) { mockOsDeviceCon.EXPECT().EnsureLogin(ipsByArrayInitiator) mockOsDeviceCon.EXPECT().RescanDevices(lun, arrayInitiators).Return(nil) mockOsDeviceCon.EXPECT().GetMpathDevice(volId).Return(mpathDevice, nil) + mockNodeUtils.EXPECT().GetSysDevicesFromMpath(mpathDeviceName).Return(sysDevices, nil) + mockOsDeviceCon.EXPECT().ValidateLun(lun, sysDevices).Return(nil) mockMounter.EXPECT().GetDiskFormat(mpathDevice).Return("", nil) mockNodeUtils.EXPECT().GetPodPath(stagingPath).Return(stagingPathWithHostPrefix) mockNodeUtils.EXPECT().IsNotMountPoint(stagingPathWithHostPrefix).Return(true, nil) @@ -339,6 +344,8 @@ func TestNodeStageVolume(t *testing.T) { mockOsDeviceCon.EXPECT().EnsureLogin(ipsByArrayInitiator) mockOsDeviceCon.EXPECT().RescanDevices(lun, arrayInitiators).Return(nil) mockOsDeviceCon.EXPECT().GetMpathDevice(volId).Return(mpathDevice, nil) + mockNodeUtils.EXPECT().GetSysDevicesFromMpath(mpathDeviceName).Return(sysDevices, nil) + mockOsDeviceCon.EXPECT().ValidateLun(lun, sysDevices).Return(nil) mockMounter.EXPECT().GetDiskFormat(mpathDevice).Return(fsType, nil) mockNodeUtils.EXPECT().GetPodPath(stagingPath).Return(stagingPathWithHostPrefix) mockNodeUtils.EXPECT().IsNotMountPoint(stagingPathWithHostPrefix).Return(true, nil) @@ -367,6 +374,8 @@ func TestNodeStageVolume(t *testing.T) { mockOsDeviceCon.EXPECT().EnsureLogin(ipsByArrayInitiator) mockOsDeviceCon.EXPECT().RescanDevices(lun, arrayInitiators).Return(nil) mockOsDeviceCon.EXPECT().GetMpathDevice(volId).Return(mpathDevice, nil) + mockNodeUtils.EXPECT().GetSysDevicesFromMpath(mpathDeviceName).Return(sysDevices, nil) + mockOsDeviceCon.EXPECT().ValidateLun(lun, sysDevices).Return(nil) mockMounter.EXPECT().GetDiskFormat(mpathDevice).Return(fsType, nil) mockNodeUtils.EXPECT().GetPodPath(stagingPath).Return(stagingPathWithHostPrefix) mockNodeUtils.EXPECT().IsNotMountPoint(stagingPathWithHostPrefix).Return(false, nil) @@ -393,6 +402,8 @@ func TestNodeStageVolume(t *testing.T) { mockNodeUtils.EXPECT().GetInfoFromPublishContext(stagingRequest.PublishContext, node.ConfigYaml).Return(conType, lun, ipsByArrayInitiator, nil).AnyTimes() mockNodeUtils.EXPECT().GetArrayInitiators(ipsByArrayInitiator).Return(arrayInitiators) mockOsDeviceCon.EXPECT().EnsureLogin(ipsByArrayInitiator) + mockNodeUtils.EXPECT().GetSysDevicesFromMpath(mpathDeviceName).Return(sysDevices, nil) + mockOsDeviceCon.EXPECT().ValidateLun(lun, sysDevices).Return(nil) mockOsDeviceCon.EXPECT().RescanDevices(lun, arrayInitiators).Return(nil) mockOsDeviceCon.EXPECT().GetMpathDevice(volId).Return(mpathDevice, nil) mockMounter.EXPECT().GetDiskFormat(mpathDevice).Return("different-fsType", nil) @@ -412,8 +423,7 @@ func TestNodeUnstageVolume(t *testing.T) { dummyError := errors.New("Dummy error") dmNotFoundError := &device_connectivity.MultipathDeviceNotFoundForVolumeError{VolumeId: volId} mpathDeviceName := "dm-2" - rawSysDevices := "/dev/d1,/dev/d2" - sysDevices := strings.Split(rawSysDevices, ",") + sysDevices := []string{"/dev/d1", "/dev/d2"} stagingPath := "/test/path" stageInfoPath := path.Join(stagingPath, driver.StageInfoFilename) stagingPathWithHostPrefix := GetPodPath(stagingPath) @@ -479,7 +489,7 @@ func TestNodeUnstageVolume(t *testing.T) { mockNodeUtils.EXPECT().GetPodPath(stagingPath).Return(stagingPathWithHostPrefix) mockNodeUtils.EXPECT().IsNotMountPoint(stagingPathWithHostPrefix).Return(true, nil) mockOsDeviceCon.EXPECT().GetMpathDevice(volId).Return(mpathDeviceName, nil) - mockNodeUtils.EXPECT().GetSysDevicesFromMpath(mpathDeviceName).Return(rawSysDevices, nil) + mockNodeUtils.EXPECT().GetSysDevicesFromMpath(mpathDeviceName).Return(sysDevices, nil) mockOsDeviceCon.EXPECT().FlushMultipathDevice(mpathDeviceName).Return(dummyError) _, err := node.NodeUnstageVolume(context.TODO(), unstageRequest) @@ -520,7 +530,7 @@ func TestNodeUnstageVolume(t *testing.T) { mockNodeUtils.EXPECT().IsNotMountPoint(stagingPathWithHostPrefix).Return(false, nil) mockMounter.EXPECT().Unmount(stagingPath).Return(nil) mockOsDeviceCon.EXPECT().GetMpathDevice(volId).Return(mpathDeviceName, nil) - mockNodeUtils.EXPECT().GetSysDevicesFromMpath(mpathDeviceName).Return(rawSysDevices, nil) + mockNodeUtils.EXPECT().GetSysDevicesFromMpath(mpathDeviceName).Return(sysDevices, nil) mockOsDeviceCon.EXPECT().FlushMultipathDevice(mpathDeviceName).Return(nil) mockOsDeviceCon.EXPECT().RemovePhysicalDevice(sysDevices).Return(nil) mockNodeUtils.EXPECT().StageInfoFileIsExist(stageInfoPath).Return(true) @@ -886,23 +896,129 @@ func TestNodeUnpublishVolume(t *testing.T) { } func TestNodeGetVolumeStats(t *testing.T) { + volumeId := "someStorageType:vol-test" + volumePath := "/test/path" + stagingTargetPath := "/staging/test/path" + mpathDevice := "/dev/dm-4" + volumePathWithHostPrefix := GetPodPath(volumePath) + mockCtl := gomock.NewController(t) + defer mockCtl.Finish() + mockNodeUtils := mocks.NewMockNodeUtilsInterface(mockCtl) + mockOsDeviceConHelper := mocks.NewMockOsDeviceConnectivityHelperScsiGenericInterface(mockCtl) + d := newTestNodeServiceExpand(mockNodeUtils, mockOsDeviceConHelper, nil) + req := &csi.NodeGetVolumeStatsRequest{ + VolumeId: volumeId, + VolumePath: volumePath, + StagingTargetPath: stagingTargetPath, + } - req := &csi.NodeGetVolumeStatsRequest{} + testCases := []struct { + name string + testFunc func(t *testing.T) + }{ + { + name: "fail volumePath does not exists", + testFunc: func(t *testing.T) { + expErrCode := codes.NotFound + mockNodeUtils.EXPECT().GetPodPath(volumePath).Return(volumePathWithHostPrefix) + mockNodeUtils.EXPECT().IsPathExists(volumePathWithHostPrefix).Return(false) - d := newTestNodeService(nil, nil, nil) + _, err := d.NodeGetVolumeStats(context.TODO(), req) + assertError(t, err, expErrCode) + }, + }, + { + name: "fail to get stats", + testFunc: func(t *testing.T) { + expErrCode := codes.Internal + expSubString := "Failed to get statistics" + mockNodeUtils.EXPECT().GetPodPath(volumePath).Return(volumePathWithHostPrefix) + mockNodeUtils.EXPECT().IsPathExists(volumePathWithHostPrefix).Return(true) + mockNodeUtils.EXPECT().IsBlock(volumePathWithHostPrefix).Return(false, nil) + mockNodeUtils.EXPECT().GetFileSystemVolumeStats(volumePathWithHostPrefix).Return(driver.VolumeStatistics{}, errors.New("fail to get stats")) + + _, err := d.NodeGetVolumeStats(context.TODO(), req) + assertError(t, err, expErrCode) + if err != nil && !strings.Contains(err.Error(), expSubString) { + t.Fatalf("Expected substring: %s in error message from NodeGetVolumeStats, got error message: %s", expSubString, err.Error()) + } + }, + }, + { + name: "success get stats on file system volume", + testFunc: func(t *testing.T) { + volumeStats := driver.VolumeStatistics{ + AvailableBytes: 1, + TotalBytes: 1, + UsedBytes: 1, + + AvailableInodes: 1, + TotalInodes: 1, + UsedInodes: 1, + } + expResp := &csi.NodeGetVolumeStatsResponse{ + Usage: []*csi.VolumeUsage{ + { + Unit: csi.VolumeUsage_BYTES, + Available: volumeStats.AvailableBytes, + Total: volumeStats.TotalBytes, + Used: volumeStats.UsedBytes, + }, + { + Unit: csi.VolumeUsage_INODES, + Available: volumeStats.AvailableInodes, + Total: volumeStats.TotalInodes, + Used: volumeStats.UsedInodes, + }, + }, + } + mockNodeUtils.EXPECT().GetPodPath(volumePath).Return(volumePathWithHostPrefix) + mockNodeUtils.EXPECT().IsPathExists(volumePathWithHostPrefix).Return(true) + mockNodeUtils.EXPECT().IsBlock(volumePathWithHostPrefix).Return(false, nil) + mockNodeUtils.EXPECT().GetFileSystemVolumeStats(volumePathWithHostPrefix).Return(volumeStats, nil) - expErrCode := codes.Unimplemented + assertExpectedStats(t, expResp, req, d) + }, + }, + { + name: "success get stats on block device volume", + testFunc: func(t *testing.T) { + volumeStats := driver.VolumeStatistics{ + TotalBytes: 1, + } + expResp := &csi.NodeGetVolumeStatsResponse{ + Usage: []*csi.VolumeUsage{ + { + Unit: csi.VolumeUsage_BYTES, + Total: volumeStats.TotalBytes, + }, + { + Unit: csi.VolumeUsage_INODES, + }, + }, + } + mockNodeUtils.EXPECT().GetPodPath(volumePath).Return(volumePathWithHostPrefix) + mockNodeUtils.EXPECT().IsPathExists(volumePathWithHostPrefix).Return(true) + mockNodeUtils.EXPECT().IsBlock(volumePathWithHostPrefix).Return(true, nil) + mockOsDeviceConHelper.EXPECT().GetMpathDevice(volumeId).Return(mpathDevice, nil) + mockNodeUtils.EXPECT().GetBlockVolumeStats(mpathDevice).Return(volumeStats, nil) - _, err := d.NodeGetVolumeStats(context.TODO(), req) - if err == nil { - t.Fatalf("Expected error code %d, got nil", expErrCode) + assertExpectedStats(t, expResp, req, d) + }, + }, } - srvErr, ok := status.FromError(err) - if !ok { - t.Fatalf("Could not get error status code from error: %v", srvErr) + for _, tc := range testCases { + t.Run(tc.name, tc.testFunc) } - if srvErr.Code() != expErrCode { - t.Fatalf("Expected error code %d, got %d message %s", expErrCode, srvErr.Code(), srvErr.Message()) +} + +func assertExpectedStats(t *testing.T, expResp *csi.NodeGetVolumeStatsResponse, req *csi.NodeGetVolumeStatsRequest, node driver.NodeService) { + resp, err := node.NodeGetVolumeStats(context.TODO(), req) + if err != nil { + t.Fatalf("Expected no error but got: %v", err) + } + if !reflect.DeepEqual(expResp, resp) { + t.Fatalf("Expected response {%+v}, got {%+v}", expResp, resp) } } @@ -929,7 +1045,6 @@ func TestNodeExpandVolume(t *testing.T) { StagingTargetPath: stagingTargetPath, } mpathDeviceName := "dm-2" - rawSysDevices := "/dev/d1,/dev/d2" sysDevices := []string{"/dev/d1", "/dev/d2"} mpathDevice := "/dev/" + mpathDeviceName fsType := "ext4" @@ -992,7 +1107,7 @@ func TestNodeExpandVolume(t *testing.T) { node := newTestNodeServiceExpand(mockNodeUtils, mockOsDeviceConHelper, mockMounter) mockOsDeviceConHelper.EXPECT().GetMpathDevice(volId).Return(mpathDevice, nil) - mockNodeUtils.EXPECT().GetSysDevicesFromMpath(mpathDeviceName).Return("", dummyError) + mockNodeUtils.EXPECT().GetSysDevicesFromMpath(mpathDeviceName).Return(nil, dummyError) _, err := node.NodeExpandVolume(context.TODO(), expandRequest) assertError(t, err, codes.Internal) @@ -1009,7 +1124,7 @@ func TestNodeExpandVolume(t *testing.T) { node := newTestNodeServiceExpand(mockNodeUtils, mockOsDeviceConHelper, mockMounter) mockOsDeviceConHelper.EXPECT().GetMpathDevice(volId).Return(mpathDevice, nil) - mockNodeUtils.EXPECT().GetSysDevicesFromMpath(mpathDeviceName).Return(rawSysDevices, nil) + mockNodeUtils.EXPECT().GetSysDevicesFromMpath(mpathDeviceName).Return(sysDevices, nil) mockNodeUtils.EXPECT().DevicesAreNvme(sysDevices).Return(false, nil) mockNodeUtils.EXPECT().RescanPhysicalDevices(sysDevices).Return(dummyError) @@ -1028,7 +1143,7 @@ func TestNodeExpandVolume(t *testing.T) { node := newTestNodeServiceExpand(mockNodeUtils, mockOsDeviceConHelper, mockMounter) mockOsDeviceConHelper.EXPECT().GetMpathDevice(volId).Return(mpathDevice, nil) - mockNodeUtils.EXPECT().GetSysDevicesFromMpath(mpathDeviceName).Return(rawSysDevices, nil) + mockNodeUtils.EXPECT().GetSysDevicesFromMpath(mpathDeviceName).Return(sysDevices, nil) mockNodeUtils.EXPECT().DevicesAreNvme(sysDevices).Return(false, nil) mockNodeUtils.EXPECT().RescanPhysicalDevices(sysDevices) mockNodeUtils.EXPECT().ExpandMpathDevice(mpathDeviceName).Return(dummyError) @@ -1048,7 +1163,7 @@ func TestNodeExpandVolume(t *testing.T) { node := newTestNodeServiceExpand(mockNodeUtils, mockOsDeviceConHelper, mockMounter) mockOsDeviceConHelper.EXPECT().GetMpathDevice(volId).Return(mpathDevice, nil) - mockNodeUtils.EXPECT().GetSysDevicesFromMpath(mpathDeviceName).Return(rawSysDevices, nil) + mockNodeUtils.EXPECT().GetSysDevicesFromMpath(mpathDeviceName).Return(sysDevices, nil) mockNodeUtils.EXPECT().DevicesAreNvme(sysDevices).Return(false, nil) mockNodeUtils.EXPECT().RescanPhysicalDevices(sysDevices) mockNodeUtils.EXPECT().ExpandMpathDevice(mpathDeviceName) @@ -1069,7 +1184,7 @@ func TestNodeExpandVolume(t *testing.T) { node := newTestNodeServiceExpand(mockNodeUtils, mockOsDeviceConHelper, mockMounter) mockOsDeviceConHelper.EXPECT().GetMpathDevice(volId).Return(mpathDevice, nil) - mockNodeUtils.EXPECT().GetSysDevicesFromMpath(mpathDeviceName).Return(rawSysDevices, nil) + mockNodeUtils.EXPECT().GetSysDevicesFromMpath(mpathDeviceName).Return(sysDevices, nil) mockNodeUtils.EXPECT().DevicesAreNvme(sysDevices).Return(false, nil) mockNodeUtils.EXPECT().RescanPhysicalDevices(sysDevices) mockNodeUtils.EXPECT().ExpandMpathDevice(mpathDeviceName) @@ -1091,7 +1206,7 @@ func TestNodeExpandVolume(t *testing.T) { node := newTestNodeServiceExpand(mockNodeUtils, mockOsDeviceConHelper, mockMounter) mockOsDeviceConHelper.EXPECT().GetMpathDevice(volId).Return(mpathDevice, nil) - mockNodeUtils.EXPECT().GetSysDevicesFromMpath(mpathDeviceName).Return(rawSysDevices, nil) + mockNodeUtils.EXPECT().GetSysDevicesFromMpath(mpathDeviceName).Return(sysDevices, nil) mockNodeUtils.EXPECT().DevicesAreNvme(sysDevices).Return(true, nil) mockNodeUtils.EXPECT().ExpandMpathDevice(mpathDeviceName) mockMounter.EXPECT().GetDiskFormat(mpathDevice).Return(fsType, nil) @@ -1114,7 +1229,7 @@ func TestNodeExpandVolume(t *testing.T) { node := newTestNodeServiceExpand(mockNodeUtils, mockOsDeviceConHelper, mockMounter) mockOsDeviceConHelper.EXPECT().GetMpathDevice(volId).Return(mpathDevice, nil) - mockNodeUtils.EXPECT().GetSysDevicesFromMpath(mpathDeviceName).Return(rawSysDevices, nil) + mockNodeUtils.EXPECT().GetSysDevicesFromMpath(mpathDeviceName).Return(sysDevices, nil) mockNodeUtils.EXPECT().DevicesAreNvme(sysDevices).Return(false, nil) mockNodeUtils.EXPECT().RescanPhysicalDevices(sysDevices) mockNodeUtils.EXPECT().ExpandMpathDevice(mpathDeviceName) @@ -1154,6 +1269,13 @@ func TestNodeGetCapabilities(t *testing.T) { }, }, }, + { + Type: &csi.NodeServiceCapability_Rpc{ + Rpc: &csi.NodeServiceCapability_RPC{ + Type: csi.NodeServiceCapability_RPC_GET_VOLUME_STATS, + }, + }, + }, } expResp := &csi.NodeGetCapabilitiesResponse{Capabilities: caps} diff --git a/node/pkg/driver/node_utils.go b/node/pkg/driver/node_utils.go index 50ce95f63..318fb6b90 100644 --- a/node/pkg/driver/node_utils.go +++ b/node/pkg/driver/node_utils.go @@ -27,6 +27,7 @@ import ( "strings" "github.com/ibm/ibm-block-csi-driver/node/pkg/driver/device_connectivity" + "golang.org/x/sys/unix" "k8s.io/apimachinery/pkg/util/errors" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -56,6 +57,7 @@ const ( TimeOutMultipathdCmd = TimeOutGeneralCmd TimeOutNvmeCmd = TimeOutGeneralCmd multipathdCmd = "multipathd" + blockDevCmd = "blockdev" nvmeCmd = "nvme" minFilesInNonEmptyDir = 1 noSuchFileOrDirectoryErrorMessage = "No such file or directory" @@ -70,7 +72,7 @@ type NodeUtilsInterface interface { ParseIscsiInitiators() (string, error) GetInfoFromPublishContext(publishContext map[string]string, configYaml ConfigFile) (string, int, map[string][]string, error) GetArrayInitiators(ipsByArrayInitiator map[string][]string) []string - GetSysDevicesFromMpath(baseDevice string) (string, error) + GetSysDevicesFromMpath(baseDevice string) ([]string, error) // TODO refactor and move all staging methods to dedicate interface. ClearStageInfoFile(filePath string) error @@ -89,6 +91,9 @@ type NodeUtilsInterface interface { GetPodPath(filepath string) string GenerateNodeID(hostName string, nvmeNQN string, fcWWNs []string, iscsiIQN string) (string, error) GetTopologyLabels(ctx context.Context, nodeName string) (map[string]string, error) + IsBlock(devicePath string) (bool, error) + GetFileSystemVolumeStats(path string) (VolumeStatistics, error) + GetBlockVolumeStats(mpathDevice string) (VolumeStatistics, error) } type NodeUtils struct { @@ -154,15 +159,15 @@ func (n NodeUtils) ClearStageInfoFile(filePath string) error { return os.Remove(filePath) } -func (n NodeUtils) GetSysDevicesFromMpath(device string) (string, error) { +func (n NodeUtils) GetSysDevicesFromMpath(baseDevice string) ([]string, error) { // this will return the /sys/block/dm-3/slaves/ - logger.Debugf("GetSysDevicesFromMpath with param : {%v}", device) - deviceSlavePath := path.Join("/sys", "block", device, "slaves") + logger.Debugf("GetSysDevicesFromMpath with param : {%v}", baseDevice) + deviceSlavePath := path.Join("/sys", "block", baseDevice, "slaves") logger.Debugf("looking in path : {%v}", deviceSlavePath) slaves, err := ioutil.ReadDir(deviceSlavePath) if err != nil { logger.Errorf("an error occured while looking for device slaves : {%v}", err.Error()) - return "", err + return nil, err } logger.Debugf("found slaves : {%v}", slaves) @@ -171,9 +176,8 @@ func (n NodeUtils) GetSysDevicesFromMpath(device string) (string, error) { for _, slave := range slaves { slavesNames = append(slavesNames, slave.Name()) } - slavesString := strings.Join(slavesNames, ",") - return slavesString, nil + return slavesNames, nil } func (n NodeUtils) StageInfoFileIsExist(filePath string) bool { @@ -516,3 +520,60 @@ func (n NodeUtils) GetTopologyLabels(ctx context.Context, nodeName string) (map[ } return topologyLabels, nil } + +func (n NodeUtils) IsBlock(devicePath string) (bool, error) { + var stat unix.Stat_t + err := unix.Stat(devicePath, &stat) + if err != nil { + return false, err + } + return (stat.Mode & unix.S_IFMT) == unix.S_IFBLK, nil +} + +func (d NodeUtils) GetFileSystemVolumeStats(path string) (VolumeStatistics, error) { + statfs := &unix.Statfs_t{} + err := unix.Statfs(path, statfs) + if err != nil { + return VolumeStatistics{}, err + } + + availableBytes := int64(statfs.Bavail) * int64(statfs.Bsize) + totalBytes := int64(statfs.Blocks) * int64(statfs.Bsize) + usedBytes := (int64(statfs.Blocks) - int64(statfs.Bfree)) * int64(statfs.Bsize) + + totalInodes := int64(statfs.Files) + availableInodes := int64(statfs.Ffree) + usedInodes := totalInodes - availableInodes + + volumeStats := VolumeStatistics{ + AvailableBytes: availableBytes, + TotalBytes: totalBytes, + UsedBytes: usedBytes, + + AvailableInodes: availableInodes, + TotalInodes: totalInodes, + UsedInodes: usedInodes, + } + + return volumeStats, nil +} + +func (d NodeUtils) GetBlockVolumeStats(mpathDevice string) (VolumeStatistics, error) { + args := []string{"--getsize64", mpathDevice} + out, err := d.Executer.ExecuteWithTimeoutSilently(device_connectivity.TimeOutBlockDevCmd, blockDevCmd, args) + if err != nil { + return VolumeStatistics{}, err + } + + strOut := strings.TrimSpace(string(out)) + sizeInBytes, err := strconv.ParseInt(strOut, 10, 64) + if err != nil { + return VolumeStatistics{}, err + } + + volumeStats := VolumeStatistics{ + TotalBytes: sizeInBytes, + } + + return volumeStats, nil +} diff --git a/node/pkg/driver/version_test.go b/node/pkg/driver/version_test.go index 9efac1b1b..ac2c1200d 100644 --- a/node/pkg/driver/version_test.go +++ b/node/pkg/driver/version_test.go @@ -46,7 +46,7 @@ func TestGetVersion(t *testing.T) { version, err := GetVersion(dir) expected := VersionInfo{ - DriverVersion: "1.8.0", + DriverVersion: "1.9.0", GitCommit: "", BuildDate: "", GoVersion: runtime.Version(), @@ -76,7 +76,7 @@ func TestGetVersionJSON(t *testing.T) { } expected := fmt.Sprintf(`{ - "driverVersion": "1.8.0", + "driverVersion": "1.9.0", "gitCommit": "", "buildDate": "", "goVersion": "%s", diff --git a/scripts/ci/Jenkinsfile b/scripts/ci/Jenkinsfile index 8a27e58b9..3cc91d7c6 100644 --- a/scripts/ci/Jenkinsfile +++ b/scripts/ci/Jenkinsfile @@ -1,6 +1,6 @@ pipeline { parameters { - string(name: 'IMAGE_VERSION', defaultValue: "1.8.0") + string(name: 'IMAGE_VERSION', defaultValue: "1.9.0") string(name: 'DOCKER_REGISTRY', defaultValue: DEFAULT_DOCKER_REGISTRY) string(name: 'EMAIL_TO', defaultValue: "") } diff --git a/scripts/run_static_code_analysis.sh b/scripts/run_static_code_analysis.sh index 3a8082fc4..e566a83ce 100755 --- a/scripts/run_static_code_analysis.sh +++ b/scripts/run_static_code_analysis.sh @@ -1,4 +1,5 @@ -#!/bin/bash -x +#!/bin/bash +set -x docker build -f Dockerfile-csi-controller.test -t csi-controller-tests . || exit 1 diff --git a/scripts/run_yamlcheck.sh b/scripts/run_yamlcheck.sh index a960cc63e..4ee5cd194 100755 --- a/scripts/run_yamlcheck.sh +++ b/scripts/run_yamlcheck.sh @@ -1,4 +1,5 @@ -#!/bin/bash -xe +#!/bin/bash -e +set -x arch=$(uname -m) if [[ "$arch" == "x86"* ]];