1 | <?php |
||
21 | class Volume extends AbstractApi |
||
22 | { |
||
23 | /** |
||
24 | * @param string $regionSlug restricts results to volumes available in a specific region |
||
25 | * |
||
26 | * @return VolumeEntity[] Lists all of the Block Storage volumes available |
||
27 | */ |
||
28 | public function getAll($regionSlug = null) |
||
41 | |||
42 | /** |
||
43 | * @param string $driveName restricts results to volumes with the specified name |
||
44 | * @param string $regionSlug restricts results to volumes available in a specific region |
||
45 | * |
||
46 | * @return VolumeEntity[] Lists all of the Block Storage volumes available |
||
47 | */ |
||
48 | public function getByNameAndRegion($driveName, $regionSlug) |
||
60 | |||
61 | /** |
||
62 | * @param string $id |
||
63 | * |
||
64 | * @return VolumeEntity the Block Storage volume with the specified id |
||
65 | */ |
||
66 | public function getById($id) |
||
74 | |||
75 | /** |
||
76 | * Get all volume snapshots. |
||
77 | * |
||
78 | * @param string $id |
||
79 | * |
||
80 | * @return ImageEntity[] |
||
81 | */ |
||
82 | public function getSnapshots($id) |
||
96 | |||
97 | /** |
||
98 | * @param string $name A human-readable name for the Block Storage volume |
||
99 | * @param string $description Free-form text field to describe a Block Storage volume |
||
100 | * @param string $sizeInGigabytes The size of the Block Storage volume in GiB |
||
101 | * @param string $regionSlug The region where the Block Storage volume will be created |
||
102 | * @param string $snapshotId The unique identifier for the volume snapshot from which to create the volume. Should not be specified with a region_id. |
||
103 | * |
||
104 | * @return VolumeEntity |
||
105 | */ |
||
106 | public function create($name, $description, $sizeInGigabytes, $regionSlug, $snapshotId = null) |
||
125 | |||
126 | /** |
||
127 | * @param string $id |
||
128 | * |
||
129 | * @throws HttpException |
||
130 | */ |
||
131 | public function delete($id) |
||
135 | |||
136 | /** |
||
137 | * @param string $driveName restricts the search to volumes with the specified name |
||
138 | * @param string $regionSlug restricts the search to volumes available in a specific region |
||
139 | * |
||
140 | * @throws HttpException |
||
141 | */ |
||
142 | public function deleteWithNameAndRegion($driveName, $regionSlug) |
||
146 | |||
147 | /** |
||
148 | * @param string $id the id of the volume |
||
149 | * @param int $dropletId the unique identifier for the Droplet the volume will be attached to |
||
150 | * @param string $regionSlug the slug identifier for the region the volume is located in |
||
151 | * |
||
152 | * @return ActionEntity |
||
153 | */ |
||
154 | public function attach($id, $dropletId, $regionSlug) |
||
168 | |||
169 | /** |
||
170 | * @param string $id the id of the volume |
||
171 | * @param int $dropletId the unique identifier for the Droplet the volume will detach from |
||
172 | * @param string $regionSlug the slug identifier for the region the volume is located in |
||
173 | * |
||
174 | * @return ActionEntity |
||
175 | */ |
||
176 | public function detach($id, $dropletId, $regionSlug) |
||
190 | |||
191 | /** |
||
192 | * @param string $id the id of the volume |
||
193 | * @param int $newSize the new size of the Block Storage volume in GiB |
||
194 | * @param string $regionSlug the slug identifier for the region the volume is located in |
||
195 | * |
||
196 | * @return ActionEntity |
||
197 | */ |
||
198 | public function resize($id, $newSize, $regionSlug) |
||
212 | |||
213 | /** |
||
214 | * Create a new snapshot of the volume. |
||
215 | * |
||
216 | * @param string $id the id of the volume |
||
217 | * @param string $name a human-readable name for the volume snapshot |
||
218 | * |
||
219 | * @throws HttpException |
||
220 | * |
||
221 | * @return SnapshotEntity |
||
222 | */ |
||
223 | public function snapshot($id, $name) |
||
235 | |||
236 | /** |
||
237 | * @param string $id |
||
238 | * @param int $actionId |
||
239 | * |
||
240 | * @return ActionEntity |
||
241 | */ |
||
242 | public function getActionById($id, $actionId) |
||
250 | |||
251 | /** |
||
252 | * @param string $id |
||
253 | * |
||
254 | * @return ActionEntity[] |
||
255 | */ |
||
256 | public function getActions($id) |
||
268 | } |
||
269 |