예제 #1
0
    def populate_parser(parser):
        parser.add_argument(
            '--on-auth',
            metavar='<auth>',
            default=utils.env('ON_AUTH') or 'oneadmin:opennebula',
            help=('Specify authorization information. For core drivers, '
                  'it should be <username>:<password>. '
                  'Defaults to env[ON_USERNAME] or oneadmin:opennebula.'))

        parser.add_argument(
            '--on-rpcxml-endpoint',
            metavar='<auth-url>',
            default=utils.env('ON_RPCXML_ENDPOINT')
                    or 'http://localhost:2633/RPC2',
            help=('Specify OpenNebula XML RPC endpoint. '
                  'Defaults to env[ON_RPCXML_ENDPOINT]'
                  ' or http://localhost:2633/RPC2.'))

        parser.add_argument(
            '--all-images',
            action='store_true',
            default=False,
            help=('If set, include information about all images (including '
                  'snapshots), otherwise only publish images with cloudkeeper '
                  'metadata, ignoring the others.'))
예제 #2
0
    def populate_parser(parser):
        parser.add_argument(
            "--on-auth",
            metavar="<auth>",
            default=utils.env("ON_AUTH") or "oneadmin:opennebula",
            help=("Specify authorization information. For core drivers, "
                  "it should be <username>:<password>. "
                  "Defaults to env[ON_USERNAME] or oneadmin:opennebula."),
        )

        parser.add_argument(
            "--on-rpcxml-endpoint",
            metavar="<auth-url>",
            default=utils.env("ON_RPCXML_ENDPOINT")
            or "http://localhost:2633/RPC2",
            help=("Specify OpenNebula XML RPC endpoint. "
                  "Defaults to env[ON_RPCXML_ENDPOINT]"
                  " or http://localhost:2633/RPC2."),
        )

        parser.add_argument(
            "--all-images",
            action="store_true",
            default=False,
            help=("If set, include information about all images (including "
                  "snapshots), otherwise only publish images with cloudkeeper "
                  "metadata, ignoring the others."),
        )
예제 #3
0
    def populate_parser(parser):
        parser.add_argument(
            '--on-auth',
            metavar='<auth>',
            default=utils.env('ON_AUTH') or 'oneadmin:opennebula',
            help=('Specify authorization information. For core drivers, '
                  'it should be <username>:<password>. '
                  'Defaults to env[ON_USERNAME] or oneadmin:opennebula.'))

        parser.add_argument(
            '--on-rpcxml-endpoint',
            metavar='<auth-url>',
            default=utils.env('ON_RPCXML_ENDPOINT')
                    or 'http://localhost:2633/RPC2',
            help=('Specify OpenNebula XML RPC endpoint. '
                  'Defaults to env[ON_RPCXML_ENDPOINT]'
                  ' or http://localhost:2633/RPC2.'))

        parser.add_argument(
            '--all-images',
            action='store_true',
            default=False,
            help=('If set, include information about all images (including '
                  'snapshots), otherwise only publish images with cloudkeeper '
                  'metadata, ignoring the others.'))
예제 #4
0
 def populate_parser(parser):
     parser.add_argument(
         '--aws-region',
         default=utils.env('AWS_DEFAULT_REGION'),
         dest='aws_region_code',
         help=('Specify AWS Region Code '
               '(i. e, us-east-2, ap-south-1, eu-west-3...))'))
     parser.add_argument('--aws-access-key',
                         default=utils.env('AWS_ACCESS_KEY_ID'),
                         dest='aws_access_key',
                         help=('Specify AWS Access Key ID'))
     parser.add_argument('--aws-secret-key',
                         default=utils.env('AWS_SECRET_ACCESS_KEY'),
                         dest='aws_secret_key',
                         help=('Specify AWS Secret Access Key for'
                               ' the provided AWS Access Key ID'))
     parser.add_argument(
         '--all-amis-from',
         metavar='DATE',
         default=(datetime.now() -
                  relativedelta(years=1)).strftime("%Y-%m-%d"),
         dest='all_amis_from',
         help=('Starting date from which the creation date'
               ' of the AMIs are valid. Date format is '
               ' YYYY-MM-DD, and the default is one year'
               ' back from the current date.'))
예제 #5
0
    def populate_parser(parser):
        plugins = loading_base.get_available_plugin_names()
        default_auth = "v3password"

        parser.add_argument(
            "--os-auth-type",
            "--os-auth-plugin",
            metavar="<name>",
            default=utils.env("OS_AUTH_TYPE", default=default_auth),
            choices=plugins,
            help="Authentication type to use, available "
            "types are: %s" % ", ".join(plugins),
        )

        # arguments come from session and plugins
        loading_session.register_argparse_arguments(parser)
        for plugin_name in plugins:
            plugin = loading_base.get_plugin_loader(plugin_name)
            # NOTE(aloga): we do not want a project to be passed from the
            # CLI, as we will iterate over it for each configured VO and
            # project. However, as the plugin is expecting them when
            # parsing the arguments we need to set them to None before
            # calling the load_auth_from_argparse_arguments method in the
            # __init__ method of this class.
            for opt in filter(
                    lambda x: x.name not in ("project-name", "project-id"),
                    plugin.get_options(),
            ):
                parser.add_argument(*opt.argparse_args,
                                    default=opt.argparse_default,
                                    metavar="<auth-%s>" % opt.name,
                                    help=opt.help,
                                    dest="os_%s" % opt.dest.replace("-", "_"))

        parser.add_argument(
            "--insecure",
            default=utils.env("NOVACLIENT_INSECURE", default=False),
            action="store_true",
            help="Explicitly allow novaclient to perform 'insecure' "
            "SSL (https) requests. The server's certificate will "
            "not be verified against any certificate authorities. "
            "This option should be used with caution.",
        )

        parser.add_argument(
            "--os-cacert",
            metavar="<ca-certificate>",
            default=utils.env("OS_CACERT", default=requests.certs.where()),
            help="Specify a CA bundle file to use in "
            "verifying a TLS (https) server certificate. "
            "Defaults to env[OS_CACERT].",
        )

        parser.add_argument(
            "--os-cert",
            metavar="<certificate>",
            default=utils.env("OS_CERT", default=None),
            help="Defaults to env[OS_CERT].",
        )

        parser.add_argument(
            "--os-key",
            metavar="<key>",
            default=utils.env("OS_KEY", default=None),
            help="Defaults to env[OS_KEY].",
        )

        parser.add_argument(
            "--timeout",
            default=600,
            metavar="<seconds>",
            help="Set request timeout (in seconds).",
        )

        parser.add_argument(
            "--select-flavors",
            default="all",
            choices=["all", "public", "private"],
            help="Select all (default), public or private flavors/templates.",
        )

        parser.add_argument(
            "--all-images",
            action="store_true",
            default=False,
            help=("If set, include information about all images (including "
                  "snapshots), otherwise only publish images with cloudkeeper "
                  "metadata, ignoring the others."),
        )
예제 #6
0
    def populate_parser(parser):
        plugins = loading_base.get_available_plugin_names()
        default_auth = "v3password"

        parser.add_argument('--os-auth-type',
                            '--os-auth-plugin',
                            metavar='<name>',
                            default=utils.env('OS_AUTH_TYPE',
                                              default=default_auth),
                            choices=plugins,
                            help='Authentication type to use, available '
                                 'types are: %s' % ", ".join(plugins))

        # arguments come from session and plugins
        loading_session.register_argparse_arguments(parser)
        for plugin_name in plugins:
            plugin = loading_base.get_plugin_loader(plugin_name)
            # NOTE(aloga): we do not want a project to be passed from the
            # CLI, as we will iterate over it for each configured VO and
            # project. However, as the plugin is expecting them when
            # parsing the arguments we need to set them to None before
            # calling the load_auth_from_argparse_arguments method in the
            # __init__ method of this class.
            for opt in filter(lambda x: x.name not in ("project-name",
                                                       "project-id"),
                              plugin.get_options()):
                parser.add_argument(*opt.argparse_args,
                                    default=opt.argparse_default,
                                    metavar='<auth-%s>' % opt.name,
                                    help=opt.help,
                                    dest='os_%s' % opt.dest.replace("-", "_"))

        parser.add_argument(
            '--insecure',
            default=utils.env('NOVACLIENT_INSECURE', default=False),
            action='store_true',
            help="Explicitly allow novaclient to perform 'insecure' "
                 "SSL (https) requests. The server's certificate will "
                 'not be verified against any certificate authorities. '
                 'This option should be used with caution.')

        parser.add_argument(
            '--os-cacert',
            metavar='<ca-certificate>',
            default=utils.env('OS_CACERT', default=requests.certs.where()),
            help='Specify a CA bundle file to use in '
            'verifying a TLS (https) server certificate. '
            'Defaults to env[OS_CACERT].')

        parser.add_argument(
            '--os-cert',
            metavar='<certificate>',
            default=utils.env('OS_CERT', default=None),
            help='Defaults to env[OS_CERT].')

        parser.add_argument(
            '--os-key',
            metavar='<key>',
            default=utils.env('OS_KEY', default=None),
            help='Defaults to env[OS_KEY].')

        parser.add_argument(
            '--timeout',
            default=600,
            metavar='<seconds>',
            help='Set request timeout (in seconds).')

        parser.add_argument(
            '--select-flavors',
            default='all',
            choices=['all', 'public', 'private'],
            help='Select all (default), public or private flavors/templates.')

        parser.add_argument(
            '--all-images',
            action='store_true',
            default=False,
            help=('If set, include information about all images (including '
                  'snapshots), otherwise only publish images with cloudkeeper '
                  'metadata, ignoring the others.'))
예제 #7
0
    def populate_parser(parser):
        plugins = loading_base.get_available_plugin_names()
        default_auth = "v3password"

        parser.add_argument('--os-auth-type',
                            '--os-auth-plugin',
                            metavar='<name>',
                            default=utils.env('OS_AUTH_TYPE',
                                              default=default_auth),
                            choices=plugins,
                            help='Authentication type to use, available '
                            'types are: %s' % ", ".join(plugins))

        # arguments come from session and plugins
        loading_session.register_argparse_arguments(parser)
        for plugin_name in plugins:
            plugin = loading_base.get_plugin_loader(plugin_name)
            for opt in plugin.get_options():
                # NOTE(aloga): we do not want a project to be passed from the
                # CLI, as we will iterate over it for each configured VO and
                # project. However, as the plugin is expecting them when
                # parsing the arguments we need to set them to None before
                # calling the load_auth_from_argparse_arguments method in the
                # __init__ method of this class.
                if opt.name in ("project-name", "project-id"):
                    continue

                parser.add_argument(*opt.argparse_args,
                                    default=opt.argparse_default,
                                    metavar='<auth-%s>' % opt.name,
                                    help=opt.help,
                                    dest='os_%s' % opt.dest.replace("-", "_"))

        parser.add_argument(
            '--insecure',
            default=utils.env('NOVACLIENT_INSECURE', default=False),
            action='store_true',
            help="Explicitly allow novaclient to perform 'insecure' "
            "SSL (https) requests. The server's certificate will "
            'not be verified against any certificate authorities. '
            'This option should be used with caution.')

        parser.add_argument('--os-cacert',
                            metavar='<ca-certificate>',
                            default=utils.env('OS_CACERT',
                                              default=requests.certs.where()),
                            help='Specify a CA bundle file to use in '
                            'verifying a TLS (https) server certificate. '
                            'Defaults to env[OS_CACERT].')

        parser.add_argument('--os-cert',
                            metavar='<certificate>',
                            default=utils.env('OS_CERT', default=None),
                            help='Defaults to env[OS_CERT].')

        parser.add_argument('--os-key',
                            metavar='<key>',
                            default=utils.env('OS_KEY', default=None),
                            help='Defaults to env[OS_KEY].')

        parser.add_argument('--timeout',
                            default=600,
                            metavar='<seconds>',
                            help='Set request timeout (in seconds).')

        parser.add_argument(
            '--select-flavors',
            default='all',
            choices=['all', 'public', 'private'],
            help='Select all (default), public or private flavors/templates.')

        parser.add_argument(
            '--all-images',
            action='store_true',
            default=False,
            help=('If set, include information about all images (including '
                  'snapshots), otherwise only publish images with cloudkeeper '
                  'metadata, ignoring the others.'))