def delete_snapshot_from_landing_page(self, snapshot_id): """ Navigates to landing page, deletes snapshot, verifies snapshot is gone from landing page. :param snapshot_id: """ BasePage(self).goto_snapshots_view_via_menu() SnapshotLanding(self).click_action_delete_snapshot_on_view_page(snapshot_id) DeleteSnapshotModal(self).delete_snapshot() SnapshotLanding(self).verify_snapshot_not_present(snapshot_id)
def verify_snapshot_not_present_on_lp(self, snapshot_id): """ Navigates to snapshot landing page. Verifies snapshot not on landing page :param snapshot_id: """ BasePage(self).goto_snapshots_view_via_menu() SnapshotLanding(self).verify_snapshot_not_present(snapshot_id)
def register_snapshot_as_an_image_from_snapshot_landing_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).click_action_register_as_image(snapshot_id) RegisterSnapshotAsImageModal(self).register_as_image(name=image_name, description=description, delete_on_terminate=delete_on_terminate, register_as_windows_image=register_as_windows_image) image_id = ImageDetailPage(self).get_image_id() image = {'image_name': image_name, 'image_id': image_id} print image return image
def create_snapshot_on_snapshot_view_page(self, volume_id, snapshot_name=None, snapshot_description=None, timeout_in_seconds=240): """ Navigates to snapshot landing page, creates snapshot. :param volume_id: :param snapshot_name: :param snapshot_description: :param timeout_in_seconds: """ BasePage(self).goto_snapshots_view_via_menu() SnapshotLanding(self).click_create_snapshot_btn_on_view_page() CreateSnapshotPage(self).create_snapshot(volume_id=volume_id, snapshot_name=snapshot_name, snapshot_description=snapshot_description) snapshot = SnapshotDetailPage(self).get_snapshot_name_and_id(snapshot_name) SnapshotDetailPage(self).verify_snapshot_status_is_completed(timeout_in_seconds) print snapshot return snapshot
def create_volume_from_snapshot_on_snapshot_lp(self, snapshot_id, volume_name=None, availability_zone=None, volume_size=None, timeout_in_seconds=240): """ Navigates to snapshot landing page. Goes to "create volume from snapshot" in the actions menu. Creates volume from snapshot. :param snapshot_id: :param volume_name: :param availability_zone: :param volume_size: :param timeout_in_seconds: """ BasePage(self).goto_snapshots_view_via_menu() SnapshotLanding(self).click_action_create_volume_from_snapshot(snapshot_id) CreateVolumeDialog(self).create_volume(volume_name, volume_size=volume_size, availability_zone=availability_zone, timeout_in_seconds=timeout_in_seconds) VolumeDetailPage(self).verify_volume_status_is_available(timeout_in_seconds=timeout_in_seconds) volume = VolumeDetailPage(self).get_volume_name_and_id() print volume return volume