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

Since: 5.4.0 (04.03.2015)
Author: Vitaliy Demidov ([email protected])
Inheritance: extends Scalr\Api\Rest\Controller\ApiController, use trait GlobalVariableTrait
Afficher le fichier Open project: scalr/scalr Class Usage Examples

Méthodes publiques

Méthode Description
createAction ( ) Creates a new Role in this Environment
createVariableAction ( integer $roleId ) : Scalr\Api\DataType\ResultEnvelope Creates role's global var
deleteAction ( integer $roleId ) : Scalr\Api\DataType\ResultEnvelope Deletes the role from the environment
deleteVariableAction ( integer $roleId, string $name ) : Scalr\Api\DataType\ResultEnvelope Deletes role's global variable
deregisterImageAction ( integer $roleId, string $imageId ) : Scalr\Api\DataType\ResultEnvelope Disassociates the specified Image.
describeAction ( ) Retrieves the list of the roles that are available on the Environment
describeImagesAction ( integer $roleId ) : array Retrieves the list of the Images associated with this Role
describeVariablesAction ( integer $roleId ) : array Gets the list of the available Global Variables of the role
fetchAction ( integer $roleId ) : Scalr\Api\DataType\ResultEnvelope Retrieves a specified role
fetchImageAction ( integer $roleId, string $imageId ) : mixed Fetches specified Image. It actually checks relations and redirects to Image
fetchVariableAction ( integer $roleId, string $name ) : Scalr\Api\DataType\ResultEnvelope Gets specific global var of the role
getImage ( integer $roleId, string $imageId ) : Image Gets the Image that is associated with the specified Role using User's Environment
getRole ( integer $roleId, boolean $restrictToCurrentScope = false, boolean $modify = null ) : Role | null Gets role from database using User's Environment
getVariableInstance ( ) : Scalr_Scripting_GlobalVariables Gets global variable object
modifyAction ( integer $roleId ) : Scalr\Api\DataType\ResultEnvelope Modifies role attributes
modifyVariableAction ( integer $roleId, string $name ) : Scalr\Api\DataType\ResultEnvelope Modifies role's global variable
registerImageAction ( integer $roleId ) : Scalr\Api\DataType\ResultEnvelope Associates a new Image with the Role
replaceImageAction ( integer $roleId, string $imageId ) : Scalr\Api\DataType\ResultEnvelope Associates a new Image with the Role

Méthodes protégées

Méthode Description
setImage ( ) Add, replace or remove image in role

Private Methods

Méthode Description
getDefaultCriteria ( ) : array Gets Default search criteria for the Environment scope

Method Details

createAction() public méthode

Creates a new Role in this Environment
public createAction ( )

createVariableAction() public méthode

Creates role's global var
public createVariableAction ( integer $roleId ) : Scalr\Api\DataType\ResultEnvelope
$roleId integer
Résultat Scalr\Api\DataType\ResultEnvelope

deleteAction() public méthode

Deletes the role from the environment
public deleteAction ( integer $roleId ) : Scalr\Api\DataType\ResultEnvelope
$roleId integer The identifier of the role
Résultat Scalr\Api\DataType\ResultEnvelope

deleteVariableAction() public méthode

Deletes role's global variable
public deleteVariableAction ( integer $roleId, string $name ) : Scalr\Api\DataType\ResultEnvelope
$roleId integer
$name string
Résultat Scalr\Api\DataType\ResultEnvelope

deregisterImageAction() public méthode

It actually checks relations before deletion.
public deregisterImageAction ( integer $roleId, string $imageId ) : Scalr\Api\DataType\ResultEnvelope
$roleId integer The identifier of the Role
$imageId string The identifier of the Image (uuid)
Résultat Scalr\Api\DataType\ResultEnvelope

describeAction() public méthode

Retrieves the list of the roles that are available on the Environment
public describeAction ( )

describeImagesAction() public méthode

Retrieves the list of the Images associated with this Role
public describeImagesAction ( integer $roleId ) : array
$roleId integer The identifier of the role
Résultat array

describeVariablesAction() public méthode

Gets the list of the available Global Variables of the role
public describeVariablesAction ( integer $roleId ) : array
$roleId integer
Résultat array

fetchAction() public méthode

Retrieves a specified role
public fetchAction ( integer $roleId ) : Scalr\Api\DataType\ResultEnvelope
$roleId integer The identifier of the role
Résultat Scalr\Api\DataType\ResultEnvelope

fetchImageAction() public méthode

Fetches specified Image. It actually checks relations and redirects to Image
public fetchImageAction ( integer $roleId, string $imageId ) : mixed
$roleId integer The identifier of the Role
$imageId string The identifier of the Image (uuid)
Résultat mixed

fetchVariableAction() public méthode

Gets specific global var of the role
public fetchVariableAction ( integer $roleId, string $name ) : Scalr\Api\DataType\ResultEnvelope
$roleId integer
$name string
Résultat Scalr\Api\DataType\ResultEnvelope

getImage() public méthode

Gets the Image that is associated with the specified Role using User's Environment
public getImage ( integer $roleId, string $imageId ) : Image
$roleId integer The identifier of the Role
$imageId string The identifier of the Image which is expected to be associated with the Role
Résultat Scalr\Model\Entity\Image Returns the Image which corresponds the specified Role

getRole() public méthode

Gets role from database using User's Environment
public getRole ( integer $roleId, boolean $restrictToCurrentScope = false, boolean $modify = null ) : Role | null
$roleId integer The identifier of the Role
$restrictToCurrentScope boolean optional Whether it should additionally check that role corresponds to current scope
$modify boolean optional Whether it should check access permission with modify flag
Résultat Scalr\Model\Entity\Role | null Returns Role entity on success or NULL otherwise

getVariableInstance() public méthode

Gets global variable object
public getVariableInstance ( ) : Scalr_Scripting_GlobalVariables
Résultat Scalr_Scripting_GlobalVariables

modifyAction() public méthode

Modifies role attributes
public modifyAction ( integer $roleId ) : Scalr\Api\DataType\ResultEnvelope
$roleId integer The identifier of the role
Résultat Scalr\Api\DataType\ResultEnvelope

modifyVariableAction() public méthode

Modifies role's global variable
public modifyVariableAction ( integer $roleId, string $name ) : Scalr\Api\DataType\ResultEnvelope
$roleId integer
$name string
Résultat Scalr\Api\DataType\ResultEnvelope

registerImageAction() public méthode

Associates a new Image with the Role
public registerImageAction ( integer $roleId ) : Scalr\Api\DataType\ResultEnvelope
$roleId integer The Identifier of the role
Résultat Scalr\Api\DataType\ResultEnvelope

replaceImageAction() public méthode

Associates a new Image with the Role
public replaceImageAction ( integer $roleId, string $imageId ) : Scalr\Api\DataType\ResultEnvelope
$roleId integer The Identifier of the role
$imageId string The Identifier of the image
Résultat Scalr\Api\DataType\ResultEnvelope

setImage() protected méthode

It wraps into separate call to avoid code duplicates on catching Exceptions
protected setImage ( )