public class SLSClient extends Object implements SimpleLogService
构造器和说明 |
---|
SLSClient(String endpoint,
String accessId,
String accessKey)
Construct the sls client with accessId, accessKey and server address, all
other parameters will be set to default value
|
SLSClient(String endpoint,
String accessId,
String accessKey,
String SourceIp)
Construct the sls client with accessId, accessKey , server address and
client ip address, all other parameters will be set to default value
|
SLSClient(String endpoint,
String accessId,
String accessKey,
String sourceIp,
boolean compressFlag)
Construct sls client with full parameters
|
限定符和类型 | 方法和说明 |
---|---|
GetHistogramsResponse |
GetHistograms(GetHistogramsRequest request)
Get The log status(histogram info) from sls server which match input
parameters.
|
GetHistogramsResponse |
GetHistograms(String project,
String logStore,
int from,
int to,
String topic,
String query)
Get The log status(histogram info) from sls server which match input
parameters.
|
GetLogsResponse |
GetLogs(GetLogsRequest request)
Get The sub set of logs data from sls server which match input
parameters.
|
GetLogsResponse |
GetLogs(String project,
String logStore,
int from,
int to,
String topic,
String query)
Get The sub set of logs data from sls server which match input
parameters.
|
GetLogsResponse |
GetLogs(String project,
String logStore,
int from,
int to,
String topic,
String query,
int line,
int offset,
boolean reverse)
Get The sub set of logs data from sls server which match input
parameters.
|
ListLogStoresResponse |
ListLogStores(ListLogStoresRequest request)
Get all the logstore of a project
|
ListLogStoresResponse |
ListLogStores(String project)
Get all the logstore for the user
|
ListTopicsResponse |
ListTopics(ListTopicsRequest request)
Get the topics in the logtstore
|
ListTopicsResponse |
ListTopics(String project,
String logStore,
String token,
int line)
Get the topics in the logtstore
|
PutLogsResponse |
PutLogs(PutLogsRequest request)
Send Data to sls server
|
PutLogsResponse |
PutLogs(String project,
String logStore,
String topic,
List<LogItem> logItems,
String source)
Send Data to sls server
|
public SLSClient(String endpoint, String accessId, String accessKey)
endpoint
- the sls server addressaccessId
- aliyun accessIdaccessKey
- aliyun accessKeyNullPointerException
- if the input parameter is nullIllegalArgumentException
- if the input parameter is emptypublic SLSClient(String endpoint, String accessId, String accessKey, String SourceIp)
endpoint
- the sls server addressaccessId
- aliyun accessIdaccessKey
- aliyun accessKeySourceIp
- client ip addressNullPointerException
- if the input parameter is nullIllegalArgumentException
- if the input parameter is emptypublic SLSClient(String endpoint, String accessId, String accessKey, String sourceIp, boolean compressFlag)
endpoint
- the sls server addressaccessId
- aliyun accessIdaccessKey
- aliyun accessKeysourceIp
- client ip addresscompressFlag
- a flag to determine if the send data will compressed , default
is true ( data compressed)NullPointerException
- if the input parameter is nullIllegalArgumentException
- if the input parameter is emptypublic GetHistogramsResponse GetHistograms(String project, String logStore, int from, int to, String topic, String query) throws SlsException
SimpleLogService
GetHistograms
在接口中 SimpleLogService
project
- the project namelogStore
- the result data logstorefrom
- the begin time of the result data to getto
- the end time of the result data to gettopic
- the result data topicquery
- If the query is not empty, it will return the logs contain the
keys in query, if "all_hit" is contained in the query, only
the logs contains all the keys in query are matched logs,
other wise logs contain any key in query are matched logs.SlsException
- if any error happen when get the data from sls severpublic GetHistogramsResponse GetHistograms(GetHistogramsRequest request) throws SlsException
SimpleLogService
GetHistograms
在接口中 SimpleLogService
request
- the get histogram requestSlsException
- if any error happen when get the data from sls severpublic PutLogsResponse PutLogs(String project, String logStore, String topic, List<LogItem> logItems, String source) throws SlsException
SimpleLogService
PutLogs
在接口中 SimpleLogService
project
- the project namelogStore
- the log store where the source data should be puttopic
- source data topiclogItems
- the log data to sendsource
- the source of the data, if the source is empty, it will be
reset to the host ipSlsException
- if any error happen when send data to the serverpublic PutLogsResponse PutLogs(PutLogsRequest request) throws SlsException
SimpleLogService
PutLogs
在接口中 SimpleLogService
request
- the put log requestSlsException
- if any error happen when send data to the serverpublic GetLogsResponse GetLogs(String project, String logStore, int from, int to, String topic, String query) throws SlsException
SimpleLogService
GetLogs
在接口中 SimpleLogService
project
- the project namelogStore
- the result data logstorefrom
- the begin time of the result data to getto
- the end time of the result data to gettopic
- the result data topicquery
- If the query is not empty, it will return the logs contain the
keys in query, if "all_hit" is contained in the query, only
the logs contains all the keys in query are matched logs,
other wise logs contain any key in query are matched logsSlsException
- if any error happen when get the data from sls severpublic GetLogsResponse GetLogs(String project, String logStore, int from, int to, String topic, String query, int line, int offset, boolean reverse) throws SlsException
SimpleLogService
GetLogs
在接口中 SimpleLogService
project
- the project namelogStore
- the result data logstorefrom
- the begin time of the result data to getto
- the end time of the result data to gettopic
- the result data topicquery
- If the query is not empty, it will return the logs contain the
keys in query, if "all_hit" is contained in the query, only
the logs contains all the keys in query are matched logs,
other wise logs contain any key in query are matched logs.line
- how many lines to get, the max lines is decided by
the sls backend serveroffset
- the start log index in all the matched logs.reverse
- a flag to determine the return data order, if reverse is set
to false, the return logs is ascending order by time, other
wise, it's descending orderSlsException
- if any error happen when get the data from sls severpublic GetLogsResponse GetLogs(GetLogsRequest request) throws SlsException
SimpleLogService
GetLogs
在接口中 SimpleLogService
request
- the get logs requestSlsException
- if any error happen when get the data from sls severpublic ListLogStoresResponse ListLogStores(String project) throws SlsException
SimpleLogService
ListLogStores
在接口中 SimpleLogService
project
- the project nameSlsException
- if any error happen when get the data from sls severpublic ListLogStoresResponse ListLogStores(ListLogStoresRequest request) throws SlsException
SimpleLogService
ListLogStores
在接口中 SimpleLogService
request
- the list log store requestSlsException
- if any error happen when get the data from sls severpublic ListTopicsResponse ListTopics(String project, String logStore, String token, int line) throws SlsException
SimpleLogService
ListTopics
在接口中 SimpleLogService
project
- the project namelogStore
- where the topic belongs totoken
- all the returned topics are equal or larger than the given
token according to topics' lexicographical orderline
- the topic number from sls serverSlsException
- if any error happen when get the data from sls severpublic ListTopicsResponse ListTopics(ListTopicsRequest request) throws SlsException
SimpleLogService
ListTopics
在接口中 SimpleLogService
request
- the list topics requestSlsException
- if any error happen when get the data from sls severCopyright © 2015. All Rights Reserved.