PHP Class Scalr\Api\Service\User\V1beta0\Controller\FarmRoles

Author: N.V.
Inheritance: extends Scalr\Api\Rest\Controller\ApiController
Show file Open project: scalr/scalr Class Usage Examples

Protected Properties

Property Type Description
$scalingRuleNamespace string Namespace for scaling rule adapters

Public Methods

Method Description
adapter ( string | FarmRoleScalingMetric | object $name, string $scope = null, string $version = null ) : ApiEntityAdapter Gets a new Instance of the adapter
createAction ( integer $farmId ) : Scalr\Api\DataType\ResultEnvelope Create a new Farm role in this Environment
createScalingRuleAction ( integer $farmRoleId ) : Scalr\Api\DataType\ResultEnvelope Add new scaling metric configuration for farm-role
createVariableAction ( integer $farmRoleId ) : Scalr\Api\DataType\ResultEnvelope Creates farm role's global var
deleteAction ( string $farmRoleId ) : Scalr\Api\DataType\ResultEnvelope Delete an Farm role
deleteScalingRuleAction ( integer $farmRoleId, string $scalingRuleName ) : Scalr\Api\DataType\ResultEnvelope Delete farm role scaling metric
deleteVariableAction ( integer $farmRoleId, string $name ) : Scalr\Api\DataType\ResultEnvelope Deletes farm role's global variable
describeAction ( integer $farmId ) : Scalr\Api\DataType\ListResultEnvelope Retrieves the list of the farm roles
describeInstanceAction ( integer $farmRoleId ) : Scalr\Api\DataType\ResultEnvelope Describes instance configuration
describePlacementAction ( integer $farmRoleId ) : Scalr\Api\DataType\ResultEnvelope Describes placement configuration
describeScalingAction ( integer $farmRoleId ) : Scalr\Api\DataType\ResultEnvelope Describes placement configuration
describeServersAction ( integer $farmRoleId ) : Scalr\Api\DataType\ListResultEnvelope Gets list of farm role's servers
describeVariablesAction ( integer $farmRoleId ) : Scalr\Api\DataType\ListResultEnvelope List Global Variables associated with this Farm role
fetchAction ( string $farmRoleId ) : Scalr\Api\DataType\ResultEnvelope Fetches detailed info about one farm role
fetchScalingRuleAction ( integer $farmRoleId, string $scalingRuleName ) : Scalr\Api\DataType\ResultEnvelope Gets specific scaling metric of the farm role
fetchVariableAction ( integer $farmRoleId, string $name ) : Scalr\Api\DataType\ResultEnvelope Gets specific global var of the farm role
getFarm ( integer $farmId, boolean $modify = false ) : Farm | null Gets farm from database using User's Environment
getFarmRole ( string $farmRoleId, integer $farmId = null, boolean $modify = false ) : FarmRole Gets specified Farm Role taking into account both scope and authentication token
getRole ( integer $roleId ) : Role | null Gets role from database using User's Environment
getScalingRule ( integer $farmRoleId, string $scalingRuleName, boolean $modify = false ) : FarmRoleScalingMetric Gets specified farm role scaling metric entity
getVariableInstance ( ) : Scalr_Scripting_GlobalVariable\Scalr_Scripting_GlobalVariables Gets global variable object
importServerAction ( integer $farmRoleId ) : Scalr\Api\DataType\ResultEnvelope Import non-scalarizr server to the Farm Role
modifyAction ( integer $farmRoleId ) : Scalr\Api\DataType\ResultEnvelope Change farm role attributes.
modifyInstanceAction ( integer $farmRoleId ) : Scalr\Api\DataType\ResultEnvelope Change instance configuration
modifyPlacementAction ( integer $farmRoleId ) : Scalr\Api\DataType\ResultEnvelope Change placement configuration
modifyScalingAction ( integer $farmRoleId ) : Scalr\Api\DataType\ResultEnvelope Change scaling configuration of farm-role
modifyScalingRuleAction ( integer $farmRoleId, string $scalingRuleName ) : Scalr\Api\DataType\ResultEnvelope Change farm role scaling metric attributes.
modifyVariableAction ( integer $farmRoleId, string $name ) : Scalr\Api\DataType\ResultEnvelope Modifies farm role's global variable

Method Details

adapter() public method

Gets a new Instance of the adapter
public adapter ( string | FarmRoleScalingMetric | object $name, string $scope = null, string $version = null ) : ApiEntityAdapter
$name string | Scalr\Model\Entity\FarmRoleScalingMetric | object The name of the adapter or FarmRoleScalingMetric entity or farm role scaling metric data
$scope string optional The scope of the adapter
$version string optional The version of the adapter
return Scalr\Api\DataType\ApiEntityAdapter

createAction() public method

Create a new Farm role in this Environment
public createAction ( integer $farmId ) : Scalr\Api\DataType\ResultEnvelope
$farmId integer Identifier of the Farm, for which Farm role creates
return Scalr\Api\DataType\ResultEnvelope

createScalingRuleAction() public method

Add new scaling metric configuration for farm-role
public createScalingRuleAction ( integer $farmRoleId ) : Scalr\Api\DataType\ResultEnvelope
$farmRoleId integer Unique farm-role identifier
return Scalr\Api\DataType\ResultEnvelope

createVariableAction() public method

Creates farm role's global var
public createVariableAction ( integer $farmRoleId ) : Scalr\Api\DataType\ResultEnvelope
$farmRoleId integer Numeric identifier of the Farm Role
return Scalr\Api\DataType\ResultEnvelope

deleteAction() public method

Delete an Farm role
public deleteAction ( string $farmRoleId ) : Scalr\Api\DataType\ResultEnvelope
$farmRoleId string Unique identifier of the script
return Scalr\Api\DataType\ResultEnvelope

deleteScalingRuleAction() public method

Delete farm role scaling metric
public deleteScalingRuleAction ( integer $farmRoleId, string $scalingRuleName ) : Scalr\Api\DataType\ResultEnvelope
$farmRoleId integer Unique farm-role identifier
$scalingRuleName string Scaling metric's name.
return Scalr\Api\DataType\ResultEnvelope

deleteVariableAction() public method

Deletes farm role's global variable
public deleteVariableAction ( integer $farmRoleId, string $name ) : Scalr\Api\DataType\ResultEnvelope
$farmRoleId integer Numeric identifier of the Farm Role
$name string Name of variable
return Scalr\Api\DataType\ResultEnvelope

describeAction() public method

Retrieves the list of the farm roles
public describeAction ( integer $farmId ) : Scalr\Api\DataType\ListResultEnvelope
$farmId integer Identifier of the Farm containing Farm role
return Scalr\Api\DataType\ListResultEnvelope Returns describe result

describeInstanceAction() public method

Describes instance configuration
public describeInstanceAction ( integer $farmRoleId ) : Scalr\Api\DataType\ResultEnvelope
$farmRoleId integer Unique farm-role identifier
return Scalr\Api\DataType\ResultEnvelope

describePlacementAction() public method

Describes placement configuration
public describePlacementAction ( integer $farmRoleId ) : Scalr\Api\DataType\ResultEnvelope
$farmRoleId integer Unique farm-role identifier
return Scalr\Api\DataType\ResultEnvelope

describeScalingAction() public method

Describes placement configuration
public describeScalingAction ( integer $farmRoleId ) : Scalr\Api\DataType\ResultEnvelope
$farmRoleId integer Unique farm-role identifier
return Scalr\Api\DataType\ResultEnvelope

describeServersAction() public method

Gets list of farm role's servers
public describeServersAction ( integer $farmRoleId ) : Scalr\Api\DataType\ListResultEnvelope
$farmRoleId integer Identifier of the Farm Role
return Scalr\Api\DataType\ListResultEnvelope

describeVariablesAction() public method

List Global Variables associated with this Farm role
public describeVariablesAction ( integer $farmRoleId ) : Scalr\Api\DataType\ListResultEnvelope
$farmRoleId integer Unique farm-role identifier
return Scalr\Api\DataType\ListResultEnvelope

fetchAction() public method

Fetches detailed info about one farm role
public fetchAction ( string $farmRoleId ) : Scalr\Api\DataType\ResultEnvelope
$farmRoleId string Numeric identifier of the farm role
return Scalr\Api\DataType\ResultEnvelope

fetchScalingRuleAction() public method

Gets specific scaling metric of the farm role
public fetchScalingRuleAction ( integer $farmRoleId, string $scalingRuleName ) : Scalr\Api\DataType\ResultEnvelope
$farmRoleId integer Unique farm-role identifier
$scalingRuleName string Scaling metric's name.
return Scalr\Api\DataType\ResultEnvelope

fetchVariableAction() public method

Gets specific global var of the farm role
public fetchVariableAction ( integer $farmRoleId, string $name ) : Scalr\Api\DataType\ResultEnvelope
$farmRoleId integer Numeric identifier of the Farm Role
$name string Name of variable
return Scalr\Api\DataType\ResultEnvelope

getFarm() public method

Gets farm from database using User's Environment
public getFarm ( integer $farmId, boolean $modify = false ) : Farm | null
$farmId integer The identifier of the Role
$modify boolean optional Modification flag
return Scalr\Model\Entity\Farm | null Returns specified Farm

getFarmRole() public method

Gets specified Farm Role taking into account both scope and authentication token
public getFarmRole ( string $farmRoleId, integer $farmId = null, boolean $modify = false ) : FarmRole
$farmRoleId string Numeric identifier of the Farm role
$farmId integer optional Identifier of the Farm containing Farm role
$modify boolean optional Flag checking write permissions
return Scalr\Model\Entity\FarmRole Returns the Script Entity on success

getRole() public method

Gets role from database using User's Environment
public getRole ( integer $roleId ) : Role | null
$roleId integer The identifier of the Role
return Scalr\Model\Entity\Role | null Returns role from database using User's Environment

getScalingRule() public method

Gets specified farm role scaling metric entity
public getScalingRule ( integer $farmRoleId, string $scalingRuleName, boolean $modify = false ) : FarmRoleScalingMetric
$farmRoleId integer Unique farm-role identifier
$scalingRuleName string Scaling metric's name.
$modify boolean optional Flag checking write permissions
return Scalr\Model\Entity\FarmRoleScalingMetric

getVariableInstance() public method

Gets global variable object
public getVariableInstance ( ) : Scalr_Scripting_GlobalVariable\Scalr_Scripting_GlobalVariables
return Scalr_Scripting_GlobalVariable\Scalr_Scripting_GlobalVariables

importServerAction() public method

Import non-scalarizr server to the Farm Role
public importServerAction ( integer $farmRoleId ) : Scalr\Api\DataType\ResultEnvelope
$farmRoleId integer
return Scalr\Api\DataType\ResultEnvelope

modifyAction() public method

Change farm role attributes.
public modifyAction ( integer $farmRoleId ) : Scalr\Api\DataType\ResultEnvelope
$farmRoleId integer Unique identifier of the farm role
return Scalr\Api\DataType\ResultEnvelope

modifyInstanceAction() public method

Change instance configuration
public modifyInstanceAction ( integer $farmRoleId ) : Scalr\Api\DataType\ResultEnvelope
$farmRoleId integer Farm role unique identifier
return Scalr\Api\DataType\ResultEnvelope

modifyPlacementAction() public method

Change placement configuration
public modifyPlacementAction ( integer $farmRoleId ) : Scalr\Api\DataType\ResultEnvelope
$farmRoleId integer Unique farm-role identifier
return Scalr\Api\DataType\ResultEnvelope

modifyScalingAction() public method

Change scaling configuration of farm-role
public modifyScalingAction ( integer $farmRoleId ) : Scalr\Api\DataType\ResultEnvelope
$farmRoleId integer Unique farm-role identifier
return Scalr\Api\DataType\ResultEnvelope

modifyScalingRuleAction() public method

Change farm role scaling metric attributes.
public modifyScalingRuleAction ( integer $farmRoleId, string $scalingRuleName ) : Scalr\Api\DataType\ResultEnvelope
$farmRoleId integer Unique farm-role identifier
$scalingRuleName string Scaling metric's name.
return Scalr\Api\DataType\ResultEnvelope

modifyVariableAction() public method

Modifies farm role's global variable
public modifyVariableAction ( integer $farmRoleId, string $name ) : Scalr\Api\DataType\ResultEnvelope
$farmRoleId integer Numeric identifier of the Farm Role
$name string Name of variable
return Scalr\Api\DataType\ResultEnvelope

Property Details

$scalingRuleNamespace protected static property

Namespace for scaling rule adapters
protected static string $scalingRuleNamespace
return string