cloudendure.cloudendure

Define the CloudEndure main entry logic.

CloudEndure

CloudEndure(self,
            project_name: 'str' = '',
            dry_run: 'bool' = False,
            username: 'str' = '',
            password: 'str' = '',
            token: 'str' = '')

Define the CloudEndure general object.

version

Display the CloudEndure module version.

Returns: str: The CloudEndure Python module version.

get_project_id

CloudEndure.get_project_id(project_name: 'str' = '')

Get the associated CloudEndure project ID by project_name.

Args: project_name (str): The name of the CloudEndure project.

Exceptions: Exception: Currently catch all encountered exceptions while traversing the project list API call.

Returns: str: The CloudEndure project UUID.

get_cloud

CloudEndure.get_cloud(cloud_type: 'str' = '')

Get the ID for the specified cloud type.

create_cloud_credentials

CloudEndure.create_cloud_credentials(access_key: 'str' = '',
                                     secret_key: 'str' = '')

Create a new CloudEndure project.

Args: project_name (str): The name of the CloudEndure project to be created.

Returns: str: The newly created CloudEndure project ID.

create_repl_config

CloudEndure.create_repl_config(region: 'str' = '',
                               cloud_cred_id: 'str' = '')

Create a CloudEndure project replication configuration.

Args: project_name (str): The name of the CloudEndure project to get replication configurations for.

Returns: list of dict: The CloudEndure replication configuration dictionary mapping.

get_repl_configs

CloudEndure.get_repl_configs()

Get a CloudEndure project's replication configurations.

Args: project_name (str): The name of the CloudEndure project to get replication configurations for.

Returns: list of dict: The CloudEndure replication configuration dictionary mapping.

create_project

CloudEndure.create_project(project_name: 'str')

Create a new CloudEndure project.

Args: project_name (str): The name of the CloudEndure project to be created.

Returns: str: The newly created CloudEndure project ID.

update_project

CloudEndure.update_project(project_data: 'Dict[str, Any]' = None)

Update a CloudEndure project.

Args: project_name (str): The name of the CloudEndure project to be updated. project_data (dict): The project payload to be used to update the project. Defaults to the current project state.

Returns: bool: Whether or not the project has been updated.

check

CloudEndure.check()

Check the status of machines in the provided project.

update_encryption_key

CloudEndure.update_encryption_key(kms_id: 'str')

Update encryption keys for replication.

Warning: This will cause re-sync if key does not match!

Args: kms_id (str): The AWS KMD ID to update the project to use. project_name (str): The name of the CloudEndure project to be updated. dry_run (bool): Whether or not this execution should be a dry run, making no actual changes to CloudEndure for validation purposes.

Returns: bool: Whether or not the encryption key was updated.

check_licenses

CloudEndure.check_licenses()

Check licenses for all available instances in a given project.

get_machine_sync_details

CloudEndure.get_machine_sync_details()

Checks CloudEndure Project inventory and returns register machine replication state.

update_blueprint

CloudEndure.update_blueprint()

Update the blueprint associated with the specified machines.

launch

CloudEndure.launch()

Launch the test target instances.

status

CloudEndure.status()

Get the status of machines in the current wave.

execute

CloudEndure.execute()

Start the migration project my checking and launching the migration wave.

replication

CloudEndure.replication(action: 'str', machine_ids: 'str' = '')

Handle replication actions.

share_image

CloudEndure.share_image(image_id: 'str',
                        image_name: 'str' = 'CloudEndureImage')

Share the generated AMIs to the provided destination account.

create_ami

CloudEndure.create_ami()

Create an AMI from the specified instances.

Args: project_name (str): The name of the CloudEndure project.

Returns: bool: Whether or not the AMI creation was successful.

copy_image

CloudEndure.copy_image(image_id: 'str')

Copy a shared image to an account.

Args: image_id (str): The AWS AMI to be copied.

Returns: str: The copied AWS AMI ID.

split_image

CloudEndure.split_image(image_id: 'str')

Split the image into a root drive only AMI and a collection of snapshots.

Args: image_id (str): The AWS AMI to be copied.

Returns: dict: The mapping of AWS EBS block devices.

gen_terraform

CloudEndure.gen_terraform(image_id: 'str',
                          name: 'str' = 'INSTANCENAME',
                          subnet_id: 'str' = 'SUBNET_ID',
                          private_ip: 'str' = 'PRIVATE_IP',
                          keypair: 'str' = 'KEYPAIR',
                          security_group: 'str' = 'SECURITY_GROUP',
                          tagging_module: 'str' = 'tagging_module')

Generate Terraform for a given split image.

Args: image_id (str): The split AMI ID to be referenced. name (str): The name of the instance to be generated. subnet_id (str): The AWS VPC Subnet ID to be referenced. private_id (str): The internal IP address to associate with the AWS ENI. keypair (str): The AWS EC2 keypair name to be referenced. security_group (str): The AWS security group ID to be referenced.

Returns: str: The raw Terraform with volume, ENI, and EC2 instance templates.

terminate

CloudEndure.terminate()

Terminate the launched machine(s).

Returns: bool: Whether cleanup was successful.

delete_image

CloudEndure.delete_image(image_id: 'str')

Remove the AMI and snapshots.

Args: image_id (str): The AWS AMI to be deleted.

Returns: bool: Whether the AMI deletion was requested successfully.

main

main()

Define the main entry method for the CLI.