Skip to content

create_analysis async

create_analysis(
    aws_account_id: AwsAccountId,
    analysis_id: ShortRestrictiveResourceId,
    name: AnalysisName,
    *,
    config_overrides: Optional[AsyncQuickSightClientConfig] = None,
    parameters: Optional[Parameters] = None,
    permissions: Optional[ResourcePermissionList] = None,
    source_entity: Optional[AnalysisSourceEntity] = None,
    theme_arn: Optional[Arn] = None,
    tags: Optional[TagList] = None,
    definition: Optional[AnalysisDefinition] = None,
    validation_strategy: Optional[ValidationStrategy] = None,
    folder_arns: Optional[FolderArnList] = None,
) -> CreateAnalysisResponse

Creates an analysis in Amazon Quick Sight. Analyses can be created either from a template or from an AnalysisDefinition.

Parameters:

  • aws_account_id (AwsAccountId) –

    The ID of the Amazon Web Services account where you are creating an analysis.

  • analysis_id (ShortRestrictiveResourceId) –

    The ID for the analysis that you're creating. This ID displays in the URL of the analysis.

  • name (AnalysisName) –

    A descriptive name for the analysis that you're creating. This name displays for the analysis in the Amazon Quick Sight console.

  • parameters (Optional[Parameters], default: None ) –

    The parameter names and override values that you want to use. An analysis can have any parameter type, and some parameters might accept multiple values.

  • permissions (Optional[ResourcePermissionList], default: None ) –

    A structure that describes the principals and the resource-level permissions on an analysis. You can use the Permissions structure to grant permissions by providing a list of Identity and Access Management (IAM) action information for each principal listed by Amazon Resource Name (ARN).

    To specify no permissions, omit Permissions.

  • source_entity (Optional[AnalysisSourceEntity], default: None ) –

    A source entity to use for the analysis that you're creating. This metadata structure contains details that describe a source template and one or more datasets or topics.

    Either a SourceEntity or a Definition must be provided in order for the request to be valid.

  • theme_arn (Optional[Arn], default: None ) –

    The ARN for the theme to apply to the analysis that you're creating. To see the theme in the Amazon Quick Sight console, make sure that you have access to it.

  • tags (Optional[TagList], default: None ) –

    Contains a map of the key-value pairs for the resource tag or tags assigned to the analysis.

  • definition (Optional[AnalysisDefinition], default: None ) –

    The definition of an analysis.

    A definition is the data model of all features in a Dashboard, Template, or Analysis.

    Either a SourceEntity or a Definition must be provided in order for the request to be valid.

  • validation_strategy (Optional[ValidationStrategy], default: None ) –

    The option to relax the validation needed to create an analysis with definition objects. This skips the validation step for specific errors.

  • folder_arns (Optional[FolderArnList], default: None ) –

    When you create the analysis, Amazon Quick Sight adds the analysis to these folders.

Raises:

Source code in docs_src/capo_quicksight/_services/async_quick_sight.py
async def create_analysis(
    self,
    aws_account_id: "capo_quicksight.types.aws_account_id.AwsAccountId",
    analysis_id: "capo_quicksight.types.short_restrictive_resource_id.ShortRestrictiveResourceId",
    name: "capo_quicksight.types.analysis_name.AnalysisName",
    *,
    config_overrides: Optional[AsyncQuickSightClientConfig] = None,
    parameters: Optional["capo_quicksight.types.parameters.Parameters"] = None,
    permissions: Optional[
        "capo_quicksight.types.resource_permission_list.ResourcePermissionList"
    ] = None,
    source_entity: Optional[
        "capo_quicksight.types.analysis_source_entity.AnalysisSourceEntity"
    ] = None,
    theme_arn: Optional["capo_quicksight.types.arn.Arn"] = None,
    tags: Optional["capo_quicksight.types.tag_list.TagList"] = None,
    definition: Optional[
        "capo_quicksight.types.analysis_definition.AnalysisDefinition"
    ] = None,
    validation_strategy: Optional[
        "capo_quicksight.types.validation_strategy.ValidationStrategy"
    ] = None,
    folder_arns: Optional[
        "capo_quicksight.types.folder_arn_list.FolderArnList"
    ] = None,
) -> "capo_quicksight.types.create_analysis_response.CreateAnalysisResponse":
    """<p>Creates an analysis in Amazon Quick Sight. Analyses can be created either from a template or from an <code>AnalysisDefinition</code>.</p>

    Args:
        aws_account_id: <p>The ID of the Amazon Web Services account where you are creating an analysis.</p>
        analysis_id: <p>The ID for the analysis that you're creating. This ID displays in the URL of the analysis.</p>
        name: <p>A descriptive name for the analysis that you're creating. This name displays for the analysis in the Amazon Quick Sight console. </p>
        parameters: <p>The parameter names and override values that you want to use. An analysis can have any parameter type, and some parameters might accept multiple values. </p>
        permissions: <p>A structure that describes the principals and the resource-level permissions on an analysis. You can use the <code>Permissions</code> structure to grant permissions by providing a list of Identity and Access Management (IAM) action information for each principal listed by Amazon Resource Name (ARN). </p> <p>To specify no permissions, omit <code>Permissions</code>.</p>
        source_entity: <p>A source entity to use for the analysis that you're creating. This metadata structure contains details that describe a source template and one or more datasets or topics.</p> <p>Either a <code>SourceEntity</code> or a <code>Definition</code> must be provided in order for the request to be valid.</p>
        theme_arn: <p>The ARN for the theme to apply to the analysis that you're creating. To see the theme in the Amazon Quick Sight console, make sure that you have access to it.</p>
        tags: <p>Contains a map of the key-value pairs for the resource tag or tags assigned to the analysis.</p>
        definition: <p>The definition of an analysis.</p> <p>A definition is the data model of all features in a Dashboard, Template, or Analysis.</p> <p>Either a <code>SourceEntity</code> or a <code>Definition</code> must be provided in order for the request to be valid.</p>
        validation_strategy: <p>The option to relax the validation needed to create an analysis with definition objects. This skips the validation step for specific errors.</p>
        folder_arns: <p>When you create the analysis, Amazon Quick Sight adds the analysis to these folders.</p>

    Raises:
        capo_quicksight.errors.conflict_exception.ConflictException: <p>Updating or deleting a resource can cause an inconsistent state.</p>
        capo_quicksight.errors.internal_failure_exception.InternalFailureException: <p>An internal failure occurred.</p>
        capo_quicksight.errors.invalid_parameter_value_exception.InvalidParameterValueException: <p>One or more parameters has a value that isn't valid.</p>
        capo_quicksight.errors.limit_exceeded_exception.LimitExceededException: <p>A limit is exceeded.</p>
        capo_quicksight.errors.resource_exists_exception.ResourceExistsException: <p>The resource specified already exists. </p>
        capo_quicksight.errors.resource_not_found_exception.ResourceNotFoundException: <p>One or more resources can't be found.</p>
        capo_quicksight.errors.throttling_exception.ThrottlingException: <p>Access is throttled.</p>
        capo_quicksight.errors.unsupported_user_edition_exception.UnsupportedUserEditionException: <p>This error indicates that you are calling an operation on an Amazon Quick Suite subscription where the edition doesn't include support for that operation. Amazon Quick Suite currently has Standard Edition and Enterprise Edition. Not every operation and capability is available in every edition.</p>
        capo_quicksight.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_quicksight.types.create_analysis_request.CreateAnalysisRequest]",
    ) -> AsyncOperationResponse[
        "capo_quicksight.types.create_analysis_response.CreateAnalysisResponse"
    ]:
        import capo_quicksight._operations.quick_sight_20180401.create_analysis

        (
            output,
            http_response,
        ) = await capo_quicksight._operations.quick_sight_20180401.create_analysis.async_create_analysis(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    def _redact_input(
        input_: "capo_quicksight.types.create_analysis_request.CreateAnalysisRequest",
    ) -> dict[str, Any]:
        import capo_quicksight.types.create_analysis_request

        return capo_quicksight.types.create_analysis_request.redact_sensitive(
            input_
        )

    interceptors_, options_ = self.operation_options(
        config_overrides,
        OperationLogging("CreateAnalysis", redact_input=_redact_input),
    )
    input_: capo_quicksight.types.create_analysis_request.CreateAnalysisRequest = {
        "aws_account_id": aws_account_id,
        "analysis_id": analysis_id,
        "name": name,
    }
    if parameters is not None:
        input_["parameters"] = parameters
    if permissions is not None:
        input_["permissions"] = permissions
    if source_entity is not None:
        input_["source_entity"] = source_entity
    if theme_arn is not None:
        input_["theme_arn"] = theme_arn
    if tags is not None:
        input_["tags"] = tags
    if definition is not None:
        input_["definition"] = definition
    if validation_strategy is not None:
        input_["validation_strategy"] = validation_strategy
    if folder_arns is not None:
        input_["folder_arns"] = folder_arns

    response = await aexecute_pipeline(
        AsyncOperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    await response.response.aclose()
    return response.output