Documentation

BareMetalService extends VultrService
in package

Baremetal service handler, for bare-metals endpoints.

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

Table of Contents

Properties

$vultr  : VultrClient
$client  : VultrClientHandler

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

Methods

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
$id :
  • string - Example: cb676a46-66fd-4dfb-b839-443f2e6c0b60
Tags
see
https://www.vultr.com/api/#operation/get-bandwidth-baremetal
throws
BareMetalException
throws
VultrException
Return values
array<string|int, mixed>

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

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>

multipleServersAction()

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

        
On this page

Search results