Documentation

RegionService extends VultrService
in package

Region service handler, for all regions endpoints.

Tags
see
https://www.vultr.com/api/#tag/region

Table of Contents

Properties

$vultr  : VultrClient
$cache_region  : array<string|int, mixed>|null
$client  : VultrClientHandler

Methods

__construct()  : mixed
cacheRegions()  : void
Cache all regions from the vultr api.
getAvailablility()  : array<string|int, \Vultr\VultrPhp\Services\Regions\VPSPlan|\Vultr\VultrPhp\Services\Regions\BMPlan>
Get a list of the available plans in the region.
getRegion()  : Region|null
Get a specific region object based on the region id
getRegions()  : array<string|int, Region>
List all regions 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

Properties

$cache_region

private static array<string|int, mixed>|null $cache_region = null

Methods

cacheRegions()

Cache all regions from the vultr api.

public cacheRegions([ $override = false ]) : void
Parameters
$override : = false
  • bool - Depending on whether to requery the regions.
Tags
throws
RegionException

getAvailablility()

Get a list of the available plans in the region.

public getAvailablility( $id[,  $type = null ]) : array<string|int, \Vultr\VultrPhp\Services\Regions\VPSPlan|\Vultr\VultrPhp\Services\Regions\BMPlan>
Parameters
$id :
  • string - Ex ewr - Id of the region
$type : = null
  • string|null - PlanService Filters - FILTER_ALL, FILTER_VC2, FILTER_VHF, FILTER_VDC, FILTER_VBM
Tags
throws
RegionException
Return values
array<string|int, \Vultr\VultrPhp\Services\Regions\VPSPlan|\Vultr\VultrPhp\Services\Regions\BMPlan>

getRegion()

Get a specific region object based on the region id

public getRegion( $id) : Region|null
Parameters
$id :
  • string - Ex ewr - Region id.
Tags
throws
RegionException
Return values
Region|null

getRegions()

List all regions at vultr

public getRegions([ &$options = null ]) : array<string|int, Region>
Parameters
$options : = null
  • ListOptions - Interact via reference.
Tags
throws
RegionException
Return values
array<string|int, Region>

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
throws
Child

of VultrServiceObject

Return values
ModelInterface

deleteObject()

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
throws
Child

of VultrServiceObject

getListObjects()

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
throws
Child

of VultrServiceObject

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
throws
Child

of VultrServiceObject

Return values
ModelInterface

list()

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
throws
Child

of VultrServiceObject


        
On this page

Search results