Skip to content

Instantly share code, notes, and snippets.

@rotemtam
Last active January 16, 2017 14:09
Show Gist options
  • Save rotemtam/588c624f5ac57bf74ee12cb208361979 to your computer and use it in GitHub Desktop.
Save rotemtam/588c624f5ac57bf74ee12cb208361979 to your computer and use it in GitHub Desktop.
copy-backlog

Purpose

Get your copy backlog programatically.

Endpoint

https://console-api.atom-data.io/api/external/v1/copybacklog/:target_id/:schema_name/:table_name/?key=<api key>

Parameters

  • target_id (path): the id (hash) of the target that contains that table you wish to get backlog metrics on.
  • schema_name (path): the name of the Redshift schema containing the table to get backlog metrics on.
  • table_name (path): the name of the table to get backlog metrics on.
  • key (query string): api key for the operation

Examples

curl:

curl -X GET -H "Content-Type: application/json" "https://console-api.atom-data.io/api/external/v1/copybacklog/<target_id>/public/contact_key?key=<api key>"

response:

{
  "ApproxNumberOfMessages": "266", // number of messages in the queue
  "ApproximateNumberOfMessagesNotVisible": "0" // number of messages "in flight", currently working on
}

python:

import requests

url = "https://console-api.atom-data.io/api/external/v1/copybacklog/<target id>/public/contact_key"

querystring = {"key":"<key>"}

headers = {
    'content-type': "application/json",
    }

response = requests.request("GET", url, headers=headers, params=querystring)

print(response.text)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment