SageMaker / Client / render_ui_template

render_ui_template#

SageMaker.Client.render_ui_template(**kwargs)#

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

See also: AWS API Documentation

Request Syntax

response = client.render_ui_template(
    UiTemplate={
        'Content': 'string'
    },
    Task={
        'Input': 'string'
    },
    RoleArn='string',
    HumanTaskUiArn='string'
)
Parameters:
  • UiTemplate (dict) –

    A Template object containing the worker UI template to render.

    • Content (string) – [REQUIRED]

      The content of the Liquid template for the worker user interface.

  • Task (dict) –

    [REQUIRED]

    A RenderableTask object containing a representative task to render.

    • Input (string) – [REQUIRED]

      A JSON object that contains values for the variables defined in the template. It is made available to the template under the substitution variable task.input. For example, if you define a variable task.input.text in your template, you can supply the variable in the JSON object as "text": "sample text".

  • RoleArn (string) –

    [REQUIRED]

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

  • HumanTaskUiArn (string) –

    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.

Return type:

dict

Returns:

Response Syntax

{
    'RenderedContent': 'string',
    'Errors': [
        {
            'Code': 'string',
            'Message': 'string'
        },
    ]
}

Response Structure

  • (dict) –

    • RenderedContent (string) –

      A Liquid template that renders the HTML for the worker UI.

    • Errors (list) –

      A list of one or more RenderingError objects if any were encountered while rendering the template. If there were no errors, the list is empty.

      • (dict) –

        A description of an error that occurred while rendering the template.

        • Code (string) –

          A unique identifier for a specific class of errors.

        • Message (string) –

          A human-readable message describing the error.

Exceptions

  • SageMaker.Client.exceptions.ResourceNotFound