sync_cogs

Retrieve a list of cogs that have changed.

Arguments

content_hashes ([String!]!)

An array of content hashes for COGs the client has previously retrieved. The server will return COGs whose content hashes do not match the client's content hashes.

survey_sentera_id (ID!)

The ID of the survey containing the COGs to be synced.

Return fields

deleted ([SyncItem!]!)

Items that have been deleted.

failed ([SyncError!])

A list describing errors that occurred during the syncing process.

remaining_count (Int!)

The number of items remaining to be synced.

upserted ([SyncItem!]!)

Items that have been inserted or updated.

Examples

Sync COGs for a survey

This query is used by a client to sync COGs for a specific survey with COGs stored on the server. This query will return up to the first 1,000 COGs in a survey that are different from the COGs held by the client. To retrieve the remaining COGs, a client should call this query repeatedly, passing in the full set of content hashes for COGs it holds, until no more COGs are returned, or the remaining count returned is 0.

Try this example in GraphiQL
query SyncSurveyCogs {
  sync_cogs(
  survey_sentera_id: "itqkn28_CO_SHORT1_CV_test_dc0d87d_170907_235328"
  content_hashes: [
    "xdNDk/aet07YA1pi"
    "/h9Kp8h1wLAR77g6"
    "pZCIzimW+sJQ1tPP"
    "zShxQoCpBmIvKQzg"
    "qYcc+5d0r6xXrJ+B"
    "1RUHdRg7eewn5Ytc"
    "jut/CTgwHV4nPhHU"
    "3mT/9ITHMbrufod3"
    "Frw7c/jWXG0DGhDp"
    "szY6ppzZ4mJKUK//"
    "szOWioO7aPh41tns"
    "aHhl10uJY5pP8x5Y"
    "s8O1QwaYex8nMGIt"
    "2iZuIOjIq9GToC1k"
    "nZ21khXOu5k96QNW"
  ]
  ) {
  remaining_count
  upserted {
    sentera_id
    content_hash
    created_at
    updated_at
    ... on Cog {
      status
      clipped
      error
      max_zoom
      mosaic {
        sentera_id
      }
    }
  }
  deleted {
    sentera_id
    content_hash
  }
  }
}

{
  "data": {
  "sync_cogs": {
    "remaining_count": 0,
    "upserted": [
      {
        "sentera_id": "84mj0xz_CG_ljkuAcme_CV_deve_12421c42d_211221_133840",
        "content_hash": "BNQNMOsbmmxrH9k3",
        "created_at": "2021-12-21T19:38:40Z",
        "updated_at": "2021-12-21T23:38:12Z",
        "status": "FAIL",
        "clipped": true,
        "error": "Failed to ungrayscale input image: Expected number of bands to be in (2, 4), but found 1",
        "max_zoom": null,
        "mosaic": {
          "sentera_id": "43ht9il_MO_ljkuAcme_CV_deve_12421c42d_211221_133840"
        }
      },
      {
        "sentera_id": "02fg2zb_CG_ljkuAcme_CV_deve_12421c42d_211221_133840",
        "content_hash": "UMNWEDsbmmxrA2Q1",
        "created_at": "2021-12-21T19:42:40Z",
        "updated_at": "2021-12-21T23:42:12Z",
        "status": "SUCCESS",
        "clipped": false,
        "error": null,
        "max_zoom": 19,
        "mosaic": {
          "sentera_id": "22wq7nc_MO_ljkuAcme_CV_deve_12421c42d_211221_133840"
        }
      }
    ],
    "deleted": [
      {
        "sentera_id": "wivyzrk_CG_ljkuAcme_CV_deve_12421c42d_211221_133840",
        "content_hash": "KrYpFM4/mMpkijFw"
      }
    ]
  }
  }
}