digitalocean
Version:
nodejs wrapper for digitalocean v2 api
2,177 lines (554 loc) • 29.3 kB
HTML
<html lang="en">
<head>
<meta charset="utf-8">
<title>JSDoc: Class: Volume</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: Volume</h1>
<section>
<header>
<h2>Volume</h2>
</header>
<article>
<div class="container-overview">
<h4 class="name" id="Volume"><span class="type-signature"></span>new Volume<span class="signature">()</span><span class="type-signature"></span></h4>
<div class="description">
Volume resource
</div>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="digitalocean_volume.js.html">digitalocean/volume.js</a>, <a href="digitalocean_volume.js.html#line5">line 5</a>
</li></ul></dd>
</dl>
</div>
<h3 class="subsection-title">Methods</h3>
<h4 class="name" id="action"><span class="type-signature"></span>action<span class="signature">(volumeId, parametersOrType, callback<span class="signature-attributes">opt</span>)</span><span class="type-signature"></span></h4>
<div class="description">
Create an action on the identified volume.
</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>volumeId</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="attributes">
</td>
<td class="description last">The id of the volume for which to create the action</td>
</tr>
<tr>
<td class="name"><code>parametersOrType</code></td>
<td class="type">
<span class="param-type">string</span>
|
<span class="param-type">object</span>
</td>
<td class="attributes">
</td>
<td class="description last">The name of the action to create or an object with key value pairs of parameters.</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">
<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_volume.js.html">digitalocean/volume.js</a>, <a href="digitalocean_volume.js.html#line138">line 138</a>
</li></ul></dd>
</dl>
<h4 class="name" id="attach"><span class="type-signature"></span>attach<span class="signature">(volumeId, parametersOrDropletId, callback<span class="signature-attributes">opt</span>)</span><span class="type-signature"></span></h4>
<div class="description">
Attach the identified volume to a given Droplet.
</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>volumeId</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="attributes">
</td>
<td class="description last">The id of the volume for which to create the action</td>
</tr>
<tr>
<td class="name"><code>parametersOrDropletId</code></td>
<td class="type">
<span class="param-type">number</span>
|
<span class="param-type">object</span>
</td>
<td class="attributes">
</td>
<td class="description last">If a number, the id of the droplet to which to attach the volume. Otherwise, an object with required keys of `droplet_id`. See the <a href="https://developers.digitalocean.com/documentation/v2/#attach-a-block-storage-volume-to-a-droplet">official docs</a> for valid attributes.</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">
<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_volume.js.html">digitalocean/volume.js</a>, <a href="digitalocean_volume.js.html#line170">line 170</a>
</li></ul></dd>
</dl>
<h4 class="name" id="create"><span class="type-signature"></span>create<span class="signature">(attributes, callback<span class="signature-attributes">opt</span>)</span><span class="type-signature"></span></h4>
<div class="description">
Create a volume object.
</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>attributes</code></td>
<td class="type">
<span class="param-type">object</span>
</td>
<td class="attributes">
</td>
<td class="description last">The attributes with which to create the Volume. See the <a href="https://developers.digitalocean.com/documentation/v2/#volumes">official docs</a> for valid attributes.</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">
<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_volume.js.html">digitalocean/volume.js</a>, <a href="digitalocean_volume.js.html#line35">line 35</a>
</li></ul></dd>
</dl>
<h4 class="name" id="delete"><span class="type-signature"></span>delete<span class="signature">(id, callback<span class="signature-attributes">opt</span>)</span><span class="type-signature"></span></h4>
<div class="description">
Delete the identified volume object.
</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>id</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="attributes">
</td>
<td class="description last">The id of the volume to retrieve</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">
<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_volume.js.html">digitalocean/volume.js</a>, <a href="digitalocean_volume.js.html#line97">line 97</a>
</li></ul></dd>
</dl>
<h4 class="name" id="detach"><span class="type-signature"></span>detach<span class="signature">(volumeId, callback<span class="signature-attributes">opt</span>)</span><span class="type-signature"></span></h4>
<div class="description">
Detach the identified volume if it is attached to a Droplet.
</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>volumeId</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="attributes">
</td>
<td class="description last">The id of the volume for which to create the action</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">
<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_volume.js.html">digitalocean/volume.js</a>, <a href="digitalocean_volume.js.html#line158">line 158</a>
</li></ul></dd>
</dl>
<h4 class="name" id="get"><span class="type-signature"></span>get<span class="signature">(id, callback<span class="signature-attributes">opt</span>)</span><span class="type-signature"></span></h4>
<div class="description">
Get the identified volume object.
</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>id</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="attributes">
</td>
<td class="description last">The id of the volume to retrieve</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">
<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_volume.js.html">digitalocean/volume.js</a>, <a href="digitalocean_volume.js.html#line46">line 46</a>
</li></ul></dd>
</dl>
<h4 class="name" id="getAction"><span class="type-signature"></span>getAction<span class="signature">(volumeId, id, callback<span class="signature-attributes">opt</span>)</span><span class="type-signature"></span></h4>
<div class="description">
Get the identified action object.
</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>volumeId</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="attributes">
</td>
<td class="description last">The id of the volume for which to retrieve the action</td>
</tr>
<tr>
<td class="name"><code>id</code></td>
<td class="type">
<span class="param-type">number</span>
</td>
<td class="attributes">
</td>
<td class="description last">The id of the action to retrieve</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">
<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_volume.js.html">digitalocean/volume.js</a>, <a href="digitalocean_volume.js.html#line125">line 125</a>
</li></ul></dd>
</dl>
<h4 class="name" id="list"><span class="type-signature"></span>list<span class="signature">(page or queryObject<span class="signature-attributes">opt</span>, perPage<span class="signature-attributes">opt</span>, callback<span class="signature-attributes">opt</span>)</span><span class="type-signature"></span></h4>
<div class="description">
List volume objects.
</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>page or queryObject</code></td>
<td class="type">
<span class="param-type">number</span>
|
<span class="param-type">object</span>
</td>
<td class="attributes">
<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">
<optional><br>
</td>
<td class="description last">number of result per page to retrieve</td>
</tr>
<tr>
<td class="name"><code>callback</code></td>
<td class="type">
<span class="param-type"><a href="global.html#listRequestCallback">listRequestCallback</a></span>
</td>
<td class="attributes">
<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_volume.js.html">digitalocean/volume.js</a>, <a href="digitalocean_volume.js.html#line22">line 22</a>
</li></ul></dd>
</dl>
<h4 class="name" id="listActions"><span class="type-signature"></span>listActions<span class="signature">(id, page or queryObject<span class="signature-attributes">opt</span>, perPage<span class="signature-attributes">opt</span>, callback<span class="signature-attributes">opt</span>)</span><span class="type-signature"></span></h4>
<div class="description">
List of action objects.
</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>id</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="attributes">
</td>
<td class="description last">ID of volume for which to retrieve actions</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">
<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">
<optional><br>
</td>
<td class="description last">number of result per page to retrieve</td>
</tr>
<tr>
<td class="name"><code>callback</code></td>
<td class="type">
<span class="param-type"><a href="global.html#listRequestCallback">listRequestCallback</a></span>
</td>
<td class="attributes">
<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_volume.js.html">digitalocean/volume.js</a>, <a href="digitalocean_volume.js.html#line111">line 111</a>
</li></ul></dd>
</dl>
<h4 class="name" id="resize"><span class="type-signature"></span>resize<span class="signature">(volumeId, parametersOrSizeGibabytes, region, callback<span class="signature-attributes">opt</span>)</span><span class="type-signature"></span></h4>
<div class="description">
Increase the size of the identified volume.
</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>volumeId</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="attributes">
</td>
<td class="description last">The id of the volume for which to create the action</td>
</tr>
<tr>
<td class="name"><code>parametersOrSizeGibabytes</code></td>
<td class="type">
<span class="param-type">number</span>
|
<span class="param-type">object</span>
</td>
<td class="attributes">
</td>
<td class="description last">If a number, the size in gigabytes to which the volume should be resized. Otherwise, an object with required keys of `size_gigabytes` and `region`. See the <a href="https://developers.digitalocean.com/documentation/v2/#resize-a-volume">official docs</a> for valid attributes.</td>
</tr>
<tr>
<td class="name"><code>region</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="attributes">
</td>
<td class="description last">The slug of the region in which the drive was created</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">
<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_volume.js.html">digitalocean/volume.js</a>, <a href="digitalocean_volume.js.html#line194">line 194</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>