Browse Source

update docs

pull/17/head
Brett Langdon 11 years ago
parent
commit
54db417d37
1 changed files with 15 additions and 2 deletions
  1. +15
    -2
      index.html

+ 15
- 2
index.html View File

@ -486,7 +486,7 @@ var options = {
dogapi.initialize(options); dogapi.initialize(options);
var query = "system.cpu.idle{*}"; var query = "system.cpu.idle{*}";
var to = dogapi.now(); var to = dogapi.now();
var from = from - 3600; // an hour ago
var from = to - 3600; // an hour ago
dogapi.graph.snapshot(query, from, to, function(err, res){ dogapi.graph.snapshot(query, from, to, function(err, res){
console.dir(res); console.dir(res);
}); });
@ -1772,15 +1772,28 @@ with the datadog api. The available options are.</p>
<li>app_key: your app key</li> <li>app_key: your app key</li>
<li>api_version: the version of the api [default: <code>v1</code>]</li> <li>api_version: the version of the api [default: <code>v1</code>]</li>
<li>api_host: the host to call [default: <code>api.datadoghq.com</code>]</li> <li>api_host: the host to call [default: <code>api.datadoghq.com</code>]</li>
<li>proxy_agent: Optional, A Https Proxy agent.</li>
</ul> </ul>
</dd> </dd>
</dl> </dl>
</div> </div>
<div class="col-md-6"> <div class="col-md-6">
<pre><code class="lang-javascript">var dogapi = require(&quot;dogapi&quot;); <pre><code class="lang-javascript">var dogapi = require(&quot;dogapi&quot;);
// Optional for Proxy -------8&lt;----------
// Code from http://blog.vanamco.com/proxy-requests-in-node-js/
var HttpsProxyAgent = require(&quot;./httpsproxyagent&quot;);
var agent = new HttpsProxyAgent({
proxyHost: &quot;MY_PROXY_HOST&quot;,
proxyPort: 3128
});
// Optional for Proxy --------&gt;8----------
var options = { var options = {
api_key: &quot;&lt;API_KEY_HERE&gt;&quot;, api_key: &quot;&lt;API_KEY_HERE&gt;&quot;,
app_key: &quot;&lt;APP_KEY_HERE&gt;&quot;
app_key: &quot;&lt;APP_KEY_HERE&gt;&quot;,
proxy_agent: agent // Optional for Proxy
}; };
dogapi.initialize(options); dogapi.initialize(options);
dogapi.event.create(...); dogapi.event.create(...);


Loading…
Cancel
Save