Comparing version 0.1.6 to 0.1.7
@@ -75,2 +75,28 @@ var extend = require('extend'); | ||
snapshot_api.prototype.snapshot_status = function(snapshot_url, callback){ | ||
/* | ||
* snapshot_api.add_snapshot(snapshot_url, [callback]) | ||
* | ||
* method used to check the status of a datadog snapshot. | ||
* https://github.com/DataDog/dogapi/blob/master/src/dogapi/http/snapshot.py#L64 | ||
* Snapshot URLs are returned right away, but may be empty if the query or graph is complicated. | ||
* Result will be a json payload, with 403 for incomplete, or 200 for complete. | ||
* Examples: | ||
* * {"status_code":403} - incomplete (still processing, image is empty) | ||
* * {"status_code":200} - image is rendered and ready | ||
* | ||
* `snapshot_url` is a string containing URL returned from a call to add_snapshot or add_snapshot_from_def | ||
* | ||
* `callback` is an optional function for the result | ||
* callback(error, result, status_code) | ||
*/ | ||
if(typeof snapshot_url != 'string'){ | ||
throw new Error('`snapshot_url` parameter must be a string'); | ||
} | ||
url = snapshot_url.split('/snapshot/view/')[1].split('.png')[0] | ||
this.request('GET', '/graph/snapshot_status/'+url, {}, callback); | ||
}; | ||
return module.exports = snapshot_api; |
{ | ||
"name": "dogapi", | ||
"version": "0.1.6", | ||
"version": "0.1.7", | ||
"description": "Datadog API Node.JS Client", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
@@ -122,2 +122,4 @@ node-dogapi | ||
* method used to take a snapshot of a datadog graph | ||
* `dogapi.snapshot_status(snapshot_url, [callback])` | ||
* method used to check the status of a datadog snapshot | ||
@@ -124,0 +126,0 @@ ## Sample Usage: |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
42484
943
165