PHP Класс Scalr\Service\OpenStack\OpenStack

С версии: 04.12.2012
Автор: Vitaliy Demidov ([email protected])
Показать файл Открыть проект Примеры использования класса

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

Метод Описание
__construct ( OpenStackConfig $config ) Constructor
__get ( $name ) It's used to retrieve service interface instances as public properties
auth ( ) : object Performs an authentication request
createSecurityGroup ( string $name, string $description ) : object Create Security Group action
createSecurityGroupRule ( Scalr\Service\OpenStack\Services\Network\Type\CreateSecurityGroupRule | object | array $request ) : object Creates Security Group Rule (POST /security-group-rules)
decamelize ( string $str ) : string Decamelizes a string
deleteSecurityGroup ( integer $securityGroupId ) : boolean Removes a specific security group
deleteSecurityGroupRule ( string $securityGroupRuleId ) : boolean Deletes Security Group Rule (DELETE /security-group-rules/​rules-security-groups-id})
getAvailableServices ( ) : array Gets a list of available services
getClient ( ) : RestClient Gets Client
getConfig ( ) : OpenStackConfig Gets the OpenStack config
hasNetworkSecurityGroupExtension ( ) : boolean Checks whether openstack has network service as well as security group extension
hasService ( $serviceName, string $ns = null ) : boolean Checks whether specified service does exist in the retrieved endpoints for this user.
listSecurityGroupRules ( string $id = null, ListSecurityGroupRulesFilter | array $filter = null, array $fields = null ) : Scalr\Service\OpenStack\Type\DefaultPaginationList | object | null Gets the list of the security group rules (GET /security-group-rules/[rules-security-groups-id] )
listSecurityGroups ( string $serverId = null, Scalr\Service\OpenStack\Services\Network\Type\ListSecurityGroupsFilter | array $filter = null, array $fields = null ) : Scalr\Service\OpenStack\Type\DefaultPaginationList | object Gets list of security groups
listServices ( ) : array Gets the list of allowed services for this tenant
listZones ( ) : array Gets the list of available zones for the current endpoint
resetRequestTimeout ( ) : OpenStack Sets default request timeout for api calls (from config)
setDebug ( boolean $debug = true ) : OpenStack Enables or disables debug mode
setRequestTimeout ( integer $requestTimeout ) : OpenStack Sets request timeout for api calls

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

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

Constructor
public __construct ( OpenStackConfig $config )
$config OpenStackConfig OpenStack configuration object

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

It's used to retrieve service interface instances as public properties
public __get ( $name )

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

Performs an authentication request
public auth ( ) : object
Результат object Returns auth token

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

Create Security Group action
public createSecurityGroup ( string $name, string $description ) : object
$name string A security group name.
$description string A description.
Результат object Returns created secrurity group.

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

Creates Security Group Rule (POST /security-group-rules)
public createSecurityGroupRule ( Scalr\Service\OpenStack\Services\Network\Type\CreateSecurityGroupRule | object | array $request ) : object
$request Scalr\Service\OpenStack\Services\Network\Type\CreateSecurityGroupRule | object | array The request object
Результат object Returns Security Group Rule object

decamelize() публичный статический Метод

Decamelizes a string
public static decamelize ( string $str ) : string
$str string A string "FooName"
Результат string Returns decamelized string "foo_name"

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

Removes a specific security group
public deleteSecurityGroup ( integer $securityGroupId ) : boolean
$securityGroupId integer Security group unique identifier.
Результат boolean Returns true on success or throws an exception

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

Deletes Security Group Rule (DELETE /security-group-rules/​rules-security-groups-id})
public deleteSecurityGroupRule ( string $securityGroupRuleId ) : boolean
$securityGroupRuleId string The UUID of the security group rule to delete
Результат boolean Returns true on success or throws an exception

getAvailableServices() публичный статический Метод

Gets a list of available services
public static getAvailableServices ( ) : array
Результат array Returns the list of available services looks like array(serviceName => className)

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

Gets Client
public getClient ( ) : RestClient
Результат Scalr\Service\OpenStack\Client\RestClient Returns RestClient

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

Gets the OpenStack config
public getConfig ( ) : OpenStackConfig
Результат OpenStackConfig Returns OpenStack config

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

Checks whether openstack has network service as well as security group extension
public hasNetworkSecurityGroupExtension ( ) : boolean
Результат boolean Returns true if network service exists and has security group extension

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

Checks whether specified service does exist in the retrieved endpoints for this user.
public hasService ( $serviceName, string $ns = null ) : boolean
$ns string optional The namespace
Результат boolean Returns true if specified service does exist for this user.

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

Lists a summary of all OpenStack Networking security group rules that the specified tenant can access.
public listSecurityGroupRules ( string $id = null, ListSecurityGroupRulesFilter | array $filter = null, array $fields = null ) : Scalr\Service\OpenStack\Type\DefaultPaginationList | object | null
$id string optional The ID of the security group rule to view
$filter ListSecurityGroupRulesFilter | array optional The filter options. Filter doesn't apply to detailed info
$fields array optional The list of the fields to show
Результат Scalr\Service\OpenStack\Type\DefaultPaginationList | object | null Returns the list of the security groups, specified security group or null

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

Gets list of security groups
public listSecurityGroups ( string $serverId = null, Scalr\Service\OpenStack\Services\Network\Type\ListSecurityGroupsFilter | array $filter = null, array $fields = null ) : Scalr\Service\OpenStack\Type\DefaultPaginationList | object
$serverId string optional The ID of the security group to view
$filter Scalr\Service\OpenStack\Services\Network\Type\ListSecurityGroupsFilter | array optional The filter options. Filter doesn't apply to detailed info
$fields array optional The list of the fields to show
Результат Scalr\Service\OpenStack\Type\DefaultPaginationList | object Returns the list of the security groups

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

Gets the list of allowed services for this tenant
public listServices ( ) : array
Результат array Returns the list of allowed services for this tenant

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

Gets the list of available zones for the current endpoint
public listZones ( ) : array
Результат array Zones list looks like array(stdClass1, stdClass2, ...)

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

Sets default request timeout for api calls (from config)
public resetRequestTimeout ( ) : OpenStack
Результат OpenStack

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

In debug mode all requests and responses will be printed to stdout.
public setDebug ( boolean $debug = true ) : OpenStack
$debug boolean optional True to enable debug mode
Результат OpenStack

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

Sets request timeout for api calls
public setRequestTimeout ( integer $requestTimeout ) : OpenStack
$requestTimeout integer Request timeout (in seconds)
Результат OpenStack