webinarium /
linode-api3
| 1 | <?php |
||
| 2 | |||
| 3 | //---------------------------------------------------------------------- |
||
| 4 | // |
||
| 5 | // Copyright (C) 2015-2017 Artem Rodygin |
||
| 6 | // |
||
| 7 | // This file is part of Linode API Client Library for PHP. |
||
| 8 | // |
||
| 9 | // You should have received a copy of the MIT License along with |
||
| 10 | // the library. If not, see <http://opensource.org/licenses/MIT>. |
||
| 11 | // |
||
| 12 | //---------------------------------------------------------------------- |
||
| 13 | |||
| 14 | namespace Linode; |
||
| 15 | |||
| 16 | /** |
||
| 17 | * This class is autogenerated. |
||
| 18 | * |
||
| 19 | * @version Linode API v3.3 |
||
| 20 | */ |
||
| 21 | class VolumeApi extends BaseLinodeApi |
||
| 22 | { |
||
| 23 | /** |
||
| 24 | * Creates a new Block Storage Volume. One of DatacenterID or LinodeID is required. |
||
| 25 | * |
||
| 26 | * @param int $DatacenterID [optional] Sets the datacenter where the Volume should be provisioned |
||
| 27 | * @param string $Label [required] A unique name for the Volume |
||
| 28 | * @param int $Size [required] Sets the size of the new Volume in GiB |
||
| 29 | * @param int $LinodeID [optional] The Linode to attach this Volume to |
||
| 30 | * |
||
| 31 | * @return array |
||
| 32 | */ |
||
| 33 | 1 | public function create($DatacenterID, $Label, $Size, $LinodeID = null) |
|
| 34 | { |
||
| 35 | 1 | return $this->call('volume.create', [ |
|
|
0 ignored issues
–
show
Bug
Best Practice
introduced
by
Loading history...
|
|||
| 36 | 1 | 'DatacenterID' => $DatacenterID, |
|
| 37 | 1 | 'Label' => $Label, |
|
| 38 | 1 | 'Size' => $Size, |
|
| 39 | 1 | 'LinodeID' => $LinodeID, |
|
| 40 | ]); |
||
| 41 | } |
||
| 42 | |||
| 43 | /** |
||
| 44 | * Deletes a Block Storage Volume. |
||
| 45 | * |
||
| 46 | * @param int $VolumeID [required] The Volume to delete |
||
| 47 | * |
||
| 48 | * @return array |
||
| 49 | */ |
||
| 50 | 1 | public function delete($VolumeID) |
|
| 51 | { |
||
| 52 | 1 | return $this->call('volume.delete', [ |
|
|
0 ignored issues
–
show
|
|||
| 53 | 1 | 'VolumeID' => $VolumeID, |
|
| 54 | ]); |
||
| 55 | } |
||
| 56 | |||
| 57 | /** |
||
| 58 | * Clones an existing Block Storage Volume. |
||
| 59 | * |
||
| 60 | * @param int $CloneFromID [required] |
||
| 61 | * @param string $Label [required] A unique name for the new Volume |
||
| 62 | * |
||
| 63 | * @return array |
||
| 64 | */ |
||
| 65 | 1 | public function duplicate($CloneFromID, $Label) |
|
| 66 | { |
||
| 67 | 1 | return $this->call('volume.clone', [ |
|
|
0 ignored issues
–
show
|
|||
| 68 | 1 | 'CloneFromID' => $CloneFromID, |
|
| 69 | 1 | 'Label' => $Label, |
|
| 70 | ]); |
||
| 71 | } |
||
| 72 | |||
| 73 | /** |
||
| 74 | * Returns a list of block storage Volumes. |
||
| 75 | * |
||
| 76 | * @param int $VolumeID [optional] Limits the list to the specified Volume |
||
| 77 | * |
||
| 78 | * @return array |
||
| 79 | */ |
||
| 80 | 1 | public function getList($VolumeID = null) |
|
| 81 | { |
||
| 82 | 1 | return $this->call('volume.list', [ |
|
|
0 ignored issues
–
show
|
|||
| 83 | 1 | 'VolumeID' => $VolumeID, |
|
| 84 | ]); |
||
| 85 | } |
||
| 86 | |||
| 87 | /** |
||
| 88 | * Updates a Volume's properties. |
||
| 89 | * |
||
| 90 | * @param int $VolumeID [required] The Volume to modify |
||
| 91 | * @param string $Label [optional] A unique name for the Volume |
||
| 92 | * @param int $Size [optional] Sets the new size of the new Volume in GiB; Volumes can only be made larger |
||
| 93 | * @param int $LinodeID [optional] The Linode to attach this Volume to |
||
| 94 | * |
||
| 95 | * @return array |
||
| 96 | */ |
||
| 97 | 1 | public function update($VolumeID, $Label = null, $Size = null, $LinodeID = null) |
|
| 98 | { |
||
| 99 | 1 | return $this->call('volume.update', [ |
|
|
0 ignored issues
–
show
|
|||
| 100 | 1 | 'VolumeID' => $VolumeID, |
|
| 101 | 1 | 'Label' => $Label, |
|
| 102 | 1 | 'Size' => $Size, |
|
| 103 | 1 | 'LinodeID' => $LinodeID, |
|
| 104 | ]); |
||
| 105 | } |
||
| 106 | } |
||
| 107 |