def build_option_parser(parser): """Hook to add global options""" parser.add_argument( '--os-application-catalog-api-version', metavar='<application-catalog-api-version>', default=utils.env( 'OS_APPLICATION_CATALOG_API_VERSION', default=DEFAULT_APPLICATION_CATALOG_API_VERSION), help=_("Application catalog API version, default={0}" "(Env:OS_APPLICATION_CATALOG_API_VERSION)").format( DEFAULT_APPLICATION_CATALOG_API_VERSION)) parser.add_argument('--murano-url', default=utils.env('MURANO_URL'), help=_('Defaults to env[MURANO_URL].')) parser.add_argument('--glare-url', default=utils.env('GLARE_URL'), help='Defaults to env[GLARE_URL].') parser.add_argument('--murano-packages-service', choices=['murano', 'glare'], default=utils.env('MURANO_PACKAGES_SERVICE', default='murano'), help='Specifies if murano-api ("murano") or ' 'Glance Artifact Repository ("glare") ' 'should be used to store murano packages. ' 'Defaults to env[MURANO_PACKAGES_SERVICE] or ' 'to "murano"') return parser
def build_option_parser(parser): parser.add_argument('--inspector-api-version', default=utils.env('INSPECTOR_VERSION', default=DEFAULT_API_VERSION), help='inspector API version, only 1 is supported now ' '(env: INSPECTOR_VERSION).') parser.add_argument('--inspector-url', default=utils.env('INSPECTOR_URL', default=None), help='inspector URL, defaults to localhost ' '(env: INSPECTOR_URL).') return parser
def build_option_parser(parser): # TODO(dtantsur): deprecate these options in favor of more generic OS_* parser.add_argument('--inspector-api-version', default=utils.env('INSPECTOR_VERSION', default=DEFAULT_API_VERSION), help='inspector API version, only 1 is supported now ' '(env: INSPECTOR_VERSION).') parser.add_argument('--inspector-url', default=utils.env('INSPECTOR_URL', default=None), help='inspector URL, defaults to localhost ' '(env: INSPECTOR_URL).') return parser
def build_option_parser(parser): """Hook to add global options""" parser.add_argument('--os-function-engine-api-version', metavar='<function-engine-api-version>', default=utils.env( 'OS_FUNCTION_ENGINE_API_VERSION', default=DEFAULT_FUNCTION_ENGINE_API_VERSION), help=_("Function engine API version, default={0}" "(Env:OS_FUNCTION_ENGINE_API_VERSION)").format( DEFAULT_FUNCTION_ENGINE_API_VERSION)) parser.add_argument('--qinling-url', default=utils.env('QINLING_URL'), help=_('Defaults to env[QINLING_URL].')) return parser
def _append_monasca_args(parser): parser.add_argument('--monasca-api-url', default=utils.env('MONASCA_API_URL'), help='Defaults to env[MONASCA_API_URL].') parser.add_argument('--monasca_api_url', help=argparse.SUPPRESS) parser.add_argument('--monasca-api-version', default=utils.env( 'MONASCA_API_VERSION', default='2_0'), help='Defaults to env[MONASCA_API_VERSION] or 2_0') parser.add_argument('--monasca_api_version', help=argparse.SUPPRESS) return parser
def build_option_parser(parser): """Hook to add global options""" parser.add_argument( '--os-application-catalog-api-version', metavar='<application-catalog-api-version>', default=utils.env( 'OS_APPLICATION_CATALOG_API_VERSION', default=DEFAULT_APPLICATION_CATALOG_API_VERSION), help=_("Application catalog API version, default={0}" "(Env:OS_APPLICATION_CATALOG_API_VERSION)").format( DEFAULT_APPLICATION_CATALOG_API_VERSION)) parser.add_argument('--murano-url', default=utils.env('MURANO_URL'), help=_('Defaults to env[MURANO_URL].')) return parser
def build_option_parser(parser): """Hook to add global options.""" parser.add_argument("--os-data-processing-api-version", metavar="<data-processing-api-version>", default=utils.env( 'OS_DATA_PROCESSING_API_VERSION', default=DEFAULT_DATA_PROCESSING_API_VERSION), help=("Data processing API version, default=" + DEFAULT_DATA_PROCESSING_API_VERSION + ' (Env: OS_DATA_PROCESSING_API_VERSION)')) parser.add_argument("--os-data-processing-url", default=utils.env("OS_DATA_PROCESSING_URL"), help=("Data processing API URL, " "(Env: OS_DATA_PROCESSING_API_URL)")) return parser
def build_option_parser(parser): """Hook to add global options.""" parser.add_argument('--os-tacker-api-version', metavar='<tacker-api-version>', default=utils.env('OS_TACKER_API_VERSION', default=DEFAULT_TACKER_API_VERSION)) return parser
def get_parser(self, prog_name): parser = super(Authorize, self).get_parser(prog_name) parser.add_argument('--stack', dest='stack', help=_('Name or ID of heat stack ' '(default=Env: OVERCLOUD_STACK_NAME)'), default=utils.env('OVERCLOUD_STACK_NAME', default='overcloud')) parser.add_argument('--overcloud-ssh-user', default='heat-admin', help=_('User for ssh access to overcloud nodes')) parser.add_argument( '--overcloud-ssh-key', default=None, help=_('Key path for ssh access to overcloud nodes. When' 'undefined the key will be autodetected.')) parser.add_argument( '--overcloud-ssh-network', help=_('Network name to use for ssh access to overcloud nodes.'), default='ctlplane') parser.add_argument('--overcloud-ssh-enable-timeout', help=_('This option no longer has any effect.'), type=int, default=constants.ENABLE_SSH_ADMIN_TIMEOUT) parser.add_argument( '--overcloud-ssh-port-timeout', help=_('Timeout for the ssh port to become active.'), type=int, default=constants.ENABLE_SSH_ADMIN_SSH_PORT_TIMEOUT) return parser
def get_parser(self, prog_name): parser = super(FFWDUpgradeRun, self).get_parser(prog_name) parser.add_argument( '--yes', action='store_true', help=_("Use --yes to skip the confirmation " "required before any ffwd-upgrade " "operation. Use this with caution! "), ) parser.add_argument('--static-inventory', dest='static_inventory', action="store", default=None, help=_('Path to an existing ansible inventory to ' 'use. If not specified, one will be ' 'generated in ' '~/tripleo-ansible-inventory.yaml')) parser.add_argument("--ssh-user", dest="ssh_user", action="store", default="heat-admin", help=_("The ssh user name for connecting to " "the overcloud nodes.")) parser.add_argument('--stack', dest='stack', help=_('Name or ID of heat stack ' '(default=Env: OVERCLOUD_STACK_NAME)'), default=utils.env('OVERCLOUD_STACK_NAME', default='overcloud')) return parser
def get_parser(self, prog_name): parser = super(UpdateOvercloud, self).get_parser(prog_name) parser.add_argument('stack', nargs='?', help=_('Name or ID of heat stack to scale ' '(default=Env: OVERCLOUD_STACK_NAME)'), default=utils.env('OVERCLOUD_STACK_NAME')) parser.add_argument( '--templates', nargs='?', const=constants.TRIPLEO_HEAT_TEMPLATES, help=_("The directory containing the Heat templates to deploy"), ) parser.add_argument('-i', '--interactive', dest='interactive', action='store_true') parser.add_argument('-a', '--abort', dest='abort_update', action='store_true') parser.add_argument( '-e', '--environment-file', metavar='<HEAT ENVIRONMENT FILE>', action='append', dest='environment_files', help=_('Environment files to be passed to the heat stack-create ' 'or heat stack-update command. (Can be specified more than ' 'once.)')) parser.add_argument( '--answers-file', help=_('Path to a YAML file with arguments and parameters.')) return parser
def get_parser(self, prog_name): parser = super(DeleteOvercloud, self).get_parser(prog_name) parser.add_argument('stack', nargs='?', help=_('Name or ID of heat stack to delete' '(default=Env: OVERCLOUD_STACK_NAME)'), default=osc_utils.env('OVERCLOUD_STACK_NAME')) parser.add_argument('-y', '--yes', help=_('Skip yes/no prompt (assume yes).'), default=False, action="store_true") parser.add_argument('-s', '--skip-ipa-cleanup', help=_('Skip removing overcloud hosts, services, ' 'and DNS records from FreeIPA. This is ' 'particularly relevant for deployments ' 'using certificates from FreeIPA for TLS. ' 'By default, overcloud hosts, services, ' 'and DNS records will be removed from ' 'FreeIPA before deleting the overcloud. ' 'Using this option might require you to ' 'manually cleanup FreeIPA later.'), default=False, action="store_true") return parser
def build_option_parser(self, description, version, argparse_kwargs=None): parser = super(App, self).build_option_parser( description, version, argparse_kwargs=argparse_kwargs) self.config.register_argparse_arguments(parser, sys.argv[1:]) parser.add_argument( '--os-baremetal-api-version', metavar='<baremetal-api-version>', default=utils.env('OS_BAREMETAL_API_VERSION'), help='Bare metal API version, default="latest" (the maximum ' 'version supported by both the client and the server). ' '(Env: OS_BAREMETAL_API_VERSION)', ) parser.add_argument( '--max-retries', metavar='<max-retries-number>', default=http.DEFAULT_MAX_RETRIES, type=int, help='Maximum number of retries on connection problems and ' 'resource state conflicts') parser.add_argument('--retry-interval', metavar='<retry-interval-seconds>', default=http.DEFAULT_RETRY_INTERVAL, type=int, help='Interval in seconds between two retries') return parser
def get_parser(self, prog_name): parser = super(ProvisionNode, self).get_parser(prog_name) parser.add_argument('input', metavar='<baremetal_deployment.yaml>', help=_('Configuration file describing the ' 'baremetal deployment')) parser.add_argument('-o', '--output', default='baremetal_environment.yaml', help=_('The output environment file path')) parser.add_argument('--stack', dest='stack', help=_('Name or ID of heat stack ' '(default=Env: OVERCLOUD_STACK_NAME)'), default=utils.env('OVERCLOUD_STACK_NAME', default='overcloud')) parser.add_argument('--overcloud-ssh-user', default='heat-admin', help=_('User for SSH access to newly deployed ' 'nodes')) parser.add_argument('--overcloud-ssh-key', default=None, help=_('Key path for ssh access to' 'overcloud nodes. When undefined the key' 'will be autodetected.')) parser.add_argument('--concurrency', type=int, default=20, help=_('Maximum number of nodes to provision at ' 'once. (default=20)')) parser.add_argument('--timeout', type=int, default=3600, help=_('Number of seconds to wait for the node ' 'provision to complete. (default=3600)')) return parser
def get_parser(self, prog_name): parser = super(ExportCell, self).get_parser(prog_name) parser.add_argument('name', metavar='<cell name>', help=_('Name of the stack used for the additional ' 'cell.')) parser.add_argument('--control-plane-stack', dest='control_plane_stack', metavar='<control plane stack>', help=_('Name of the environment main Heat stack ' 'to export information from. ' '(default=Env: OVERCLOUD_STACK_NAME)'), default=utils.env('OVERCLOUD_STACK_NAME', default='overcloud')) parser.add_argument('--cell-stack', '-e', metavar='<cell stack>', help=_('Name of the controller cell Heat stack to ' 'export information from. Used in case of: ' 'control plane stack -> cell controller ' 'stack -> multiple compute stacks')) parser.add_argument('--output-file', '-o', metavar='<output file>', help=_('Name of the output file for the cell data ' 'export. It will default to "<name>.yaml"')) parser.add_argument('--force-overwrite', '-f', action='store_true', default=False, help=_('Overwrite output file if it exists.')) return parser
def get_parser(self, prog_name): parser = super(ExportOvercloud, self).get_parser(prog_name) parser.add_argument('--stack', dest='stack', metavar='<stack>', help=_('Name of the environment main Heat stack ' 'to export information from. ' '(default=Env: OVERCLOUD_STACK_NAME)'), default=utils.env('OVERCLOUD_STACK_NAME', default='overcloud')) parser.add_argument('--output-file', '-o', metavar='<output file>', help=_('Name of the output file for the stack ' 'data export. It will default to ' '"<name>.yaml"')) parser.add_argument('--force-overwrite', '-f', action='store_true', default=False, help=_('Overwrite output file if it exists.')) parser.add_argument('--config-download-dir', action='store', help=_('Directory to search for config-download ' 'export data. Defaults to ' '/var/lib/mistral/<stack>')) parser.add_argument('--no-password-excludes', action='store_true', dest='no_password_excludes', help=_('Don''t exclude certain passwords from ' 'the password export. Defaults to False ' 'in that some passwords will be excluded ' 'that are not typically necessary.')) return parser
def get_parser(self, prog_name): parser = super(DeleteNode, self).get_parser(prog_name) parser.add_argument('nodes', metavar='<node>', nargs="+", help=_('Node ID(s) to delete')) parser.add_argument('--stack', dest='stack', help=_('Name or ID of heat stack to scale ' '(default=Env: OVERCLOUD_STACK_NAME)'), default=utils.env('OVERCLOUD_STACK_NAME')) parser.add_argument( '--templates', nargs='?', const=constants.TRIPLEO_HEAT_TEMPLATES, help=_("The directory containing the Heat templates to deploy")) parser.add_argument( '-e', '--environment-file', metavar='<HEAT ENVIRONMENT FILE>', action='append', dest='environment_files', help=_('Environment files to be passed to the heat stack-create ' 'or heat stack-update command. (Can be specified more than ' 'once.)')) return parser
def get_parser(self, prog_name): parser = super(ProvisionNode, self).get_parser(prog_name) parser.add_argument('input', metavar='<baremetal_deployment.yaml>', help=_('Configuration file describing the ' 'baremetal deployment')) parser.add_argument('-o', '--output', default='baremetal_environment.yaml', help=_('The output environment file path')) parser.add_argument('--stack', dest='stack', help=_('Name or ID of heat stack ' '(default=Env: OVERCLOUD_STACK_NAME)'), default=utils.env('OVERCLOUD_STACK_NAME', default='overcloud')) parser.add_argument('--overcloud-ssh-user', default='heat-admin', help=_('User for SSH access to newly deployed ' 'nodes')) parser.add_argument('--overcloud-ssh-key', default=os.path.join(os.path.expanduser('~'), '.ssh', 'id_rsa.pub'), help=_('Public key path for SSH access to newly ' 'deployed nodes')) return parser
def get_parser(self, prog_name): parser = super(DeleteNode, self).get_parser(prog_name) parser.add_argument('nodes', metavar='<node>', nargs="+", help=_('Node ID(s) to delete')) parser.add_argument('--stack', dest='stack', help=_('Name or ID of heat stack to scale ' '(default=Env: OVERCLOUD_STACK_NAME)'), default=utils.env('OVERCLOUD_STACK_NAME', default='overcloud')) parser.add_argument( '--templates', nargs='?', const=constants.TRIPLEO_HEAT_TEMPLATES, help=_("The directory containing the Heat templates to deploy. " "This argument is deprecated. The command now utilizes " "a deployment plan, which should be updated prior to " "running this command, should that be required. Otherwise " "this argument will be silently ignored."), ) parser.add_argument( '-e', '--environment-file', metavar='<HEAT ENVIRONMENT FILE>', action='append', dest='environment_files', help=_("Environment files to be passed to the heat stack-create " "or heat stack-update command. (Can be specified more than " "once.) This argument is deprecated. The command now " "utilizes a deployment plan, which should be updated prior " "to running this command, should that be required. " "Otherwise this argument will be silently ignored."), ) return parser
def build_option_parser(parser): """Hook to add global options.""" parser.add_argument( '--rating-api-version', type=int, default=utils.env( 'OS_RATING_API_VERSION', default=DEFAULT_API_VERSION) ) return parser
def get_parser(self, prog_name): parser = super(ExternalUpdateRun, self).get_parser(prog_name) parser.add_argument('--static-inventory', dest='static_inventory', action="store", default=None, help=_('Path to an existing ansible inventory to ' 'use. If not specified, one will be ' 'generated in ' '~/tripleo-ansible-inventory.yaml')) parser.add_argument("--ssh-user", dest="ssh_user", action="store", default="tripleo-admin", help=_("DEPRECATED: Only tripleo-admin should be " "used as ssh user.")) parser.add_argument('--tags', dest='tags', action="store", default="", help=_('A string specifying the tag or comma ' 'separated list of tags to be passed ' 'as --tags to ansible-playbook. ')) parser.add_argument('--skip-tags', dest='skip_tags', action="store", default="", help=_('A string specifying the tag or comma ' 'separated list of tags to be passed ' 'as --skip-tags to ansible-playbook. ')) parser.add_argument('--stack', dest='stack', help=_('Name or ID of heat stack ' '(default=Env: OVERCLOUD_STACK_NAME)'), default=utils.env('OVERCLOUD_STACK_NAME', default='overcloud')) parser.add_argument('-e', '--extra-vars', dest='extra_vars', action='append', help=('Set additional variables as key=value or ' 'yaml/json'), default=[]) parser.add_argument('--no-workflow', dest='no_workflow', action='store_true', default=True, help=_('This option no longer has any effect.')) parser.add_argument( '--limit', action='store', default=None, help=_("A string that identifies a single node or comma-separated" "list of nodes the config-download Ansible playbook " "execution will be limited to. For example: --limit" " \"compute-0,compute-1,compute-5\".")) return parser
def build_option_parser(parser): """Hook to add global options.""" parser.add_argument('--os-baremetal-api-version', metavar='<baremetal-api-version>', default=utils.env('OS_BAREMETAL_API_VERSION', default=http.DEFAULT_VER), help='Baremetal API version, default=' + http.DEFAULT_VER + ' (Env: OS_BAREMETAL_API_VERSION)') return parser
def build_option_parser(parser): """Hook to add global options""" parser.add_argument('--os-ha-api-version', metavar='<ha-api-version>', default=utils.env('OS_HA_API_VERSION', default=DEFAULT_HA_API_VERSION), help='ha API version, default=' + DEFAULT_HA_API_VERSION + ' (Env: OS_HA_API_VERSION)') return parser
def build_option_parser(parser): """Hook to add global options.""" parser.add_argument( "--os-data-processing-api-version", metavar="<data-processing-api-version>", default=utils.env( 'OS_DATA_PROCESSING_API_VERSION', default=DEFAULT_DATA_PROCESSING_API_VERSION), help=("Data processing API version, default=" + DEFAULT_DATA_PROCESSING_API_VERSION + ' (Env: OS_DATA_PROCESSING_API_VERSION)')) parser.add_argument( "--os-data-processing-url", default=utils.env( "OS_DATA_PROCESSING_URL"), help=("Data processing API URL, " "(Env: OS_DATA_PROCESSING_API_URL)")) return parser
def build_option_parser(parser): """Hook to add global options.""" parser.add_argument( '--os-tacker-api-version', metavar='<tacker-api-version>', default=utils.env( 'OS_TACKER_API_VERSION', default=DEFAULT_TACKER_API_VERSION)) return parser
def build_option_parser(parser): """Hook to add global options""" parser.add_argument('--os_vbs_api_version', metavar='<vbs-api-version>', default=utils.env('OS_VBS_API_VERSION'), help=_("VBS API version, default=%s " "(Env: OS_VBS_API_VERSION)") % DEFAULT_API_VERSION) return parser
def build_option_parser(parser): """Hook to add global options""" parser.add_argument('--os-volume-api-version', metavar='<volume-api-version>', default=utils.env('OS_VOLUME_API_VERSION'), help=_('Volume API version, default=%s ' '(Env: OS_VOLUME_API_VERSION)') % DEFAULT_API_VERSION) return parser
def build_option_parser(parser): """Hook to add global options""" parser.add_argument('--os-network-api-version', metavar='<network-api-version>', default=utils.env('OS_NETWORK_API_VERSION'), help=_("Network API version, default=%s " "(Env: OS_NETWORK_API_VERSION)") % DEFAULT_API_VERSION) return parser
def build_option_parser(parser): """Hook to add global options""" parser.add_argument('--os-compute-api-version', metavar='<compute-api-version>', default=utils.env('OS_COMPUTE_API_VERSION'), help=_("Compute API version, default=%s " "(Env: OS_COMPUTE_API_VERSION)") % DEFAULT_API_VERSION) return parser
def get_parser(self, prog_name): parser = super(UpdateRun, self).get_parser(prog_name) parser.add_argument( '--limit', action='store', required=True, help=_( "A string that identifies a single node or comma-separated" " list of nodes to be upgraded in parallel in this upgrade" " run invocation. For example: --limit \"compute-0," " compute-1, compute-5\".") ) parser.add_argument('--playbook', action="store", default="all", help=_("Ansible playbook to use for the minor " "update. Defaults to the special value " "\'all\' which causes all the update " "playbooks to be executed. That is the " "update_steps_playbook.yaml and then the" "deploy_steps_playbook.yaml. " "Set this to each of those playbooks in " "consecutive invocations of this command " "if you prefer to run them manually. Note: " "make sure to run both those playbooks so " "that all services are updated and running " "with the target version configuration.") ) parser.add_argument("--ssh-user", dest="ssh_user", action="store", default="tripleo-admin", help=_("DEPRECATED: Only tripleo-admin should be " "used as ssh user.") ) parser.add_argument('--static-inventory', dest='static_inventory', action="store", default=None, help=_('Path to an existing ansible inventory to ' 'use. If not specified, one will be ' 'generated in ' '~/tripleo-ansible-inventory.yaml') ) parser.add_argument('--stack', dest='stack', help=_('Name or ID of heat stack ' '(default=Env: OVERCLOUD_STACK_NAME)'), default=utils.env('OVERCLOUD_STACK_NAME', default='overcloud') ) parser.add_argument('--no-workflow', dest='no_workflow', action='store_true', default=False, help=_('Run ansible-playbook directly via ' 'system command instead of running Ansible' 'via the TripleO mistral workflows.') ) return parser
def build_option_parser(parser): """Hook to add global options""" parser.add_argument( '--os-object-api-version', metavar='<object-api-version>', default=utils.env('OS_OBJECT_API_VERSION'), help='Object API version, default=' + DEFAULT_API_VERSION + ' (Env: OS_OBJECT_API_VERSION)') return parser
def build_option_parser(parser): """Hook to add global options""" parser.add_argument( '--os-identity-api-version', metavar='<identity-api-version>', default=utils.env('OS_IDENTITY_API_VERSION'), help=_('Identity API version, default=%s ' '(Env: OS_IDENTITY_API_VERSION)') % DEFAULT_API_VERSION, ) return auth.build_auth_plugins_option_parser(parser)
def build_option_parser(parser): """Hook to add global options""" parser.add_argument( '--os-identity-api-version', metavar='<identity-api-version>', default=utils.env('OS_IDENTITY_API_VERSION'), help=_('Identity API version, default=%s ' '(Env: OS_IDENTITY_API_VERSION)') % DEFAULT_API_VERSION, ) return parser
def _get_environment_version(default): global OS_BAREMETAL_API_LATEST env_value = utils.env('OS_BAREMETAL_API_VERSION') if not env_value: env_value = default if env_value == 'latest': env_value = LATEST_VERSION else: OS_BAREMETAL_API_LATEST = False return env_value
def _get_environment_version(default): env_value = utils.env('OS_CONTAINER_API_VERSION') or default latest = env_value == '1.latest' if latest: # NOTE(hongbin): '1.latest' means enabling negotiation of the # latest version between server and client but due to how OSC works # we cannot just add "1.latest" to the list of supported versions. # Use '1' in this case. env_value = '1' return env_value
def build_option_parser(parser): """Hook to add global options""" parser.add_argument( '--os-image-api-version', metavar='<image-api-version>', default=utils.env('OS_IMAGE_API_VERSION'), help=_('Image API version, default=%s (Env: OS_IMAGE_API_VERSION)') % DEFAULT_API_VERSION, ) return parser
def build_option_parser(parser): """Hook to add global options""" parser.add_argument( '--os-compute-api-version', metavar='<compute-api-version>', default=utils.env('OS_COMPUTE_API_VERSION'), help=_("Compute API version, default=%s " "(Env: OS_COMPUTE_API_VERSION)") % DEFAULT_API_VERSION ) return parser
def build_option_parser(parser): """Hook to add global options""" parser.add_argument( '--os-network-api-version', metavar='<network-api-version>', default=utils.env('OS_NETWORK_API_VERSION'), help=_("Network API version, default=%s " "(Env: OS_NETWORK_API_VERSION)") % DEFAULT_API_VERSION ) return parser
def build_option_parser(parser): """Hook to add global options""" parser.add_argument( '--os-artifact-api-version', metavar='<artifact-api-version>', default=utils.env('OS_ARTIFACT_API_VERSION'), help=_('Artifact API version, default=%s ' '(Env: OS_ARTIFACT_API_VERSION)') % DEFAULT_API_VERSION, ) return parser
def build_option_parser(parser): """Hook to add global options""" parser.add_argument( '--os-volume-api-version', metavar='<volume-api-version>', default=utils.env('OS_VOLUME_API_VERSION'), help=_('Volume API version, default=%s ' '(Env: OS_VOLUME_API_VERSION)') % DEFAULT_API_VERSION ) return parser
def build_option_parser(parser): """Hook to add global options.""" parser.add_argument('--os-infra-optim-api-version', metavar='<infra-optim-api-version>', default=utils.env( 'OS_INFRA_OPTIM_API_VERSION', default=DEFAULT_API_VERSION), help=('Watcher API version, default=' + DEFAULT_API_VERSION + ' (Env: OS_INFRA_OPTIM_API_VERSION)')) return parser
def get_parser(self, prog_name): parser = super(DeleteOvercloud, self).get_parser(prog_name) parser.add_argument('stack', nargs='?', help=_('Name or ID of heat stack to delete' '(default=Env: OVERCLOUD_STACK_NAME)'), default=osc_utils.env('OVERCLOUD_STACK_NAME')) parser.add_argument('-y', '--yes', help=_('Skip yes/no prompt (assume yes).'), default=False, action="store_true") return parser
def build_option_parser(parser): """Hook to add global options.""" parser.add_argument( '--os-queues-api-version', metavar='<queues-api-version>', default=utils.env( 'OS_QUEUES_API_VERSION', default=DEFAULT_QUEUES_API_VERSION), help=('Queues API version, default=' + DEFAULT_QUEUES_API_VERSION + ' (Env: OS_QUEUES_API_VERSION)')) return parser
def build_option_parser(parser): """Hook to add global options""" parser.add_argument( '--os-orchestration-api-version', metavar='<orchestration-api-version>', default=utils.env( 'OS_ORCHESTRATION_API_VERSION', default=DEFAULT_ORCHESTRATION_API_VERSION), help='Orchestration API version, default=' + DEFAULT_ORCHESTRATION_API_VERSION + ' (Env: OS_ORCHESTRATION_API_VERSION)') return parser
def build_option_parser(parser): """Hook to add global options""" parser.add_argument( '--os-search-api-version', metavar='<search-api-version>', default=utils.env( 'OS_SEARCH_API_VERSION', default=DEFAULT_SEARCH_API_VERSION), help='Search API version, default=' + DEFAULT_SEARCH_API_VERSION + ' (Env: OS_SEARCH_API_VERSION)') return parser
def build_option_parser(parser): """Hook to add global options.""" parser.add_argument( '--os-baremetal-api-version', metavar='<baremetal-api-version>', default=utils.env( 'OS_BAREMETAL_API_VERSION', default=http.DEFAULT_VER), help='Baremetal API version, default=' + http.DEFAULT_VER + ' (Env: OS_BAREMETAL_API_VERSION)') return parser
def build_option_parser(parser): """Hook to add global options""" parser.add_argument( '--os-data-protection-api-version', metavar='<data-protection-api-version>', default=utils.env( 'OS_DATA_PROTECTION_API_VERSION', default=DEFAULT_DATA_PROTECTION_API_VERSION), help='Data protection API version, default=' + DEFAULT_DATA_PROTECTION_API_VERSION + ' (Env: OS_DATA_PROTECTION_API_VERSION)') return parser
def build_auth_plugins_option_parser(parser): """Auth plugins options builder Builds dynamically the list of options expected by each available authentication plugin. """ available_plugins = list(get_plugin_list()) parser.add_argument( '--os-auth-type', metavar='<auth-type>', dest='auth_type', default=utils.env('OS_AUTH_TYPE'), help=_('Select an authentication type. Available types: %s.' ' Default: selected based on --os-username/--os-token' ' (Env: OS_AUTH_TYPE)') % ', '.join(available_plugins), choices=available_plugins ) # Maintain compatibility with old tenant env vars envs = { 'OS_PROJECT_NAME': utils.env( 'OS_PROJECT_NAME', default=utils.env('OS_TENANT_NAME') ), 'OS_PROJECT_ID': utils.env( 'OS_PROJECT_ID', default=utils.env('OS_TENANT_ID') ), } for o in get_options_list(): # Remove tenant options from KSC plugins and replace them below if 'tenant' not in o: parser.add_argument( '--os-' + o, metavar='<auth-%s>' % o, dest=o.replace('-', '_'), default=envs.get( OPTIONS_LIST[o]['env'], utils.env(OPTIONS_LIST[o]['env']), ), help=_('%(help)s\n(Env: %(env)s)') % { 'help': OPTIONS_LIST[o]['help'], 'env': OPTIONS_LIST[o]['env'], }, ) # add tenant-related options for compatibility # this is deprecated but still used in some tempest tests... parser.add_argument( '--os-tenant-name', metavar='<auth-tenant-name>', dest='os_project_name', help=argparse.SUPPRESS, ) parser.add_argument( '--os-tenant-id', metavar='<auth-tenant-id>', dest='os_project_id', help=argparse.SUPPRESS, ) return parser
def build_option_parser(parser): """Hook to add global options.""" parser.add_argument( '--os-workflow-api-version', metavar='<workflow-api-version>', default=utils.env( 'OS_WORKFLOW_API_VERSION', default=DEFAULT_WORKFLOW_API_VERSION), help='Workflow API version, default=' + DEFAULT_WORKFLOW_API_VERSION + ' (Env: OS_WORKFLOW_API_VERSION)') return parser
def build_option_parser(parser): """Hook to add global options Called from openstackclient.shell.OpenStackShell.__init__() after the builtin parser has been initialized. This is where a plugin can add global options such as an API version setting. :param argparse.ArgumentParser parser: The parser object that has been initialized by OpenStackShell. """ parser.add_argument( '--os-oscplugin-api-version', metavar='<oscplugin-api-version>', default=utils.env( 'OS_OSCPLUGIN_API_VERSION', default=DEFAULT_OSCPLUGIN_API_VERSION), help='OSC Plugin API version, default=' + DEFAULT_OSCPLUGIN_API_VERSION + ' (Env: OS_OSCPLUGIN_API_VERSION)') return parser
def build_option_parser(self, description, version, argparse_kwargs=None): """Introduces global arguments for the application. This is inherited from the framework. """ parser = super(WatcherShell, self).build_option_parser( description, version, argparse_kwargs) parser.add_argument('--no-auth', '-N', action='store_true', help='Do not use authentication.') parser.add_argument('--os-identity-api-version', metavar='<identity-api-version>', default=utils.env('OS_IDENTITY_API_VERSION'), help='Specify Identity API version to use. ' 'Defaults to env[OS_IDENTITY_API_VERSION]' ' or 3.') parser.add_argument('--os-auth-url', '-A', metavar='<auth-url>', default=utils.env('OS_AUTH_URL'), help='Defaults to env[OS_AUTH_URL].') parser.add_argument('--os-region-name', '-R', metavar='<region-name>', default=utils.env('OS_REGION_NAME'), help='Defaults to env[OS_REGION_NAME].') parser.add_argument('--os-username', '-U', metavar='<auth-user-name>', default=utils.env('OS_USERNAME'), help='Defaults to env[OS_USERNAME].') parser.add_argument('--os-user-id', metavar='<auth-user-id>', default=utils.env('OS_USER_ID'), help='Defaults to env[OS_USER_ID].') parser.add_argument('--os-password', '-P', metavar='<auth-password>', default=utils.env('OS_PASSWORD'), help='Defaults to env[OS_PASSWORD].') parser.add_argument('--os-user-domain-id', metavar='<auth-user-domain-id>', default=utils.env('OS_USER_DOMAIN_ID'), help='Defaults to env[OS_USER_DOMAIN_ID].') parser.add_argument('--os-user-domain-name', metavar='<auth-user-domain-name>', default=utils.env('OS_USER_DOMAIN_NAME'), help='Defaults to env[OS_USER_DOMAIN_NAME].') parser.add_argument('--os-tenant-name', '-T', metavar='<auth-tenant-name>', default=utils.env('OS_TENANT_NAME'), help='Defaults to env[OS_TENANT_NAME].') parser.add_argument('--os-tenant-id', '-I', metavar='<tenant-id>', default=utils.env('OS_TENANT_ID'), help='Defaults to env[OS_TENANT_ID].') parser.add_argument('--os-project-id', metavar='<auth-project-id>', default=utils.env('OS_PROJECT_ID'), help='Another way to specify tenant ID. ' 'This option is mutually exclusive with ' ' --os-tenant-id. ' 'Defaults to env[OS_PROJECT_ID].') parser.add_argument('--os-project-name', metavar='<auth-project-name>', default=utils.env('OS_PROJECT_NAME'), help='Another way to specify tenant name. ' 'This option is mutually exclusive with ' ' --os-tenant-name. ' 'Defaults to env[OS_PROJECT_NAME].') parser.add_argument('--os-project-domain-id', metavar='<auth-project-domain-id>', default=utils.env('OS_PROJECT_DOMAIN_ID'), help='Defaults to env[OS_PROJECT_DOMAIN_ID].') parser.add_argument('--os-project-domain-name', metavar='<auth-project-domain-name>', default=utils.env('OS_PROJECT_DOMAIN_NAME'), help='Defaults to env[OS_PROJECT_DOMAIN_NAME].') parser.add_argument('--os-auth-token', metavar='<auth-token>', default=utils.env('OS_AUTH_TOKEN'), help='Defaults to env[OS_AUTH_TOKEN].') parser.add_argument( '--os-infra-optim-api-version', metavar='<infra-optim-api-version>', default=utils.env('OS_INFRA_OPTIM_API_VERSION', default=DEFAULT_OS_INFRA_OPTIM_API_VERSION), help='Accepts X, X.Y (where X is major and Y is minor part) or ' '"X.latest", defaults to env[OS_INFRA_OPTIM_API_VERSION].') parser.add_argument('--os-endpoint-type', default=utils.env('OS_ENDPOINT_TYPE'), help='Defaults to env[OS_ENDPOINT_TYPE] or ' '"publicURL"') parser.add_argument('--os-endpoint-override', metavar='<endpoint-override>', default=utils.env('OS_ENDPOINT_OVERRIDE'), help="Use this API endpoint instead of the " "Service Catalog.") parser.epilog = ('See "watcher help COMMAND" for help ' 'on a specific command.') loading.register_session_argparse_arguments(parser) return parser
def build_option_parser(self, description, version): parser = super(OpenStackShell, self).build_option_parser( description, version) # service token auth argument parser.add_argument( '--os-cloud', metavar='<cloud-config-name>', dest='cloud', default=utils.env('OS_CLOUD'), help=_('Cloud name in clouds.yaml (Env: OS_CLOUD)'), ) # Global arguments parser.add_argument( '--os-region-name', metavar='<auth-region-name>', dest='region_name', default=utils.env('OS_REGION_NAME'), help=_('Authentication region name (Env: OS_REGION_NAME)'), ) parser.add_argument( '--os-cacert', metavar='<ca-bundle-file>', dest='cacert', default=utils.env('OS_CACERT'), help=_('CA certificate bundle file (Env: OS_CACERT)'), ) parser.add_argument( '--os-cert', metavar='<certificate-file>', dest='cert', default=utils.env('OS_CERT'), help=_('Client certificate bundle file (Env: OS_CERT)'), ) parser.add_argument( '--os-key', metavar='<key-file>', dest='key', default=utils.env('OS_KEY'), help=_('Client certificate key file (Env: OS_KEY)'), ) verify_group = parser.add_mutually_exclusive_group() verify_group.add_argument( '--verify', action='store_true', default=None, help=_('Verify server certificate (default)'), ) verify_group.add_argument( '--insecure', action='store_true', default=None, help=_('Disable server certificate verification'), ) parser.add_argument( '--os-default-domain', metavar='<auth-domain>', dest='default_domain', default=utils.env( 'OS_DEFAULT_DOMAIN', default=DEFAULT_DOMAIN), help=_('Default domain ID, default=%s. ' '(Env: OS_DEFAULT_DOMAIN)') % DEFAULT_DOMAIN, ) parser.add_argument( '--os-interface', metavar='<interface>', dest='interface', choices=['admin', 'public', 'internal'], default=utils.env('OS_INTERFACE'), help=_('Select an interface type.' ' Valid interface types: [admin, public, internal].' ' (Env: OS_INTERFACE)'), ) parser.add_argument( '--timing', default=False, action='store_true', help=_("Print API call timing info"), ) parser.add_argument( '--os-beta-command', action='store_true', help=_("Enable beta commands which are subject to change"), ) # osprofiler HMAC key argument if osprofiler_profiler: parser.add_argument( '--os-profile', metavar='hmac-key', dest='profile', help=_('HMAC key for encrypting profiling context data'), ) # NOTE(dtroyer): This global option should have been named # --os-profile as --profile interferes with at # least one existing command option. Deprecate # --profile and remove after Apr 2017. parser.add_argument( '--profile', metavar='hmac-key', dest='old_profile', help=argparse.SUPPRESS, ) return clientmanager.build_plugin_option_parser(parser)
def build_option_parser(self, description, version): parser = super(OpenStackShell, self).build_option_parser( description, version) # service token auth argument parser.add_argument( '--os-cloud', metavar='<cloud-config-name>', dest='cloud', default=utils.env('OS_CLOUD'), help=_('Cloud name in clouds.yaml (Env: OS_CLOUD)'), ) # Global arguments parser.add_argument( '--os-region-name', metavar='<auth-region-name>', dest='region_name', default=utils.env('OS_REGION_NAME'), help=_('Authentication region name (Env: OS_REGION_NAME)'), ) parser.add_argument( '--os-cacert', metavar='<ca-bundle-file>', dest='cacert', default=utils.env('OS_CACERT', default=None), help=_('CA certificate bundle file (Env: OS_CACERT)'), ) parser.add_argument( '--os-cert', metavar='<certificate-file>', dest='cert', default=utils.env('OS_CERT'), help=_('Client certificate bundle file (Env: OS_CERT)'), ) parser.add_argument( '--os-key', metavar='<key-file>', dest='key', default=utils.env('OS_KEY'), help=_('Client certificate key file (Env: OS_KEY)'), ) verify_group = parser.add_mutually_exclusive_group() verify_group.add_argument( '--verify', action='store_true', default=None, help=_('Verify server certificate (default)'), ) verify_group.add_argument( '--insecure', action='store_true', default=None, help=_('Disable server certificate verification'), ) parser.add_argument( '--os-default-domain', metavar='<auth-domain>', dest='default_domain', default=utils.env( 'OS_DEFAULT_DOMAIN', default=DEFAULT_DOMAIN), help=_('Default domain ID, default=%s. ' '(Env: OS_DEFAULT_DOMAIN)') % DEFAULT_DOMAIN, ) parser.add_argument( '--os-interface', metavar='<interface>', dest='interface', choices=['admin', 'public', 'internal'], default=utils.env( 'OS_INTERFACE', default=DEFAULT_INTERFACE), help=_('Select an interface type.' ' Valid interface types: [admin, public, internal].' ' default=%s, (Env: OS_INTERFACE)') % DEFAULT_INTERFACE, ) parser.add_argument( '--os-service-provider', metavar='<service_provider>', dest='service_provider', default=utils.env('OS_SERVICE_PROVIDER'), help=_('Authenticate with and perform the command on a service' ' provider using Keystone-to-keystone federation. Must' ' also specify the remote project option.') ) remote_project_group = parser.add_mutually_exclusive_group() remote_project_group.add_argument( '--os-remote-project-name', metavar='<remote_project_name>', dest='remote_project_name', default=utils.env('OS_REMOTE_PROJECT_NAME'), help=_('Project name when authenticating to a service provider' ' if using Keystone-to-Keystone federation.') ) remote_project_group.add_argument( '--os-remote-project-id', metavar='<remote_project_id>', dest='remote_project_id', default=utils.env('OS_REMOTE_PROJECT_ID'), help=_('Project ID when authenticating to a service provider' ' if using Keystone-to-Keystone federation.') ) remote_project_domain_group = parser.add_mutually_exclusive_group() remote_project_domain_group.add_argument( '--os-remote-project-domain-name', metavar='<remote_project_domain_name>', dest='remote_project_domain_name', default=utils.env('OS_REMOTE_PROJECT_DOMAIN_NAME'), help=_('Domain name of the project when authenticating to a' ' service provider if using Keystone-to-Keystone' ' federation.') ) remote_project_domain_group.add_argument( '--os-remote-project-domain-id', metavar='<remote_project_domain_id>', dest='remote_project_domain_id', default=utils.env('OS_REMOTE_PROJECT_DOMAIN_ID'), help=_('Domain ID of the project when authenticating to a' ' service provider if using Keystone-to-Keystone' ' federation.') ) parser.add_argument( '--timing', default=False, action='store_true', help=_("Print API call timing info"), ) parser.add_argument( '--os-beta-command', action='store_true', help=_("Enable beta commands which are subject to change"), ) # osprofiler HMAC key argument if osprofiler_profiler: parser.add_argument( '--os-profile', metavar='hmac-key', dest='profile', default=utils.env('OS_PROFILE'), help=_('HMAC key for encrypting profiling context data'), ) return parser