CLI
- class smarter.apps.api.v1.cli.urls.ApiV1CliReverseViews[source]
Bases:
objectReverse views for the CLI commands.
Provides named references for reversing CLI-related API endpoints.
This class is used for reverse URL resolution in Django, where each attribute corresponds to a CLI command endpoint. The names are derived from the actual API view class names, ensuring consistency and reducing the risk of typos when using Django’s URL reversing features.
All CLI commands available in the Smarter platform are included as attributes of this class. This centralizes the reverse URL names for all CLI endpoints, making it easier to maintain and reference them throughout the codebase.
Usage
Use these attributes with Django’s
reverse()function or in templates to generate URLs for CLI API endpoints based on the view class names.Example
from smarter.lib.django.shortcuts import reverse url = reverse(ApiV1CliReverseViews.deploy, kwargs={'kind': 'Plugin'}) str(ApiV1CliReverseViews.deploy) returns 'api_v1_cli_deploy_api_view'
- apply = 'api_v1_cli_apply_api_view'
- chat_config = 'api_v1_cli_prompt_config_api_view'
- delete = 'api_v1_cli_delete_api_view'
- deploy = 'api_v1_cli_deploy_api_view'
- describe = 'api_v1_cli_describe_api_view'
- example_manifest = 'api_v1_cli_manifest_api_view'
- get = 'api_v1_cli_get_api_view'
- logs = 'api_v1_cli_logs_api_view'
- manifest = 'api_v1_cli_manifest_api_view'
- namespace = 'api:v1:cli:'
- prompt = 'api_v1_cli_prompt_api_view'
- schema = 'api_v1_cli_schema_api_view'
- status = 'api_v1_cli_status_api_view'
- undeploy = 'api_v1_cli_undeploy_api_view'
- version = 'api_v1_cli_version_api_view'
- whoami = 'api_v1_cli_whoami_api_view'