PlanService
extends VultrService
in package
Plan service handler, for all plans endpoints.
Tags
Table of Contents
Constants
- FILTER_ALL = 'all'
- FILTER_VBM = 'vbm'
- FILTER_VC2 = 'vc2'
- FILTER_VCG = 'vcg'
- FILTER_VDC = 'vdc'
- FILTER_VHF = 'vhf'
- FILTER_VOC = 'voc'
- FILTER_VOCC = 'voc-c'
- FILTER_VOCG = 'voc-g'
- FILTER_VOCM = 'voc-m'
- FILTER_VOCS = 'voc-s'
- FILTER_WINDOWS = 'windows'
Properties
- $vultr : VultrClient
- $cache_plans : array<string|int, mixed>|null
- $client : VultrClientHandler
Methods
- __construct() : mixed
- cachePlans() : void
- Query and cache all plans from the vultr api.
- getBMPlans() : array<string|int, BMPlan>
- Get baremetal plans that are available at vultr.
- getPlan() : VPSPlan|BMPlan|null
- Get a specific plan vps or baremetal plan from the static cache.
- getVPSPlans() : array<string|int, VPSPlan>
- Get vps plans that are available at vultr.
- createObject() : ModelInterface
- deleteObject() : void
- getClientHandler() : VultrClientHandler
- getListObjects() : array<string|int, ModelInterface>
- getObject() : ModelInterface
- getVultrClient() : VultrClient
- list() : array<string|int, mixed>
- patchObject() : void
- getReadableClassType() : string
- setPlanLocations() : void
Constants
FILTER_ALL
public
mixed
FILTER_ALL
= 'all'
Tags
FILTER_VBM
public
mixed
FILTER_VBM
= 'vbm'
FILTER_VC2
public
mixed
FILTER_VC2
= 'vc2'
FILTER_VCG
public
mixed
FILTER_VCG
= 'vcg'
FILTER_VDC
public
mixed
FILTER_VDC
= 'vdc'
FILTER_VHF
public
mixed
FILTER_VHF
= 'vhf'
FILTER_VOC
public
mixed
FILTER_VOC
= 'voc'
FILTER_VOCC
public
mixed
FILTER_VOCC
= 'voc-c'
FILTER_VOCG
public
mixed
FILTER_VOCG
= 'voc-g'
FILTER_VOCM
public
mixed
FILTER_VOCM
= 'voc-m'
FILTER_VOCS
public
mixed
FILTER_VOCS
= 'voc-s'
FILTER_WINDOWS
public
mixed
FILTER_WINDOWS
= 'windows'
Properties
$vultr
protected
VultrClient
$vultr
$cache_plans
private
static array<string|int, mixed>|null
$cache_plans
= null
$client
private
VultrClientHandler
$client
Methods
__construct()
public
__construct(VultrClient $vultr, VultrClientHandler $client) : mixed
Parameters
- $vultr : VultrClient
- $client : VultrClientHandler
cachePlans()
Query and cache all plans from the vultr api.
public
cachePlans([ $override = false ]) : void
Parameters
Tags
getBMPlans()
Get baremetal plans that are available at vultr.
public
getBMPlans([ &$options = null ]) : array<string|int, BMPlan>
Parameters
Tags
Return values
array<string|int, BMPlan>getPlan()
Get a specific plan vps or baremetal plan from the static cache.
public
getPlan( $id) : VPSPlan|BMPlan|null
Parameters
Tags
Return values
VPSPlan|BMPlan|nullgetVPSPlans()
Get vps plans that are available at vultr.
public
getVPSPlans([ $type = null ][, $os = null ][, &$options = null ]) : array<string|int, VPSPlan>
Parameters
- $type : = null
-
- string|null - FILTER_*
- $os : = null
-
- string|null - FILTER_WINDOWS
- $options : = null
-
- ListOptions - Interact via reference.
Tags
Return values
array<string|int, VPSPlan>createObject()
protected
createObject( $uri, $model, $params) : ModelInterface
Parameters
- $uri :
-
- string - the url address to query after api.vultr.com/v2
- $model :
-
- ModelInterface - the object model that we are creating
- $params :
-
- array - The values that we will be sending. Refactor to use getUpdateParams/getUpdateArray?
Tags
Return values
ModelInterfacedeleteObject()
protected
deleteObject( $uri, $model) : void
Parameters
- $uri :
-
- string - the url address to query after api.vultr.com/v2
- $model :
-
- ModelInterface - the object model that we are acting on deleting. This doesn't need to be a fully initialized object.
Tags
getClientHandler()
protected
getClientHandler() : VultrClientHandler
Return values
VultrClientHandlergetListObjects()
protected
getListObjects( $uri, $model[, &$options = null ][, $params = null ]) : array<string|int, ModelInterface>
Parameters
- $uri :
-
- string - the url address to query after api.vultr.com/v2
- $model :
-
- ModelInterface - the object that will be mapped to the get response.
- $options : = null
-
- ListOptions - Pagination object
- $params : = null
-
- array - filter parameters.
Tags
Return values
array<string|int, ModelInterface>getObject()
protected
getObject( $uri, $model) : ModelInterface
Parameters
- $uri :
-
- string - the url address to query after api.vultr.com/v2
- $model :
-
- ModelInterface - the object that will be mapped to the get response.
Tags
Return values
ModelInterfacegetVultrClient()
protected
getVultrClient() : VultrClient
Return values
VultrClientlist()
protected
list(string $uri, ModelInterface $model, ListOptions &$options[, array<string|int, mixed>|null $params = null ]) : array<string|int, mixed>
Parameters
- $uri : string
- $model : ModelInterface
- $options : ListOptions
- $params : array<string|int, mixed>|null = null
Return values
array<string|int, mixed>patchObject()
protected
patchObject( $uri, $model[, array<string|int, mixed>|null $params = null ]) : void
Parameters
- $uri :
-
- string - the url address to query after api.vultr.com/v2
- $model :
-
- ModelInterface - the object model that we are updating. This needs to be a fully initialized object.
- $params : array<string|int, mixed>|null = null
Tags
getReadableClassType()
private
getReadableClassType(ModelInterface $model) : string
Parameters
- $model : ModelInterface
Return values
stringsetPlanLocations()
private
setPlanLocations(array<string|int, mixed> &$plans) : void
Parameters
- $plans : array<string|int, mixed>