PHP Class BundleTask

ファイルを表示 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_oe property

public $bundleType

$clientId public_oe property

public $clientId

$cloudLocation public_oe property

public $cloudLocation

$createdByEmail public_oe property

public $createdByEmail

$createdById public_oe property

public $createdById

$dateAdded public_oe property

deprecated, todo: remove
public $dateAdded

$dateFinished public_oe property

public $dateFinished

$dateStarted public_oe property

public $dateStarted

$description public_oe property

public $description

$envId public_oe property

public $envId

$failureReason public_oe property

public $failureReason

$farmId public_oe property

public $farmId

$id public_oe property

public $id

$object public_oe property

public $object

$objectScope public_oe property

public $objectScope

$osFamily public_oe property

public $osFamily

$osId public_oe property

public $osId

$osName public_oe property

public $osName

$osVersion public_oe property

public $osVersion

$platform public_oe property

public $platform

$prototypeRoleId public_oe property

public $prototypeRoleId

$removePrototypeRole public_oe property

public $removePrototypeRole

$replaceType public_oe property

public $replaceType

$roleId public_oe property

public $roleId

$roleName public_oe property

public $roleName

$serverId public_oe property

public $serverId

$snapshotId public_oe property

public $snapshotId

$status public_oe property

public $status