Owner API

Queries

The query domains for the Fleet API are

developmentb16x16
productionfuse_owner

The production version is always pre-pended to the production query domain with a period, so for version 1 of the API would use v1_fuse_owner as the query domain. In this document we will use the production query domain without the version. See Fuse Base URLs for more information on how to turn the descriptions shown here into a query URL. 

fuse_owner:fleetChannel()

Query the owner pico for a the current fleet channel. The result is a map with key eci indicating the fleet channel. 

Ensure system accounts are correct as a side-effect. 

You should avoid using the channel as a means of identifying the fleet since it could change. This function always provides the current fleet channel.

Events

Services

The following services operate in the fleet API

fuse_owner:create_fleet

Selector:

select when fuse need_fleet

Synopsis:

Creates a new fleet pico. 

Idempotent. Will not create more than one fleet per owner. This may change in the future to allow a since person to associate with more than one fleet. 

Uses:
Raises:

pds:new_data_available - with fleet channel

pds:new_settings_available - default preferences

cloudos:picoAttrsSet - make it a pico for the owner

cloudos:subscribe - set up subscription to fleet pico

fuse_owner:delete_fleet

Selector:

select when fuse delete_fleet

Synopsis:

Deletes the fleet pico. All data is lost.  

Uses:

  • fleet_eci - channel of fleet pico to delete
Raises:

cloudos:picoAttrClear - remove pico record

cloudod:unsubscribe - remove subscription to fleet pico

pds:remove_old_data - delete PDS entries associated with fleet 

fuse_owner:send_email_to_owner

Selector:

select when fuse email_for_owner

Synopsis:

Sends an email to the owner. 

Uses:
  •  subj - subject of email
  • msg - email body in plain text
  • html - email body in html
Raises:

fuse_owner:schedule_report

Selector:

select when fuse sched_report
         or pds new_settings_available reportPreference re/.+/

Synopsis:

Sets up a scheduled event for the weekly report. 

Uses:

  • vehicle_data - array of picoIds for any vehicles not in sync

Schedules:

fuse:periodic_report 

fuse_owner:catch_periodic_report

Selector:

select when fuse periodic_report

Synopsis:

Tells the fleet to create a report for the vehicle if the owner's reportPreference equals "on". 

Uses:
Raises:

none

fuse_owner:process_reminders

Selector:

select when fuse reminders_ready

Synopsis:

Signals reminders to the owner. 

Uses:
  • reminders - array of reminder maps
Raises:

notification:status when fired