PHP Class BundleTask

Show file Open project: scalr/scalr Class Usage Examples

Public Properties

Property Type Description
$bundleType
$clientId
$cloudLocation
$createdByEmail
$createdById
$dateAdded deprecated, todo: remove
$dateFinished
$dateStarted
$description
$envId
$failureReason
$farmId
$id
$object
$objectScope
$osFamily
$osId
$osName
$osVersion
$platform
$prototypeRoleId
$removePrototypeRole
$replaceType
$roleId
$roleName
$serverId
$snapshotId
$status

Public Methods

Method Description
Create ( ServerSnapshotCreateInfo $ServerSnapshotCreateInfo, $isRoleBuilder = false ) : BundleTask
GenerateRoleName ( $DBFarmRole, $DBServer )
LoadById ( integer $id ) : BundleTask
Log ( $message )
Save ( )
SnapshotCreationComplete ( $snapshotId, $metaData = [] )
SnapshotCreationFailed ( $failed_reason )
__construct ( $id )
createImageEntity ( ) : Image
designateType ( string $platform, string $family, string $generation = null, string $version = '' ) Designates the type of the bundle task
failObsoleteTasks ( integer $limit = null ) : integer Cancels obsolete tasks
getActiveTaskIdByName ( string $name, integer $accountId, integer $envId ) : integer | boolean Check if given name is already used in any running bundletask of this account or environment
getActiveTaskIdByRoleId ( integer $roleId, integer $envId, string $object ) : integer | boolean Check if there any running bundletask that will affect given role
getFarmObject ( ) : DBFarm Gets DBFarm object
getImageEntity ( ) : Image
getOsDetails ( )
getSnapshotDetails ( ) : ServerSnapshotDetails
setDate ( string $dt ) Sets a timestamps according to a specified event
setMetaData ( $data )

Private Methods

Method Description
Unbind ( )

Method Details

Create() public static method

public static Create ( ServerSnapshotCreateInfo $ServerSnapshotCreateInfo, $isRoleBuilder = false ) : BundleTask
$ServerSnapshotCreateInfo ServerSnapshotCreateInfo
return BundleTask

GenerateRoleName() public static method

public static GenerateRoleName ( $DBFarmRole, $DBServer )

LoadById() public static method

public static LoadById ( integer $id ) : BundleTask
$id integer
return BundleTask

Log() public method

public Log ( $message )

Save() public method

public Save ( )

SnapshotCreationComplete() public method

public SnapshotCreationComplete ( $snapshotId, $metaData = [] )

SnapshotCreationFailed() public method

public SnapshotCreationFailed ( $failed_reason )

__construct() public method

public __construct ( $id )

createImageEntity() public method

public createImageEntity ( ) : Image
return Scalr\Model\Entity\Image

designateType() public method

It sets the type of bundle task to ec2.ebs-hvm to bundle in AWS way according to the OS version
public designateType ( string $platform, string $family, string $generation = null, string $version = '' )
$platform string The name of the cloud platform
$family string OS family
$generation string optional OS generation. If generation is not provided it will use version instead.
$version string optional OS version. If generation is not provided it will use version instead.

failObsoleteTasks() public static method

Cancels obsolete tasks
public static failObsoleteTasks ( integer $limit = null ) : integer
$limit integer
return integer Returns number of cancelled tasks

getActiveTaskIdByName() public static method

Check if given name is already used in any running bundletask of this account or environment
public static getActiveTaskIdByName ( string $name, integer $accountId, integer $envId ) : integer | boolean
$name string Name of Role
$accountId integer Identifier of Account
$envId integer Identifier of Environment
return integer | boolean Returns identifier of the Active BundleTask that matches the specified criteria or false otherwise

getActiveTaskIdByRoleId() public static method

Check if there any running bundletask that will affect given role
public static getActiveTaskIdByRoleId ( integer $roleId, integer $envId, string $object ) : integer | boolean
$roleId integer Identifier of Role
$envId integer Identifier of Account
$object string Object of BundleTask (role, image)
return integer | boolean Returns identifier of the Active BundleTask that matches the specified criteria or false otherwise

getFarmObject() public method

Gets DBFarm object
public getFarmObject ( ) : DBFarm
return DBFarm

getImageEntity() public method

public getImageEntity ( ) : Image
return Scalr\Model\Entity\Image

getOsDetails() public method

public getOsDetails ( )

getSnapshotDetails() public method

public getSnapshotDetails ( ) : ServerSnapshotDetails
return ServerSnapshotDetails

setDate() public method

Sets a timestamps according to a specified event
public setDate ( string $dt )
$dt string The name of event (finished | added | started)

setMetaData() public method

public setMetaData ( $data )

Property Details

$bundleType public property

public $bundleType

$clientId public property

public $clientId

$cloudLocation public property

public $cloudLocation

$createdByEmail public property

public $createdByEmail

$createdById public property

public $createdById

$dateAdded public property

deprecated, todo: remove
public $dateAdded

$dateFinished public property

public $dateFinished

$dateStarted public property

public $dateStarted

$description public property

public $description

$envId public property

public $envId

$failureReason public property

public $failureReason

$farmId public property

public $farmId

$id public property

public $id

$object public property

public $object

$objectScope public property

public $objectScope

$osFamily public property

public $osFamily

$osId public property

public $osId

$osName public property

public $osName

$osVersion public property

public $osVersion

$platform public property

public $platform

$prototypeRoleId public property

public $prototypeRoleId

$removePrototypeRole public property

public $removePrototypeRole

$replaceType public property

public $replaceType

$roleId public property

public $roleId

$roleName public property

public $roleName

$serverId public property

public $serverId

$snapshotId public property

public $snapshotId

$status public property

public $status