當前位置: 首頁>>代碼示例>>Python>>正文


Python GuiOps.create_keypair_from_dashboard方法代碼示例

本文整理匯總了Python中guiops.guiops.GuiOps.create_keypair_from_dashboard方法的典型用法代碼示例。如果您正苦於以下問題:Python GuiOps.create_keypair_from_dashboard方法的具體用法?Python GuiOps.create_keypair_from_dashboard怎麽用?Python GuiOps.create_keypair_from_dashboard使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在guiops.guiops.GuiOps的用法示例。


在下文中一共展示了GuiOps.create_keypair_from_dashboard方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: InstanceOperationsSequence

# 需要導入模塊: from guiops.guiops import GuiOps [as 別名]
# 或者: from guiops.guiops.GuiOps import create_keypair_from_dashboard [as 別名]
class InstanceOperationsSequence(GuiOps):
    def __init__(self):
        parser = Option_parser()
        options = parser.parse_options()
        self.console_url = options['console_url']
        self.webdriver_url = options['web_driver']
        self.account = options['account']
        self.user = options['user_name']
        self.password = options['password']
        self.sauce = options['sauce']
        self.browser = options['browser']
        self.version = options['version']
        self.platform = options['platform']
        self.zones = self.get_zones_from_options(options)
        self.zone1 = self.zones.get(0)
        self.tester = GuiOps(console_url=self.console_url, webdriver_url=self.webdriver_url, sauce=self.sauce,
                             browser=self.browser, version=self.version, platform=self.platform)

    def instance_ops_test(self):
        self.tester.login(self.account, self.user, self.password)
        keypair1_name = self.id_generator()+"-key-pair"
        self.tester.create_keypair_from_dashboard(keypair1_name)
        s_group1_name = self.id_generator() + "-group"
        s_group1 = self.tester.create_security_group_from_view_page(
            s_group1_name, "Security group created by instance test")
        s_group1_id = s_group1.get("s_group_id")
        instance1_name = self.id_generator() + "-instance"
        instance1 = self.tester.launch_instance_from_image_view_page(
            image_id_or_type="centos", instance_name=instance1_name,
            instance_type="m1.medium", security_group=s_group1_name, key_name=keypair1_name, timeout_in_seconds=480)
        instance1_id = instance1.get("instance_id")
        instance2_name = self.id_generator() + "-instance"
        instance2 = self.tester.launch_more_like_this_from_view_page(
            instance_id=instance1_id, instance_name=instance2_name, timeout_in_seconds=480)
        instance2_id = instance2.get("instance_id")
        self.tester.terminate_instance_from_view_page(instance2_id, instance2_name,timeout_in_seconds=480)
        self.tester.launch_more_like_this_from_detail_page(instance2_id, monitoring=True, user_data="Test user data.")
        self.tester.terminate_instance_from_detail_page(instance1_id, timeout_in_seconds=480)
        instance3_name = self.id_generator() + "-instance"
        instance3 = self.tester.launch_instance_from_dashboard(
            image="centos", instance_name=instance3_name, availability_zone=self.zone1,
            instance_type="m1.small", security_group=s_group1_name, key_name=keypair1_name, timeout_in_seconds=480)
        instance3_id = instance3.get("instance_id")
        self.tester.terminate_instance_from_detail_page(instance3_id,timeout_in_seconds=480)
        self.tester.batch_terminate_all_instances()
        instance4 = self.tester.launch_instance_from_dashboard(
            image="centos", availability_zone=self.zone1, instance_type="m1.large", timeout_in_seconds=480)
        instance4_id = instance4.get("instance_id")
        self.tester.terminate_instance_from_view_page(instance_id=instance4_id, timeout_in_seconds=480)
        self.tester.delete_keypair_from_detail_page(keypair1_name)
        self.tester.delete_security_group_from_view_page(s_group1_name, s_group1_id)
        self.tester.logout()
        self.tester.exit_browser()
開發者ID:aliceh,項目名稱:eucaconsole,代碼行數:55,代碼來源:instances.py

示例2: Instance_operations_sequence

# 需要導入模塊: from guiops.guiops import GuiOps [as 別名]
# 或者: from guiops.guiops.GuiOps import create_keypair_from_dashboard [as 別名]
class Instance_operations_sequence(GuiOps):

    def __init__(self):
        parser = Option_parser()
        self.console_url = parser.parse_options()['console_url']
        self.webdriver_url = parser.parse_options()['web_driver']
        self.account = parser.parse_options()['account']
        self.user = parser.parse_options()['user_name']
        self.password = parser.parse_options()['password']
        self.sauce = parser.parse_options()['sauce']
        self.browser = parser.parse_options()['browser']
        self.version = parser.parse_options()['version']
        self.platform = parser.parse_options()['platform']
        self.tester = GuiOps(console_url=self.console_url, webdriver_url=self.webdriver_url, sauce=self.sauce, browser=self.browser, version=self.version, platform=self.platform)


    def id_generator(self, size = 6, chars=string.ascii_uppercase + string.digits):
        return ''.join(random.choice(chars) for j in range(size))

    def instance_ops_test(self):
        self.tester.login(self.account, self.user, self.password)
        s_group1_name = self.id_generator()+"-group"
        s_group1=self.tester.create_security_group_from_view_page(s_group1_name, "Security group created by instance test")
        s_group1_id = s_group1.get("s_group_id")
        keypair1_name = self.id_generator()+"-key-pair"
        self.tester.create_keypair_from_dashboard(keypair1_name)
        instance1_name = self.id_generator()+"-instance"
        instance1 = self.tester.launch_instance_from_image_view_page(image_id_or_type="centos", instance_name=instance1_name,
                                                               instance_type= "m1.medium", security_group=s_group1_name, key_name=keypair1_name)
        instance1_id = instance1.get("instance_id")
        instance2_name = self.id_generator()+"-instance"
        instance2 = self.tester.launch_more_like_this_from_view_page(inatance_id=instance1_id, instance_name=instance2_name)
        instance2_id = instance2.get("instance_id")
        self.tester.terminate_instance_from_view_page(instance2_id, instance2_name)
        self.tester.launch_more_like_this_from_detail_page(instance2_id, monitoring=True, user_data="Test user data.")
        self.tester.terminate_instance_from_detail_page(instance1_id)
        instance3_name = self.id_generator()+"-instance"
        instance3=self.tester.launch_instance_from_dashboard(image="centos", instance_name=instance3_name, availability_zone="one",
                                                            instance_type= "m1.small",security_group=s_group1_name, key_name=keypair1_name)
        instance3_id = instance3.get("instance_id")
        self.tester.terminate_instance_from_detail_page(instance3_id)
        self.tester.batch_terminate_all_instances()
        instance4 = self.tester.launch_instance_from_dashboard(image="centos", availability_zone="one",
                                                            instance_type= "m1.large")
        instance4_id = instance4.get("instance_id")
        self.tester.terminate_instance_from_view_page(instance_id=instance4_id)
        self.tester.delete_keypair_from_detail_page(keypair1_name)
        self.tester.delete_security_group_from_view_page(s_group1_name, s_group1_id)
        self.tester.logout()
        self.tester.exit_browser()
開發者ID:mbacchi,項目名稱:eucaconsole,代碼行數:52,代碼來源:instances.py

示例3: Keypair_operations_sequence

# 需要導入模塊: from guiops.guiops import GuiOps [as 別名]
# 或者: from guiops.guiops.GuiOps import create_keypair_from_dashboard [as 別名]
class Keypair_operations_sequence(GuiOps):

    keypair = (
        "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDI1x6tEjkBQCCP0ssF69vAgP2xg+N9ScoTrqRqyl5w4qEgsV/AppfHHYRKYr0N/tTyG4/"
        "z1XGNrB2SaslnRpgEOsvMZldlOnqsUujL2fgoEg+/gB92+1JhZgTjU8nL5j5BFkVTh93nSHtXHdzYl7SjlXrv26ZbyuDwJmI+s6bJQk5noJ4Q4g"
        "7N/0y9pHRvezyhgxkyX7PQoA9WJm8SqlakyhMYa0j/baMhb/ehSI0VvwNodmcaWaS6Z2F4rZS4C2DmCUDXYy/1+0tiRTjHjlPbqRKCVKam8ImWy"
        "tlZD0zbdV/tpADxDpnhW2cPVpXcjy4sRzUCc8AZW+OE3LQxXild [email protected]"
    )

    def id_generator(self, size=6, chars=string.ascii_uppercase + string.digits):
        return "".join(random.choice(chars) for j in range(size))

    def __init__(self):
        parser = Option_parser()
        self.console_url = parser.parse_options()["console_url"]
        self.webdriver_url = parser.parse_options()["web_driver"]
        self.account = parser.parse_options()["account"]
        self.user = parser.parse_options()["user_name"]
        self.password = parser.parse_options()["password"]
        self.sauce = parser.parse_options()["sauce"]
        self.browser = parser.parse_options()["browser"]
        self.version = parser.parse_options()["version"]
        self.platform = parser.parse_options()["platform"]
        self.tester = GuiOps(
            console_url=self.console_url,
            webdriver_url=self.webdriver_url,
            sauce=self.sauce,
            browser=self.browser,
            version=self.version,
            platform=self.platform,
        )

    def keypair_ops_test(self):

        keypair1_name = self.id_generator() + "-key"
        self.tester.login(self.account, self.user, self.password)
        self.tester.create_keypair_from_keypair_view_page(keypair1_name)
        self.tester.delete_keypair_from_detail_page(keypair1_name)
        keypair2_name = self.id_generator() + "-key"
        self.tester.create_keypair_from_dashboard(keypair2_name)
        self.tester.delete_keypair_from_view_page(keypair2_name)
        keypair3_name = self.id_generator() + "-key"
        self.tester.import_keypair(self.keypair, keypair3_name)
        self.tester.delete_keypair_from_detail_page(keypair3_name)
        self.tester.logout()
        self.tester.exit_browser()
開發者ID:mbacchi,項目名稱:eucaconsole,代碼行數:48,代碼來源:keypair.py

示例4: Stack_operations_sequence

# 需要導入模塊: from guiops.guiops import GuiOps [as 別名]
# 或者: from guiops.guiops.GuiOps import create_keypair_from_dashboard [as 別名]
class Stack_operations_sequence(GuiOps):
    TEMPLATE_URL = 'https://raw.githubusercontent.com/eucalyptus/eucaconsole/19b2a55ce33e0d76567bff9541319bb7b51e18d4/eucaconsole/cf-templates/Euca%20Stacks/Basic%20Instance.json'

    def __init__(self):
        parser = Option_parser()
        self.console_url = parser.parse_options()['console_url']
        self.webdriver_url = parser.parse_options()['web_driver']
        self.account = parser.parse_options()['account']
        self.user = parser.parse_options()['user_name']
        self.password = parser.parse_options()['password']
        self.sauce = parser.parse_options()['sauce']
        self.browser = parser.parse_options()['browser']
        self.version = parser.parse_options()['version']
        self.platform = parser.parse_options()['platform']
        self.tester = GuiOps(console_url=self.console_url, webdriver_url=self.webdriver_url, sauce=self.sauce, browser=self.browser, version=self.version, platform=self.platform)
        self.tester.zoom_out()

    def stack_ops_test(self):
        self.tester.login(self.account, self.user, self.password)
        keypair_name = self.id_generator()+"-keypair"
        self.tester.create_keypair_from_dashboard(keypair_name)

        # test stack from sample
        stack1_name = "test-" + self.id_generator() + "-stack"
        self.tester.create_stack_from_dashboard(stack1_name)
        stack2_name = "test-" + self.id_generator() + "-stack"
        self.tester.create_stack_from_lp(stack2_name)
        # update a stack
        self.tester.update_stack_from_lp(stack2_name)
        # delete the stacks
        self.tester.delete_stack_from_lp(stack1_name)
        self.tester.delete_stack_from_detail_page(stack2_name)

        #test stack from uploaded template
        stack3_name = "test-" + self.id_generator() + "-stack"
        self.tester.create_stack_from_dashboard(stack3_name, template_url=self.TEMPLATE_URL)
        self.tester.delete_stack_from_lp(stack3_name)

        self.tester.delete_keypair_from_detail_page(keypair_name)
        self.tester.logout()
        self.tester.exit_browser()
開發者ID:,項目名稱:,代碼行數:43,代碼來源:

示例5: Keypair_operations_sequence

# 需要導入模塊: from guiops.guiops import GuiOps [as 別名]
# 或者: from guiops.guiops.GuiOps import create_keypair_from_dashboard [as 別名]
class Keypair_operations_sequence(GuiOps):

    keypair = "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDI1x6tEjkBQCCP0ssF69vAgP2xg+N9ScoTrqRqyl5w4qEgsV/AppfHHYRKYr0N/tTyG4/" \
                  "z1XGNrB2SaslnRpgEOsvMZldlOnqsUujL2fgoEg+/gB92+1JhZgTjU8nL5j5BFkVTh93nSHtXHdzYl7SjlXrv26ZbyuDwJmI+s6bJQk5noJ4Q4g" \
                  "7N/0y9pHRvezyhgxkyX7PQoA9WJm8SqlakyhMYa0j/baMhb/ehSI0VvwNodmcaWaS6Z2F4rZS4C2DmCUDXYy/1+0tiRTjHjlPbqRKCVKam8ImWy" \
                  "tlZD0zbdV/tpADxDpnhW2cPVpXcjy4sRzUCc8AZW+OE3LQxXild [email protected]"

    def __init__(self):
        parser = Option_parser()
        self.console_url = parser.parse_options()['console_url']
        self.webdriver_url = parser.parse_options()['web_driver']
        self.account = parser.parse_options()['account']
        self.user = parser.parse_options()['user_name']
        self.password = parser.parse_options()['password']
        self.sauce = parser.parse_options()['sauce']
        self.browser = parser.parse_options()['browser']
        self.version = parser.parse_options()['version']
        self.platform = parser.parse_options()['platform']
        self.tester = GuiOps(console_url=self.console_url, webdriver_url=self.webdriver_url, sauce=self.sauce, browser=self.browser, version=self.version, platform=self.platform)
        logging.basicConfig(format='%(asctime)s %(message)s')

        self.tester.zoom_out()

    def keypair_ops_test(self):

        keypair1_name=self.id_generator()+"-key"
        self.tester.login(self.account, self.user, self.password)
        self.tester.create_keypair_from_keypair_view_page(keypair1_name)
        self.tester.delete_keypair_from_detail_page(keypair1_name)
        keypair2_name=self.id_generator()+"-key"
        self.tester.create_keypair_from_dashboard(keypair2_name)
        self.tester.delete_keypair_from_view_page(keypair2_name)
        keypair3_name=self.id_generator()+"-key"
        self.tester.import_keypair(self.keypair, keypair3_name)
        self.tester.delete_keypair_from_detail_page(keypair3_name)
        self.tester.logout()
        self.tester.exit_browser()
開發者ID:,項目名稱:,代碼行數:39,代碼來源:


注:本文中的guiops.guiops.GuiOps.create_keypair_from_dashboard方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。