Skip to content

create_group

create_group(
    group_name: GroupName,
    *,
    config_overrides: Optional[XRayClientConfig] = None,
    filter_expression: Optional[FilterExpression] = None,
    insights_configuration: Optional[InsightsConfiguration] = None,
    tags: Optional[TagList] = None,
) -> CreateGroupResult

Creates a group resource with a name and a filter expression.

Parameters:

  • group_name (GroupName) –

    The case-sensitive name of the new group. Default is a reserved name and names must be unique.

  • filter_expression (Optional[FilterExpression], default: None ) –

    The filter expression defining criteria by which to group traces.

  • insights_configuration (Optional[InsightsConfiguration], default: None ) –

    The structure containing configurations related to insights.

    • The InsightsEnabled boolean can be set to true to enable insights for the new group or false to disable insights for the new group.

    • The NotificationsEnabled boolean can be set to true to enable insights notifications for the new group. Notifications may only be enabled on a group with InsightsEnabled set to true.

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

    A map that contains one or more tag keys and tag values to attach to an X-Ray group. For more information about ways to use tags, see Tagging Amazon Web Services resources in the Amazon Web Services General Reference.

    The following restrictions apply to tags:

    • Maximum number of user-applied tags per resource: 50

    • Maximum tag key length: 128 Unicode characters

    • Maximum tag value length: 256 Unicode characters

    • Valid values for key and value: a-z, A-Z, 0-9, space, and the following characters: _ . : / = + - and @

    • Tag keys and values are case sensitive.

    • Don't use aws: as a prefix for keys; it's reserved for Amazon Web Services use.

Raises:

Source code in docs_src/capo_xray/_services/x_ray.py
def create_group(
    self,
    group_name: "capo_xray.types.group_name.GroupName",
    *,
    config_overrides: Optional[XRayClientConfig] = None,
    filter_expression: Optional[
        "capo_xray.types.filter_expression.FilterExpression"
    ] = None,
    insights_configuration: Optional[
        "capo_xray.types.insights_configuration.InsightsConfiguration"
    ] = None,
    tags: Optional["capo_xray.types.tag_list.TagList"] = None,
) -> "capo_xray.types.create_group_result.CreateGroupResult":
    """<p>Creates a group resource with a name and a filter expression. </p>

    Args:
        group_name: <p>The case-sensitive name of the new group. Default is a reserved name and names must be unique.</p>
        filter_expression: <p>The filter expression defining criteria by which to group traces.</p>
        insights_configuration: <p>The structure containing configurations related to insights.</p> <ul> <li> <p>The InsightsEnabled boolean can be set to true to enable insights for the new group or false to disable insights for the new group.</p> </li> <li> <p>The NotificationsEnabled boolean can be set to true to enable insights notifications for the new group. Notifications may only be enabled on a group with InsightsEnabled set to true.</p> </li> </ul>
        tags: <p>A map that contains one or more tag keys and tag values to attach to an X-Ray group. For more information about ways to use tags, see <a href="https://docs.aws.amazon.com/general/latest/gr/aws_tagging.html">Tagging Amazon Web Services resources</a> in the <i>Amazon Web Services General Reference</i>.</p> <p>The following restrictions apply to tags:</p> <ul> <li> <p>Maximum number of user-applied tags per resource: 50</p> </li> <li> <p>Maximum tag key length: 128 Unicode characters</p> </li> <li> <p>Maximum tag value length: 256 Unicode characters</p> </li> <li> <p>Valid values for key and value: a-z, A-Z, 0-9, space, and the following characters: _ . : / = + - and @</p> </li> <li> <p>Tag keys and values are case sensitive.</p> </li> <li> <p>Don't use <code>aws:</code> as a prefix for keys; it's reserved for Amazon Web Services use.</p> </li> </ul>

    Raises:
        capo_xray.errors.invalid_request_exception.InvalidRequestException: <p>The request is missing required parameters or has invalid parameters.</p>
        capo_xray.errors.throttled_exception.ThrottledException: <p>The request exceeds the maximum number of requests per second.</p>
        capo_xray.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_xray.types.create_group_request.CreateGroupRequest]",
    ) -> OperationResponse["capo_xray.types.create_group_result.CreateGroupResult"]:
        import capo_xray._operations.awsx_ray.create_group

        output, http_response = (
            capo_xray._operations.awsx_ray.create_group.create_group(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("CreateGroup")
    )
    input_: capo_xray.types.create_group_request.CreateGroupRequest = {
        "group_name": group_name
    }
    if filter_expression is not None:
        input_["filter_expression"] = filter_expression
    if insights_configuration is not None:
        input_["insights_configuration"] = insights_configuration
    if tags is not None:
        input_["tags"] = tags

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