Skip to content

create_dynamic_thing_group

create_dynamic_thing_group(
    thing_group_name: ThingGroupName,
    query_string: QueryString,
    *,
    config_overrides: Optional[IoTClientConfig] = None,
    thing_group_properties: Optional[ThingGroupProperties] = None,
    index_name: Optional[IndexName] = None,
    query_version: Optional[QueryVersion] = None,
    tags: Optional[TagList] = None,
) -> CreateDynamicThingGroupResponse

Creates a dynamic thing group.

Requires permission to access the CreateDynamicThingGroup action.

Parameters:

  • thing_group_name (ThingGroupName) –

    The dynamic thing group name to create.

  • thing_group_properties (Optional[ThingGroupProperties], default: None ) –

    The dynamic thing group properties.

  • index_name (Optional[IndexName], default: None ) –

    The dynamic thing group index name.

    Currently one index is supported: AWS_Things.

  • query_string (QueryString) –

    The dynamic thing group search query string.

    See Query Syntax for information about query string syntax.

  • query_version (Optional[QueryVersion], default: None ) –

    The dynamic thing group query version.

    Currently one query version is supported: "2017-09-30". If not specified, the query version defaults to this value.

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

    Metadata which can be used to manage the dynamic thing group.

Raises:

Source code in docs_src/capo_iot/_services/io_t.py
def create_dynamic_thing_group(
    self,
    thing_group_name: "capo_iot.types.thing_group_name.ThingGroupName",
    query_string: "capo_iot.types.query_string.QueryString",
    *,
    config_overrides: Optional[IoTClientConfig] = None,
    thing_group_properties: Optional[
        "capo_iot.types.thing_group_properties.ThingGroupProperties"
    ] = None,
    index_name: Optional["capo_iot.types.index_name.IndexName"] = None,
    query_version: Optional["capo_iot.types.query_version.QueryVersion"] = None,
    tags: Optional["capo_iot.types.tag_list.TagList"] = None,
) -> "capo_iot.types.create_dynamic_thing_group_response.CreateDynamicThingGroupResponse":
    """<p>Creates a dynamic thing group.</p> <p>Requires permission to access the <a href="https://docs.aws.amazon.com/service-authorization/latest/reference/list_awsiot.html#awsiot-actions-as-permissions">CreateDynamicThingGroup</a> action.</p>

    Args:
        thing_group_name: <p>The dynamic thing group name to create.</p>
        thing_group_properties: <p>The dynamic thing group properties.</p>
        index_name: <p>The dynamic thing group index name.</p> <note> <p>Currently one index is supported: <code>AWS_Things</code>.</p> </note>
        query_string: <p>The dynamic thing group search query string.</p> <p>See <a href="https://docs.aws.amazon.com/iot/latest/developerguide/query-syntax.html">Query Syntax</a> for information about query string syntax.</p>
        query_version: <p>The dynamic thing group query version.</p> <note> <p>Currently one query version is supported: "2017-09-30". If not specified, the query version defaults to this value.</p> </note>
        tags: <p>Metadata which can be used to manage the dynamic thing group.</p>

    Raises:
        capo_iot.errors.internal_failure_exception.InternalFailureException: <p>An unexpected error has occurred.</p>
        capo_iot.errors.invalid_query_exception.InvalidQueryException: <p>The query is invalid.</p>
        capo_iot.errors.invalid_request_exception.InvalidRequestException: <p>The request is not valid.</p>
        capo_iot.errors.limit_exceeded_exception.LimitExceededException: <p>A limit has been exceeded.</p>
        capo_iot.errors.resource_already_exists_exception.ResourceAlreadyExistsException: <p>The resource already exists.</p>
        capo_iot.errors.resource_not_found_exception.ResourceNotFoundException: <p>The specified resource does not exist.</p>
        capo_iot.errors.throttling_exception.ThrottlingException: <p>The rate exceeds the limit.</p>
        capo_iot.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_iot.types.create_dynamic_thing_group_request.CreateDynamicThingGroupRequest]",
    ) -> OperationResponse[
        "capo_iot.types.create_dynamic_thing_group_response.CreateDynamicThingGroupResponse"
    ]:
        import capo_iot._operations.aws_iot_service.create_dynamic_thing_group

        output, http_response = (
            capo_iot._operations.aws_iot_service.create_dynamic_thing_group.create_dynamic_thing_group(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("CreateDynamicThingGroup")
    )
    input_: capo_iot.types.create_dynamic_thing_group_request.CreateDynamicThingGroupRequest = {
        "thing_group_name": thing_group_name,
        "query_string": query_string,
    }
    if thing_group_properties is not None:
        input_["thing_group_properties"] = thing_group_properties
    if index_name is not None:
        input_["index_name"] = index_name
    if query_version is not None:
        input_["query_version"] = query_version
    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