Source code for models_v2.recover_azure_vm_params

# -*- coding: utf-8 -*-

import cohesity_management_sdk.models_v2.recover_protection_group_run_params
import cohesity_management_sdk.models_v2.azure_target_params

[docs]class RecoverAzureVMParams(object): """Implementation of the 'Recover Azure VM params.' model. Specifies the parameters to recover Azure VM. Attributes: recover_protection_group_runs_params (list of RecoverProtectionGroupRunParams): Specifies the Protection Group Runs params to recover. All the VM's that are successfully backed up by specified Runs will be recovered. This can be specified along with individual snapshots of VMs. User has to make sure that specified Object snapshots and Protection Group Runs should not have any intersection. For example, user cannot specify multiple Runs which has same Object or an Object snapshot and a Run which has same Object's snapshot. target_environment (string): Specifies the environment of the recovery target. The corresponding params below must be filled out. azure_target_params (AzureTargetParams): Specifies the params for recovering to an Azure target. """ # Create a mapping from Model property names to API property names _names = { "target_environment":'targetEnvironment', "recover_protection_group_runs_params":'recoverProtectionGroupRunsParams', "azure_target_params":'azureTargetParams' } def __init__(self, target_environment='kAzure', recover_protection_group_runs_params=None, azure_target_params=None): """Constructor for the RecoverAzureVMParams class""" # Initialize members of the class self.recover_protection_group_runs_params = recover_protection_group_runs_params self.target_environment = target_environment self.azure_target_params = azure_target_params
[docs] @classmethod def from_dictionary(cls, dictionary): """Creates an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object as obtained from the deserialization of the server's response. The keys MUST match property names in the API description. Returns: object: An instance of this structure class. """ if dictionary is None: return None # Extract variables from the dictionary target_environment = dictionary.get("targetEnvironment") if dictionary.get("targetEnvironment") else 'kAzure' recover_protection_group_runs_params = None if dictionary.get('recoverProtectionGroupRunsParams') != None: recover_protection_group_runs_params = list() for structure in dictionary.get('recoverProtectionGroupRunsParams'): recover_protection_group_runs_params.append(cohesity_management_sdk.models_v2.recover_protection_group_run_params.RecoverProtectionGroupRunParams.from_dictionary(structure)) azure_target_params = cohesity_management_sdk.models_v2.azure_target_params.AzureTargetParams.from_dictionary(dictionary.get('azureTargetParams')) if dictionary.get('azureTargetParams') else None # Return an object of this model return cls(target_environment, recover_protection_group_runs_params, azure_target_params)