Documentation

ServerManager extends ServerManagerAbstraction
in package

This class will handle the comunication between our system and the Open Stack API system.

Table of Contents

$errorLogName  : string
$warningLogName  : string
$apiVersion  : string
API Version
$authenticationManager  : AuthenticationManager
The authentication manager, used to interact with Open Stack APIs
$jobsLogName  : string
The name of the log in which we are going to log actions performed by jobs
$passwordComplexity  : int
__construct()  : mixed
changePassword()  : string
This function will ask to Open Stack to set a new password for the root user.
delete()  : bool
This function will send the delete request to the Open Stack API
fromOpenStack()  : Server
Fill model from OpenStack
getAuthenticationManager()  : AuthenticationManager
getConsoleVnc()  : array<string|int, mixed>
This functions asks OpenStack the VNC Console Url for the server
getOpenStackServer()  : Server
hasChanged()  : bool
import()  : Server
logEntry()  : Activity
logEntryWithoutModel()  : Activity
logError()  : Activity
logWarning()  : Activity
pause()  : bool
Pause the OpenStack server instance
reboot()  : bool
This function will ask to Open Stack to reboot the server.
rebuild()  : bool
This function will ask to Open Stack to rebuild the server.
refresh()  : bool
It refreshes the Bennu server instance with data retrieved from OpenStack remote
resize()  : bool
This function asks OpenStack to start a resize action on the Server
resizeConfirm()  : bool
This function asks OpenStack to confirm the resizing operation on the server
resizeRevert()  : bool
retrieveOrImport()  : Server
setAuthenticationManager()  : OpenStackObjectManager
start()  : bool
Starts the OpenStack server instance
stop()  : bool
Stops the OpenStack server instance
toOpenStack()  : Server
Fill OpenStack from model
toOpenStackArray()  : array<string|int, mixed>
Return an array to be used vs OpenStack
unpause()  : bool
Pause the OpenStack server instance
log()  : array<string|int, Activity>
create()  : void
This function will send the creation request to the Open Stack APi
getComputeService()  : Service
update()  : void
This function will send the update request to the Open Stack API.

Properties

$warningLogName

public static string $warningLogName = "warning"

$jobsLogName

The name of the log in which we are going to log actions performed by jobs

protected string $jobsLogName = "jobs"

$passwordComplexity

private int $passwordComplexity = 8
Tags
todo

Improve password complexity creation

Methods

logEntry()

public static logEntry(Model $model, array<string|int, mixed> $properties, string $description, string $event, string $logName) : Activity
Parameters
$model : Model
$properties : array<string|int, mixed>
$description : string
$event : string
$logName : string
Return values
Activity

logEntryWithoutModel()

public static logEntryWithoutModel(array<string|int, mixed> $properties, string $description, string $event, string $logName) : Activity
Parameters
$properties : array<string|int, mixed>
$description : string
$event : string
$logName : string
Return values
Activity

logError()

public static logError(Model $model, array<string|int, mixed> $properties, string $description, string $event) : Activity
Parameters
$model : Model
$properties : array<string|int, mixed>
$description : string
$event : string
Return values
Activity

logWarning()

public static logWarning(Model $model, array<string|int, mixed> $properties, string $description, string $event) : Activity
Parameters
$model : Model
$properties : array<string|int, mixed>
$description : string
$event : string
Return values
Activity

reboot()

This function will ask to Open Stack to reboot the server.

public reboot(Server $server[, bool $hardReboot = false ]) : bool
Parameters
$server : Server

the server instance

$hardReboot : bool = false

whether perform a hard reboot or a soft reboot

Tags
throws
OpenStackException
throws
ReporterException
Return values
bool

true on success, false otherwise

refresh()

It refreshes the Bennu server instance with data retrieved from OpenStack remote

public refresh(Server $server[, OperatorResource|null $openStackServer = null ][, bool $refreshStatus = true ]) : bool
Parameters
$server : Server

the server instance

$openStackServer : OperatorResource|null = null

the openstack server instance (optional)

$refreshStatus : bool = true
Return values
bool

true on success, false otherwise

resizeConfirm()

This function asks OpenStack to confirm the resizing operation on the server

public resizeConfirm(Server $server) : bool
Parameters
$server : Server
Tags
throws
ReporterException
Return values
bool

true on success, false otherwise

toOpenStack()

Fill OpenStack from model

public toOpenStack(Server $server, Server $openStackServer) : Server
Parameters
$server : Server
$openStackServer : Server
Return values
Server

toOpenStackArray()

Return an array to be used vs OpenStack

public toOpenStackArray(Server $server) : array<string|int, mixed>
Parameters
$server : Server
Return values
array<string|int, mixed>

log()

protected log(Model|array<string|int, mixed> $models, array<string|int, mixed> $properties, string $description[, null $logName = null ]) : array<string|int, Activity>
Parameters
$models : Model|array<string|int, mixed>
$properties : array<string|int, mixed>
$description : string
$logName : null = null
Return values
array<string|int, Activity>

getComputeService()

private getComputeService() : Service
Return values
Service

Search results