Detail View
This module contains views to implement the Orchestrator.
card-style detail view in the Smarter Dashboard.
- class smarter.apps.orchestrator.views.detailview.OrchestratorDetailView(**kwargs)[source]
Bases:
DocsBaseViewRenders the detail view for a Smarter dashboard orchestrator.
This view renders a detailed manifest for a specific orchestrator, including its configuration and metadata, in YAML format. It is intended for authenticated users and provides error handling for missing or unsupported orchestrator kinds and names.
- Parameters:
- Returns:
Rendered HTML page with orchestrator manifest details, or a 404 error page if the orchestrator is not found or parameters are invalid.
- Return type:
HttpResponse
Note
The orchestrator name and kind must be provided and valid. Otherwise, a “not found” response is returned.
See also
Orchestratorfor orchestrator metadata retrieval.ApiV1CliDescribeApiViewfor API details.Example usage:
GET /orchestrator/detail/?name=my_orchestrator&kind=custom
- get(request, *args, **kwargs)[source]
Handle GET requests to render the orchestrator manifest detail view.
This method processes the incoming request to retrieve the specified orchestrator’s manifest details and renders them in a user-friendly format. It performs validation on the provided orchestrator name and kind, retrieves the orchestrator metadata, and handles any errors that may arise during this process.
Process: 1. Extract and validate ‘name’ and ‘kind’ from kwargs. 2. Retrieve the orchestrator metadata using the provided name and user context. 3. If the orchestrator is found, call the API view to get the orchestrator details 4. Convert the JSON response to YAML format for better readability. 5. Render the orchestrator manifest detail template with the retrieved data. 6. Handle any errors that occur during the process and return appropriate error responses.
- Parameters:
- Returns:
Rendered HTML page with orchestrator manifest details, or an error response if the orchestrator is not found or parameters are invalid.
- Return type:
- orchestrator: Orchestrator | None = None