コード例 #1
0
    opt_parser.add_option("-i", "--s2_server_id", action="store", type="string", \
                          dest="s2_server_id", help='s2_server_id', default="")

    opt_parser.add_option("-d", "--vdi_ips", action="store", type="string", \
                          dest="vdi_ips", help='vdi ips', default="")

    (options, _) = opt_parser.parse_args(sys.argv)

    zone_id = options.zone_id
    access_key_id = options.access_key_id
    secret_access_key = options.secret_access_key
    host = options.host
    port = options.port
    protocol = options.protocol
    s2_server_id = options.s2_server_id
    vdi_ips = Common.explode_array(options.vdi_ips or "")

    print("zone_id:%s" % (zone_id))
    print("access_key_id:%s" % (access_key_id))
    print("secret_access_key:%s" % (secret_access_key))
    print("host:%s" % (host))
    print("port:%s" % (port))
    print("protocol:%s" % (protocol))
    print("s2_server_id:%s" % (s2_server_id))
    print("vdi_ips:%s" % (vdi_ips))

    #连接iaas后台
    conn = Common.connect_iaas(zone_id, access_key_id, secret_access_key, host,
                               port, protocol)
    print("connect_iaas conn == %s" % (conn))
コード例 #2
0
                          dest="port", help='port', default="")

    opt_parser.add_option("-P", "--protocol", action="store", type="string", \
                          dest="protocol", help='protocol', default="")

    opt_parser.add_option("-A", "--app_ids", action="store", type="string", \
                          dest="app_ids", help='appcenter app_ids', default="")

    (options, _) = opt_parser.parse_args(sys.argv)
    zone_id = options.zone_id
    access_key_id = options.access_key_id
    secret_access_key = options.secret_access_key
    host = options.host
    port = options.port
    protocol = options.protocol
    app_ids = Common.explode_array(options.app_ids or "")

    print("zone_id:%s" % (zone_id))
    print("access_key_id:%s" % (access_key_id))
    print("secret_access_key:%s" % (secret_access_key))
    print("host:%s" % (host))
    print("port:%s" % (port))
    print("protocol:%s" % (protocol))
    print("app_ids:%s" % (app_ids))

    #连接iaas后台
    conn = Common.connect_iaas(zone_id, access_key_id, secret_access_key, host,port,protocol)
    print("connect_iaas conn == %s" % (conn))

    # 获取账号ID
    user_id = Common.get_user_id(conn,access_key_id)
コード例 #3
0
    opt_parser.add_option("-F", "--platform", action="store", type="string", \
                          dest="platform", help='platform', default="")

    opt_parser.add_option("-m", "--private_ips", action="store", type="string", \
                          dest="private_ips", help='private ips', default="")

    (options, _) = opt_parser.parse_args(sys.argv)

    zone_id = options.zone_id
    access_key_id = options.access_key_id
    secret_access_key = options.secret_access_key
    host = options.host
    port = options.port
    protocol = options.protocol
    vxnet_id = options.vxnet_id
    resource_ids = Common.explode_array(options.resource_id or "")
    platform = options.platform
    private_ips = options.private_ips

    print("zone_id:%s" % (zone_id))
    print("access_key_id:%s" % (access_key_id))
    print("secret_access_key:%s" % (secret_access_key))
    print("host:%s" % (host))
    print("port:%s" % (port))
    print("protocol:%s" % (protocol))
    print("vxnet_id:%s" % (vxnet_id))
    print("resource_ids:%s" % (resource_ids))
    print("platform:%s" % (platform))
    print("private_ips:%s" % (private_ips))

    #连接iaas后台
コード例 #4
0
    opt_parser.add_option("-P", "--protocol", action="store", type="string", \
                          dest="protocol", help='protocol', default="")

    opt_parser.add_option("-l", "--instance_ids", action="store", type="string", \
                          dest="instance_ids", help='instance_ids', default="")

    (options, _) = opt_parser.parse_args(sys.argv)

    zone_id = options.zone_id
    access_key_id = options.access_key_id
    secret_access_key = options.secret_access_key
    host = options.host
    port = options.port
    protocol = options.protocol
    instance_ids = Common.explode_array(options.instance_ids or "")

    print("zone_id:%s" % (zone_id))
    print("access_key_id:%s" % (access_key_id))
    print("secret_access_key:%s" % (secret_access_key))
    print("host:%s" % (host))
    print("port:%s" % (port))
    print("protocol:%s" % (protocol))
    print("instance_ids:%s" % (instance_ids))

    #连接iaas后台
    conn = Common.connect_iaas(zone_id, access_key_id, secret_access_key, host,port,protocol)
    print("connect_iaas conn == %s" % (conn))

    # 获取账号ID
    user_id = Common.get_user_id(conn,access_key_id)
コード例 #5
0
    opt_parser.add_option("-l", "--loadbalancer_id", action="store", type="string", \
                          dest="loadbalancer_id", help='loadbalancer_id', default="")

    opt_parser.add_option("-b", "--loadbalancer_backends_ids", action="store", type="string", \
                          dest="loadbalancer_backends_ids", help='loadbalancer_backends_ids', default="")

    (options, _) = opt_parser.parse_args(sys.argv)

    zone_id = options.zone_id
    access_key_id = options.access_key_id
    secret_access_key = options.secret_access_key
    host = options.host
    port = options.port
    protocol = options.protocol
    loadbalancer_id = options.loadbalancer_id
    loadbalancer_backends_ids = Common.explode_array(
        options.loadbalancer_backends_ids or "")

    print("zone_id:%s" % (zone_id))
    print("access_key_id:%s" % (access_key_id))
    print("secret_access_key:%s" % (secret_access_key))
    print("host:%s" % (host))
    print("port:%s" % (port))
    print("protocol:%s" % (protocol))
    print("loadbalancer_id:%s" % (loadbalancer_id))
    print("loadbalancer_backends_ids:%s" % (loadbalancer_backends_ids))

    #连接iaas后台
    conn = Common.connect_iaas(zone_id, access_key_id, secret_access_key, host,
                               port, protocol)
    print("connect_iaas conn == %s" % (conn))