Skip to content

create_system_template

create_system_template(
    definition: DefinitionDocument,
    *,
    config_overrides: Optional[IoTThingsGraphClientConfig] = None,
    compatible_namespace_version: Optional[Version] = None,
) -> CreateSystemTemplateResponse

Creates a system. The system is validated against the entities in the latest version of the user's namespace unless another namespace version is specified in the request.

Parameters:

  • definition (DefinitionDocument) –

    The DefinitionDocument used to create the system.

  • compatible_namespace_version (Optional[Version], default: None ) –

    The namespace version in which the system is to be created.

    If no value is specified, the latest version is used by default.

Raises:

Source code in docs_src/capo_iotthingsgraph/_services/io_t_things_graph.py
def create_system_template(
    self,
    definition: "capo_iotthingsgraph.types.definition_document.DefinitionDocument",
    *,
    config_overrides: Optional[IoTThingsGraphClientConfig] = None,
    compatible_namespace_version: Optional[
        "capo_iotthingsgraph.types.version.Version"
    ] = None,
) -> "capo_iotthingsgraph.types.create_system_template_response.CreateSystemTemplateResponse":
    """<p>Creates a system. The system is validated against the entities in the latest version of the user's namespace unless another namespace version is specified in the request.</p>

    Args:
        definition: <p>The <code>DefinitionDocument</code> used to create the system.</p>
        compatible_namespace_version: <p>The namespace version in which the system is to be created.</p> <p>If no value is specified, the latest version is used by default.</p>

    Raises:
        capo_iotthingsgraph.errors.internal_failure_exception.InternalFailureException: <p></p>
        capo_iotthingsgraph.errors.invalid_request_exception.InvalidRequestException: <p></p>
        capo_iotthingsgraph.errors.resource_already_exists_exception.ResourceAlreadyExistsException: <p></p>
        capo_iotthingsgraph.errors.throttling_exception.ThrottlingException: <p></p>
        capo_iotthingsgraph.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_iotthingsgraph.types.create_system_template_request.CreateSystemTemplateRequest]",
    ) -> OperationResponse[
        "capo_iotthingsgraph.types.create_system_template_response.CreateSystemTemplateResponse"
    ]:
        import capo_iotthingsgraph._operations.iot_things_graph_front_end_service.create_system_template

        output, http_response = (
            capo_iotthingsgraph._operations.iot_things_graph_front_end_service.create_system_template.create_system_template(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("CreateSystemTemplate")
    )
    input_: capo_iotthingsgraph.types.create_system_template_request.CreateSystemTemplateRequest = {
        "definition": definition
    }
    if compatible_namespace_version is not None:
        input_["compatible_namespace_version"] = compatible_namespace_version

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