def main():
    parser = argparse.ArgumentParser(add_help=True, description='Usage')
    parser.add_argument('-a', '--appliance', dest='host', required=True,
                        help='HP OneView Appliance hostname or IP')
    parser.add_argument('-u', '--user', dest='user', required=False,
                        default='Administrator', help='HP OneView Username')
    parser.add_argument('-p', '--pass', dest='passwd', required=False,
                        help='HP OneView Password')
    parser.add_argument('-c', '--certificate', dest='cert', required=False,
                        help='Trusted SSL Certificate Bundle in PEM '
                        '(Base64 Encoded DER) Format')
    parser.add_argument('-r', '--proxy', dest='proxy', required=False,
                        help='Proxy (host:port format')

    args = parser.parse_args()
    credential = {'userName': args.user, 'password': args.passwd}

    con = hpov.connection(args.host)
    fcs = hpov.fcsans(con)

    if args.proxy:
        con.set_proxy(args.proxy.split(':')[0], args.proxy.split(':')[1])
    if args.cert:
        con.set_trusted_ssl_bundle(args.cert)

    login(con, credential)
    acceptEULA(con)

    getproviders(fcs)
def main():
    parser = argparse.ArgumentParser(add_help=True,
                        formatter_class=argparse.RawTextHelpFormatter,
                                     description='''
    Delete individual or ALL SAN Managers

    Usage: ''')
    parser.add_argument('-a', dest='host', required=True,
                        help='''
                        HPE OneView Appliance hostname or IP address''')
    parser.add_argument('-u', dest='user', required=False,
                        default='Administrator',
                        help='''
                        HPE OneView Username''')
    parser.add_argument('-p', dest='passwd', required=True,
                        help='''
                        HPE OneView Password''')
    parser.add_argument('-c', dest='cert', required=False,
                        help='''
                        Trusted SSL Certificate Bundle in PEM (Base64 Encoded DER) Format''')
    parser.add_argument('-y', dest='proxy', required=False,
                        help='''
                        Proxy (host:port format''')
    parser.add_argument('-j', dest='domain', required=False,
                        default='Local',
                        help='''
    HPE OneView Authorized Login Domain''')
    group = parser.add_mutually_exclusive_group(required=True)
    group.add_argument('-d', dest='delete_all', action='store_true',
                       help='''
                       Delete ALL SAN Managers''')
    group.add_argument('-n', dest='name',
                       help='''
                       Name of the SAN Manager to delete''')

    args = parser.parse_args()
    credential = {'authLoginDomain': args.domain.upper(), 'userName': args.user, 'password': args.passwd}

    con = hpov.connection(args.host)
    fcs = hpov.fcsans(con)

    if args.proxy:
        con.set_proxy(args.proxy.split(':')[0], args.proxy.split(':')[1])
        if args.cert:
            con.set_trusted_ssl_bundle(args.cert)

    login(con, credential)
    acceptEULA(con)

    if args.delete_all:
        del_all_san_managers(fcs)
        sys.exit()

    del_san_manager_by_name(fcs, args.name)
def main():
    parser = argparse.ArgumentParser(
        add_help=True,
        formatter_class=argparse.RawTextHelpFormatter,
        description='''
    Display Providers

    Usage: ''')
    parser.add_argument('-a',
                        dest='host',
                        required=True,
                        help='''
    HP OneView Appliance hostname or IP address''')
    parser.add_argument('-u',
                        dest='user',
                        required=False,
                        default='Administrator',
                        help='''
    HP OneView Username''')
    parser.add_argument('-p',
                        dest='passwd',
                        required=True,
                        help='''
    HP OneView Password''')
    parser.add_argument('-c',
                        dest='cert',
                        required=False,
                        help='''
    Trusted SSL Certificate Bundle in PEM (Base64 Encoded DER) Format''')
    parser.add_argument('-y',
                        dest='proxy',
                        required=False,
                        help='''
    Proxy (host:port format''')

    args = parser.parse_args()
    credential = {'userName': args.user, 'password': args.passwd}

    con = hpov.connection(args.host)
    fcs = hpov.fcsans(con)

    if args.proxy:
        con.set_proxy(args.proxy.split(':')[0], args.proxy.split(':')[1])
    if args.cert:
        con.set_trusted_ssl_bundle(args.cert)

    login(con, credential)
    acceptEULA(con)

    getproviders(fcs)
def main():
    parser = argparse.ArgumentParser(add_help=True, description='Usage')
    parser.add_argument('-a',
                        '--appliance',
                        dest='host',
                        required=True,
                        help='HP OneView Appliance hostname or IP')
    parser.add_argument('-u',
                        '--user',
                        dest='user',
                        required=False,
                        default='Administrator',
                        help='HP OneView Username')
    parser.add_argument('-p',
                        '--pass',
                        dest='passwd',
                        required=False,
                        help='HP OneView Password')
    parser.add_argument('-c',
                        '--certificate',
                        dest='cert',
                        required=False,
                        help='Trusted SSL Certificate Bundle in PEM '
                        '(Base64 Encoded DER) Format')
    parser.add_argument('-r',
                        '--proxy',
                        dest='proxy',
                        required=False,
                        help='Proxy (host:port format')

    args = parser.parse_args()
    credential = {'userName': args.user, 'password': args.passwd}

    con = hpov.connection(args.host)
    fcs = hpov.fcsans(con)

    if args.proxy:
        con.set_proxy(args.proxy.split(':')[0], args.proxy.split(':')[1])
    if args.cert:
        con.set_trusted_ssl_bundle(args.cert)

    login(con, credential)
    acceptEULA(con)

    getsanmgr(fcs)
def main():
    parser = argparse.ArgumentParser(add_help=True,
                        formatter_class=argparse.RawTextHelpFormatter,
                                     description='''
    Display Providers

    Usage: ''')
    parser.add_argument('-a', dest='host', required=True,
                        help='''
    HPE OneView Appliance hostname or IP address''')
    parser.add_argument('-u', dest='user', required=False,
                        default='Administrator',
                        help='''
    HPE OneView Username''')
    parser.add_argument('-p', dest='passwd', required=True,
                        help='''
    HPE OneView Password''')
    parser.add_argument('-c', dest='cert', required=False,
                        help='''
    Trusted SSL Certificate Bundle in PEM (Base64 Encoded DER) Format''')
    parser.add_argument('-y', dest='proxy', required=False,
                        help='''
    Proxy (host:port format''')
    parser.add_argument('-j', dest='domain', required=False,
                        default='Local',
                        help='''
    HPE OneView Authorized Login Domain''')

    args = parser.parse_args()
    credential = {'authLoginDomain': args.domain.upper(), 'userName': args.user, 'password': args.passwd}

    con = hpov.connection(args.host)
    fcs = hpov.fcsans(con)

    if args.proxy:
        con.set_proxy(args.proxy.split(':')[0], args.proxy.split(':')[1])
    if args.cert:
        con.set_trusted_ssl_bundle(args.cert)

    login(con, credential)
    acceptEULA(con)

    getproviders(fcs)
Exemple #6
0
def main():
    parser = argparse.ArgumentParser(
        add_help=True,
        formatter_class=argparse.RawTextHelpFormatter,
        description='''
    Delete individual or ALL SAN Managers

    Usage: ''')
    parser.add_argument('-a',
                        dest='host',
                        required=True,
                        help='''
                        HP OneView Appliance hostname or IP address''')
    parser.add_argument('-u',
                        dest='user',
                        required=False,
                        default='Administrator',
                        help='''
                        HP OneView Username''')
    parser.add_argument('-p',
                        dest='passwd',
                        required=True,
                        help='''
                        HP OneView Password''')
    parser.add_argument('-c',
                        dest='cert',
                        required=False,
                        help='''
                        Trusted SSL Certificate Bundle in PEM (Base64 Encoded DER) Format'''
                        )
    parser.add_argument('-y',
                        dest='proxy',
                        required=False,
                        help='''
                        Proxy (host:port format''')
    group = parser.add_mutually_exclusive_group(required=True)
    group.add_argument('-d',
                       dest='delete_all',
                       action='store_true',
                       help='''
                       Delete ALL SAN Managers''')
    group.add_argument('-n',
                       dest='name',
                       help='''
                       Name of the SAN Manager to delete''')

    args = parser.parse_args()
    credential = {'userName': args.user, 'password': args.passwd}

    con = hpov.connection(args.host)
    fcs = hpov.fcsans(con)

    if args.proxy:
        con.set_proxy(args.proxy.split(':')[0], args.proxy.split(':')[1])
        if args.cert:
            con.set_trusted_ssl_bundle(args.cert)

    login(con, credential)
    acceptEULA(con)

    if args.delete_all:
        del_all_san_managers(fcs)
        sys.exit()

    del_san_manager_by_name(fcs, args.name)
def main():
    parser = argparse.ArgumentParser(add_help=True,
                        formatter_class=argparse.RawTextHelpFormatter,
                                     description='''
    Add a new SAN Manager

    Usage: ''')
    parser.add_argument('-a', dest='host', required=True,
                        help='''
    HP OneView Appliance hostname or IP address''')
    parser.add_argument('-u', dest='user', required=False,
                        default='Administrator',
                        help='''
    HP OneView Username''')
    parser.add_argument('-p', dest='passwd', required=True,
                        help='''
    HP OneView Password''')
    parser.add_argument('-c', dest='cert', required=False,
                        help='''
    Trusted SSL Certificate Bundle in PEM (Base64 Encoded DER) Format''')
    parser.add_argument('-y', dest='proxy', required=False,
                        help='''
    Proxy (host:port format''')
    parser.add_argument('-sm', dest='sanmgr',
                        required=True,
                        help='''
    FQDN or IP Address of the SAN Manager''')
    parser.add_argument('-so', dest='port',
                        required=False,
                        default=5989,
                        help='''
    TCP Port of the SAN Manager

    Default: 5989''')
    parser.add_argument('-su', dest='suser',
                        required=True,
                        help='''
    Username used to authenticate and manage the SAN Manager''')
    parser.add_argument('-sp', dest='spass',
                        required=True,
                        help='''
    Password used to authenticate and manage the SAN Manager''')
    parser.add_argument('-e', dest='ssl',
                        required=False,
                        action='store_true',
                        help='''
    Use to enable SSL communication with the SAN Manager''')

    args = parser.parse_args()
    credential = {'userName': args.user, 'password': args.passwd}

    con = hpov.connection(args.host)
    fcs = hpov.fcsans(con)

    if args.proxy:
        con.set_proxy(args.proxy.split(':')[0], args.proxy.split(':')[1])
    if args.cert:
        con.set_trusted_ssl_bundle(args.cert)

    login(con, credential)
    acceptEULA(con)

    add_san_manager(fcs, args.sanmgr, args.port, args.suser,
                    args.spass, args.ssl)
Exemple #8
0
def main():
    parser = argparse.ArgumentParser(
        add_help=True,
        formatter_class=argparse.RawTextHelpFormatter,
        description='''
    Add a new SAN Manager

    Usage: ''')
    parser.add_argument('-a',
                        dest='host',
                        required=True,
                        help='''
    HPE OneView Appliance hostname or IP address''')
    parser.add_argument('-u',
                        dest='user',
                        required=False,
                        default='Administrator',
                        help='''
    HPE OneView Username''')
    parser.add_argument('-p',
                        dest='passwd',
                        required=True,
                        help='''
    HPE OneView Password''')
    parser.add_argument('-c',
                        dest='cert',
                        required=False,
                        help='''
    Trusted SSL Certificate Bundle in PEM (Base64 Encoded DER) Format''')
    parser.add_argument('-y',
                        dest='proxy',
                        required=False,
                        help='''
    Proxy (host:port format''')
    parser.add_argument('-j',
                        dest='domain',
                        required=False,
                        default='Local',
                        help='''
    HPE OneView Authorized Login Domain''')
    parser.add_argument('-sm',
                        dest='sanmgr',
                        required=True,
                        help='''
    FQDN or IP Address of the SAN Manager''')
    parser.add_argument('-so',
                        dest='port',
                        required=False,
                        default=5989,
                        help='''
    TCP Port of the SAN Manager

    Default: 5989''')
    parser.add_argument('-su',
                        dest='suser',
                        required=True,
                        help='''
    Username used to authenticate and manage the SAN Manager''')
    parser.add_argument('-sp',
                        dest='spass',
                        required=True,
                        help='''
    Password used to authenticate and manage the SAN Manager''')
    parser.add_argument('-e',
                        dest='ssl',
                        required=False,
                        action='store_true',
                        help='''
    Use to enable SSL communication with the SAN Manager''')

    args = parser.parse_args()
    credential = {
        'authLoginDomain': args.domain.upper(),
        'userName': args.user,
        'password': args.passwd
    }

    con = hpov.connection(args.host)
    fcs = hpov.fcsans(con)

    if args.proxy:
        con.set_proxy(args.proxy.split(':')[0], args.proxy.split(':')[1])
    if args.cert:
        con.set_trusted_ssl_bundle(args.cert)

    login(con, credential)
    acceptEULA(con)

    add_san_manager(fcs, args.sanmgr, args.port, args.suser, args.spass,
                    args.ssl)
def main():
    parser = argparse.ArgumentParser(
        add_help=True,
        formatter_class=argparse.RawTextHelpFormatter,
        description="""
    Display or list the available Managed SAN resources in the appliance

    Usage: """,
    )
    parser.add_argument(
        "-a",
        dest="host",
        required=True,
        help="""
    HP OneView Appliance hostname or IP address""",
    )
    parser.add_argument(
        "-u",
        dest="user",
        required=False,
        default="Administrator",
        help="""
    HP OneView Username""",
    )
    parser.add_argument(
        "-p",
        dest="passwd",
        required=True,
        help="""
    HP OneView Password""",
    )
    parser.add_argument(
        "-c",
        dest="cert",
        required=False,
        help="""
    Trusted SSL Certificate Bundle in PEM (Base64 Encoded DER) Format""",
    )
    parser.add_argument(
        "-y",
        dest="proxy",
        required=False,
        help="""
    Proxy (host:port format""",
    )

    args = parser.parse_args()
    credential = {"userName": args.user, "password": args.passwd}

    con = hpov.connection(args.host)
    fcs = hpov.fcsans(con)

    if args.proxy:
        con.set_proxy(args.proxy.split(":")[0], args.proxy.split(":")[1])
    if args.cert:
        con.set_trusted_ssl_bundle(args.cert)

    login(con, credential)
    acceptEULA(con)

    get_managed_sans(fcs)
def main():
    parser = argparse.ArgumentParser(
        add_help=True,
        formatter_class=argparse.RawTextHelpFormatter,
        description="""
    Add a new SAN Manager

    Usage: """,
    )
    parser.add_argument(
        "-a",
        dest="host",
        required=True,
        help="""
    HP OneView Appliance hostname or IP address""",
    )
    parser.add_argument(
        "-u",
        dest="user",
        required=False,
        default="Administrator",
        help="""
    HP OneView Username""",
    )
    parser.add_argument(
        "-p",
        dest="passwd",
        required=True,
        help="""
    HP OneView Password""",
    )
    parser.add_argument(
        "-c",
        dest="cert",
        required=False,
        help="""
    Trusted SSL Certificate Bundle in PEM (Base64 Encoded DER) Format""",
    )
    parser.add_argument(
        "-y",
        dest="proxy",
        required=False,
        help="""
    Proxy (host:port format""",
    )
    parser.add_argument(
        "-sm",
        dest="sanmgr",
        required=True,
        help="""
    FQDN or IP Address of the SAN Manager""",
    )
    parser.add_argument(
        "-so",
        dest="port",
        required=False,
        default=5989,
        help="""
    TCP Port of the SAN Manager

    Default: 5989""",
    )
    parser.add_argument(
        "-su",
        dest="suser",
        required=True,
        help="""
    Username used to authenticate and manage the SAN Manager""",
    )
    parser.add_argument(
        "-sp",
        dest="spass",
        required=True,
        help="""
    Password used to authenticate and manage the SAN Manager""",
    )
    parser.add_argument(
        "-e",
        dest="ssl",
        required=False,
        action="store_true",
        help="""
    Use to enable SSL communication with the SAN Manager""",
    )

    args = parser.parse_args()
    credential = {"userName": args.user, "password": args.passwd}

    con = hpov.connection(args.host)
    fcs = hpov.fcsans(con)

    if args.proxy:
        con.set_proxy(args.proxy.split(":")[0], args.proxy.split(":")[1])
    if args.cert:
        con.set_trusted_ssl_bundle(args.cert)

    login(con, credential)
    acceptEULA(con)

    add_san_manager(fcs, args.sanmgr, args.port, args.suser, args.spass, args.ssl)