| @@ 17-31 (lines=15) @@ | ||
| 14 | /** |
|
| 15 | * @author Albert Leitato <[email protected]> |
|
| 16 | */ |
|
| 17 | class Application extends AbstractApi |
|
| 18 | { |
|
| 19 | /** |
|
| 20 | * Retrieve a list of available applications. |
|
| 21 | * These refer to applications that can be launched when creating a Vultr VPS. |
|
| 22 | * |
|
| 23 | * @return ApplicationEntity |
|
| 24 | */ |
|
| 25 | public function list() |
|
| 26 | { |
|
| 27 | $response = $this->adapter->get(\sprintf('%s/app/list', $this->endpoint)); |
|
| 28 | ||
| 29 | return $this->handleResponse($response, ApplicationEntity::class, true); |
|
| 30 | } |
|
| 31 | } |
|
| 32 | ||
| @@ 17-34 (lines=18) @@ | ||
| 14 | /** |
|
| 15 | * @author Albert Leitato <[email protected]> |
|
| 16 | */ |
|
| 17 | class Os extends AbstractApi |
|
| 18 | { |
|
| 19 | /** |
|
| 20 | * Retrieve a list of available operating systems. |
|
| 21 | * |
|
| 22 | * If the "windows" flag is true, |
|
| 23 | * a Windows license will be included with the instance, |
|
| 24 | * which will increase the cost. |
|
| 25 | * |
|
| 26 | * @return OsEntity[] |
|
| 27 | */ |
|
| 28 | public function list() |
|
| 29 | { |
|
| 30 | $response = $this->adapter->get(\sprintf('%s/os/list', $this->endpoint)); |
|
| 31 | ||
| 32 | return $this->handleResponse($response, OsEntity::class, true); |
|
| 33 | } |
|
| 34 | } |
|
| 35 | ||
| @@ 17-34 (lines=18) @@ | ||
| 14 | /** |
|
| 15 | * @author Albert Leitato <[email protected]> |
|
| 16 | */ |
|
| 17 | class Plan extends AbstractApi |
|
| 18 | { |
|
| 19 | /** |
|
| 20 | * Retrieve a list of all active plans. |
|
| 21 | * |
|
| 22 | * Plans that are no longer available will not be shown. |
|
| 23 | * |
|
| 24 | * @param string $type the type of plans to return |
|
| 25 | * |
|
| 26 | * @return PlanEntity[] |
|
| 27 | */ |
|
| 28 | public function list($type = 'all') |
|
| 29 | { |
|
| 30 | $response = $this->adapter->get(\sprintf('%s/plans/list?type=%s', $this->endpoint, $type)); |
|
| 31 | ||
| 32 | return $this->handleResponse($response, PlanEntity::class, true); |
|
| 33 | } |
|
| 34 | } |
|
| 35 | ||