Aliyun_Sls_Client class is the main class in the SDK. It can be used to communicate with SLS server to put/get data.

author sls_dev
package SLS_PHP_SDK

 Methods

Aliyun_Sls_Client constructor

__construct(string $endpoint, string $accessKeyId, string $accessKey) 

Parameters

$endpoint

string

SLS host name, for example, http://ch-hangzhou.sls.aliyuncs.com

$accessKeyId

string

aliyun accessKeyId

$accessKey

string

aliyun accessKey

Get histograms of requested query from SLS.

getHistograms(\Aliyun_Sls_Models_GetHistogramsRequest $request) : \Aliyun_Sls_Models_GetHistogramsResponse

Unsuccessful opertaion will cause an Aliyun_Sls_Exception.

Parameters

$request

\Aliyun_Sls_Models_GetHistogramsRequest

the GetHistograms request parameters class.

Exceptions

\Aliyun_Sls_Exception

Returns

\Aliyun_Sls_Models_GetHistogramsResponse

Get logs from SLS.

getLogs(\Aliyun_Sls_Models_GetLogsRequest $request) : \Aliyun_Sls_Models_GetLogsResponse

Unsuccessful opertaion will cause an Aliyun_Sls_Exception.

Parameters

$request

\Aliyun_Sls_Models_GetLogsRequest

the GetLogs request parameters class.

Exceptions

\Aliyun_Sls_Exception

Returns

\Aliyun_Sls_Models_GetLogsResponse

List all logstores of requested project.

listLogstores(\Aliyun_Sls_Models_ListLogstoresRequest $request) : \Aliyun_Sls_Models_ListLogstoresResponse

Unsuccessful opertaion will cause an Aliyun_Sls_Exception.

Parameters

$request

\Aliyun_Sls_Models_ListLogstoresRequest

the ListLogstores request parameters class.

Exceptions

\Aliyun_Sls_Exception

Returns

\Aliyun_Sls_Models_ListLogstoresResponse

List all topics in a logstore.

listTopics(\Aliyun_Sls_Models_ListTopicsRequest $request) : \Aliyun_Sls_Models_ListTopicsResponse

Unsuccessful opertaion will cause an Aliyun_Sls_Exception.

Parameters

$request

\Aliyun_Sls_Models_ListTopicsRequest

the ListTopics request parameters class.

Exceptions

\Aliyun_Sls_Exception

Returns

\Aliyun_Sls_Models_ListTopicsResponse

Put logs to SLS.

putLogs(\Aliyun_Sls_Models_PutLogsRequest $request) : \Aliyun_Sls_Models_PutLogsResponse

Unsuccessful opertaion will cause an Aliyun_Sls_Exception.

Parameters

$request

\Aliyun_Sls_Models_PutLogsRequest

the PutLogs request parameters class

Exceptions

\Aliyun_Sls_Exception

Returns

\Aliyun_Sls_Models_PutLogsResponse

GMT format time string.

getGMT() : string

Returns

string

getHttpResponse()

getHttpResponse($method, $url, $body, $headers) : array

Parameters

$method

$url

$body

$headers

Returns

array

Decodes a JSON string.

loadJson($json, $requestId) : string

Unsuccessful decode will cause an Aliyun_Sls_Exception.

Parameters

$json

$requestId

Exceptions

\Aliyun_Sls_Exception

Returns

string

send()

send($method, $project, $body, $resource, $params, $headers) : array

Parameters

$method

$project

$body

$resource

$params

$headers

Exceptions

\Aliyun_Sls_Exception

Returns

array

sendRequest()

sendRequest($method, $url, $body, $headers) : array

Parameters

$method

$url

$body

$headers

Exceptions

\Aliyun_Sls_Exception

Returns

array

setEndpoint()

setEndpoint($endpoint) 

Parameters

$endpoint

 Properties

 

aliyun accessKey

$accessKey : string

Default

 

aliyun accessKeyId

$accessKeyId : string

Default

 

SLS endpoint

$endpoint : string

Default

 

Check if the host if row ip.

$isRowIp : string

Default

 

Http send port. The dafault value is 80.

$port : integer

Default

 

sls sever host.

$slsHost : string

Default

 

the local machine ip address.

$source : string

Default