Releasesv0.1.0
Api referenceEndpointsAdmin

What has landed, per provider and day, and what is still processing (instance admin, one tenant)

GET
/v1/admin/tenants/{tenant_id}/users/{id}/coverage

GET /v1/users/{id}/coverage (getCoverage) for the tenant of tenant_id, read with an instance admin key: the same parameters and the same answer as the tenant's own key gets. Read only. Recorded in the caller's audit log and, actor admin, in the tenant's. See docs/admin-api.md.

Authorization

tenantKey
headerAuthorizationBearer <token>

Tenant API key, ohs_sk_ + 43 base62 characters.

Path Parameters

tenant_id*string

The id of a tenant; any other value is a 404.

Formatuuid
id*string
Formatuuid

Query Parameters

provider?string
start?|

Inclusive lower bound, RFC 3339 or YYYY-MM-DD.

end?|

Exclusive upper bound, RFC 3339 or YYYY-MM-DD. Must not be before start.

view?string

merged (the default): when several sources recorded the same thing (a ring and a watch the same night, a phone and a watch the same steps, one sample directly and through an aggregator), only the best ranked source's record is listed, so nothing counts twice. The order of sources is the user's (see source-priorities). all: every stored record of every source.

Default"merged"
Value in"merged""all"

Header Parameters

Authorization*string

The tenant API key, as a bearer secret.

Response Body

Coverage report.

application/json
  1. response
pending_jobs*integer

Work of the user not finished yet: ETL jobs and provider pulls (backfill, scheduled or notified), pending or running. A pull that keeps failing stays pending while it retries; GET /v1/users/{id}/freshness says why.

parked_jobs*integer

ETL jobs that exhausted their retries (an operator must look).

rejected_records*integer

Lines of the user the ETL could not store (bad value, missing field, unknown unit) and has not recovered since, each line once; an object that failed as a whole counts as one. Counts every provider and day, whatever the filters.

truncated*boolean

True when more than 10000 days matched; days holds the earliest.

days*array<>
curl -X GET 'http://localhost:8080/v1/admin/tenants/497f6eca-6276-4993-bfeb-53cbbbba6f08/users/497f6eca-6276-4993-bfeb-53cbbbba6f08/coverage' \  -H 'Authorization: Bearer ohs_sk_...'
{  "pending_jobs": 0,  "parked_jobs": 0,  "rejected_records": 0,  "truncated": true,  "days": [    {      "provider": "string",      "date": "2019-08-24",      "records": 0,      "metrics": {        "property1": 0,        "property2": 0      },      "last_synced_at": "2019-08-24T14:15:22Z"    }  ]}
Edit on GitHub