Пример #1
0
 def create_vip_port(self, loadbalancer_id, project_id, vip_dictionary):
     # raise NotImplementedError to let octavia create port for us.
     raise exceptions.NotImplementedError(
         user_fault_string=
         'The a10 provider does not implement custom create_vip_port()',
         operator_fault_string=
         'The a10 provider does not implement custom create_vip_port()')
Пример #2
0
    def loadbalancer_failover(self, loadbalancer_id):
        """Performs a fail over of a load balancer.

        :param loadbalancer_id (string): ID of the load balancer to failover.
        :return: Nothing if the failover request was accepted.
        :raises DriverError: An unexpected error occurred in the driver.
        :raises: NotImplementedError if driver does not support request.
        """
        raise exceptions.NotImplementedError()
Пример #3
0
    def get_supported_flavor_metadata(self):
        """Returns the valid flavor metadata keys and descriptions.

        This extracts the valid flavor metadata keys and descriptions
        from the JSON validation schema and returns it as a dictionary.

        :return: Dictionary of flavor metadata keys and descriptions.
        :raises DriverError: An unexpected error occurred.
        """
        raise exceptions.NotImplementedError()
Пример #4
0
    def test_NotImplementedError(self):
        not_implemented_error = exceptions.NotImplementedError(
            user_fault_string=self.user_fault_string,
            operator_fault_string=self.operator_fault_string)

        self.assertEqual(self.user_fault_string,
                         not_implemented_error.user_fault_string)
        self.assertEqual(self.operator_fault_string,
                         not_implemented_error.operator_fault_string)
        self.assertIsInstance(not_implemented_error, Exception)
Пример #5
0
    def validate_flavor(self, flavor_metadata):
        """Validates if driver can support flavor as defined in flavor_metadata.

        :param flavor_metadata (dict): Dictionary with flavor metadata.
        :return: Nothing if the flavor is valid and supported.
        :raises DriverError: An unexpected error occurred in the driver.
        :raises NotImplementedError: The driver does not support flavors.
        :raises UnsupportedOptionError: if driver does not
              support one of the configuration options.
        """
        raise exceptions.NotImplementedError()
Пример #6
0
    def loadbalancer_failover(self, loadbalancer_id):
        """Performs a fail over of a load balancer.

        :param loadbalancer_id: ID of the load balancer to failover.
        :type loadbalancer_id: string
        :return: Nothing if the failover request was accepted.
        :raises DriverError: An unexpected error occurred in the driver.
        :raises: NotImplementedError if driver does not support request.
        """
        raise exceptions.NotImplementedError(
            user_fault_string='This provider does not support failing over '
            'load balancers.',
            operator_fault_string='This provider does not support failing '
            'over load balancers.')
Пример #7
0
    def l7rule_delete(self, l7rule):
        """Deletes an L7 rule.

        :param l7rule: The L7 rule to delete.
        :type l7rule: object
        :return: Nothing if the delete request was accepted.
        :raises DriverError: An unexpected error occurred in the driver.
        :raises NotImplementedError: if driver does not support request.
        """
        raise exceptions.NotImplementedError(
            user_fault_string='This provider does not support deleting '
            'l7rules.',
            operator_fault_string='This provider does not support deleting '
            'l7rules.')
Пример #8
0
    def health_monitor_delete(self, healthmonitor):
        """Deletes a healthmonitor_id.

        :param healthmonitor: The monitor to delete.
        :type healthmonitor: object
        :return: Nothing if the create request was accepted.
        :raises DriverError: An unexpected error occurred in the driver.
        :raises NotImplementedError: if driver does not support request.
        """
        raise exceptions.NotImplementedError(
            user_fault_string='This provider does not support deleting '
            'health monitors.',
            operator_fault_string='This provider does not support deleting '
            'health monitors.')
Пример #9
0
    def pool_delete(self, pool):
        """Deletes a pool and its members.

        :param pool: The pool to delete.
        :type pool: object
        :return: Nothing if the create request was accepted.
        :raises DriverError: An unexpected error occurred in the driver.
        :raises NotImplementedError: if driver does not support request.
        """
        raise exceptions.NotImplementedError(
            user_fault_string='This provider does not support deleting '
            'pools.',
            operator_fault_string='This provider does not support deleting '
            'pools.')
Пример #10
0
    def get_supported_flavor_metadata(self):
        """Returns a dict of flavor metadata keys supported by this driver.

        The returned dictionary will include key/value pairs, 'name' and
        'description.'

        :returns: The flavor metadata dictionary
        :raises DriverError: An unexpected error occurred in the driver.
        :raises NotImplementedError: The driver does not support flavors.
        """
        raise exceptions.NotImplementedError(
            user_fault_string='This provider does not support getting the '
            'supported flavor metadata.',
            operator_fault_string='This provider does not support getting '
            'the supported flavor metadata.')
Пример #11
0
    def member_batch_update(self, members):
        """Creates, updates, or deletes a set of pool members.

        :param members: List of member objects.
        :type members: list
        :return: Nothing if the create request was accepted.
        :raises DriverError: An unexpected error occurred in the driver.
        :raises NotImplementedError: if driver does not support request.
        :raises UnsupportedOptionError: if driver does not
          support one of the configuration options.
        """
        raise exceptions.NotImplementedError(
            user_fault_string='This provider does not support batch '
            'updating members.',
            operator_fault_string='This provider does not support batch '
            'updating members.')
Пример #12
0
    def validate_flavor(self, flavor_metadata):
        """Validates if driver can support the flavor.

        :param flavor_metadata: Dictionary with flavor metadata.
        :type flavor_metadata: dict
        :return: Nothing if the flavor is valid and supported.
        :raises DriverError: An unexpected error occurred in the driver.
        :raises NotImplementedError: The driver does not support flavors.
        :raises UnsupportedOptionError: if driver does not
          support one of the configuration options.
        """
        raise exceptions.NotImplementedError(
            user_fault_string='This provider does not support validating '
            'flavors.',
            operator_fault_string='This provider does not support validating '
            'the supported flavor metadata.')
Пример #13
0
    def l7rule_create(self, l7rule):
        """Creates a new L7 rule.

        :param l7rule: The L7 rule object.
        :type l7rule: object
        :return: Nothing if the create request was accepted.
        :raises DriverError: An unexpected error occurred in the driver.
        :raises NotImplementedError: if driver does not support request.
        :raises UnsupportedOptionError: if driver does not
          support one of the configuration options.
        """
        raise exceptions.NotImplementedError(
            user_fault_string='This provider does not support creating '
            'l7rules.',
            operator_fault_string='This provider does not support creating '
            'l7rules.')
Пример #14
0
    def health_monitor_create(self, healthmonitor):
        """Creates a new health monitor.

        :param healthmonitor: The health monitor object.
        :type healthmonitor: object
        :return: Nothing if the create request was accepted.
        :raises DriverError: An unexpected error occurred in the driver.
        :raises NotImplementedError: if driver does not support request.
        :raises UnsupportedOptionError: if driver does not
          support one of the configuration options.
        """
        raise exceptions.NotImplementedError(
            user_fault_string='This provider does not support creating '
            'health monitors.',
            operator_fault_string='This provider does not support creating '
            'health monitors.')
Пример #15
0
    def loadbalancer_create(self, loadbalancer):
        """Creates a new load balancer.

        :param loadbalancer: The load balancer object.
        :type loadbalancer: object
        :return: Nothing if the create request was accepted.
        :raises DriverError: An unexpected error occurred in the driver.
        :raises NotImplementedError: The driver does not support create.
        :raises UnsupportedOptionError: The driver does not
          support one of the configuration options.
        """
        raise exceptions.NotImplementedError(
            user_fault_string='This provider does not support creating '
            'load balancers.',
            operator_fault_string='This provider does not support creating '
            'load balancers. What?')
Пример #16
0
    def loadbalancer_delete(self, loadbalancer, cascade=False):
        """Deletes a load balancer.

        :param loadbalancer: The load balancer to delete.
        :type loadbalancer: object
        :param cascade: If True, deletes all child objects (listeners,
          pools, etc.) in addition to the load balancer.
        :type cascade: bool
        :return: Nothing if the delete request was accepted.
        :raises DriverError: An unexpected error occurred in the driver.
        :raises NotImplementedError: if driver does not support request.
        """
        raise exceptions.NotImplementedError(
            user_fault_string='This provider does not support deleting '
            'load balancers.',
            operator_fault_string='This provider does not support deleting '
            'load balancers.')
Пример #17
0
    def validate_availability_zone(self, availability_zone_metadata):
        """Validates if driver can support the availability zone.

        :param availability_zone_metadata: Dictionary with az metadata.
        :type availability_zone_metadata: dict
        :return: Nothing if the availability zone is valid and supported.
        :raises DriverError: An unexpected error occurred in the driver.
        :raises NotImplementedError: The driver does not support availability
          zones.
        :raises UnsupportedOptionError: if driver does not
          support one of the configuration options.
        """
        raise exceptions.NotImplementedError(
            user_fault_string='This provider does not support validating '
            'availability zones.',
            operator_fault_string='This provider does not support validating '
            'the supported availability zone metadata.')
Пример #18
0
    def validate_availability_zone(self, availability_zone_dict):
        """Validates availability zone profile data.

        This will validate an availability zone profile dataset against the
        availability zone settings the amphora driver supports.

        :param availability_zone_dict: The availability zone dict to validate.
        :type availability_zone_dict: dict
        :return: None
        :raises DriverError: An unexpected error occurred.
        :raises UnsupportedOptionError: If the driver does not support
          one of the availability zone settings.
        """
        raise exceptions.NotImplementedError(
            user_fault_string=
            'The a10 provider does not support Availability zone feature',
            operator_fault_string=
            'The a10 provider does not support Availability zone feature')
Пример #19
0
    def member_update(self, old_member, new_member):
        """Updates a pool member.

        :param old_member: The baseline member object.
        :type old_member: object
        :param new_member: The updated member object.
        :type new_member: object
        :return: Nothing if the create request was accepted.
        :raises DriverError: An unexpected error occurred in the driver.
        :raises NotImplementedError: if driver does not support request.
        :raises UnsupportedOptionError: if driver does not
          support one of the configuration options.
        """
        raise exceptions.NotImplementedError(
            user_fault_string='This provider does not support updating '
            'members.',
            operator_fault_string='This provider does not support updating '
            'members.')
Пример #20
0
    def l7policy_update(self, old_l7policy, new_l7policy):
        """Updates an L7 policy.

        :param old_l7policy: The baseline L7 policy object.
        :type old_l7policy: object
        :param new_l7policy: The updated L7 policy object.
        :type new_l7policy: object
        :return: Nothing if the update request was accepted.
        :raises DriverError: An unexpected error occurred in the driver.
        :raises NotImplementedError: if driver does not support request.
        :raises UnsupportedOptionError: if driver does not
          support one of the configuration options.
        """
        raise exceptions.NotImplementedError(
            user_fault_string='This provider does not support updating '
            'l7policies.',
            operator_fault_string='This provider does not support updating '
            'l7policies.')
Пример #21
0
    def create_vip_port(self, loadbalancer_id, project_id, vip_dictionary,
                        additional_vip_dicts):
        """Creates a port for a load balancer VIP.

        If the driver supports creating VIP ports, the driver will create a
        VIP port with the primary VIP and all additional VIPs added to the
        port, and return the vip_dictionary populated with the vip_port_id and
        a list of vip_dictionaries populated with data from the additional
        VIPs (which are guaranteed to be in the same Network).
        This might look like:
        {'port_id': port_id, 'subnet_id': subnet_id_1, 'ip_address': ip1},
        [{'subnet_id': subnet_id_2, 'ip_address': ip2}, {...}, {...}]
        If the driver does not support port creation, the driver will raise
        a NotImplementedError.

        :param loadbalancer_id: ID of loadbalancer.
        :type loadbalancer_id: string
        :param project_id: The project ID to create the VIP under.
        :type project_id: string
        :param: vip_dictionary: The VIP dictionary.
        :type vip_dictionary: dict
        :param: additional_vip_dicts: A list of additional VIP dictionaries,
                                      with subnets guaranteed to be in the same
                                      network as the primary vip_dictionary.
        :type additional_vip_dicts: list(dict)
        :returns: VIP dictionary with vip_port_id + a list of additional VIP
                  dictionaries (vip_dict, additional_vip_dicts).
        :raises DriverError: An unexpected error occurred in the driver.
        :raises NotImplementedError: The driver does not support creating VIP
                                     ports.
        """
        raise exceptions.NotImplementedError(
            user_fault_string='This provider does not support creating VIP '
            'ports.',
            operator_fault_string='This provider does not support creating '
            'VIP ports. Octavia will create it.')
Пример #22
0
 def test_not_implemented(self, mock_get_metadata):
     mock_get_metadata.side_effect = lib_exceptions.NotImplementedError()
     self.get(self.FLAVOR_CAPABILITIES_PATH.format(provider='noop_driver'),
              status=501)
Пример #23
0
 def member_batch_update(self, pool_id, members):
     raise exceptions.NotImplementedError(
         user_fault_string=
         'The a10 provider does not support batch member update',
         operator_fault_string=
         'The a10 provider does not support batch member update')
Пример #24
0
 def create_vip_port(self, loadbalancer_id, project_id, vip_dictionary):
     # Let Octavia create the port
     raise exceptions.NotImplementedError()