Skip to content

render_ui_template

render_ui_template(
    *,
    config_overrides: Optional[SageMakerClientConfig] = None,
    ui_template: Optional[UiTemplate] = None,
    task: Optional[RenderableTask] = None,
    role_arn: Optional[RoleArn] = None,
    human_task_ui_arn: Optional[HumanTaskUiArn] = None,
) -> RenderUiTemplateResponse

Renders the UI template so that you can preview the worker's experience.

Parameters:

  • ui_template (Optional[UiTemplate], default: None ) –

    A Template object containing the worker UI template to render.

  • task (Optional[RenderableTask], default: None ) –

    A RenderableTask object containing a representative task to render.

  • role_arn (Optional[RoleArn], default: None ) –

    The Amazon Resource Name (ARN) that has access to the S3 objects that are used by the template.

  • human_task_ui_arn (Optional[HumanTaskUiArn], default: None ) –

    The HumanTaskUiArn of the worker UI that you want to render. Do not provide a HumanTaskUiArn if you use the UiTemplate parameter.

    See a list of available Human Ui Amazon Resource Names (ARNs) in UiConfig.

Raises:

Source code in docs_src/capo_sagemaker/_services/sage_maker.py
def render_ui_template(
    self,
    *,
    config_overrides: Optional[SageMakerClientConfig] = None,
    ui_template: Optional["capo_sagemaker.types.ui_template.UiTemplate"] = None,
    task: Optional["capo_sagemaker.types.renderable_task.RenderableTask"] = None,
    role_arn: Optional["capo_sagemaker.types.role_arn.RoleArn"] = None,
    human_task_ui_arn: Optional[
        "capo_sagemaker.types.human_task_ui_arn.HumanTaskUiArn"
    ] = None,
) -> "capo_sagemaker.types.render_ui_template_response.RenderUiTemplateResponse":
    """<p>Renders the UI template so that you can preview the worker's experience. </p>

    Args:
        ui_template: <p>A <code>Template</code> object containing the worker UI template to render.</p>
        task: <p>A <code>RenderableTask</code> object containing a representative task to render.</p>
        role_arn: <p>The Amazon Resource Name (ARN) that has access to the S3 objects that are used by the template.</p>
        human_task_ui_arn: <p>The <code>HumanTaskUiArn</code> of the worker UI that you want to render. Do not provide a <code>HumanTaskUiArn</code> if you use the <code>UiTemplate</code> parameter.</p> <p>See a list of available Human Ui Amazon Resource Names (ARNs) in <a href="https://docs.aws.amazon.com/sagemaker/latest/APIReference/API_UiConfig.html">UiConfig</a>.</p>

    Raises:
        capo_sagemaker.errors.resource_not_found.ResourceNotFound: <p>Resource being access is not found.</p>
        capo_sagemaker.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_sagemaker.types.render_ui_template_request.RenderUiTemplateRequest]",
    ) -> OperationResponse[
        "capo_sagemaker.types.render_ui_template_response.RenderUiTemplateResponse"
    ]:
        import capo_sagemaker._operations.sage_maker.render_ui_template

        output, http_response = (
            capo_sagemaker._operations.sage_maker.render_ui_template.render_ui_template(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("RenderUiTemplate")
    )
    input_: capo_sagemaker.types.render_ui_template_request.RenderUiTemplateRequest = {}
    if ui_template is not None:
        input_["ui_template"] = ui_template
    if task is not None:
        input_["task"] = task
    if role_arn is not None:
        input_["role_arn"] = role_arn
    if human_task_ui_arn is not None:
        input_["human_task_ui_arn"] = human_task_ui_arn

    response = execute_pipeline(
        OperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    response.response.close()
    return response.output