def launch_instance_from_image_view_page(self, image_id_or_type, availability_zone = None, instance_type="t1.micro", number_of_of_instances = None, instance_name = None, key_name = "None (advanced option)", security_group = "default", user_data=None, monitoring=False, private_addressing=False, timeout_in_seconds=480): """ Navigates to image view page via menu. Launches instance from given image. :param image_id_or_type: :param availability_zone: :param instance_type: :param number_of_of_instances: :param instance_name: :param key_name: :param security_group: :param user_data: :param monitoring: :param private_addressing: """ BasePage(self).goto_images_view_via_menu() ImageLanding(self).click_action_launch_instance(image_id_or_type) LaunchInstanceWizard(self).launch_instance_step2(availability_zone, instance_type, number_of_of_instances, instance_name, key_name, security_group, user_data, monitoring, private_addressing) instance_id = InstanceLanding(self).get_id_of_newly_launched_instance() InstanceLanding(self).goto_instance_detail_page_via_link(instance_id) InstanceDetailPage(self, instance_id, instance_name).verify_instance_is_in_running_state(timeout_in_seconds=timeout_in_seconds) return {'instance_name': instance_name, 'instance_id':instance_id}
def launch_instance_from_instance_view_page(self, image = "centos",availability_zone = None, instance_type = "t1.micro: 1 CPUs, 256 memory (MB), 5 disk (GB,root device)", number_of_of_instances = None, instance_name = None, key_name = "None (advanced option)", security_group = "default", user_data=None, monitoring=False, private_addressing=False): """ Navigates to instance view page via menu. Launches instance. :param image: :param availability_zone: :param instance_type: :param number_of_of_instances: :param instance_name: :param key_name: :param security_group: :param user_data: :param monitoring: :param private_addressing: """ BasePage(self).goto_instances_via_menu() InstanceView(self).click_action_launch_instance_on_view_page() LaunchInstanceWizard(self).launch_instance(image, availability_zone, instance_type, number_of_of_instances, instance_name, key_name, security_group, user_data, monitoring, private_addressing) instance_id = InstanceView(self).get_id_of_newly_launched_instance() InstanceView(self).goto_instance_detail_page_via_link(instance_id) InstanceDetailPage(self, instance_id, instance_name).verify_instance_is_in_running_state() return {'instance_name': instance_name, 'instance_id':instance_id}