BareMetalService
extends VultrService
in package
Baremetal service handler, for bare-metals endpoints.
Tags
Table of Contents
Properties
Methods
- __construct() : mixed
- createBareMetal() : BareMetal
- Create a new Bare Metal instance based on BareMetalCreate
- deleteBareMetal() : void
- Delete a Bare Metal instance.
- getAvailableUpgrades() : OperatingSystem|array<string|int, Application>
- Get available upgrades for a Bare Metal instance.
- getBandwidth() : array<string|int, mixed>
- Get bandwidth information for the Bare Metal instance
- getBareMetal() : BareMetal
- Get information for a Bare Metal instance.
- getBareMetals() : array<string|int, BareMetal>
- List all Bare Metal instances in your account.
- getIPv4Addresses() : array<string|int, BareMetalIPv4Info>
- Get all IPv4 information for the Bare Metal instance.
- getIPv6Addresses() : array<string|int, BareMetalIPv6Info>
- Get all IPv6 information for the Bare Metal instance.
- getUserData() : string
- Get the user-supplied, which is decoded for you from base64 that the api returns.
- getVNCUrl() : string
- Get the VNC URL for a Bare Metal instance. Which can be used to access the console of the machine.
- haltBareMetal() : void
- Halt the Bare Metal instance. The machine will remain off till started again.
- haltBareMetals() : void
- Halt multiple Bare Metal instances. The machines will remain off till started again.
- rebootBareMetal() : void
- Reboot the Bare Metal instance.
- rebootBareMetals() : void
- Reboot multiple Bare Metal instances with 1 api call.
- reinstallBareMetal() : BareMetal
- Reinstall the Bare Metal instance. This action usually takes a few seconds to complete.
- startBareMetal() : void
- startBareMetals() : void
- Start the Bare Metal instance.
- updateBareMetal() : BareMetal
- Update a Bare Metal instance. All attributes are optional in BareMetalUpdate. If not set the attributes will not be sent to the API.
- createObject() : ModelInterface
- deleteObject() : void
- getClientHandler() : VultrClientHandler
- getListObjects() : array<string|int, ModelInterface>
- getObject() : ModelInterface
- getVultrClient() : VultrClient
- list() : array<string|int, mixed>
- patchObject() : void
- getAddressInfo() : array<string|int, mixed>
- getReadableClassType() : string
- multipleServersAction() : void
- singleServerAction() : void
Properties
$vultr
protected
VultrClient
$vultr
$client
private
VultrClientHandler
$client
Methods
__construct()
public
__construct(VultrClient $vultr, VultrClientHandler $client) : mixed
Parameters
- $vultr : VultrClient
- $client : VultrClientHandler
createBareMetal()
Create a new Bare Metal instance based on BareMetalCreate
public
createBareMetal( $payload) : BareMetal
Parameters
Tags
Return values
BareMetaldeleteBareMetal()
Delete a Bare Metal instance.
public
deleteBareMetal(string $id) : void
Parameters
- $id : string
Tags
getAvailableUpgrades()
Get available upgrades for a Bare Metal instance.
public
getAvailableUpgrades( $id[, $type = 'all' ]) : OperatingSystem|array<string|int, Application>
Parameters
- $id :
-
- string - Example: cb676a46-66fd-4dfb-b839-443f2e6c0b60
- $type : = 'all'
-
- string - filter based on upgrade types.
Tags
Return values
OperatingSystem|array<string|int, Application>getBandwidth()
Get bandwidth information for the Bare Metal instance
public
getBandwidth( $id) : array<string|int, mixed>
The structure of the array will follow this format. ['2022-11-05' => ['incoming_bytes' => 234523452352, 'outgoing_bytes' => 132432423]]
Parameters
Tags
Return values
array<string|int, mixed>getBareMetal()
Get information for a Bare Metal instance.
public
getBareMetal( $id) : BareMetal
Parameters
Tags
Return values
BareMetalgetBareMetals()
List all Bare Metal instances in your account.
public
getBareMetals([ &$options = null ]) : array<string|int, BareMetal>
Parameters
Tags
Return values
array<string|int, BareMetal>getIPv4Addresses()
Get all IPv4 information for the Bare Metal instance.
public
getIPv4Addresses( $id) : array<string|int, BareMetalIPv4Info>
Parameters
Tags
Return values
array<string|int, BareMetalIPv4Info>getIPv6Addresses()
Get all IPv6 information for the Bare Metal instance.
public
getIPv6Addresses( $id) : array<string|int, BareMetalIPv6Info>
Parameters
Tags
Return values
array<string|int, BareMetalIPv6Info>getUserData()
Get the user-supplied, which is decoded for you from base64 that the api returns.
public
getUserData( $id) : string
Parameters
Tags
Return values
stringgetVNCUrl()
Get the VNC URL for a Bare Metal instance. Which can be used to access the console of the machine.
public
getVNCUrl( $id) : string
Parameters
Tags
Return values
stringhaltBareMetal()
Halt the Bare Metal instance. The machine will remain off till started again.
public
haltBareMetal( $id) : void
Parameters
Tags
haltBareMetals()
Halt multiple Bare Metal instances. The machines will remain off till started again.
public
haltBareMetals( $ids) : void
Parameters
- $ids :
-
- array - Example: [cb676a46-66fd-4dfb-b839-443f2e6c0b60, cb676a46-66fd-4dfb-b839-443f2e6c0b65]
Tags
rebootBareMetal()
Reboot the Bare Metal instance.
public
rebootBareMetal( $id) : void
Parameters
Tags
rebootBareMetals()
Reboot multiple Bare Metal instances with 1 api call.
public
rebootBareMetals( $ids) : void
Parameters
- $ids :
-
- array - Example: [cb676a46-66fd-4dfb-b839-443f2e6c0b60, cb676a46-66fd-4dfb-b839-443f2e6c0b65]
Tags
reinstallBareMetal()
Reinstall the Bare Metal instance. This action usually takes a few seconds to complete.
public
reinstallBareMetal( $id) : BareMetal
Parameters
Tags
Return values
BareMetalstartBareMetal()
public
startBareMetal( $id) : void
Parameters
Tags
startBareMetals()
Start the Bare Metal instance.
public
startBareMetals( $ids) : void
Parameters
- $ids :
-
- array - Example: [cb676a46-66fd-4dfb-b839-443f2e6c0b60, cb676a46-66fd-4dfb-b839-443f2e6c0b65]
Tags
updateBareMetal()
Update a Bare Metal instance. All attributes are optional in BareMetalUpdate. If not set the attributes will not be sent to the API.
public
updateBareMetal( $id, $payload) : BareMetal
Parameters
Tags
Return values
BareMetalcreateObject()
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
getAddressInfo()
private
getAddressInfo(ModelInterface $model, string $uri, string $id) : array<string|int, mixed>
Parameters
- $model : ModelInterface
- $uri : string
- $id : string
Return values
array<string|int, mixed>getReadableClassType()
private
getReadableClassType(ModelInterface $model) : string
Parameters
- $model : ModelInterface
Return values
stringmultipleServersAction()
private
multipleServersAction(string $action, array<string|int, mixed> $ids) : void
Parameters
- $action : string
- $ids : array<string|int, mixed>
singleServerAction()
private
singleServerAction(string $action, string $id) : void
Parameters
- $action : string
- $id : string