Beispiel #1
0
    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}
Beispiel #2
0
 def register_snapshot_as_an_image_from_snapshot_detail_page(self, snapshot_id, image_name, description=None,
                                                             delete_on_terminate=True,
                                                             register_as_windows_image=False
                                                             ):
     BasePage(self).goto_snapshots_view_via_menu()
     SnapshotLanding(self).goto_snapshot_detail_page_via_link(snapshot_id)
     SnapshotDetailPage(self).click_action_register_as_image_on_detail_page()
     RegisterSnapshotAsImageModal(self).register_as_image(name=image_name, description=description,
                                                          delete_on_terminate=delete_on_terminate,
                                                          register_as_windows_image=register_as_windows_image)
     if ImageDetailPage(self).is_image_detail_page_loaded():
         image_id = ImageDetailPage(self).get_image_id()
         image = {'image_name': image_name, 'image_id': image_id}
     else:
         BasePage(self).goto_images_view_via_menu()
         image_id = ImageLanding(self).get_image_id_by_name(image_name)
         image = {'image_name': image_name, 'image_id': image_id}
     print image
     return image
Beispiel #3
0
 def remove_image_from_cloud_on_images_lp(self, image_id, delete_associated_snapshot=False):
     BasePage(self).goto_images_view_via_menu()
     ImageLanding(self).click_action_remove_image_from_cloud(image_id)
     RemoveImageFromCloudDialog(self).remove_image(delete_associated_snapshot)
Beispiel #4
0
 def goto_images_page_via_nav(self):
     BasePage(self).goto_images_view_via_menu()
     ImageLanding(self)