PHP 인터페이스 Scalr\Modules\PlatformModuleInterface

파일 보기 프로젝트 열기: scalr/scalr 0 사용 예제들

공개 메소드들

메소드 설명
CheckServerSnapshotStatus ( BundleTask $BundleTask ) Checks server snapshot status
ClearCache ( ) Clears internal cache
CreateServerSnapshot ( BundleTask $BundleTask ) : boolean Creates server snapshot for specified bundle task
GetServerCloudLocation ( DBServer $DBServer ) : string Gets cloud location for the specified server
GetServerConsoleOutput ( DBServer $DBServer ) : string Gets console output for the specified server
GetServerExtendedInformation ( DBServer $DBServer, $extended = false ) : array | boolean Gets server extended information
GetServerID ( DBServer $DBServer ) : string Gets instance id for specified server
GetServerIPAddresses ( DBServer $DBServer ) : array Gets IP Addresses for the specified DB Server
GetServerRealStatus ( DBServer $DBServer ) : Scalr\Modules\Platforms\StatusAdapterInterface Gets the status for the specified DB Server
IsServerExists ( DBServer $DBServer ) : boolean Checks whether specified server exists
LaunchServer ( DBServer $DBServer, Scalr_Server_LaunchOptions $launchOptions = null ) : DBServer Launches new server
PutAccessData ( DBServer $DBServer, Scalr_Messaging_Msg $message ) Puts access data
RebootServer ( DBServer $DBServer, boolean $soft = true ) : boolean Reboots specified server
RemoveServerSnapshot ( Image $image ) Removes servers snapshot
TerminateServer ( DBServer $DBServer ) : boolean Terminates specified server
getConfigVariable ( string $name, Scalr_Environment $env, string $encrypted = true, string $cloudLocation = '' ) : string Gets platform property
getContainer ( ) : Container Gets DI container
getEndpointUrl ( Scalr_Environment $env, string $group = null ) : string | null Gets endpoint url for private clouds
getHttpClient ( DBServer $dbServer ) : mixed Gets API HTTP client configured for specified server
getImageInfo ( Scalr_Environment $environment, string $cloudLocation, string $imageId ) : array Get information for an image instance
getInstanceIdPropertyName ( ) : string Gets string which is used to retrieve instance is from server_properties table
getInstanceType ( string $instanceTypeId, Scalr_Environment $env, string $cloudLocation = null ) : Scalr\Model\Entity\CloudInstanceType | array Returns vCPUs for an instance by its ID
getInstanceTypes ( Scalr_Environment $env = null, string $cloudLocation = null, boolean $details = false ) : array Gets the list of all available flavors for the specified environment and cloud location
getLocations ( Scalr_Environment $environment = null ) : array Gets cloud locations
getOrphanedServers ( Environment $environment, string $cloudLocation, array $instanceIds = null ) : OrphanedServer[] Gets the list of the orphaned instances for the specified environment and location that are not managed by Scalr
hasCloudPrices ( Scalr_Environment $env ) : mixed Checks whether there is some price for the appropriate cloud and url from the specified environment
setConfigVariable ( array $pars, Scalr_Environment $env, string $encrypted = true, string $cloudLocation = '' ) Sets the values for the specified platform properties

메소드 상세

CheckServerSnapshotStatus() 공개 메소드

Checks server snapshot status
public CheckServerSnapshotStatus ( BundleTask $BundleTask )
$BundleTask BundleTask The Bundle Task object

ClearCache() 공개 메소드

Clears internal cache
public ClearCache ( )

CreateServerSnapshot() 공개 메소드

Creates server snapshot for specified bundle task
public CreateServerSnapshot ( BundleTask $BundleTask ) : boolean
$BundleTask BundleTask The bundle task object
리턴 boolean Returns true on success

GetServerCloudLocation() 공개 메소드

Gets cloud location for the specified server
public GetServerCloudLocation ( DBServer $DBServer ) : string
$DBServer DBServer The DBServer object
리턴 string Returns cloud location of the specified server

GetServerConsoleOutput() 공개 메소드

Gets console output for the specified server
public GetServerConsoleOutput ( DBServer $DBServer ) : string
$DBServer DBServer The DB Server object
리턴 string Returns console output if it is not empty otherwise it returns FALSE. If server can not be found it throws an exception.

GetServerExtendedInformation() 공개 메소드

Gets server extended information
public GetServerExtendedInformation ( DBServer $DBServer, $extended = false ) : array | boolean
$DBServer DBServer The DBServer object
리턴 array | boolean Returns array on success or false otherwise

GetServerID() 공개 메소드

Gets instance id for specified server
public GetServerID ( DBServer $DBServer ) : string
$DBServer DBServer The DBServer object
리턴 string Returns the identifier of the instance in the cloud

GetServerIPAddresses() 공개 메소드

Gets IP Addresses for the specified DB Server
public GetServerIPAddresses ( DBServer $DBServer ) : array
$DBServer DBServer DB Server object
리턴 array Returns array looks like array( 'localIp' => Local-IP, 'remoteIp' => Remote-IP, )

GetServerRealStatus() 공개 메소드

Gets the status for the specified DB Server
public GetServerRealStatus ( DBServer $DBServer ) : Scalr\Modules\Platforms\StatusAdapterInterface
$DBServer DBServer DB Server object
리턴 Scalr\Modules\Platforms\StatusAdapterInterface $status Returns the status

IsServerExists() 공개 메소드

Checks whether specified server exists
public IsServerExists ( DBServer $DBServer ) : boolean
$DBServer DBServer The DBServer object
리턴 boolean Returns true if server exists of false otherwise

LaunchServer() 공개 메소드

Launches new server
public LaunchServer ( DBServer $DBServer, Scalr_Server_LaunchOptions $launchOptions = null ) : DBServer
$DBServer DBServer The DBServer instance
$launchOptions Scalr_Server_LaunchOptions optional The options used in this instance
리턴 DBServer Returns DBServer object on success or throws an exception

PutAccessData() 공개 메소드

Puts access data
public PutAccessData ( DBServer $DBServer, Scalr_Messaging_Msg $message )
$DBServer DBServer The DBServer object
$message Scalr_Messaging_Msg The message object

RebootServer() 공개 메소드

This method should throw valid InstanceNotFound excepiton for the case when the node does not exist in the cloud.
public RebootServer ( DBServer $DBServer, boolean $soft = true ) : boolean
$DBServer DBServer The DB Server object
$soft boolean Soft reboot or HARD
리턴 boolean Returns TRUE on success or throws an Exception otherwise.

RemoveServerSnapshot() 공개 메소드

Removes servers snapshot
public RemoveServerSnapshot ( Image $image )
$image Scalr\Model\Entity\Image The Image object

TerminateServer() 공개 메소드

This method should throw valid InstanceNotFound excepiton for the case when the node does not exist in the cloud.
public TerminateServer ( DBServer $DBServer ) : boolean
$DBServer DBServer The DB Server object
리턴 boolean Returns TRUE on success or throws an Exception otherwise.

getConfigVariable() 공개 메소드

Gets platform property
사용 중단: by cloud credentials
public getConfigVariable ( string $name, Scalr_Environment $env, string $encrypted = true, string $cloudLocation = '' ) : string
$name string The name of the platform property
$env Scalr_Environment The environment
$encrypted string optional This is ignored
$cloudLocation string optional The cloud location
리턴 string Returns the value of the specified platform property

getContainer() 공개 메소드

Gets DI container
public getContainer ( ) : Container
리턴 Scalr\DependencyInjection\Container Returns DI container

getEndpointUrl() 공개 메소드

Gets endpoint url for private clouds
public getEndpointUrl ( Scalr_Environment $env, string $group = null ) : string | null
$env Scalr_Environment The scalr environment object
$group string optional The group name
리턴 string | null Returns endpoint url for private clouds. Null otherwise.

getHttpClient() 공개 메소드

Gets API HTTP client configured for specified server
public getHttpClient ( DBServer $dbServer ) : mixed
$dbServer DBServer DBServer to configure client
리턴 mixed Returns low-level API HTTP client

getImageInfo() 공개 메소드

Get information for an image instance
public getImageInfo ( Scalr_Environment $environment, string $cloudLocation, string $imageId ) : array
$environment Scalr_Environment Environment object
$cloudLocation string Location if exists
$imageId string Image identifier
리턴 array Array of image related information

getInstanceIdPropertyName() 공개 메소드

Gets string which is used to retrieve instance is from server_properties table
public getInstanceIdPropertyName ( ) : string
리턴 string Returns instance id's property name for each platform

getInstanceType() 공개 메소드

Returns vCPUs for an instance by its ID
public getInstanceType ( string $instanceTypeId, Scalr_Environment $env, string $cloudLocation = null ) : Scalr\Model\Entity\CloudInstanceType | array
$instanceTypeId string Instance type identifier
$env Scalr_Environment The Scalr environment object
$cloudLocation string optional The cloud location
리턴 Scalr\Model\Entity\CloudInstanceType | array Cloud Instance Type entity or array for Ec2 platform

getInstanceTypes() 공개 메소드

Gets the list of all available flavors for the specified environment and cloud location
public getInstanceTypes ( Scalr_Environment $env = null, string $cloudLocation = null, boolean $details = false ) : array
$env Scalr_Environment optional The scalr environment object
$cloudLocation string optional The cloud location
$details boolean optional Return instance type with detalis (CPU, RAM, DISK, etc)
리턴 array Returns array of the available flavors. It should look like array(flavor => name).

getLocations() 공개 메소드

Gets cloud locations
public getLocations ( Scalr_Environment $environment = null ) : array
$environment Scalr_Environment The environment object.
리턴 array Returns cloud locations available for current cloud platform. Array looks like array(location => description).

getOrphanedServers() 공개 메소드

Gets the list of the orphaned instances for the specified environment and location that are not managed by Scalr
public getOrphanedServers ( Environment $environment, string $cloudLocation, array $instanceIds = null ) : OrphanedServer[]
$environment Scalr\Model\Entity\Account\Environment Environment Entity
$cloudLocation string Location name
$instanceIds array optional List of instanceId to filter
리턴 Scalr\Modules\Platforms\OrphanedServer[] Returns array of orphaned servers

hasCloudPrices() 공개 메소드

It returns first found url which has not any price set for.
public hasCloudPrices ( Scalr_Environment $env ) : mixed
$env Scalr_Environment The scalr environment object
리턴 mixed Returns first found url which has not any price set for. Returns TRUE if there is some price for the cloud OR Returns FALSE if it is public cloud and no price has been set

setConfigVariable() 공개 메소드

Sets the values for the specified platform properties
public setConfigVariable ( array $pars, Scalr_Environment $env, string $encrypted = true, string $cloudLocation = '' )
$pars array Associative array of the keys -> value
$env Scalr_Environment The environment object
$encrypted string optional This parameter is already ignored
$cloudLocation string The cloud location