cloudendure.cloudendure
Define the CloudEndure main entry logic.
CloudEndure
CloudEndure(self, project_name: 'str' = '', dry_run: 'bool' = False, username: 'str' = '', password: 'str' = '', token: 'str' = '') -> 'None'
Define the CloudEndure general object.
get_project_id
CloudEndure.get_project_id(self, project_name: 'str' = '') -> '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.
check
CloudEndure.check(self) -> 'bool'
Check the status of machines in the provided project.
update_encryption_key
CloudEndure.update_encryption_key(self, kms_id: 'str') -> 'bool'
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.
update_blueprint
CloudEndure.update_blueprint(self) -> 'bool'
Update the blueprint associated with the specified machines.
launch
CloudEndure.launch(self) -> 'Dict[str, Any]'
Launch the test target instances.
status
CloudEndure.status(self) -> 'bool'
Get the status of machines in the current wave.
execute
CloudEndure.execute(self) -> 'bool'
Start the migration project my checking and launching the migration wave.
share_image
CloudEndure.share_image(self, image_id: 'str', image_name: 'str' = 'CloudEndureImage') -> 'bool'
Share the generated AMIs to the provided destination account.
create_ami
CloudEndure.create_ami(self) -> 'Dict[str, str]'
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(self, image_id: 'str') -> '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(self, image_id: 'str') -> 'Dict[str, Any]'
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(self, 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') -> 'str'
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(self) -> 'bool'
Terminate the launched machine(s).
Returns: bool: Whether cleanup was successful.
delete_image
CloudEndure.delete_image(self, image_id: 'str') -> 'bool'
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() -> 'None'
Define the main entry method for the CLI.