\Aculab\WebServicesWrapperServicesWebService

Services Web Service.

Summary

Methods
Properties
Constants
setWebServicesServer()
setCryptoMethod()
__construct()
listServices()
getServiceSchema()
readService()
writeService()
modifyService()
deleteService()
outboundQueues()
outboundQueueInfo()
outboundQueuePurge()
No public properties found
VERSION
No protected methods found
No protected properties found
N/A
No private methods found
No private properties found
N/A

Constants

VERSION

VERSION

The wrapper version.

The wrapper version number.

Methods

setWebServicesServer()

setWebServicesServer(string  $wsserver) 

Set the web services server address.

This allows the web service requests to be directed to a specific server. The default is https://ws-<cloud_id>.aculabcloud.net

Parameters

string $wsserver

The base URL of the web services server.

setCryptoMethod()

setCryptoMethod(integer  $method) 

Set the crypto method used when connectiing to the web services server.

This allows a specific crypto method to be used when connecting to the web service server. The values should be one of the STREAM_CRYPTO_METHOD_TLSv1_N_CLIENT constants. The default is STREAM_CRYPTO_METHOD_ANY_CLIENT.

Parameters

integer $method

The crypto method to use.

__construct()

__construct(string  $cloud_id, string  $username, string  $access_key) 

Create a ServicesWebService object.

Parameters

string $cloud_id

The cloud identifier, such as "1-2-0".

string $username

The cloud account username.

string $access_key

The access key for the cloud account.

listServices()

listServices(boolean  $is_outbound) : array

List services.

Parameters

boolean $is_outbound

Whether to list outbound or inbound services.

Throws

\Aculab\WebServicesWrapper\WebServiceException

Returns

array —

Returns an array of ServiceInfo objects.

getServiceSchema()

getServiceSchema(boolean  $is_outbound, string  $dst_filename = null) : object|integer

Get service schema.

Parameters

boolean $is_outbound

Whether to get outbound or inbound schema.

string $dst_filename

A local filename to store the schema in.

Throws

\Aculab\WebServicesWrapper\WebServiceException

Returns

object|integer —

Returns the schema as an object, or the amount of data written to the file.

readService()

readService(boolean  $is_outbound, string  $service_name, string  $dst_filename = null) : object|integer

Read a service configuration.

Parameters

boolean $is_outbound

Whether to read an outbound or an inbound sservice.

string $service_name

The name of the service to read.

string $dst_filename

A local filename to store the retrieved configuration in.

Throws

\Aculab\WebServicesWrapper\WebServiceException

Returns

object|integer —

Returns the service configuration as an object, or the amount of data written to the file.

writeService()

writeService(boolean  $is_outbound, string  $service_name, mixed  $config = null, string  $dst_filename = null) : array

Write a service configuration.

Parameters

boolean $is_outbound

Whether to write an outbound or an inbound sservice.

string $service_name

The name of the service to write.

mixed $config

The configuration to write. If a string, it is treated as a local file to read the configuration from. Other types are encoded using json_encode(). Null means no body is included, which is only valid for inbound services.

string $dst_filename

A local filename to store the new configuration in.

Throws

\Aculab\WebServicesWrapper\WebServiceException

Returns

array —

The array will have a 'status' key, the value of which will be "created" if the service was created, or "replaced" if the service existed and was replaced. If a destination filename was given, an 'amount_written' key with the value being the number of bytes written as integer. Otherwise, a 'config' key with the value being the new configuration as an object.

modifyService()

modifyService(boolean  $is_outbound, string  $service_name, mixed  $config, string  $dst_filename = null) : object|integer

Modify a service configuration.

Parameters

boolean $is_outbound

Whether to modify an outbound or an inbound sservice.

string $service_name

The name of the service to modify.

mixed $config

The configuration to apply as a modification. If a string, it is treated as a local file to read the configuration from. Other types are encoded using json_encode().

string $dst_filename

A local filename to store the new configuration in.

Throws

\Aculab\WebServicesWrapper\WebServiceException

Returns

object|integer —

Returns the new configuration as an object, or the amount of data written to the file.

deleteService()

deleteService(boolean  $is_outbound, string  $service_name) 

Delete a service.

Parameters

boolean $is_outbound

Whether to delete an outbound or an inbound sservice.

string $service_name

The name of the service to delete.

Throws

\Aculab\WebServicesWrapper\WebServiceException

outboundQueues()

outboundQueues() : array

Get the information about active outbound queues.

Throws

\Aculab\WebServicesWrapper\WebServiceException

Returns

array —

An array of OutboundQueueInfo objects.

outboundQueueInfo()

outboundQueueInfo(string  $service_name) : \Aculab\WebServicesWrapper\OutboundQueueInfo

Get the outbound queue info.

Parameters

string $service_name

The name of the service to get the queue info for.

Throws

\Aculab\WebServicesWrapper\WebServiceException

Returns

\Aculab\WebServicesWrapper\OutboundQueueInfo

outboundQueuePurge()

outboundQueuePurge(string  $service_name) : \Aculab\WebServicesWrapper\OutboundQueuePurgeResult

Purge the outbound queue.

Parameters

string $service_name

The name of the service to purge the queue of.

Throws

\Aculab\WebServicesWrapper\WebServiceException

Returns

\Aculab\WebServicesWrapper\OutboundQueuePurgeResult