Skip to content

list_rules async

list_rules(
    domain_identifier: DomainId,
    target_type: RuleTargetType,
    target_identifier: str,
    *,
    config_overrides: Optional[AsyncDataZoneClientConfig] = None,
    rule_type: Optional[RuleType] = None,
    action: Optional[RuleAction] = None,
    project_ids: Optional[ProjectIds] = None,
    asset_types: Optional[AssetTypeIdentifiers] = None,
    data_product: Optional[bool] = None,
    include_cascaded: Optional[bool] = None,
    max_results: Optional[int] = None,
    next_token: Optional[PaginationToken] = None,
) -> ListRulesOutput

Lists existing rules. In Amazon DataZone, a rule is a formal agreement that enforces specific requirements across user workflows (e.g., publishing assets to the catalog, requesting subscriptions, creating projects) within the Amazon DataZone data portal. These rules help maintain consistency, ensure compliance, and uphold governance standards in data management processes. For instance, a metadata enforcement rule can specify the required information for creating a subscription request or publishing a data asset to the catalog, ensuring alignment with organizational standards.

Parameters:

  • domain_identifier (DomainId) –

    The ID of the domain in which the rules are to be listed.

  • target_type (RuleTargetType) –

    The target type of the rule.

  • target_identifier (str) –

    The target ID of the rule.

  • rule_type (Optional[RuleType], default: None ) –

    The type of the rule.

  • action (Optional[RuleAction], default: None ) –

    The action of the rule.

  • project_ids (Optional[ProjectIds], default: None ) –

    The IDs of projects in which rules are to be listed.

  • asset_types (Optional[AssetTypeIdentifiers], default: None ) –

    The asset types of the rule.

  • data_product (Optional[bool], default: None ) –

    The data product of the rule.

  • include_cascaded (Optional[bool], default: None ) –

    Specifies whether to include cascading rules in the results.

  • max_results (Optional[int], default: None ) –

    The maximum number of rules to return in a single call to ListRules. When the number of rules to be listed is greater than the value of MaxResults, the response contains a NextToken value that you can use in a subsequent call to ListRules to list the next set of rules.

  • next_token (Optional[PaginationToken], default: None ) –

    When the number of rules is greater than the default value for the MaxResults parameter, or if you explicitly specify a value for MaxResults that is less than the number of rules, the response includes a pagination token named NextToken. You can specify this NextToken value in a subsequent call to ListRules to list the next set of rules.

Raises:

Source code in docs_src/capo_datazone/_services/async_data_zone.py
async def list_rules(
    self,
    domain_identifier: "capo_datazone.types.domain_id.DomainId",
    target_type: "capo_datazone.types.rule_target_type.RuleTargetType",
    target_identifier: str,
    *,
    config_overrides: Optional[AsyncDataZoneClientConfig] = None,
    rule_type: Optional["capo_datazone.types.rule_type.RuleType"] = None,
    action: Optional["capo_datazone.types.rule_action.RuleAction"] = None,
    project_ids: Optional["capo_datazone.types.project_ids.ProjectIds"] = None,
    asset_types: Optional[
        "capo_datazone.types.asset_type_identifiers.AssetTypeIdentifiers"
    ] = None,
    data_product: Optional[bool] = None,
    include_cascaded: Optional[bool] = None,
    max_results: Optional[int] = None,
    next_token: Optional[
        "capo_datazone.types.pagination_token.PaginationToken"
    ] = None,
) -> "capo_datazone.types.list_rules_output.ListRulesOutput":
    """<p>Lists existing rules. In Amazon DataZone, a rule is a formal agreement that enforces specific requirements across user workflows (e.g., publishing assets to the catalog, requesting subscriptions, creating projects) within the Amazon DataZone data portal. These rules help maintain consistency, ensure compliance, and uphold governance standards in data management processes. For instance, a metadata enforcement rule can specify the required information for creating a subscription request or publishing a data asset to the catalog, ensuring alignment with organizational standards.</p>

    Args:
        domain_identifier: <p>The ID of the domain in which the rules are to be listed.</p>
        target_type: <p>The target type of the rule.</p>
        target_identifier: <p>The target ID of the rule.</p>
        rule_type: <p>The type of the rule.</p>
        action: <p>The action of the rule.</p>
        project_ids: <p>The IDs of projects in which rules are to be listed.</p>
        asset_types: <p>The asset types of the rule.</p>
        data_product: <p>The data product of the rule.</p>
        include_cascaded: <p>Specifies whether to include cascading rules in the results.</p>
        max_results: <p>The maximum number of rules to return in a single call to <code>ListRules</code>. When the number of rules to be listed is greater than the value of <code>MaxResults</code>, the response contains a <code>NextToken</code> value that you can use in a subsequent call to <code>ListRules</code> to list the next set of rules.</p>
        next_token: <p>When the number of rules is greater than the default value for the <code>MaxResults</code> parameter, or if you explicitly specify a value for <code>MaxResults</code> that is less than the number of rules, the response includes a pagination token named <code>NextToken</code>. You can specify this <code>NextToken</code> value in a subsequent call to <code>ListRules</code> to list the next set of rules.</p>

    Raises:
        capo_datazone.errors.access_denied_exception.AccessDeniedException: <p>You do not have sufficient access to perform this action.</p>
        capo_datazone.errors.throttling_exception.ThrottlingException: <p>The request was denied due to request throttling.</p>
        capo_datazone.errors.unauthorized_exception.UnauthorizedException: <p>You do not have permission to perform this action.</p>
        capo_datazone.errors.internal_server_exception.InternalServerException: <p>The request has failed because of an unknown error, exception or failure.</p>
        capo_datazone.errors.resource_not_found_exception.ResourceNotFoundException: <p>The specified resource cannot be found.</p>
        capo_datazone.errors.validation_exception.ValidationException: <p>The input fails to satisfy the constraints specified by the Amazon Web Services service.</p>
        capo_datazone.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_datazone.types.list_rules_input.ListRulesInput]",
    ) -> AsyncOperationResponse[
        "capo_datazone.types.list_rules_output.ListRulesOutput"
    ]:
        import capo_datazone._operations.data_zone.list_rules

        (
            output,
            http_response,
        ) = await capo_datazone._operations.data_zone.list_rules.async_list_rules(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    def _redact_output(
        output: "capo_datazone.types.list_rules_output.ListRulesOutput",
    ) -> dict[str, Any]:
        import capo_datazone.types.list_rules_output

        return capo_datazone.types.list_rules_output.redact_sensitive(output)

    interceptors_, options_ = self.operation_options(
        config_overrides,
        OperationLogging("ListRules", redact_output=_redact_output),
    )
    input_: capo_datazone.types.list_rules_input.ListRulesInput = {
        "domain_identifier": domain_identifier,
        "target_type": target_type,
        "target_identifier": target_identifier,
    }
    if rule_type is not None:
        input_["rule_type"] = rule_type
    if action is not None:
        input_["action"] = action
    if project_ids is not None:
        input_["project_ids"] = project_ids
    if asset_types is not None:
        input_["asset_types"] = asset_types
    if data_product is not None:
        input_["data_product"] = data_product
    if include_cascaded is not None:
        input_["include_cascaded"] = include_cascaded
    if max_results is not None:
        input_["max_results"] = max_results
    if next_token is not None:
        input_["next_token"] = next_token

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