Skip to content

create_state_template async

create_state_template(
    name: resourceName,
    signal_catalog_arn: arn,
    state_template_properties: StateTemplateProperties,
    *,
    config_overrides: Optional[AsyncIoTFleetWiseClientConfig] = None,
    description: Optional[description] = None,
    data_extra_dimensions: Optional[StateTemplateDataExtraDimensionNodePathList] = None,
    metadata_extra_dimensions: Optional[
        StateTemplateMetadataExtraDimensionNodePathList
    ] = None,
    tags: Optional[TagList] = None,
) -> CreateStateTemplateResponse

Creates a state template. State templates contain state properties, which are signals that belong to a signal catalog that is synchronized between the Amazon Web Services IoT FleetWise Edge and the Amazon Web Services Cloud.

Access to certain Amazon Web Services IoT FleetWise features is currently gated. For more information, see Amazon Web Services Region and feature availability in the Amazon Web Services IoT FleetWise Developer Guide.

Parameters:

  • name (resourceName) –

    The name of the state template.

  • description (Optional[description], default: None ) –

    A brief description of the state template.

  • signal_catalog_arn (arn) –

    The ARN of the signal catalog associated with the state template.

  • state_template_properties (StateTemplateProperties) –

    A list of signals from which data is collected. The state template properties contain the fully qualified names of the signals.

  • data_extra_dimensions (Optional[StateTemplateDataExtraDimensionNodePathList], default: None ) –

    A list of vehicle attributes to associate with the payload published on the state template's MQTT topic. (See Processing last known state vehicle data using MQTT messaging). For example, if you add Vehicle.Attributes.Make and Vehicle.Attributes.Model attributes, Amazon Web Services IoT FleetWise will enrich the protobuf encoded payload with those attributes in the extraDimensions field.

  • metadata_extra_dimensions (Optional[StateTemplateMetadataExtraDimensionNodePathList], default: None ) –

    A list of vehicle attributes to associate with user properties of the messages published on the state template's MQTT topic. (See Processing last known state vehicle data using MQTT messaging). For example, if you add Vehicle.Attributes.Make and Vehicle.Attributes.Model attributes, Amazon Web Services IoT FleetWise will include these attributes as User Properties with the MQTT message.

    Default: An empty array

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

    Metadata that can be used to manage the state template.

Raises:

Source code in docs_src/capo_iotfleetwise/_services/async_io_t_fleet_wise.py
async def create_state_template(
    self,
    name: "capo_iotfleetwise.types.resource_name.resourceName",
    signal_catalog_arn: "capo_iotfleetwise.types.arn.arn",
    state_template_properties: "capo_iotfleetwise.types.state_template_properties.StateTemplateProperties",
    *,
    config_overrides: Optional[AsyncIoTFleetWiseClientConfig] = None,
    description: Optional["capo_iotfleetwise.types.description.description"] = None,
    data_extra_dimensions: Optional[
        "capo_iotfleetwise.types.state_template_data_extra_dimension_node_path_list.StateTemplateDataExtraDimensionNodePathList"
    ] = None,
    metadata_extra_dimensions: Optional[
        "capo_iotfleetwise.types.state_template_metadata_extra_dimension_node_path_list.StateTemplateMetadataExtraDimensionNodePathList"
    ] = None,
    tags: Optional["capo_iotfleetwise.types.tag_list.TagList"] = None,
) -> "capo_iotfleetwise.types.create_state_template_response.CreateStateTemplateResponse":
    """<p>Creates a state template. State templates contain state properties, which are signals that belong to a signal catalog that is synchronized between the Amazon Web Services IoT FleetWise Edge and the Amazon Web Services Cloud.</p> <important> <p>Access to certain Amazon Web Services IoT FleetWise features is currently gated. For more information, see <a href="https://docs.aws.amazon.com/iot-fleetwise/latest/developerguide/fleetwise-regions.html">Amazon Web Services Region and feature availability</a> in the <i>Amazon Web Services IoT FleetWise Developer Guide</i>.</p> </important>

    Args:
        name: <p>The name of the state template.</p>
        description: <p>A brief description of the state template.</p>
        signal_catalog_arn: <p>The ARN of the signal catalog associated with the state template.</p>
        state_template_properties: <p>A list of signals from which data is collected. The state template properties contain the fully qualified names of the signals.</p>
        data_extra_dimensions: <p>A list of vehicle attributes to associate with the payload published on the state template's MQTT topic. (See <a href="https://docs.aws.amazon.com/iot-fleetwise/latest/developerguide/process-visualize-data.html#process-last-known-state-vehicle-data"> Processing last known state vehicle data using MQTT messaging</a>). For example, if you add <code>Vehicle.Attributes.Make</code> and <code>Vehicle.Attributes.Model</code> attributes, Amazon Web Services IoT FleetWise will enrich the protobuf encoded payload with those attributes in the <code>extraDimensions</code> field.</p>
        metadata_extra_dimensions: <p>A list of vehicle attributes to associate with user properties of the messages published on the state template's MQTT topic. (See <a href="https://docs.aws.amazon.com/iot-fleetwise/latest/developerguide/process-visualize-data.html#process-last-known-state-vehicle-data"> Processing last known state vehicle data using MQTT messaging</a>). For example, if you add <code>Vehicle.Attributes.Make</code> and <code>Vehicle.Attributes.Model</code> attributes, Amazon Web Services IoT FleetWise will include these attributes as User Properties with the MQTT message.</p> <p>Default: An empty array</p>
        tags: <p>Metadata that can be used to manage the state template.</p>

    Raises:
        capo_iotfleetwise.errors.internal_server_exception.InternalServerException: <p>The request couldn't be completed because the server temporarily failed.</p>
        capo_iotfleetwise.errors.access_denied_exception.AccessDeniedException: <p>You don't have sufficient permission to perform this action.</p>
        capo_iotfleetwise.errors.conflict_exception.ConflictException: <p>The request has conflicting operations. This can occur if you're trying to perform more than one operation on the same resource at the same time.</p>
        capo_iotfleetwise.errors.invalid_signals_exception.InvalidSignalsException: <p>The request couldn't be completed because it contains signals that aren't valid.</p>
        capo_iotfleetwise.errors.limit_exceeded_exception.LimitExceededException: <p>A service quota was exceeded. </p>
        capo_iotfleetwise.errors.resource_not_found_exception.ResourceNotFoundException: <p>The resource wasn't found.</p>
        capo_iotfleetwise.errors.throttling_exception.ThrottlingException: <p>The request couldn't be completed due to throttling.</p>
        capo_iotfleetwise.errors.validation_exception.ValidationException: <p>The input fails to satisfy the constraints specified by an Amazon Web Services service.</p>
        capo_iotfleetwise.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_iotfleetwise.types.create_state_template_request.CreateStateTemplateRequest]",
    ) -> AsyncOperationResponse[
        "capo_iotfleetwise.types.create_state_template_response.CreateStateTemplateResponse"
    ]:
        import capo_iotfleetwise._operations.io_t_autobahn_control_plane.create_state_template

        (
            output,
            http_response,
        ) = await capo_iotfleetwise._operations.io_t_autobahn_control_plane.create_state_template.async_create_state_template(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("CreateStateTemplate")
    )
    input_: capo_iotfleetwise.types.create_state_template_request.CreateStateTemplateRequest = {
        "name": name,
        "signal_catalog_arn": signal_catalog_arn,
        "state_template_properties": state_template_properties,
    }
    if description is not None:
        input_["description"] = description
    if data_extra_dimensions is not None:
        input_["data_extra_dimensions"] = data_extra_dimensions
    if metadata_extra_dimensions is not None:
        input_["metadata_extra_dimensions"] = metadata_extra_dimensions
    if tags is not None:
        input_["tags"] = tags

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