BlockStorageService
extends VultrService
in package
Blockstorage service handler, for blocks endpoints.
Tags
Table of Contents
Properties
Methods
- __construct() : mixed
- attachBlockDevice() : void
- Attach the block storage device to a virtual machine.
- createBlockDevice() : array<string|int, mixed>
- Create a new block storage device in a region. The size range differs based on the block_type
- deleteBlockDevice() : void
- Delete the block storage device.
- detachBlockDevice() : void
- Detach the block storage device from the virtual machine.
- getBlockDevice() : BlockStorage
- Get a specific block storage device on the account.
- getBlockDevices() : array<string|int, mixed>
- Retrieve block storage devices on the account.
- updateBlockDevice() : void
- Update information on the block storage device.
- 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
$vultr
protected
VultrClient
$vultr
$client
private
VultrClientHandler
$client
Methods
__construct()
public
__construct(VultrClient $vultr, VultrClientHandler $client) : mixed
Parameters
- $vultr : VultrClient
- $client : VultrClientHandler
attachBlockDevice()
Attach the block storage device to a virtual machine.
public
attachBlockDevice( $block_id, string $instance_id[, $live = true ]) : void
Parameters
- $block_id :
-
- string - Example cb676a46-66fd-4dfb-b839-443f2e6c0b60
- $instance_id : string
- $live : = true
-
- bool
Tags
createBlockDevice()
Create a new block storage device in a region. The size range differs based on the block_type
public
createBlockDevice( $block) : array<string|int, mixed>
Parameters
Tags
Return values
array<string|int, mixed>deleteBlockDevice()
Delete the block storage device.
public
deleteBlockDevice( $block_id) : void
Parameters
Tags
detachBlockDevice()
Detach the block storage device from the virtual machine.
public
detachBlockDevice( $block_id[, $live = true ]) : void
Parameters
Tags
getBlockDevice()
Get a specific block storage device on the account.
public
getBlockDevice( $block_id) : BlockStorage
Parameters
Tags
Return values
BlockStoragegetBlockDevices()
Retrieve block storage devices on the account.
public
getBlockDevices([ &$options = null ]) : array<string|int, mixed>
Parameters
Tags
Return values
array<string|int, mixed>updateBlockDevice()
Update information on the block storage device.
public
updateBlockDevice( $block) : void
Parameters
Tags
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