ImageManager
extends ImageManagerAbstraction
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
- __construct() : mixed
- delete() : bool
- Delete image on Open Stack
- fromOpenStack() : Image
- Fill model from OpenStack
- getAuthenticationManager() : AuthenticationManager
- getImageService() : Service
- getOpenStackImage() : Image
- hasChanged() : bool
- import() : Image
- list() : Generator|array<string|int, mixed>
- Return a list of images from the Open Stack APIs
- logEntry() : Activity
- logEntryWithoutModel() : Activity
- logError() : Activity
- logWarning() : Activity
- refresh() : bool
- retrieveOrImport() : Image
- setAuthenticationManager() : OpenStackObjectManager
- toOpenStack() : Image
- Fill OpenStack from model
- toOpenStackArray() : array<string|int, mixed>
- Prepare an array to be used vs OpenStack NOT USED
- log() : array<string|int, Activity>
- create() : void
- Create image on OpenStack
- update() : void
- Update data on OpenStack. Only the name is supported.
Properties
$errorLogName
public
static string
$errorLogName
= "error"
$warningLogName
public
static string
$warningLogName
= "warning"
$apiVersion
API Version
protected
static string
$apiVersion
= 'v1'
$authenticationManager
The authentication manager, used to interact with Open Stack APIs
protected
AuthenticationManager
$authenticationManager
$jobsLogName
The name of the log in which we are going to log actions performed by jobs
protected
string
$jobsLogName
= "jobs"
Methods
__construct()
public
__construct(AuthenticationManager $authenticationManager) : mixed
Parameters
- $authenticationManager : AuthenticationManager
Return values
mixed —delete()
Delete image on Open Stack
public
delete(Image $image) : bool
Parameters
- $image : Image
Tags
Return values
bool —fromOpenStack()
Fill model from OpenStack
public
fromOpenStack(Image $image, Image $openStackImage) : Image
Parameters
- $image : Image
- $openStackImage : Image
Tags
Return values
Image —getAuthenticationManager()
public
getAuthenticationManager() : AuthenticationManager
Return values
AuthenticationManager —getImageService()
public
getImageService() : Service
Return values
Service —getOpenStackImage()
public
getOpenStackImage(string $id[, bool $retrieve = false ]) : Image
Parameters
- $id : string
- $retrieve : bool = false
Tags
Return values
Image —hasChanged()
public
hasChanged(Image $image) : bool
Parameters
- $image : Image
Tags
Return values
bool —import()
public
import(string $external_id) : Image
Parameters
- $external_id : string
Tags
Return values
Image —list()
Return a list of images from the Open Stack APIs
public
list([array<string|int, mixed> $parameters = [] ]) : Generator|array<string|int, mixed>
Parameters
- $parameters : array<string|int, mixed> = []
Tags
Return values
Generator|array<string|int, mixed> —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 —refresh()
public
refresh(Image $image[, Image|OperatorResource|null $openStackImage = null ]) : bool
Parameters
- $image : Image
- $openStackImage : Image|OperatorResource|null = null
Return values
bool —retrieveOrImport()
public
retrieveOrImport(string $external_id[, bool $refresh = false ]) : Image
Parameters
- $external_id : string
- $refresh : bool = false
Tags
Return values
Image —setAuthenticationManager()
public
setAuthenticationManager([AuthenticationManager|null $authenticationManager = null ]) : OpenStackObjectManager
Parameters
- $authenticationManager : AuthenticationManager|null = null
Return values
OpenStackObjectManager —toOpenStack()
Fill OpenStack from model
public
toOpenStack(Image $image, Image $openStackImage) : Image
Parameters
- $image : Image
- $openStackImage : Image
Return values
Image —toOpenStackArray()
Prepare an array to be used vs OpenStack NOT USED
public
toOpenStackArray(Image $image) : array<string|int, mixed>
Parameters
- $image : Image
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> —create()
Create image on OpenStack
private
create(Image $image) : void
Parameters
- $image : Image
Tags
Return values
void —update()
Update data on OpenStack. Only the name is supported.
private
update(Image $image) : void
Parameters
- $image : Image