|
@@ -66,14 +66,25 @@ def _check_ensure_volumes_info_ordering(export_info, volumes_info):
|
|
|
class GetInstanceInfoTask(base.TaskRunner):
|
|
class GetInstanceInfoTask(base.TaskRunner):
|
|
|
""" Task which gathers the export info for a VM. """
|
|
""" Task which gathers the export info for a VM. """
|
|
|
|
|
|
|
|
- @property
|
|
|
|
|
- def required_task_info_properties(self):
|
|
|
|
|
|
|
+ @classmethod
|
|
|
|
|
+ def get_required_platform(cls):
|
|
|
|
|
+ return constants.TASK_PLATFORM_SOURCE
|
|
|
|
|
+
|
|
|
|
|
+ @classmethod
|
|
|
|
|
+ def get_required_task_info_properties(cls):
|
|
|
return ["source_environment"]
|
|
return ["source_environment"]
|
|
|
|
|
|
|
|
- @property
|
|
|
|
|
- def returned_task_info_properties(self):
|
|
|
|
|
|
|
+ @classmethod
|
|
|
|
|
+ def get_returned_task_info_properties(cls):
|
|
|
return ["export_info"]
|
|
return ["export_info"]
|
|
|
|
|
|
|
|
|
|
+ @classmethod
|
|
|
|
|
+ def get_required_provider_types(cls):
|
|
|
|
|
+ return {
|
|
|
|
|
+ constants.PROVIDER_PLATFORM_SOURCE: [
|
|
|
|
|
+ constants.PROVIDER_TYPE_REPLICA_EXPORT]
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
def _run(self, ctxt, instance, origin, destination, task_info,
|
|
def _run(self, ctxt, instance, origin, destination, task_info,
|
|
|
event_handler):
|
|
event_handler):
|
|
|
provider = providers_factory.get_provider(
|
|
provider = providers_factory.get_provider(
|
|
@@ -96,14 +107,25 @@ class GetInstanceInfoTask(base.TaskRunner):
|
|
|
class ShutdownInstanceTask(base.TaskRunner):
|
|
class ShutdownInstanceTask(base.TaskRunner):
|
|
|
""" Task which shuts down a VM. """
|
|
""" Task which shuts down a VM. """
|
|
|
|
|
|
|
|
- @property
|
|
|
|
|
- def required_task_info_properties(self):
|
|
|
|
|
|
|
+ @classmethod
|
|
|
|
|
+ def get_required_platform(cls):
|
|
|
|
|
+ return constants.TASK_PLATFORM_SOURCE
|
|
|
|
|
+
|
|
|
|
|
+ @classmethod
|
|
|
|
|
+ def get_required_task_info_properties(cls):
|
|
|
return ["source_environment"]
|
|
return ["source_environment"]
|
|
|
|
|
|
|
|
- @property
|
|
|
|
|
- def returned_task_info_properties(self):
|
|
|
|
|
|
|
+ @classmethod
|
|
|
|
|
+ def get_returned_task_info_properties(cls):
|
|
|
return []
|
|
return []
|
|
|
|
|
|
|
|
|
|
+ @classmethod
|
|
|
|
|
+ def get_required_provider_types(cls):
|
|
|
|
|
+ return {
|
|
|
|
|
+ constants.PROVIDER_PLATFORM_SOURCE: [
|
|
|
|
|
+ constants.PROVIDER_TYPE_REPLICA_EXPORT]
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
def _run(self, ctxt, instance, origin, destination, task_info,
|
|
def _run(self, ctxt, instance, origin, destination, task_info,
|
|
|
event_handler):
|
|
event_handler):
|
|
|
provider = providers_factory.get_provider(
|
|
provider = providers_factory.get_provider(
|
|
@@ -119,18 +141,32 @@ class ShutdownInstanceTask(base.TaskRunner):
|
|
|
|
|
|
|
|
class ReplicateDisksTask(base.TaskRunner):
|
|
class ReplicateDisksTask(base.TaskRunner):
|
|
|
|
|
|
|
|
- @property
|
|
|
|
|
- def required_task_info_properties(self):
|
|
|
|
|
|
|
+ @classmethod
|
|
|
|
|
+ def get_required_platform(cls):
|
|
|
|
|
+ # NOTE: considering Replication reads from one end (be it PMR minion
|
|
|
|
|
+ # or otherwise) to the disk writer minion on the destination,
|
|
|
|
|
+ # replicate_disks would need access to both:
|
|
|
|
|
+ return constants.TASK_PLATFORM_BILATERAL
|
|
|
|
|
+
|
|
|
|
|
+ @classmethod
|
|
|
|
|
+ def get_required_task_info_properties(cls):
|
|
|
return [
|
|
return [
|
|
|
"export_info", "volumes_info", "source_environment",
|
|
"export_info", "volumes_info", "source_environment",
|
|
|
"source_resources",
|
|
"source_resources",
|
|
|
"source_resources_connection_info",
|
|
"source_resources_connection_info",
|
|
|
"target_resources_connection_info"]
|
|
"target_resources_connection_info"]
|
|
|
|
|
|
|
|
- @property
|
|
|
|
|
- def returned_task_info_properties(self):
|
|
|
|
|
|
|
+ @classmethod
|
|
|
|
|
+ def get_returned_task_info_properties(cls):
|
|
|
return ["volumes_info"]
|
|
return ["volumes_info"]
|
|
|
|
|
|
|
|
|
|
+ @classmethod
|
|
|
|
|
+ def get_required_provider_types(cls):
|
|
|
|
|
+ return {
|
|
|
|
|
+ constants.PROVIDER_PLATFORM_SOURCE: [
|
|
|
|
|
+ constants.PROVIDER_TYPE_REPLICA_EXPORT]
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
def _run(self, ctxt, instance, origin, destination, task_info,
|
|
def _run(self, ctxt, instance, origin, destination, task_info,
|
|
|
event_handler):
|
|
event_handler):
|
|
|
provider = providers_factory.get_provider(
|
|
provider = providers_factory.get_provider(
|
|
@@ -181,15 +217,26 @@ class ReplicateDisksTask(base.TaskRunner):
|
|
|
|
|
|
|
|
class DeployReplicaDisksTask(base.TaskRunner):
|
|
class DeployReplicaDisksTask(base.TaskRunner):
|
|
|
|
|
|
|
|
- @property
|
|
|
|
|
- def required_task_info_properties(self):
|
|
|
|
|
|
|
+ @classmethod
|
|
|
|
|
+ def get_required_platform(cls):
|
|
|
|
|
+ return constants.TASK_PLATFORM_DESTINATION
|
|
|
|
|
+
|
|
|
|
|
+ @classmethod
|
|
|
|
|
+ def get_required_task_info_properties(cls):
|
|
|
return [
|
|
return [
|
|
|
"export_info", "volumes_info", "target_environment"]
|
|
"export_info", "volumes_info", "target_environment"]
|
|
|
|
|
|
|
|
- @property
|
|
|
|
|
- def returned_task_info_properties(self):
|
|
|
|
|
|
|
+ @classmethod
|
|
|
|
|
+ def get_returned_task_info_properties(cls):
|
|
|
return ["volumes_info"]
|
|
return ["volumes_info"]
|
|
|
|
|
|
|
|
|
|
+ @classmethod
|
|
|
|
|
+ def get_required_provider_types(cls):
|
|
|
|
|
+ return {
|
|
|
|
|
+ constants.PROVIDER_PLATFORM_DESTINATION: [
|
|
|
|
|
+ constants.PROVIDER_TYPE_REPLICA_IMPORT]
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
def _run(self, ctxt, instance, origin, destination, task_info,
|
|
def _run(self, ctxt, instance, origin, destination, task_info,
|
|
|
event_handler):
|
|
event_handler):
|
|
|
target_environment = task_info['target_environment']
|
|
target_environment = task_info['target_environment']
|
|
@@ -216,15 +263,25 @@ class DeployReplicaDisksTask(base.TaskRunner):
|
|
|
|
|
|
|
|
class DeleteReplicaSourceDiskSnapshotsTask(base.TaskRunner):
|
|
class DeleteReplicaSourceDiskSnapshotsTask(base.TaskRunner):
|
|
|
|
|
|
|
|
- @property
|
|
|
|
|
- def required_task_info_properties(self):
|
|
|
|
|
|
|
+ @classmethod
|
|
|
|
|
+ def get_required_platform(cls):
|
|
|
|
|
+ return constants.TASK_PLATFORM_SOURCE
|
|
|
|
|
+
|
|
|
|
|
+ @classmethod
|
|
|
|
|
+ def get_required_task_info_properties(cls):
|
|
|
return [
|
|
return [
|
|
|
"volumes_info", "source_environment"]
|
|
"volumes_info", "source_environment"]
|
|
|
|
|
|
|
|
- @property
|
|
|
|
|
- def returned_task_info_properties(self):
|
|
|
|
|
|
|
+ @classmethod
|
|
|
|
|
+ def get_returned_task_info_properties(cls):
|
|
|
return ["volumes_info"]
|
|
return ["volumes_info"]
|
|
|
|
|
|
|
|
|
|
+ @classmethod
|
|
|
|
|
+ def get_required_provider_types(cls):
|
|
|
|
|
+ return {
|
|
|
|
|
+ constants.PROVIDER_PLATFORM_SOURCE: [
|
|
|
|
|
+ constants.PROVIDER_TYPE_REPLICA_EXPORT]
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
def _run(self, ctxt, instance, origin, destination, task_info,
|
|
def _run(self, ctxt, instance, origin, destination, task_info,
|
|
|
event_handler):
|
|
event_handler):
|
|
@@ -253,15 +310,26 @@ class DeleteReplicaSourceDiskSnapshotsTask(base.TaskRunner):
|
|
|
|
|
|
|
|
class DeleteReplicaDisksTask(base.TaskRunner):
|
|
class DeleteReplicaDisksTask(base.TaskRunner):
|
|
|
|
|
|
|
|
- @property
|
|
|
|
|
- def required_task_info_properties(self):
|
|
|
|
|
|
|
+ @classmethod
|
|
|
|
|
+ def get_required_platform(cls):
|
|
|
|
|
+ return constants.TASK_PLATFORM_DESTINATION
|
|
|
|
|
+
|
|
|
|
|
+ @classmethod
|
|
|
|
|
+ def get_required_task_info_properties(cls):
|
|
|
return [
|
|
return [
|
|
|
"volumes_info", "target_environment"]
|
|
"volumes_info", "target_environment"]
|
|
|
|
|
|
|
|
- @property
|
|
|
|
|
- def returned_task_info_properties(self):
|
|
|
|
|
|
|
+ @classmethod
|
|
|
|
|
+ def get_returned_task_info_properties(cls):
|
|
|
return ["volumes_info"]
|
|
return ["volumes_info"]
|
|
|
|
|
|
|
|
|
|
+ @classmethod
|
|
|
|
|
+ def get_required_provider_types(cls):
|
|
|
|
|
+ return {
|
|
|
|
|
+ constants.PROVIDER_PLATFORM_DESTINATION: [
|
|
|
|
|
+ constants.PROVIDER_TYPE_REPLICA_IMPORT]
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
def _run(self, ctxt, instance, origin, destination, task_info,
|
|
def _run(self, ctxt, instance, origin, destination, task_info,
|
|
|
event_handler):
|
|
event_handler):
|
|
|
event_manager = events.EventManager(event_handler)
|
|
event_manager = events.EventManager(event_handler)
|
|
@@ -295,14 +363,25 @@ class DeleteReplicaDisksTask(base.TaskRunner):
|
|
|
|
|
|
|
|
class DeployReplicaSourceResourcesTask(base.TaskRunner):
|
|
class DeployReplicaSourceResourcesTask(base.TaskRunner):
|
|
|
|
|
|
|
|
- @property
|
|
|
|
|
- def required_task_info_properties(self):
|
|
|
|
|
|
|
+ @classmethod
|
|
|
|
|
+ def get_required_platform(cls):
|
|
|
|
|
+ return constants.TASK_PLATFORM_SOURCE
|
|
|
|
|
+
|
|
|
|
|
+ @classmethod
|
|
|
|
|
+ def get_required_task_info_properties(cls):
|
|
|
return ["source_environment", "export_info"]
|
|
return ["source_environment", "export_info"]
|
|
|
|
|
|
|
|
- @property
|
|
|
|
|
- def returned_task_info_properties(self):
|
|
|
|
|
|
|
+ @classmethod
|
|
|
|
|
+ def get_returned_task_info_properties(cls):
|
|
|
return ["source_resources", "source_resources_connection_info"]
|
|
return ["source_resources", "source_resources_connection_info"]
|
|
|
|
|
|
|
|
|
|
+ @classmethod
|
|
|
|
|
+ def get_required_provider_types(cls):
|
|
|
|
|
+ return {
|
|
|
|
|
+ constants.PROVIDER_PLATFORM_SOURCE: [
|
|
|
|
|
+ constants.PROVIDER_TYPE_REPLICA_EXPORT]
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
def _run(self, ctxt, instance, origin, destination, task_info,
|
|
def _run(self, ctxt, instance, origin, destination, task_info,
|
|
|
event_handler):
|
|
event_handler):
|
|
|
provider = providers_factory.get_provider(
|
|
provider = providers_factory.get_provider(
|
|
@@ -355,14 +434,25 @@ class DeployReplicaSourceResourcesTask(base.TaskRunner):
|
|
|
|
|
|
|
|
class DeleteReplicaSourceResourcesTask(base.TaskRunner):
|
|
class DeleteReplicaSourceResourcesTask(base.TaskRunner):
|
|
|
|
|
|
|
|
- @property
|
|
|
|
|
- def required_task_info_properties(self):
|
|
|
|
|
|
|
+ @classmethod
|
|
|
|
|
+ def get_required_platform(cls):
|
|
|
|
|
+ return constants.TASK_PLATFORM_SOURCE
|
|
|
|
|
+
|
|
|
|
|
+ @classmethod
|
|
|
|
|
+ def get_required_task_info_properties(cls):
|
|
|
return ["source_environment", "source_resources"]
|
|
return ["source_environment", "source_resources"]
|
|
|
|
|
|
|
|
- @property
|
|
|
|
|
- def returned_task_info_properties(self):
|
|
|
|
|
|
|
+ @classmethod
|
|
|
|
|
+ def get_returned_task_info_properties(cls):
|
|
|
return ["source_resources", "source_resources_connection_info"]
|
|
return ["source_resources", "source_resources_connection_info"]
|
|
|
|
|
|
|
|
|
|
+ @classmethod
|
|
|
|
|
+ def get_required_provider_types(cls):
|
|
|
|
|
+ return {
|
|
|
|
|
+ constants.PROVIDER_PLATFORM_SOURCE: [
|
|
|
|
|
+ constants.PROVIDER_TYPE_REPLICA_EXPORT]
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
def _run(self, ctxt, instance, origin, destination, task_info,
|
|
def _run(self, ctxt, instance, origin, destination, task_info,
|
|
|
event_handler):
|
|
event_handler):
|
|
|
provider = providers_factory.get_provider(
|
|
provider = providers_factory.get_provider(
|
|
@@ -384,16 +474,27 @@ class DeleteReplicaSourceResourcesTask(base.TaskRunner):
|
|
|
|
|
|
|
|
class DeployReplicaTargetResourcesTask(base.TaskRunner):
|
|
class DeployReplicaTargetResourcesTask(base.TaskRunner):
|
|
|
|
|
|
|
|
- @property
|
|
|
|
|
- def required_task_info_properties(self):
|
|
|
|
|
|
|
+ @classmethod
|
|
|
|
|
+ def get_required_platform(cls):
|
|
|
|
|
+ return constants.TASK_PLATFORM_DESTINATION
|
|
|
|
|
+
|
|
|
|
|
+ @classmethod
|
|
|
|
|
+ def get_required_task_info_properties(cls):
|
|
|
return ["export_info", "volumes_info", "target_environment"]
|
|
return ["export_info", "volumes_info", "target_environment"]
|
|
|
|
|
|
|
|
- @property
|
|
|
|
|
- def returned_task_info_properties(self):
|
|
|
|
|
|
|
+ @classmethod
|
|
|
|
|
+ def get_returned_task_info_properties(cls):
|
|
|
return [
|
|
return [
|
|
|
"volumes_info", "target_resources",
|
|
"volumes_info", "target_resources",
|
|
|
"target_resources_connection_info"]
|
|
"target_resources_connection_info"]
|
|
|
|
|
|
|
|
|
|
+ @classmethod
|
|
|
|
|
+ def get_required_provider_types(cls):
|
|
|
|
|
+ return {
|
|
|
|
|
+ constants.PROVIDER_PLATFORM_DESTINATION: [
|
|
|
|
|
+ constants.PROVIDER_TYPE_REPLICA_IMPORT]
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
def _run(self, ctxt, instance, origin, destination, task_info,
|
|
def _run(self, ctxt, instance, origin, destination, task_info,
|
|
|
event_handler):
|
|
event_handler):
|
|
|
target_environment = task_info["target_environment"]
|
|
target_environment = task_info["target_environment"]
|
|
@@ -470,15 +571,26 @@ class DeployReplicaTargetResourcesTask(base.TaskRunner):
|
|
|
|
|
|
|
|
class DeleteReplicaTargetResourcesTask(base.TaskRunner):
|
|
class DeleteReplicaTargetResourcesTask(base.TaskRunner):
|
|
|
|
|
|
|
|
- @property
|
|
|
|
|
- def required_task_info_properties(self):
|
|
|
|
|
|
|
+ @classmethod
|
|
|
|
|
+ def get_required_platform(cls):
|
|
|
|
|
+ return constants.TASK_PLATFORM_DESTINATION
|
|
|
|
|
+
|
|
|
|
|
+ @classmethod
|
|
|
|
|
+ def get_required_task_info_properties(cls):
|
|
|
return ["target_resources", "target_environment"]
|
|
return ["target_resources", "target_environment"]
|
|
|
|
|
|
|
|
- @property
|
|
|
|
|
- def returned_task_info_properties(self):
|
|
|
|
|
|
|
+ @classmethod
|
|
|
|
|
+ def get_returned_task_info_properties(cls):
|
|
|
return [
|
|
return [
|
|
|
"target_resources", "target_resources_connection_info"]
|
|
"target_resources", "target_resources_connection_info"]
|
|
|
|
|
|
|
|
|
|
+ @classmethod
|
|
|
|
|
+ def get_required_provider_types(cls):
|
|
|
|
|
+ return {
|
|
|
|
|
+ constants.PROVIDER_PLATFORM_DESTINATION: [
|
|
|
|
|
+ constants.PROVIDER_TYPE_REPLICA_IMPORT]
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
def _run(self, ctxt, instance, origin, destination, task_info,
|
|
def _run(self, ctxt, instance, origin, destination, task_info,
|
|
|
event_handler):
|
|
event_handler):
|
|
|
provider = providers_factory.get_provider(
|
|
provider = providers_factory.get_provider(
|
|
@@ -500,14 +612,25 @@ class DeleteReplicaTargetResourcesTask(base.TaskRunner):
|
|
|
|
|
|
|
|
class DeployReplicaInstanceResourcesTask(base.TaskRunner):
|
|
class DeployReplicaInstanceResourcesTask(base.TaskRunner):
|
|
|
|
|
|
|
|
- @property
|
|
|
|
|
- def required_task_info_properties(self):
|
|
|
|
|
|
|
+ @classmethod
|
|
|
|
|
+ def get_required_platform(cls):
|
|
|
|
|
+ return constants.TASK_PLATFORM_DESTINATION
|
|
|
|
|
+
|
|
|
|
|
+ @classmethod
|
|
|
|
|
+ def get_required_task_info_properties(cls):
|
|
|
return ["export_info", "target_environment", "clone_disks"]
|
|
return ["export_info", "target_environment", "clone_disks"]
|
|
|
|
|
|
|
|
- @property
|
|
|
|
|
- def returned_task_info_properties(self):
|
|
|
|
|
|
|
+ @classmethod
|
|
|
|
|
+ def get_returned_task_info_properties(cls):
|
|
|
return ["instance_deployment_info"]
|
|
return ["instance_deployment_info"]
|
|
|
|
|
|
|
|
|
|
+ @classmethod
|
|
|
|
|
+ def get_required_provider_types(cls):
|
|
|
|
|
+ return {
|
|
|
|
|
+ constants.PROVIDER_PLATFORM_DESTINATION: [
|
|
|
|
|
+ constants.PROVIDER_TYPE_REPLICA_IMPORT]
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
def _run(self, ctxt, instance, origin, destination, task_info,
|
|
def _run(self, ctxt, instance, origin, destination, task_info,
|
|
|
event_handler):
|
|
event_handler):
|
|
|
target_environment = task_info["target_environment"]
|
|
target_environment = task_info["target_environment"]
|
|
@@ -533,14 +656,25 @@ class DeployReplicaInstanceResourcesTask(base.TaskRunner):
|
|
|
|
|
|
|
|
class FinalizeReplicaInstanceDeploymentTask(base.TaskRunner):
|
|
class FinalizeReplicaInstanceDeploymentTask(base.TaskRunner):
|
|
|
|
|
|
|
|
- @property
|
|
|
|
|
- def required_task_info_properties(self):
|
|
|
|
|
|
|
+ @classmethod
|
|
|
|
|
+ def get_required_platform(cls):
|
|
|
|
|
+ return constants.TASK_PLATFORM_DESTINATION
|
|
|
|
|
+
|
|
|
|
|
+ @classmethod
|
|
|
|
|
+ def get_required_task_info_properties(cls):
|
|
|
return ["target_environment", "instance_deployment_info"]
|
|
return ["target_environment", "instance_deployment_info"]
|
|
|
|
|
|
|
|
- @property
|
|
|
|
|
- def returned_task_info_properties(self):
|
|
|
|
|
|
|
+ @classmethod
|
|
|
|
|
+ def get_returned_task_info_properties(cls):
|
|
|
return ["transfer_result"]
|
|
return ["transfer_result"]
|
|
|
|
|
|
|
|
|
|
+ @classmethod
|
|
|
|
|
+ def get_required_provider_types(cls):
|
|
|
|
|
+ return {
|
|
|
|
|
+ constants.PROVIDER_PLATFORM_DESTINATION: [
|
|
|
|
|
+ constants.PROVIDER_TYPE_REPLICA_IMPORT]
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
def _run(self, ctxt, instance, origin, destination, task_info,
|
|
def _run(self, ctxt, instance, origin, destination, task_info,
|
|
|
event_handler):
|
|
event_handler):
|
|
|
provider = providers_factory.get_provider(
|
|
provider = providers_factory.get_provider(
|
|
@@ -564,14 +698,25 @@ class FinalizeReplicaInstanceDeploymentTask(base.TaskRunner):
|
|
|
|
|
|
|
|
class CleanupFailedReplicaInstanceDeploymentTask(base.TaskRunner):
|
|
class CleanupFailedReplicaInstanceDeploymentTask(base.TaskRunner):
|
|
|
|
|
|
|
|
- @property
|
|
|
|
|
- def required_task_info_properties(self):
|
|
|
|
|
|
|
+ @classmethod
|
|
|
|
|
+ def get_required_platform(cls):
|
|
|
|
|
+ return constants.TASK_PLATFORM_DESTINATION
|
|
|
|
|
+
|
|
|
|
|
+ @classmethod
|
|
|
|
|
+ def get_required_task_info_properties(cls):
|
|
|
return ["target_environment", "instance_deployment_info"]
|
|
return ["target_environment", "instance_deployment_info"]
|
|
|
|
|
|
|
|
- @property
|
|
|
|
|
- def returned_task_info_properties(self):
|
|
|
|
|
|
|
+ @classmethod
|
|
|
|
|
+ def get_returned_task_info_properties(cls):
|
|
|
return ["instance_deployment_info"]
|
|
return ["instance_deployment_info"]
|
|
|
|
|
|
|
|
|
|
+ @classmethod
|
|
|
|
|
+ def get_required_provider_types(cls):
|
|
|
|
|
+ return {
|
|
|
|
|
+ constants.PROVIDER_PLATFORM_DESTINATION: [
|
|
|
|
|
+ constants.PROVIDER_TYPE_REPLICA_IMPORT]
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
def _run(self, ctxt, instance, origin, destination, task_info,
|
|
def _run(self, ctxt, instance, origin, destination, task_info,
|
|
|
event_handler):
|
|
event_handler):
|
|
|
provider = providers_factory.get_provider(
|
|
provider = providers_factory.get_provider(
|
|
@@ -591,14 +736,25 @@ class CleanupFailedReplicaInstanceDeploymentTask(base.TaskRunner):
|
|
|
|
|
|
|
|
class CreateReplicaDiskSnapshotsTask(base.TaskRunner):
|
|
class CreateReplicaDiskSnapshotsTask(base.TaskRunner):
|
|
|
|
|
|
|
|
- @property
|
|
|
|
|
- def required_task_info_properties(self):
|
|
|
|
|
|
|
+ @classmethod
|
|
|
|
|
+ def get_required_platform(cls):
|
|
|
|
|
+ return constants.TASK_PLATFORM_DESTINATION
|
|
|
|
|
+
|
|
|
|
|
+ @classmethod
|
|
|
|
|
+ def get_required_task_info_properties(cls):
|
|
|
return ["target_environment", "export_info", "volumes_info"]
|
|
return ["target_environment", "export_info", "volumes_info"]
|
|
|
|
|
|
|
|
- @property
|
|
|
|
|
- def returned_task_info_properties(self):
|
|
|
|
|
|
|
+ @classmethod
|
|
|
|
|
+ def get_returned_task_info_properties(cls):
|
|
|
return ["volumes_info"]
|
|
return ["volumes_info"]
|
|
|
|
|
|
|
|
|
|
+ @classmethod
|
|
|
|
|
+ def get_required_provider_types(cls):
|
|
|
|
|
+ return {
|
|
|
|
|
+ constants.PROVIDER_PLATFORM_DESTINATION: [
|
|
|
|
|
+ constants.PROVIDER_TYPE_REPLICA_IMPORT]
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
def _run(self, ctxt, instance, origin, destination, task_info,
|
|
def _run(self, ctxt, instance, origin, destination, task_info,
|
|
|
event_handler):
|
|
event_handler):
|
|
|
provider = providers_factory.get_provider(
|
|
provider = providers_factory.get_provider(
|
|
@@ -624,14 +780,25 @@ class CreateReplicaDiskSnapshotsTask(base.TaskRunner):
|
|
|
|
|
|
|
|
class DeleteReplicaTargetDiskSnapshotsTask(base.TaskRunner):
|
|
class DeleteReplicaTargetDiskSnapshotsTask(base.TaskRunner):
|
|
|
|
|
|
|
|
- @property
|
|
|
|
|
- def required_task_info_properties(self):
|
|
|
|
|
|
|
+ @classmethod
|
|
|
|
|
+ def get_required_platform(cls):
|
|
|
|
|
+ return constants.TASK_PLATFORM_DESTINATION
|
|
|
|
|
+
|
|
|
|
|
+ @classmethod
|
|
|
|
|
+ def get_required_task_info_properties(cls):
|
|
|
return ["target_environment", "export_info", "volumes_info"]
|
|
return ["target_environment", "export_info", "volumes_info"]
|
|
|
|
|
|
|
|
- @property
|
|
|
|
|
- def returned_task_info_properties(self):
|
|
|
|
|
|
|
+ @classmethod
|
|
|
|
|
+ def get_returned_task_info_properties(cls):
|
|
|
return ["volumes_info"]
|
|
return ["volumes_info"]
|
|
|
|
|
|
|
|
|
|
+ @classmethod
|
|
|
|
|
+ def get_required_provider_types(cls):
|
|
|
|
|
+ return {
|
|
|
|
|
+ constants.PROVIDER_PLATFORM_DESTINATION: [
|
|
|
|
|
+ constants.PROVIDER_TYPE_REPLICA_IMPORT]
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
def _run(self, ctxt, instance, origin, destination, task_info,
|
|
def _run(self, ctxt, instance, origin, destination, task_info,
|
|
|
event_handler):
|
|
event_handler):
|
|
|
export_info = task_info['export_info']
|
|
export_info = task_info['export_info']
|
|
@@ -657,14 +824,25 @@ class DeleteReplicaTargetDiskSnapshotsTask(base.TaskRunner):
|
|
|
|
|
|
|
|
class RestoreReplicaDiskSnapshotsTask(base.TaskRunner):
|
|
class RestoreReplicaDiskSnapshotsTask(base.TaskRunner):
|
|
|
|
|
|
|
|
- @property
|
|
|
|
|
- def required_task_info_properties(self):
|
|
|
|
|
|
|
+ @classmethod
|
|
|
|
|
+ def get_required_platform(cls):
|
|
|
|
|
+ return constants.TASK_PLATFORM_DESTINATION
|
|
|
|
|
+
|
|
|
|
|
+ @classmethod
|
|
|
|
|
+ def get_required_task_info_properties(cls):
|
|
|
return ["target_environment", "export_info", "volumes_info"]
|
|
return ["target_environment", "export_info", "volumes_info"]
|
|
|
|
|
|
|
|
- @property
|
|
|
|
|
- def returned_task_info_properties(self):
|
|
|
|
|
|
|
+ @classmethod
|
|
|
|
|
+ def get_returned_task_info_properties(cls):
|
|
|
return ["volumes_info"]
|
|
return ["volumes_info"]
|
|
|
|
|
|
|
|
|
|
+ @classmethod
|
|
|
|
|
+ def get_required_provider_types(cls):
|
|
|
|
|
+ return {
|
|
|
|
|
+ constants.PROVIDER_PLATFORM_DESTINATION: [
|
|
|
|
|
+ constants.PROVIDER_TYPE_REPLICA_IMPORT]
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
def _run(self, ctxt, instance, origin, destination, task_info,
|
|
def _run(self, ctxt, instance, origin, destination, task_info,
|
|
|
event_handler):
|
|
event_handler):
|
|
|
provider = providers_factory.get_provider(
|
|
provider = providers_factory.get_provider(
|
|
@@ -690,14 +868,25 @@ class RestoreReplicaDiskSnapshotsTask(base.TaskRunner):
|
|
|
|
|
|
|
|
class ValidateReplicaExecutionSourceInputsTask(base.TaskRunner):
|
|
class ValidateReplicaExecutionSourceInputsTask(base.TaskRunner):
|
|
|
|
|
|
|
|
- @property
|
|
|
|
|
- def required_task_info_properties(self):
|
|
|
|
|
|
|
+ @classmethod
|
|
|
|
|
+ def get_required_platform(cls):
|
|
|
|
|
+ return constants.TASK_PLATFORM_SOURCE
|
|
|
|
|
+
|
|
|
|
|
+ @classmethod
|
|
|
|
|
+ def get_required_task_info_properties(cls):
|
|
|
return ["source_environment"]
|
|
return ["source_environment"]
|
|
|
|
|
|
|
|
- @property
|
|
|
|
|
- def returned_task_info_properties(self):
|
|
|
|
|
|
|
+ @classmethod
|
|
|
|
|
+ def get_returned_task_info_properties(cls):
|
|
|
return []
|
|
return []
|
|
|
|
|
|
|
|
|
|
+ @classmethod
|
|
|
|
|
+ def get_required_provider_types(cls):
|
|
|
|
|
+ return {
|
|
|
|
|
+ constants.PROVIDER_PLATFORM_SOURCE: [
|
|
|
|
|
+ constants.PROVIDER_TYPE_VALIDATE_REPLICA_EXPORT]
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
def _run(self, ctxt, instance, origin, destination, task_info,
|
|
def _run(self, ctxt, instance, origin, destination, task_info,
|
|
|
event_handler):
|
|
event_handler):
|
|
|
event_manager = events.EventManager(event_handler)
|
|
event_manager = events.EventManager(event_handler)
|
|
@@ -720,14 +909,25 @@ class ValidateReplicaExecutionSourceInputsTask(base.TaskRunner):
|
|
|
|
|
|
|
|
class ValidateReplicaExecutionDestinationInputsTask(base.TaskRunner):
|
|
class ValidateReplicaExecutionDestinationInputsTask(base.TaskRunner):
|
|
|
|
|
|
|
|
- @property
|
|
|
|
|
- def required_task_info_properties(self):
|
|
|
|
|
|
|
+ @classmethod
|
|
|
|
|
+ def get_required_platform(cls):
|
|
|
|
|
+ return constants.TASK_PLATFORM_DESTINATION
|
|
|
|
|
+
|
|
|
|
|
+ @classmethod
|
|
|
|
|
+ def get_required_task_info_properties(cls):
|
|
|
return ["export_info", "target_environment"]
|
|
return ["export_info", "target_environment"]
|
|
|
|
|
|
|
|
- @property
|
|
|
|
|
- def returned_task_info_properties(self):
|
|
|
|
|
|
|
+ @classmethod
|
|
|
|
|
+ def get_returned_task_info_properties(cls):
|
|
|
return []
|
|
return []
|
|
|
|
|
|
|
|
|
|
+ @classmethod
|
|
|
|
|
+ def get_required_provider_types(cls):
|
|
|
|
|
+ return {
|
|
|
|
|
+ constants.PROVIDER_PLATFORM_DESTINATION: [
|
|
|
|
|
+ constants.PROVIDER_TYPE_VALIDATE_REPLICA_IMPORT]
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
def _validate_provider_replica_import_input(
|
|
def _validate_provider_replica_import_input(
|
|
|
self, provider, ctxt, conn_info, target_environment, export_info):
|
|
self, provider, ctxt, conn_info, target_environment, export_info):
|
|
|
provider.validate_replica_import_input(
|
|
provider.validate_replica_import_input(
|
|
@@ -769,14 +969,25 @@ class ValidateReplicaExecutionDestinationInputsTask(base.TaskRunner):
|
|
|
|
|
|
|
|
class ValidateReplicaDeploymentParametersTask(base.TaskRunner):
|
|
class ValidateReplicaDeploymentParametersTask(base.TaskRunner):
|
|
|
|
|
|
|
|
- @property
|
|
|
|
|
- def required_task_info_properties(self):
|
|
|
|
|
|
|
+ @classmethod
|
|
|
|
|
+ def get_required_platform(cls):
|
|
|
|
|
+ return constants.TASK_PLATFORM_DESTINATION
|
|
|
|
|
+
|
|
|
|
|
+ @classmethod
|
|
|
|
|
+ def get_required_task_info_properties(cls):
|
|
|
return ["export_info", "target_environment"]
|
|
return ["export_info", "target_environment"]
|
|
|
|
|
|
|
|
- @property
|
|
|
|
|
- def returned_task_info_properties(self):
|
|
|
|
|
|
|
+ @classmethod
|
|
|
|
|
+ def get_returned_task_info_properties(cls):
|
|
|
return []
|
|
return []
|
|
|
|
|
|
|
|
|
|
+ @classmethod
|
|
|
|
|
+ def get_required_provider_types(cls):
|
|
|
|
|
+ return {
|
|
|
|
|
+ constants.PROVIDER_PLATFORM_DESTINATION: [
|
|
|
|
|
+ constants.PROVIDER_TYPE_VALIDATE_REPLICA_IMPORT]
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
def _run(self, ctxt, instance, origin, destination, task_info,
|
|
def _run(self, ctxt, instance, origin, destination, task_info,
|
|
|
event_handler):
|
|
event_handler):
|
|
|
event_manager = events.EventManager(event_handler)
|
|
event_manager = events.EventManager(event_handler)
|
|
@@ -811,14 +1022,25 @@ class ValidateReplicaDeploymentParametersTask(base.TaskRunner):
|
|
|
|
|
|
|
|
class UpdateSourceReplicaTask(base.TaskRunner):
|
|
class UpdateSourceReplicaTask(base.TaskRunner):
|
|
|
|
|
|
|
|
- @property
|
|
|
|
|
- def required_task_info_properties(self):
|
|
|
|
|
|
|
+ @classmethod
|
|
|
|
|
+ def get_required_platform(cls):
|
|
|
|
|
+ return constants.TASK_PLATFORM_SOURCE
|
|
|
|
|
+
|
|
|
|
|
+ @classmethod
|
|
|
|
|
+ def get_required_task_info_properties(cls):
|
|
|
return ["volumes_info", "source_environment"]
|
|
return ["volumes_info", "source_environment"]
|
|
|
|
|
|
|
|
- @property
|
|
|
|
|
- def returned_task_info_properties(self):
|
|
|
|
|
|
|
+ @classmethod
|
|
|
|
|
+ def get_returned_task_info_properties(cls):
|
|
|
return ["volumes_info", "source_environment"]
|
|
return ["volumes_info", "source_environment"]
|
|
|
|
|
|
|
|
|
|
+ @classmethod
|
|
|
|
|
+ def get_required_provider_types(cls):
|
|
|
|
|
+ return {
|
|
|
|
|
+ constants.PROVIDER_PLATFORM_SOURCE: [
|
|
|
|
|
+ constants.PROVIDER_TYPE_SOURCE_REPLICA_UPDATE]
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
def _run(self, ctxt, instance, origin, destination, task_info,
|
|
def _run(self, ctxt, instance, origin, destination, task_info,
|
|
|
event_handler):
|
|
event_handler):
|
|
|
event_manager = events.EventManager(event_handler)
|
|
event_manager = events.EventManager(event_handler)
|
|
@@ -868,14 +1090,25 @@ class UpdateSourceReplicaTask(base.TaskRunner):
|
|
|
|
|
|
|
|
class UpdateDestinationReplicaTask(base.TaskRunner):
|
|
class UpdateDestinationReplicaTask(base.TaskRunner):
|
|
|
|
|
|
|
|
- @property
|
|
|
|
|
- def required_task_info_properties(self):
|
|
|
|
|
|
|
+ @classmethod
|
|
|
|
|
+ def get_required_platform(cls):
|
|
|
|
|
+ return constants.TASK_PLATFORM_DESTINATION
|
|
|
|
|
+
|
|
|
|
|
+ @classmethod
|
|
|
|
|
+ def get_required_task_info_properties(cls):
|
|
|
return ["export_info", "volumes_info", "target_environment"]
|
|
return ["export_info", "volumes_info", "target_environment"]
|
|
|
|
|
|
|
|
- @property
|
|
|
|
|
- def returned_task_info_properties(self):
|
|
|
|
|
|
|
+ @classmethod
|
|
|
|
|
+ def get_returned_task_info_properties(cls):
|
|
|
return ["volumes_info", "target_environment"]
|
|
return ["volumes_info", "target_environment"]
|
|
|
|
|
|
|
|
|
|
+ @classmethod
|
|
|
|
|
+ def get_required_provider_types(cls):
|
|
|
|
|
+ return {
|
|
|
|
|
+ constants.PROVIDER_PLATFORM_DESTINATION: [
|
|
|
|
|
+ constants.PROVIDER_TYPE_DESTINATION_REPLICA_UPDATE]
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
def _run(self, ctxt, instance, origin, destination, task_info,
|
|
def _run(self, ctxt, instance, origin, destination, task_info,
|
|
|
event_handler):
|
|
event_handler):
|
|
|
event_manager = events.EventManager(event_handler)
|
|
event_manager = events.EventManager(event_handler)
|