How to use the rally.cli.cliutils.args function in rally

To help you get started, we’ve selected a few rally examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github openstack / rally / rally / cli / commands / verify.py View on Github external
    @cliutils.args("--deployment-id", dest="deployment", type=str,
                   metavar="", required=False,
                   help="Deployment name or UUID. If specified, only the "
                        "deployment-specific data will be deleted for "
                        "verifier. " + LIST_DEPLOYMENTS_HINT)
    @cliutils.args("--force", dest="force", action="store_true",
                   required=False,
                   help="Delete all stored verifications of the specified "
                        "verifier. If a deployment specified, only "
                        "verifications of this deployment will be deleted. "
                        "Use this argument carefully! You can delete "
                        "verifications that may be important to you.")
    @plugins.ensure_plugins_are_loaded
    def delete_verifier(self, api, verifier_id, deployment=None, force=False):
        """Delete a verifier."""

        api.verifier.delete(verifier_id=verifier_id,
github openstack / rally / rally / cli / commands / env.py View on Github external
    @cliutils.args("--only-spec", action="store_true", dest="only_spec",
                   help="Print only a spec for the environment.")
    @cliutils.suppress_warnings
    @envutils.with_default_env()
    def show(self, api, env=None, to_json=False, only_spec=False):
        env_data = env_mgr.EnvManager.get(env).data
        self._show(env_data, to_json=to_json, only_spec=only_spec)
github openstack / rally / rally / cli / commands / task.py View on Github external
    @cliutils.args("--html-static", dest="out_format",
                   action="store_const", const="html-static")
    @cliutils.args("--json", dest="out_format",
                   action="store_const", const="json")
    @cliutils.args("--uuid", dest="tasks", nargs="+", type=str,
                   help="UUIDs of tasks or json reports of tasks")
    @cliutils.args("--deployment", dest="deployment", type=str,
                   help="Report all tasks with defined deployment",
                   required=False)
    @envutils.default_from_global("tasks", envutils.ENV_TASK, "uuid")
    @cliutils.suppress_warnings
    def report(self, api, tasks=None, out=None,
               open_it=False, out_format="html", deployment=None):
        """Generate a report for the specified task(s)."""
        self.export(api, tasks=tasks,
                    output_type=out_format,
                    output_dest=out,
github openstack / rally / rally / cli / commands / use.py View on Github external
    @cliutils.args("--deployment", type=str, dest="deployment",
                   help="UUID or name of the deployment")
    def deployment(self, deployment=None):
        """Set active deployment.

        :param deployment: UUID or name of a deployment
        """
        LOG.warning("Deprecated command 'rally use deployment', "
                    "'rally deployment use' should be used instead.")
        cli_deployment.DeploymentCommands().use(deployment)
github openstack / rally / rally / cli / commands / verify.py View on Github external
    @cliutils.args("--id", dest="verifier_id", type=str, required=True,
                   help="Verifier name or UUID. " + LIST_VERIFIERS_HINT)
    @cliutils.args("--deployment-id", dest="deployment", type=str,
                   metavar="", required=False,
                   help="Deployment name or UUID. If specified, only the "
                        "deployment-specific data will be deleted for "
                        "verifier. " + LIST_DEPLOYMENTS_HINT)
    @cliutils.args("--force", dest="force", action="store_true",
                   required=False,
                   help="Delete all stored verifications of the specified "
                        "verifier. If a deployment specified, only "
                        "verifications of this deployment will be deleted. "
                        "Use this argument carefully! You can delete "
                        "verifications that may be important to you.")
    @plugins.ensure_plugins_are_loaded
    def delete_verifier(self, api, verifier_id, deployment=None, force=False):
        """Delete a verifier."""
github openstack / rally / rally / cli / commands / task.py View on Github external
    @cliutils.args("--open", dest="open_it", action="store_true",
                   help="Open the output in a browser.")
    @cliutils.args("--html", dest="out_format",
                   action="store_const", const="html")
    @cliutils.args("--html-static", dest="out_format",
                   action="store_const", const="html-static")
    @cliutils.args("--json", dest="out_format",
                   action="store_const", const="json")
    @cliutils.args("--uuid", dest="tasks", nargs="+", type=str,
                   help="UUIDs of tasks or json reports of tasks")
    @cliutils.args("--deployment", dest="deployment", type=str,
                   help="Report all tasks with defined deployment",
                   required=False)
    @envutils.default_from_global("tasks", envutils.ENV_TASK, "uuid")
    @cliutils.suppress_warnings
    def report(self, api, tasks=None, out=None,
               open_it=False, out_format="html", deployment=None):
github openstack / rally / rally / cli / commands / plugin.py View on Github external
    @cliutils.args(
        "--platform", dest="platform", type=str,
        help="List only plugins that are in the specified platform.")
    @cliutils.args(
        "--plugin-base", dest="base_cls", type=str,
        help="Plugin base class.")
    @plugins.ensure_plugins_are_loaded
    def list(self, api, name=None, platform=None, base_cls=None):
        """List all Rally plugins that match name and platform."""
        all_plugins = plugin.Plugin.get_all(platform=platform)
        matched = all_plugins
        if name:
            name_lw = name.lower()
            matched = [p for p in all_plugins
                       if name_lw in p.get_name().lower()]

        if base_cls:
github openstack / rally / rally / cli / commands / task.py View on Github external
    @cliutils.args("--deployment", dest="deployment", type=str,
                   metavar="", required=False,
                   help="UUID or name of a deployment.")
    @cliutils.args("--tag", nargs="+", dest="tags", type=str, required=False,
                   help="Mark the task with a tag or a few tags.")
    @envutils.with_default_deployment(cli_arg_name="deployment")
    @cliutils.alias("import")
    @cliutils.suppress_warnings
    def import_results(self, api, deployment=None, task_file=None, tags=None):
        """Import json results of a test into rally database"""

        if os.path.exists(os.path.expanduser(task_file)):
            tasks_results = self._load_task_results_file(api, task_file)
            for task_results in tasks_results:
                task = api.task.import_results(deployment=deployment,
                                               task_results=task_results,
                                               tags=tags)
github openstack / rally / rally / cli / commands / verify.py View on Github external
    @cliutils.args("--type", dest="vtype", type=str, required=True,
                   help="Verifier plugin name. HINT: You can list all "
                        "verifier plugins, executing command `rally verify "
                        "list-plugins`.")
    @cliutils.args("--platform", dest="platform", type=str,
                   help="Verifier plugin platform. Should be specified in "
                        "case of two verifier plugins with equal names but "
                        "in different platforms.")
    @cliutils.args("--source", dest="source", type=str, required=False,
                   help="Path or URL to the repo to clone verifier from.")
    @cliutils.args("--version", dest="version", type=str, required=False,
                   help="Branch, tag or commit ID to checkout before "
                        "verifier installation (the 'master' branch is used "
                        "by default).")
    @cliutils.args("--system-wide", dest="system_wide", action="store_true",
                   required=False,
                   help="Use the system-wide environment for verifier instead "
github openstack / rally / rally / cli / commands / deployment.py View on Github external
    @cliutils.args("--filename", type=str, required=False, metavar="