PHP Класс Scalr\Api\Service\User\V1beta0\Controller\Roles

С версии: 5.4.0 (04.03.2015)
Автор: Vitaliy Demidov ([email protected])
Наследование: extends Scalr\Api\Rest\Controller\ApiController, use trait GlobalVariableTrait
Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
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

Защищенные методы

Метод Описание
setImage ( ) Add, replace or remove image in role

Приватные методы

Метод Описание
getDefaultCriteria ( ) : array Gets Default search criteria for the Environment scope

Описание методов

createAction() публичный Метод

Creates a new Role in this Environment
public createAction ( )

createVariableAction() публичный Метод

Creates role's global var
public createVariableAction ( integer $roleId ) : Scalr\Api\DataType\ResultEnvelope
$roleId integer
Результат Scalr\Api\DataType\ResultEnvelope

deleteAction() публичный Метод

Deletes the role from the environment
public deleteAction ( integer $roleId ) : Scalr\Api\DataType\ResultEnvelope
$roleId integer The identifier of the role
Результат Scalr\Api\DataType\ResultEnvelope

deleteVariableAction() публичный Метод

Deletes role's global variable
public deleteVariableAction ( integer $roleId, string $name ) : Scalr\Api\DataType\ResultEnvelope
$roleId integer
$name string
Результат Scalr\Api\DataType\ResultEnvelope

deregisterImageAction() публичный Метод

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)
Результат Scalr\Api\DataType\ResultEnvelope

describeAction() публичный Метод

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

describeImagesAction() публичный Метод

Retrieves the list of the Images associated with this Role
public describeImagesAction ( integer $roleId ) : array
$roleId integer The identifier of the role
Результат array

describeVariablesAction() публичный Метод

Gets the list of the available Global Variables of the role
public describeVariablesAction ( integer $roleId ) : array
$roleId integer
Результат array

fetchAction() публичный Метод

Retrieves a specified role
public fetchAction ( integer $roleId ) : Scalr\Api\DataType\ResultEnvelope
$roleId integer The identifier of the role
Результат Scalr\Api\DataType\ResultEnvelope

fetchImageAction() публичный Метод

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)
Результат mixed

fetchVariableAction() публичный Метод

Gets specific global var of the role
public fetchVariableAction ( integer $roleId, string $name ) : Scalr\Api\DataType\ResultEnvelope
$roleId integer
$name string
Результат Scalr\Api\DataType\ResultEnvelope

getImage() публичный Метод

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
Результат Scalr\Model\Entity\Image Returns the Image which corresponds the specified Role

getRole() публичный Метод

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
Результат Scalr\Model\Entity\Role | null Returns Role entity on success or NULL otherwise

getVariableInstance() публичный Метод

Gets global variable object
public getVariableInstance ( ) : Scalr_Scripting_GlobalVariables
Результат Scalr_Scripting_GlobalVariables

modifyAction() публичный Метод

Modifies role attributes
public modifyAction ( integer $roleId ) : Scalr\Api\DataType\ResultEnvelope
$roleId integer The identifier of the role
Результат Scalr\Api\DataType\ResultEnvelope

modifyVariableAction() публичный Метод

Modifies role's global variable
public modifyVariableAction ( integer $roleId, string $name ) : Scalr\Api\DataType\ResultEnvelope
$roleId integer
$name string
Результат Scalr\Api\DataType\ResultEnvelope

registerImageAction() публичный Метод

Associates a new Image with the Role
public registerImageAction ( integer $roleId ) : Scalr\Api\DataType\ResultEnvelope
$roleId integer The Identifier of the role
Результат Scalr\Api\DataType\ResultEnvelope

replaceImageAction() публичный Метод

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
Результат Scalr\Api\DataType\ResultEnvelope

setImage() защищенный Метод

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