UNPKG

digitalocean

Version:
1,898 lines (513 loc) 27.9 kB
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <title>JSDoc: Class: Client</title> <script src="scripts/prettify/prettify.js"> </script> <script src="scripts/prettify/lang-css.js"> </script> <!--[if lt IE 9]> <script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script> <![endif]--> <link type="text/css" rel="stylesheet" href="styles/prettify-tomorrow.css"> <link type="text/css" rel="stylesheet" href="styles/jsdoc-default.css"> </head> <body> <div id="main"> <h1 class="page-title">Class: Client</h1> <section> <header> <h2>Client</h2> </header> <article> <div class="container-overview"> <h4 class="name" id="Client"><span class="type-signature"></span>new Client<span class="signature">()</span><span class="type-signature"></span></h4> <div class="description"> Client resource </div> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="digitalocean_client.js.html">digitalocean/client.js</a>, <a href="digitalocean_client.js.html#line29">line 29</a> </li></ul></dd> </dl> </div> <h3 class="subsection-title">Methods</h3> <h4 class="name" id=".Client"><span class="type-signature">(static) </span>Client<span class="signature">(token, options<span class="signature-attributes">opt</span>)</span><span class="type-signature"></span></h4> <div class="description"> Create a new Client instance. </div> <h5>Parameters:</h5> <table class="params"> <thead> <tr> <th>Name</th> <th>Type</th> <th>Attributes</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>token</code></td> <td class="type"> <span class="param-type">string</span> </td> <td class="attributes"> </td> <td class="description last">The DigitalOcean token used for authorization.</td> </tr> <tr> <td class="name"><code>options</code></td> <td class="type"> <span class="param-type"><a href="global.html#ClientOptions">ClientOptions</a></span> </td> <td class="attributes"> &lt;optional><br> </td> <td class="description last">An object whose values are used to configure a client instance.</td> </tr> </tbody> </table> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="digitalocean_client.js.html">digitalocean/client.js</a>, <a href="digitalocean_client.js.html#line53">line 53</a> </li></ul></dd> </dl> <h4 class="name" id="delete"><span class="type-signature"></span>delete<span class="signature">(path, content, options, successStatuses, successRootKeys, callback<span class="signature-attributes">opt</span>)</span><span class="type-signature"></span></h4> <div class="description"> Send a HTTP DELETE request with the specified parameters. </div> <h5>Parameters:</h5> <table class="params"> <thead> <tr> <th>Name</th> <th>Type</th> <th>Attributes</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>path</code></td> <td class="type"> <span class="param-type">string</span> </td> <td class="attributes"> </td> <td class="description last">the URL escaped route</td> </tr> <tr> <td class="name"><code>content</code></td> <td class="type"> <span class="param-type">object</span> </td> <td class="attributes"> </td> <td class="description last">an object serialized to json</td> </tr> <tr> <td class="name"><code>options</code></td> <td class="type"> <span class="param-type">object</span> </td> <td class="attributes"> </td> <td class="description last">an object passed to the request library See the <a href="https://github.com/request/request#requestoptions-callback">request docs</a> for valid attributes, e.g. a proxy or user agent</td> </tr> <tr> <td class="name"><code>successStatuses</code></td> <td class="type"> <span class="param-type">number</span> | <span class="param-type">Array.&lt;number></span> </td> <td class="attributes"> </td> <td class="description last">number or array of numbers corresponding to successful HTTP status codes</td> </tr> <tr> <td class="name"><code>successRootKeys</code></td> <td class="type"> <span class="param-type">string</span> | <span class="param-type">Array.&lt;string></span> </td> <td class="attributes"> </td> <td class="description last">string or array of strings corresponding to the root objects containing successful responses</td> </tr> <tr> <td class="name"><code>callback</code></td> <td class="type"> <span class="param-type"><a href="global.html#requestCallback">requestCallback</a></span> </td> <td class="attributes"> &lt;optional><br> </td> <td class="description last">callback that handles the response</td> </tr> </tbody> </table> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="digitalocean_client.js.html">digitalocean/client.js</a>, <a href="digitalocean_client.js.html#line374">line 374</a> </li></ul></dd> </dl> <h4 class="name" id="get"><span class="type-signature"></span>get<span class="signature">(path, options, page or queryObject<span class="signature-attributes">opt</span>, perPage<span class="signature-attributes">opt</span>, successStatuses, successRootKeys, callback<span class="signature-attributes">opt</span>)</span><span class="type-signature"></span></h4> <div class="description"> Send a HTTP GET request with the specified parameters. </div> <h5>Parameters:</h5> <table class="params"> <thead> <tr> <th>Name</th> <th>Type</th> <th>Attributes</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>path</code></td> <td class="type"> <span class="param-type">string</span> </td> <td class="attributes"> </td> <td class="description last">the URL escaped route</td> </tr> <tr> <td class="name"><code>options</code></td> <td class="type"> <span class="param-type">object</span> </td> <td class="attributes"> </td> <td class="description last">an object passed to the request library See the <a href="https://github.com/request/request#requestoptions-callback">request docs</a> for valid attributes, e.g. a proxy or user agent</td> </tr> <tr> <td class="name"><code>page or queryObject</code></td> <td class="type"> <span class="param-type">number</span> | <span class="param-type">object</span> </td> <td class="attributes"> &lt;optional><br> </td> <td class="description last">page number to retrieve or key value pairs of query parameters</td> </tr> <tr> <td class="name"><code>perPage</code></td> <td class="type"> <span class="param-type">number</span> </td> <td class="attributes"> &lt;optional><br> </td> <td class="description last">number of result per page to retrieve</td> </tr> <tr> <td class="name"><code>successStatuses</code></td> <td class="type"> <span class="param-type">number</span> | <span class="param-type">Array.&lt;number></span> </td> <td class="attributes"> </td> <td class="description last">number or array of numbers corresponding to successful HTTP status codes</td> </tr> <tr> <td class="name"><code>successRootKeys</code></td> <td class="type"> <span class="param-type">string</span> | <span class="param-type">Array.&lt;string></span> </td> <td class="attributes"> </td> <td class="description last">string or array of strings corresponding to the root objects containing successful responses</td> </tr> <tr> <td class="name"><code>callback</code></td> <td class="type"> <span class="param-type"><a href="global.html#requestCallback">requestCallback</a></span> </td> <td class="attributes"> &lt;optional><br> </td> <td class="description last">callback that handles the response</td> </tr> </tbody> </table> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="digitalocean_client.js.html">digitalocean/client.js</a>, <a href="digitalocean_client.js.html#line245">line 245</a> </li></ul></dd> </dl> <h4 class="name" id="patch"><span class="type-signature"></span>patch<span class="signature">(path, content, options, successStatuses, successRootKeys, callback<span class="signature-attributes">opt</span>)</span><span class="type-signature"></span></h4> <div class="description"> Send a HTTP PATCH request with the specified parameters. </div> <h5>Parameters:</h5> <table class="params"> <thead> <tr> <th>Name</th> <th>Type</th> <th>Attributes</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>path</code></td> <td class="type"> <span class="param-type">string</span> </td> <td class="attributes"> </td> <td class="description last">the URL escaped route</td> </tr> <tr> <td class="name"><code>content</code></td> <td class="type"> <span class="param-type">object</span> </td> <td class="attributes"> </td> <td class="description last">an object serialized to json</td> </tr> <tr> <td class="name"><code>options</code></td> <td class="type"> <span class="param-type">object</span> </td> <td class="attributes"> </td> <td class="description last">an object passed to the request library See the <a href="https://github.com/request/request#requestoptions-callback">request docs</a> for valid attributes, e.g. a proxy or user agent</td> </tr> <tr> <td class="name"><code>successStatuses</code></td> <td class="type"> <span class="param-type">number</span> | <span class="param-type">Array.&lt;number></span> </td> <td class="attributes"> </td> <td class="description last">number or array of numbers corresponding to successful HTTP status codes</td> </tr> <tr> <td class="name"><code>successRootKeys</code></td> <td class="type"> <span class="param-type">string</span> | <span class="param-type">Array.&lt;string></span> </td> <td class="attributes"> </td> <td class="description last">string or array of strings corresponding to the root objects containing successful responses</td> </tr> <tr> <td class="name"><code>callback</code></td> <td class="type"> <span class="param-type"><a href="global.html#requestCallback">requestCallback</a></span> </td> <td class="attributes"> &lt;optional><br> </td> <td class="description last">callback that handles the response</td> </tr> </tbody> </table> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="digitalocean_client.js.html">digitalocean/client.js</a>, <a href="digitalocean_client.js.html#line344">line 344</a> </li></ul></dd> </dl> <h4 class="name" id="post"><span class="type-signature"></span>post<span class="signature">(path, content, options, successStatuses, successRootKeys, callback<span class="signature-attributes">opt</span>)</span><span class="type-signature"></span></h4> <div class="description"> Send a HTTP POST request with the specified parameters. </div> <h5>Parameters:</h5> <table class="params"> <thead> <tr> <th>Name</th> <th>Type</th> <th>Attributes</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>path</code></td> <td class="type"> <span class="param-type">string</span> </td> <td class="attributes"> </td> <td class="description last">the URL escaped route</td> </tr> <tr> <td class="name"><code>content</code></td> <td class="type"> <span class="param-type">object</span> </td> <td class="attributes"> </td> <td class="description last">an object serialized to json</td> </tr> <tr> <td class="name"><code>options</code></td> <td class="type"> <span class="param-type">object</span> </td> <td class="attributes"> </td> <td class="description last">an object passed to the request library See the <a href="https://github.com/request/request#requestoptions-callback">request docs</a> for valid attributes, e.g. a proxy or user agent</td> </tr> <tr> <td class="name"><code>successStatuses</code></td> <td class="type"> <span class="param-type">number</span> | <span class="param-type">Array.&lt;number></span> </td> <td class="attributes"> </td> <td class="description last">number or array of numbers corresponding to successful HTTP status codes</td> </tr> <tr> <td class="name"><code>successRootKeys</code></td> <td class="type"> <span class="param-type">string</span> | <span class="param-type">Array.&lt;string></span> </td> <td class="attributes"> </td> <td class="description last">string or array of strings corresponding to the root objects containing successful responses</td> </tr> <tr> <td class="name"><code>callback</code></td> <td class="type"> <span class="param-type"><a href="global.html#requestCallback">requestCallback</a></span> </td> <td class="attributes"> &lt;optional><br> </td> <td class="description last">callback that handles the response</td> </tr> </tbody> </table> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="digitalocean_client.js.html">digitalocean/client.js</a>, <a href="digitalocean_client.js.html#line329">line 329</a> </li></ul></dd> </dl> <h4 class="name" id="put"><span class="type-signature"></span>put<span class="signature">(path, content, options, successStatuses, successRootKeys, callback<span class="signature-attributes">opt</span>)</span><span class="type-signature"></span></h4> <div class="description"> Send a HTTP PUT request with the specified parameters. </div> <h5>Parameters:</h5> <table class="params"> <thead> <tr> <th>Name</th> <th>Type</th> <th>Attributes</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>path</code></td> <td class="type"> <span class="param-type">string</span> </td> <td class="attributes"> </td> <td class="description last">the URL escaped route</td> </tr> <tr> <td class="name"><code>content</code></td> <td class="type"> <span class="param-type">object</span> </td> <td class="attributes"> </td> <td class="description last">an object serialized to json</td> </tr> <tr> <td class="name"><code>options</code></td> <td class="type"> <span class="param-type">object</span> </td> <td class="attributes"> </td> <td class="description last">an object passed to the request library See the <a href="https://github.com/request/request#requestoptions-callback">request docs</a> for valid attributes, e.g. a proxy or user agent</td> </tr> <tr> <td class="name"><code>successStatuses</code></td> <td class="type"> <span class="param-type">number</span> | <span class="param-type">Array.&lt;number></span> </td> <td class="attributes"> </td> <td class="description last">number or array of numbers corresponding to successful HTTP status codes</td> </tr> <tr> <td class="name"><code>successRootKeys</code></td> <td class="type"> <span class="param-type">string</span> | <span class="param-type">Array.&lt;string></span> </td> <td class="attributes"> </td> <td class="description last">string or array of strings corresponding to the root objects containing successful responses</td> </tr> <tr> <td class="name"><code>callback</code></td> <td class="type"> <span class="param-type"><a href="global.html#requestCallback">requestCallback</a></span> </td> <td class="attributes"> &lt;optional><br> </td> <td class="description last">callback that handles the response</td> </tr> </tbody> </table> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="digitalocean_client.js.html">digitalocean/client.js</a>, <a href="digitalocean_client.js.html#line359">line 359</a> </li></ul></dd> </dl> </article> </section> </div> <nav> <h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="Account.html">Account</a></li><li><a href="Action.html">Action</a></li><li><a href="Certificate.html">Certificate</a></li><li><a href="Client.html">Client</a></li><li><a href="Domain.html">Domain</a></li><li><a href="Droplet.html">Droplet</a></li><li><a href="Firewall.html">Firewall</a></li><li><a href="FloatingIp.html">FloatingIp</a></li><li><a href="Image.html">Image</a></li><li><a href="ListResponse.html">ListResponse</a></li><li><a href="LoadBalancer.html">LoadBalancer</a></li><li><a href="Region.html">Region</a></li><li><a href="Size.html">Size</a></li><li><a href="Snapshot.html">Snapshot</a></li><li><a href="Tag.html">Tag</a></li><li><a href="Volume.html">Volume</a></li></ul><h3><a href="global.html">Global</a></h3> </nav> <br class="clear"> <footer> Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.4.0</a> </footer> <script> prettyPrint(); </script> <script src="scripts/linenumber.js"> </script> </body> </html>