Browse Source

Availability zone / metadata validation

Change-Id: I01ce19b1cd8331fbb5a8121a88ce9e23edd91752
changes/57/694057/2
Adam Harwell 2 years ago
parent
commit
787a8edcbe
2 changed files with 39 additions and 0 deletions
  1. +35
    -0
      octavia_lib/api/drivers/provider_base.py
  2. +4
    -0
      releasenotes/notes/add-availability-zone-validation-ed853a3ee89570be.yaml

+ 35
- 0
octavia_lib/api/drivers/provider_base.py View File

@ -493,3 +493,38 @@ class ProviderDriver(object):
'flavors.',
operator_fault_string='This provider does not support validating '
'the supported flavor metadata.')
# Availability Zone
def get_supported_availability_zone_metadata(self):
"""Returns a dict of supported availability zone metadata keys.
The returned dictionary will include key/value pairs, 'name' and
'description.'
:returns: The availability zone 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 availability zone metadata.',
operator_fault_string='This provider does not support getting '
'the supported availability zone metadata.')
def validate_availability_zone(self, flavor_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.')

+ 4
- 0
releasenotes/notes/add-availability-zone-validation-ed853a3ee89570be.yaml View File

@ -0,0 +1,4 @@
---
features:
- |
Add driver interface for validating availability zone metadata and support.

Loading…
Cancel
Save