\Aculab\WebServicesWrapperReportWebService

Report Web Service.

Summary

Methods
Properties
Constants
setWebServicesServer()
setCryptoMethod()
__construct()
startReport()
reportProgress()
cancelReport()
listReports()
getReportContent()
getReportToFile()
deleteReport()
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 ReportWebService 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.

startReport()

startReport(string  $type, \DateTime|string  $start, \DateTime|string  $end) : string

Start generating a report.

This starts generation of a new report containing comma-separated values.

Parameters

string $type

The type of the required content of the report, such as "adr", "cdr", "fdr", "msg", "err" or "csr".

See the web services documentation for details of the types available.

\DateTime|string $start

The point at which at the report should start. If a string is given, it must be in the format "YYYY-MM-DD_hh:mm:ss".

\DateTime|string $end

The point at which at the report should end. If a string is given, it must be in the format "YYYY-MM-DD_hh:mm:ss".

Throws

\Aculab\WebServicesWrapper\WebServiceException

Returns

string —

The filename of the report.

reportProgress()

reportProgress() : array

Get the progress of reports.

This queries the status of any reports currently in progress.

Throws

\Aculab\WebServicesWrapper\WebServiceException

Returns

array —

An array of ReportProgressDetails objects, keyed by report filename.

cancelReport()

cancelReport(string  $filename) 

Cancel a report.

This cancels generation of a report.

Parameters

string $filename

The filename of the report to cancel.

Throws

\Aculab\WebServicesWrapper\WebServiceException

listReports()

listReports() : array

List completed reports.

This lists all completed reports.

Throws

\Aculab\WebServicesWrapper\WebServiceException

Returns

array —

An array of FileDetails objects.

getReportContent()

getReportContent(string  $filename) : string

Get a report contents.

This downloads a completed report from Aculab Cloud and returns the contents.

Parameters

string $filename

The filename of the report to download.

Throws

\Aculab\WebServicesWrapper\WebServiceException

Returns

string —

The file contents.

getReportToFile()

getReportToFile(string  $filename, string  $local_filename) : integer

Get the file contents to a local file.

This downloads a completed report from Aculab Cloud and stores is as a local file.

Parameters

string $filename

The filename of the report to download.

string $local_filename

The local file to write to.

Throws

\Aculab\WebServicesWrapper\WebServiceException

Returns

integer —

The amount of data written to the local file.

deleteReport()

deleteReport(string  $filename) 

Delete a report.

This deletes a completed report from Aculab Cloud.

Parameters

string $filename

The filename of the report to delete.

Throws

\Aculab\WebServicesWrapper\WebServiceException