Skip to content

associate_vehicle_fleet

associate_vehicle_fleet(
    vehicle_name: vehicleName,
    fleet_id: fleetId,
    *,
    config_overrides: Optional[IoTFleetWiseClientConfig] = None,
) -> AssociateVehicleFleetResponse

Adds, or associates, a vehicle with a fleet.

Parameters:

  • vehicle_name (vehicleName) –

    The unique ID of the vehicle to associate with the fleet.

  • fleet_id (fleetId) –

    The ID of a fleet.

Raises:

Source code in docs_src/capo_iotfleetwise/_services/io_t_fleet_wise.py
def associate_vehicle_fleet(
    self,
    vehicle_name: "capo_iotfleetwise.types.vehicle_name.vehicleName",
    fleet_id: "capo_iotfleetwise.types.fleet_id.fleetId",
    *,
    config_overrides: Optional[IoTFleetWiseClientConfig] = None,
) -> "capo_iotfleetwise.types.associate_vehicle_fleet_response.AssociateVehicleFleetResponse":
    """<p> Adds, or associates, a vehicle with a fleet. </p>

    Args:
        vehicle_name: <p> The unique ID of the vehicle to associate with the fleet. </p>
        fleet_id: <p> The ID of a fleet. </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.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.
    """

    def _handler(
        req: "OperationRequest[capo_iotfleetwise.types.associate_vehicle_fleet_request.AssociateVehicleFleetRequest]",
    ) -> OperationResponse[
        "capo_iotfleetwise.types.associate_vehicle_fleet_response.AssociateVehicleFleetResponse"
    ]:
        import capo_iotfleetwise._operations.io_t_autobahn_control_plane.associate_vehicle_fleet

        output, http_response = (
            capo_iotfleetwise._operations.io_t_autobahn_control_plane.associate_vehicle_fleet.associate_vehicle_fleet(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("AssociateVehicleFleet")
    )
    input_: capo_iotfleetwise.types.associate_vehicle_fleet_request.AssociateVehicleFleetRequest = {
        "vehicle_name": vehicle_name,
        "fleet_id": fleet_id,
    }

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