Skip to content

create_vehicle async

create_vehicle(
    vehicle_name: vehicleName,
    model_manifest_arn: arn,
    decoder_manifest_arn: arn,
    *,
    config_overrides: Optional[AsyncIoTFleetWiseClientConfig] = None,
    attributes: Optional[attributesMap] = None,
    association_behavior: Optional[VehicleAssociationBehavior] = None,
    tags: Optional[TagList] = None,
    state_templates: Optional[StateTemplateAssociations] = None,
) -> CreateVehicleResponse

Creates a vehicle, which is an instance of a vehicle model (model manifest). Vehicles created from the same vehicle model consist of the same signals inherited from the vehicle model.

If you have an existing Amazon Web Services IoT thing, you can use Amazon Web Services IoT FleetWise to create a vehicle and collect data from your thing.

For more information, see Create a vehicle (AWS CLI) in the Amazon Web Services IoT FleetWise Developer Guide.

Parameters:

  • vehicle_name (vehicleName) –

    The unique ID of the vehicle to create.

  • model_manifest_arn (arn) –

    The Amazon Resource Name ARN of a vehicle model.

  • decoder_manifest_arn (arn) –

    The ARN of a decoder manifest.

  • attributes (Optional[attributesMap], default: None ) –

    Static information about a vehicle in a key-value pair. For example: "engineType" : "1.3 L R2"

    To use attributes with Campaigns or State Templates, you must include them using the request parameters dataExtraDimensions and/or metadataExtraDimensions (for state templates only) when creating your campaign/state template.

  • association_behavior (Optional[VehicleAssociationBehavior], default: None ) –

    An option to create a new Amazon Web Services IoT thing when creating a vehicle, or to validate an existing Amazon Web Services IoT thing as a vehicle.

    Default:

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

    Metadata that can be used to manage the vehicle.

  • state_templates (Optional[StateTemplateAssociations], default: None ) –

    Associate state templates with the vehicle. You can monitor the last known state of the vehicle in near real time.

Raises:

Source code in docs_src/capo_iotfleetwise/_services/async_io_t_fleet_wise.py
async def create_vehicle(
    self,
    vehicle_name: "capo_iotfleetwise.types.vehicle_name.vehicleName",
    model_manifest_arn: "capo_iotfleetwise.types.arn.arn",
    decoder_manifest_arn: "capo_iotfleetwise.types.arn.arn",
    *,
    config_overrides: Optional[AsyncIoTFleetWiseClientConfig] = None,
    attributes: Optional[
        "capo_iotfleetwise.types.attributes_map.attributesMap"
    ] = None,
    association_behavior: Optional[
        "capo_iotfleetwise.types.vehicle_association_behavior.VehicleAssociationBehavior"
    ] = None,
    tags: Optional["capo_iotfleetwise.types.tag_list.TagList"] = None,
    state_templates: Optional[
        "capo_iotfleetwise.types.state_template_associations.StateTemplateAssociations"
    ] = None,
) -> "capo_iotfleetwise.types.create_vehicle_response.CreateVehicleResponse":
    """<p> Creates a vehicle, which is an instance of a vehicle model (model manifest). Vehicles created from the same vehicle model consist of the same signals inherited from the vehicle model.</p> <note> <p> If you have an existing Amazon Web Services IoT thing, you can use Amazon Web Services IoT FleetWise to create a vehicle and collect data from your thing. </p> </note> <p>For more information, see <a href="https://docs.aws.amazon.com/iot-fleetwise/latest/developerguide/create-vehicle-cli.html">Create a vehicle (AWS CLI)</a> in the <i>Amazon Web Services IoT FleetWise Developer Guide</i>.</p>

    Args:
        vehicle_name: <p> The unique ID of the vehicle to create. </p>
        model_manifest_arn: <p> The Amazon Resource Name ARN of a vehicle model. </p>
        decoder_manifest_arn: <p> The ARN of a decoder manifest. </p>
        attributes: <p>Static information about a vehicle in a key-value pair. For example: <code>"engineType"</code> : <code>"1.3 L R2"</code> </p> <p>To use attributes with Campaigns or State Templates, you must include them using the request parameters <code>dataExtraDimensions</code> and/or <code>metadataExtraDimensions</code> (for state templates only) when creating your campaign/state template. </p>
        association_behavior: <p> An option to create a new Amazon Web Services IoT thing when creating a vehicle, or to validate an existing Amazon Web Services IoT thing as a vehicle. </p> <p>Default: <code/> </p>
        tags: <p>Metadata that can be used to manage the vehicle.</p>
        state_templates: <p>Associate state templates with the vehicle. You can monitor the last known state of the vehicle in near real time.</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.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_vehicle_request.CreateVehicleRequest]",
    ) -> AsyncOperationResponse[
        "capo_iotfleetwise.types.create_vehicle_response.CreateVehicleResponse"
    ]:
        import capo_iotfleetwise._operations.io_t_autobahn_control_plane.create_vehicle

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

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("CreateVehicle")
    )
    input_: capo_iotfleetwise.types.create_vehicle_request.CreateVehicleRequest = {
        "vehicle_name": vehicle_name,
        "model_manifest_arn": model_manifest_arn,
        "decoder_manifest_arn": decoder_manifest_arn,
    }
    if attributes is not None:
        input_["attributes"] = attributes
    if association_behavior is not None:
        input_["association_behavior"] = association_behavior
    if tags is not None:
        input_["tags"] = tags
    if state_templates is not None:
        input_["state_templates"] = state_templates

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