LIVD device sync - CDCgov/prime-simplereport GitHub Wiki

Running the LIVD device sync

Intro

This page provides a walkthrough and tips on how to run a LIVD device sync in production.

Tips

  • Go through the steps below in a lower environment to confirm it works before trying on prod
  • (Highly recommended) Pair with other developers to ensure things look good before performing the sync in prod
  • (Highly recommended) Start a Slack thread in the engineering Slack when running a device sync for record keeping
    • other helpful information to post in a thread: # of devices added, # of devices changed/updated

Steps

  1. Hit the following API endpoint .../api/devices/sync?dryRun=true
    • As a curl command for prod, it would look like:
       curl --location 'https://www.simplereport.gov/api/devices/sync?dryRun=true' \
       --header 'Authorization: Bearer yourToken'
      
    • Or use an API testing tool of your choice
  2. Go to Azure with your su account and go to Application Insights for the environment you ran the dry run on
    • Go to "Logs"

    • Run a new query

       traces
       | where message has "device created" or message has "updating device"
      
  1. Check some of the devices being updated and created to make sure they look correct. Things to check:

    • cross-reference the LIVD API
    • check metabase for the environment you ran the sync in to ensure devices being created don't already exist
    • check the blocklist to ensure no devices here are being created
    • a device that is created can be updated in the same sync if they have multiple entries in the LIVD table (i.e. for multiplex devices, or if it has different equipment uids)
  2. If the above looks, good hit the following API endpoint .../api/devices/sync?dryRun=false

    • As a curl command for prod, it would look like:
       curl --location 'https://www.simplereport.gov/api/devices/sync?dryRun=false' \
       --header 'Authorization: Bearer yourToken'
      
    • Or use an API testing tool of your choice