获取客人下订单页面浏览记录,通过调用阿里云日志API实现

ct-mobile-first
ycc 5 years ago
parent 2890fc8980
commit c5d62d6527

@ -576,6 +576,7 @@ class Information extends CI_Controller
if(substr($mobile_html, -1, 1)== '/'){
$mobile_html=$mobile_html.'index.htm';
}
$mobile_html.='-mobile.htm';
create_folder_by_path(dirname($mobile_html));
file_put_contents($mobile_html, $mobile_template, LOCK_EX);
}

@ -0,0 +1,9 @@
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
require '/lib/aliyun-log-php-sdk-master/Log_Autoload.php';
class Aliyun_log_lib extends CI_Controller{
}

@ -0,0 +1,106 @@
<?php
if (!defined('BASEPATH')) {
exit('No direct script access allowed');
}
class Index extends CI_Controller
{
private $endpoint = 'cn-guangzhou.log.aliyuncs.com';
private $accessKeyId = 'LTAI4G9HFUkuYzYCBhPK4n2w';
private $accessKey = 'Yh5vtntTF9JCX8yylvcRlwzO4Prbzb';
private $project = 'globalhoghlights';
//private $logstore = 'globalhoghlights';
private $token = "";
private $Log_Client;
private $logstore=array('cht'=>'globalhoghlights','ah'=>'asiahighlights');//站点日志存储库,每个网站对应一个
function __construct()
{
parent::__construct();
$this->load->model('wwwlogs_model');
$this->load->library('Aliyun_log_lib');
$this->Log_Client = new Aliyun_Log_Client($this->endpoint, $this->accessKeyId, $this->accessKey, $this->token);
}
public function index()
{
$data=array();
$orders=$this->wwwlogs_model->get_update_list(10);
if($orders){
foreach ($orders as $item){
$this->orders_view_path($item->COLI_SN,$item->COLI_WebCode,$item->COLI_SenderIP);
echo 'COLI_WebCode:'.$item->COLI_WebCode.' COLI_ID:'.$item->COLI_ID.' COLI_SenderIP:'.$item->COLI_SenderIP.'<br/>';
}
}
$this->load->view('welcome');
}
//定时抓取订单日志
public function orders_view_path($COLI_SN,$sitecode='cht',$ip,$offset=0){
$query_string="
* | select time_local,http_referer,request_uri,http_user_agent,http_x_forwarded_for
remote_addr,request_method,request_time,status,body_bytes_sent,upstream_response_time,request_body from log where
request_uri NOT like '%.jpg'
and request_uri NOT like '%.png'
and request_uri NOT like '%.gif'
and request_uri NOT like '/guide-use.php%'
and request_uri NOT like '/index.php%'
and request_uri NOT like '/secureforms/form_token'
and remote_addr='$ip'
";//ORDER BY time_local ASC 时间精度不够,会导致相同排序错误,只能用系统默认排序
/*
remote_addr :'23.99.99.139'
AND NOT request_uri :"/secureforms/form_token"
AND NOT request_uri :".jpg"
AND NOT request_uri :".png"
AND NOT request_uri :".gif"
AND NOT request_uri :"guide-use.php"
AND NOT request_uri : "/index.php"
*/
$from = time()-604800;//往前 604800(7天), 1296000(15天)
$to = time();
$request = new Aliyun_Log_Models_GetLogsRequest('globalhoghlights', $this->logstore[$sitecode], $from, $to, '', $query_string, 100, $offset, true);
try {
$LogData = new StdClass;
$LogData->wl_sitecode=$sitecode;
$LogData->wl_COLI_SN=$COLI_SN;//订单SN
$response = $this->Log_Client->getLogs($request);
foreach ($response -> getLogs() as $log) {
foreach ($log -> getContents() as $key => $value) {
$LogData->$key=$value;
}
$this->wwwlogs_model->add('wwwlogs',$LogData);
}
} catch (Aliyun_Log_Exception $ex) {
logVarDump($ex);
} catch (Exception $ex) {
logVarDump($ex);
}
}
public function getLogs(Aliyun_Log_Client $client, $project, $logstore)
{
$topic = '';
$from = time()-604800;//往前7天
$to = time();
$request = new Aliyun_Log_Models_GetLogsRequest($project, $logstore, $from, $to, $topic, "", 100, 0, false);
try {
$response = $client->getLogs($request);
foreach ($response -> getLogs() as $log) {
print $log -> getTime()."\t";
foreach ($log -> getContents() as $key => $value) {
print $key.":".$value."\t";
}
print "\n";
}
} catch (Aliyun_Log_Exception $ex) {
logVarDump($ex);
} catch (Exception $ex) {
logVarDump($ex);
}
}
}

@ -0,0 +1,80 @@
<?php
class wwwlogs_model extends CI_Model {
var $topnum = false; //返回记录数
var $orderby = false;
var $where = false; //查询条件
function __construct() {
parent::__construct();
$this->HT = $this->load->database('HT', TRUE);
$this->INFO = $this->load->database('INFO', TRUE);
}
public function init() {
$this->topnum = false;
$this->where = false;
$this->orderby = ' order by COLI_ApplyDate desc ';
}
public function detail($psd_URL, $psd_SiteCode) {
$this->init();
$this->topnum = 1;
$this->where = ' AND psd.psd_URL=N' . $this->INFO->escape($psd_URL);
$this->where .= ' AND psd.psd_SiteCode=' . $this->INFO->escape($psd_SiteCode);
return $this->get_list();
}
public function add($table, $data) {
if ($this->INFO->insert($table, $data)) {
return $this->INFO->last_id($table);
} else {
return false;
}
}
public function get_update_list($topnum = 10) {
$this->init();
$this->topnum = $topnum;
return $this->get_list();
}
public function update($table, $data, $where) {
$this->INFO->update($table, $data, $where);
}
//删除数据
// public function delete($psd_id) {
// $sql = " DELETE FROM PageSpeedData WHERE psd_id=? ";
// return $this->INFO->query($sql, array($psd_id));
// }
public function get_list() {
$this->topnum ? $sql = "SELECT TOP " . $this->topnum : $sql = "SELECT ";
$sql .= "
COLI_SN,COLI_ID, COLI_WebCode,COLI_Name, COLI_OrderDetailText, COLI_OrderStartDate,COLI_SenderIP,COLI_WebCode,COLI_ApplyDate from ConfirmLineInfo
where 1=1
and COLI_WebCode in ('cht','ah')
and not exists (select top 1 1 from InfoManager.dbo.wwwlogs where wl_COLI_SN=COLI_SN )
and COLI_SenderIP is not null
and DeleteFlag=0
and COLI_ApplyDate>=DATEADD(day,-7,GETDATE())
";
$this->where ? $sql.=$this->where : false;
$this->orderby ? $sql.=$this->orderby : false;
$query = $this->HT->query($sql);
//print_r($this->INFO->queries);
if ($this->topnum === 1) {
if ($query->num_rows() > 0) {
$row = $query->row();
return $row;
} else {
return FALSE;
}
} else {
return $query->result();
}
}
}

@ -0,0 +1,18 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<meta http-equiv="Expires" CONTENT="0"/>
<meta http-equiv="Cache-Control" CONTENT="no-cache"/>
<meta http-equiv="Pragma" CONTENT="no-cache"/>
<title>www log</title>
</head>
<script type="text/javascript">
</script>
<body>
<h1>WWW log</h1>
</body>
</html>

File diff suppressed because it is too large Load Diff

@ -0,0 +1,72 @@
<?php
/**
* Copyright (C) Alibaba Cloud Computing
* All rights reserved
*/
/**
* The Exception of the log serivce request & response.
*
* @author log service dev
*/
class Aliyun_Log_Exception extends Exception{
/**
* @var string
*/
private $requestId;
/**
* Aliyun_Log_Exception constructor
*
* @param string $code
* log service error code.
* @param string $message
* detailed information for the exception.
* @param string $requestId
* the request id of the response, '' is set if client error.
*/
public function __construct($code, $message, $requestId='') {
parent::__construct($message);
$this->code = $code;
$this->message = $message;
$this->requestId = $requestId;
}
/**
* The __toString() method allows a class to decide how it will react when
* it is treated like a string.
*
* @return string
*/
public function __toString() {
return "Aliyun_Log_Exception: \n{\n ErrorCode: $this->code,\n ErrorMessage: $this->message\n RequestId: $this->requestId\n}\n";
}
/**
* Get Aliyun_Log_Exception error code.
*
* @return string
*/
public function getErrorCode() {
return $this->code;
}
/**
* Get Aliyun_Log_Exception error message.
*
* @return string
*/
public function getErrorMessage() {
return $this->message;
}
/**
* Get log service sever requestid, '' is set if client or Http error.
*
* @return string
*/
public function getRequestId() {
return $this->requestId;
}
}

@ -0,0 +1,69 @@
<?php
/**
* Copyright (C) Alibaba Cloud Computing
* All rights reserved
*/
/**
* Class Aliyun_Log_LoggerFactory
* Factory for creating logger instance, with $client, $project, $logstore, $topic configurable.
* Will flush current logger when the factory instance was recycled.
*/
class Aliyun_Log_LoggerFactory{
private static $loggerMap = array();
/**
* Get logger instance
* @param $client valid log client
* @param $project which could be created in AliYun Logger Server configuration page
* @param $logstore which could be created in AliYun Logger Server configuration page
* @param null $topic used to specified the log by TOPIC field
* @return mixed return logger instance
* @throws Exception if the input parameter is invalid, throw exception
*/
public static function getLogger($client, $project, $logstore, $topic = null){
if($project === null || $project == ''){
throw new Exception('project name is blank!');
}
if($logstore === null || $logstore == ''){
throw new Exception('logstore name is blank!');
}
if($topic === null){
$topic = '';
}
$loggerKey = $project.'#'.$logstore.'#'.$topic;
if (!array_key_exists($loggerKey, static::$loggerMap))
{
$instanceSimpleLogger = new Aliyun_Log_SimpleLogger($client,$project,$logstore,$topic);
static::$loggerMap[$loggerKey] = $instanceSimpleLogger;
}
return static::$loggerMap[$loggerKey];
}
/**
* set modifier to protected for singleton pattern
* Aliyun_Log_LoggerFactory constructor.
*/
protected function __construct()
{
}
/**
* set clone function to private for singleton pattern
*/
private function __clone()
{}
/**
* flush current logger in destruct function
*/
function __destruct() {
if(static::$loggerMap != null){
foreach (static::$loggerMap as $innerLogger){
$innerLogger->logFlush();
}
}
}
}

@ -0,0 +1,110 @@
<?php
/**
* Copyright (C) Alibaba Cloud Computing
* All rights reserved
*/
class Aliyun_Log_Models_ACL {
private $principleType;
private $principleId;
private $object;
private $privilege;
private $aclId;
private $createTime;
private $lastModifyTime;
public function __construct($principleType='',$principleId='',$object='',
$privilege=array(),$aclId=null,$createTime=null,$lastModifyTime=null) {
$this->principleType = $principleType;
$this->principleId = $principleId;
$this->object = $object;
$this->privilege = $privilege;
$this->aclId = $aclId;
$this->createTime = $createTime;
$this->lastModifyTime = $lastModifyTime;
}
public function getPrincipleType(){
return $this->principleType;
}
public function setPrincipleType($principleType){
$this->principleType = $principleType;
}
public function getPrincipleId(){
return $this->principleId;
}
public function setPrincipleId($principleId){
$this->principleId = $principleId;
}
public function getObject(){
return $this->object;
}
public function setObject($object){
$this->object = $object;
}
public function getPrivilege(){
return $this->privilege;
}
public function setPrivilege($privilege){
$this->privilege = $privilege;
}
public function getAclId(){
return $this->aclId;
}
public function setAclId($aclId){
$this->aclId = $aclId;
}
public function getCreateTime(){
return $this->createTime;
}
public function setCreateTime($createTime){
$this->createTime = $createTime;
}
public function getLastModifyTime(){
return $this->lastModifyTime;
}
public function setLastModifyTime($lastModifyTime){
$this->lastModifyTime = $lastModifyTime;
}
public function toArray(){
$format_array = array();
if($this->principleType!==null)
$format_array['principleType'] = $this->principleType;
if($this->principleId!==null)
$format_array['principleId'] = $this->principleId;
if($this->object!==null)
$format_array['object'] = $this->object;
if($this->privilege!==null)
$format_array['privilege'] = $this->privilege;
if($this->aclId!==null)
$format_array['aclId'] = $this->aclId;
if($this->createTime!==null)
$format_array['createTime'] = $this->createTime;
if($this->lastModifyTime!==null)
$format_array['lastModifyTime'] = $this->lastModifyTime;
return $format_array;
}
public function setFromArray($resp){
$principleType = ($resp['principleType']!==null)?$resp['principleType']:null;
$principleId = ($resp['principleId']!==null)?$resp['principleId']:null;
$object = ($resp['object']!==null)?$resp['object']:null;
$privilege = ($resp['privilege']!==null)?$resp['privilege']:array();
$aclId = ($resp['aclId']!==null)?$resp['aclId']:null;
$createTime = ($resp['createTime']!==null)?$resp['createTime']:null;
$lastModifyTime = ($resp['lastModifyTime']!==null)?$resp['lastModifyTime']:null;
$this->setPrincipleType($principleType);
$this->setPrincipleId($principleId);
$this->setObject($object);
$this->setPrivilege($privilege);
$this->setAclId($aclId);
$this->setCreateTime($createTime);
$this->setLastModifyTime($lastModifyTime);
}
}

@ -0,0 +1,38 @@
<?php
/**
* Copyright (C) Alibaba Cloud Computing
* All rights reserved
*/
/**
* Aliyun_Log_Models_CompressedLogGroup is compressed LogGroup,
* LogGroup infomation please refer to Aliyun_Log_Models_LogGroup
*
* @author log service dev
*/
class Aliyun_Log_Models_CompressedLogGroup {
/**
* @var integer uncompressed LogGroup size
*
*/
protected $uncompressedSize;
/**
* @var integer uncompressed LogGroup size
*
*/
protected $compressedData;
public function __construct($time = null, $contents = null) {
if (! $time)
$time = time ();
$this->time = $time;
if ($contents)
$this->contents = $contents;
else
$this->contents = array ();
}
}

@ -0,0 +1,198 @@
<?php
/**
* Copyright (C) Alibaba Cloud Computing
* All rights reserved
*/
class Aliyun_Log_Models_Config_InputDetail {
public $filePattern;
public $key;
public $localStorage;
public $logBeginRegex;
public $logPath;
public $logType;
public $regex;
public $timeFormat;
public $filterRegex;
public $filterKey;
public $topicFormat;
public function __construct($filePattern='',$key=array(),$localStorage=true,
$logBeginRegex='',$logPath='',$logType='',$regex='',
$timeFormat='',$filterRegex=array(),$filterKey=array(),$topicFormat='none'){
$this->filePattern=$filePattern;
$this->key=$key;
$this->localStorage=$localStorage;
$this->logBeginRegex=$logBeginRegex;
$this->logPath=$logPath;
$this->logType=$logType;
$this->regex=$regex;
$this->timeFormat=$timeFormat;
$this->filterRegex=$filterRegex;
$this->filterKey=$filterKey;
$this->topicFormat=$topicFormat;
}
public function toArray(){
$resArray = array();
if($this->filePattern!==null)
$resArray['filePattern'] = $this->filePattern;
if($this->key!==null)
$resArray['key'] = $this->key;
if($this->localStorage!==null)
$resArray['localStorage'] = $this->localStorage;
if($this->logBeginRegex!==null)
$resArray['logBeginRegex'] = $this->logBeginRegex;
if($this->logPath!==null)
$resArray['logPath'] = $this->logPath;
if($this->logType!==null)
$resArray['logType'] = $this->logType;
if($this->regex!==null)
$resArray['regex'] = $this->regex;
if($this->timeFormat!==null)
$resArray['timeFormat'] = $this->timeFormat;
if($this->filterRegex!==null)
$resArray['filterRegex'] = $this->filterRegex;
if($this->filterKey!==null)
$resArray['filterKey'] = $this->filterKey;
if($this->topicFormat!==null)
$resArray['topicFormat'] = $this->topicFormat;
return $resArray;
}
}
class Aliyun_Log_Models_Config_OutputDetail {
public $projectName;
public $logstoreName;
public function __construct($projectName='',$logstoreName=''){
$this->projectName = $projectName;
$this->logstoreName = $logstoreName;
}
public function toArray(){
$resArray = array();
if($this->projectName!==null)
$resArray['projectName'] = $this->projectName;
if($this->logstoreName!==null)
$resArray['logstoreName'] = $this->logstoreName;
return $resArray;
}
}
class Aliyun_Log_Models_Config {
private $configName;
private $inputType;
private $inputDetail;
private $outputType;
private $outputDetail;
private $createTime;
private $lastModifyTime;
public function __construct($configName='',$inputType='',$inputDetail=null,
$outputType='',$outputDetail=null,$createTime=null,$lastModifyTime=null) {
$this->configName = $configName;
$this->inputType = $inputType;
$this->inputDetail = $inputDetail;
$this->outputType = $outputType;
$this->outputDetail = $outputDetail;
$this->createTime = $createTime;
$this->lastModifyTime = $lastModifyTime;
}
public function getConfigName(){
return $this->configName;
}
public function setConfigName($configName){
$this->configName = $configName;
}
public function getInputType(){
return $this->inputType;
}
public function setInputType($inputType){
$this->inputType = $inputType;
}
public function getInputDetail(){
return $this->inputDetail;
}
public function setInputDetail($inputDetail){
$this->inputDetail = $inputDetail;
}
public function getOutputType(){
return $this->outputType;
}
public function setOutputType($outputType){
$this->outputType = $outputType;
}
public function getOutputDetail(){
return $this->outputDetail;
}
public function setOutputDetail($outputDetail){
$this->outputDetail = $outputDetail;
}
public function getCreateTime(){
return $this->createTime;
}
public function setCreateTime($createTime){
$this->createTime = $createTime;
}
public function getLastModifyTime(){
return $this->lastModifyTime;
}
public function setLastModifyTime($lastModifyTime){
$this->lastModifyTime = $lastModifyTime;
}
public function toArray(){
$format_array = array();
if($this->configName!==null)
$format_array['configName'] = $this->configName;
if($this->inputType!==null)
$format_array['inputType'] = $this->inputType;
if($this->inputDetail!==null)
$format_array['inputDetail'] = $this->inputDetail->toArray();
if($this->outputType!==null)
$format_array['outputType'] = $this->outputType;
if($this->outputDetail!==null)
$format_array['outputDetail'] = $this->outputDetail->toArray();
if($this->createTime!==null)
$format_array['createTime'] = $this->createTime;
if($this->lastModifyTime!==null)
$format_array['lastModifyTime'] = $this->lastModifyTime;
return $format_array;
}
public function setFromArray($resp){
$inputDetail = new Aliyun_Log_Models_Config_InputDetail();
$inputDetail->filePattern = $resp['inputDetail']['filePattern'];
$inputDetail->key = $resp['inputDetail']['key'];
$inputDetail->localStorage = $resp['inputDetail']['localStorage'];
$inputDetail->logBeginRegex = $resp['inputDetail']['logBeginRegex'];
$inputDetail->logPath = $resp['inputDetail']['logPath'];
$inputDetail->logType = $resp['inputDetail']['logType'];
$inputDetail->regex = $resp['inputDetail']['regex'];
$inputDetail->timeFormat = $resp['inputDetail']['timeFormat'];
$inputDetail->filterRegex = $resp['inputDetail']['filterRegex'];
$inputDetail->filterKey = $resp['inputDetail']['filterKey'];
$inputDetail->topicFormat = $resp['inputDetail']['topicFormat'];
$outputDetail = new Aliyun_Log_Models_Config_OutputDetail();
$outputDetail->projectName = $resp['outputDetail']['projectName'];
$outputDetail->logstoreName = $resp['outputDetail']['logstoreName'];
$configName=$resp['configName'];
$inputType=$resp['inputType'];
$outputType=$resp['outputType'];
$this->setConfigName($configName);
$this->setInputType($inputType);
$this->setInputDetail($inputDetail);
$this->setOutputType($outputType);
$this->setOutputDetail($outputDetail);
}
}

@ -0,0 +1,90 @@
<?php
/**
* Copyright (C) Alibaba Cloud Computing
* All rights reserved
*/
/**
* The class used to present the result of log histogram status. For every log
* histogram, it contains : from/to time range, hit log count and query
* completed status.
*
* @author log service dev
*/
class Aliyun_Log_Models_Histogram {
/**
* @var integer the begin time
*/
private $from;
/**
* @var integer the end time
*/
private $to;
/**
* @var integer log count of histogram that query hits
*/
private $count;
/**
* @var string histogram query status(Complete or InComplete)
*/
private $progress;
/**
* Aliyun_Log_Models_Histogram constructor
*
* @param integer $from
* the begin time
* @param integer $to
* the end time
* @param integer $count
* log count of histogram that query hits
* @param string $progress
* histogram query status(Complete or InComplete)
*/
public function __construct($from, $to, $count, $progress) {
$this->from = $from;
$this->to = $to;
$this->count = $count;
$this->progress = $progress;
}
/**
* Get begin time
*
* @return integer the begin time
*/
public function getFrom() {
return $this->from;
}
/**
* Get the end time
*
* @return integer the end time
*/
public function getTo() {
return $this->to;
}
/**
* Get log count of histogram that query hits
*
* @return integer log count of histogram that query hits
*/
public function getCount() {
return $this->count;
}
/**
* Check if the histogram is completed
*
* @return bool true if this histogram is completed
*/
public function isCompleted() {
return $this->progress == 'Complete';
}
}

@ -0,0 +1,92 @@
<?php
/**
* Copyright (C) Alibaba Cloud Computing
* All rights reserved
*/
/**
* Aliyun_Log_Models_LogItem used to present a log, it contains log time and multiple
* key/value pairs to present the log contents.
*
* @author log service dev
*/
class Aliyun_Log_Models_LogItem {
/**
* @var integer time of the log item, the default time if the now time.
*/
private $time;
/**
* @var array the data of the log item, including many key/value pairs.
*/
private $contents;
/**
* Aliyun_Log_Models_LogItem cnostructor
*
* @param array $contents
* the data of the log item, including many key/value pairs.
* @param integer $time
* time of the log item, the default time if the now time.
*/
public function __construct($time = null, $contents = null) {
if (! $time)
$time = time ();
$this->time = $time;
if ($contents)
$this->contents = $contents;
else
$this->contents = array ();
}
/**
* Get log time
*
* @return integer log time
*/
public function getTime() {
return $this->time;
}
/**
* Set log time
*
* @param integer $time
* log time
*/
public function setTime($time) {
$this->time = $time;
}
/**
* Get log contents
*
* @return array log contents
*/
public function getContents() {
return $this->contents;
}
/**
* Set log contents
*
* @param array $contents
* log contents
*/
public function setContents($contents) {
$this->contents = $contents;
}
/**
* Add a key/value pair as log content to the log
*
* @param string $key
* log content key
* @param string $value
* log content value
*/
public function pushBack($key, $value) {
$this->contents [$key] = $value;
}
}

@ -0,0 +1,92 @@
<?php
/**
* Copyright (C) Alibaba Cloud Computing
* All rights reserved
*/
class Aliyun_Log_Models_LogLevel_LogLevel{
const debug = 'debug';
const info = 'info';
const warn = 'warn';
const error = 'error';
private static $constCacheArray = NULL;
private $level;
/**
* Constructor
*
* @param string $level
*/
private function __construct($level) {
$this->level = $level;
}
/**
* Compares two logger levels.
*
* @param LoggerLevels $other
* @return boolean
*/
public function equals($other) {
if($other instanceof Aliyun_Log_Models_LogLevel_LogLevel) {
if($this->level == $other->level) {
return true;
}
} else {
return false;
}
}
public static function getLevelDebug(){
if(!isset(self::$constCacheArray[Aliyun_Log_Models_LogLevel_LogLevel::debug])){
self::$constCacheArray[Aliyun_Log_Models_LogLevel_LogLevel::debug] = new Aliyun_Log_Models_LogLevel_LogLevel('debug');
}
return self::$constCacheArray[Aliyun_Log_Models_LogLevel_LogLevel::debug];
}
public static function getLevelInfo(){
if(!isset(self::$constCacheArray[Aliyun_Log_Models_LogLevel_LogLevel::info])){
self::$constCacheArray[Aliyun_Log_Models_LogLevel_LogLevel::info] = new Aliyun_Log_Models_LogLevel_LogLevel('info');
}
return self::$constCacheArray[Aliyun_Log_Models_LogLevel_LogLevel::info];
}
public static function getLevelWarn(){
if(!isset(self::$constCacheArray[Aliyun_Log_Models_LogLevel_LogLevel::warn])){
self::$constCacheArray[Aliyun_Log_Models_LogLevel_LogLevel::warn] = new Aliyun_Log_Models_LogLevel_LogLevel('warn');
}
return self::$constCacheArray[Aliyun_Log_Models_LogLevel_LogLevel::warn];
}
public static function getLevelError(){
if(!isset(self::$constCacheArray[Aliyun_Log_Models_LogLevel_LogLevel::error])){
self::$constCacheArray[Aliyun_Log_Models_LogLevel_LogLevel::error] = new Aliyun_Log_Models_LogLevel_LogLevel('error');
}
return self::$constCacheArray[Aliyun_Log_Models_LogLevel_LogLevel::error];
}
public static function getLevelStr(Aliyun_Log_Models_LogLevel_LogLevel $logLevel){
$logLevelStr = '';
if(null === $logLevel){
$logLevelStr = 'info';
}
switch ($logLevel->level){
case "error":
$logLevelStr= 'error';
break;
case "warn":
$logLevelStr= 'warn';
break;
case "info":
$logLevelStr= 'info';
break;
case "debug":
$logLevelStr= 'debug';
break;
}
return $logLevelStr;
}
}

@ -0,0 +1,173 @@
<?php
/**
* Copyright (C) Alibaba Cloud Computing
* All rights reserved
*/
class Aliyun_Log_Models_Machine_Info{
public $ip;
public $os;
public $hostName;
public function __construct($ip=null,$os=null,$hostName=null){
$this->ip = $ip;
$this->os = $os;
$this->hostName = $hostName;
}
public function getIp(){
return $this->ip;
}
public function setIp($ip){
$this->ip = $ip;
}
public function getOs(){
return $this->os;
}
public function setOs($os){
$this->os = $os;
}
public function getHostName(){
return $this->hostName;
}
public function setHostName($hostname){
$this->hostName = $hostName;
}
public function toArray(){
$resArr = array();
if($this->ip!==null)
$resArr['ip'] = $this->ip;
if($this->os!==null)
$resArr['os'] = $this->os;
if($this->hostName!==null)
$resArr['hostName'] = $this->hostName;
return $resArr;
}
}
class Aliyun_Log_Models_Machine_Status{
public $binaryCurVersion;
public $binaryDeployVersion;
public function __construct($binaryCurVersion=null,$binaryDeployVersion=null){
$this->binaryCurVersion = $binaryCurVersion;
$this->binaryDeployVersion = $binaryDeployVersion;
}
public function toArray(){
$resArr = array();
if($this->binaryCurVersion!==null)
$resArr['binaryCurVersion'] = $this->binaryCurVersion;
if($this->binaryDeployVersion!==null)
$resArr['binaryDeployVersion'] = $this->binaryDeployVersion;
return $resArr;
}
}
class Aliyun_Log_Models_Machine {
private $uuid;
private $lastHeartbeatTime;
private $info;
private $status;
private $createTime;
private $lastModifyTime;
public function __construct($uuid=null,$lastHeartbeatTime=null,$info=null,
$status=null,$createTime=null,$lastModifyTime=null) {
$this->uuid = $uuid;
$this->lastHeartbeatTime = $lastHeartbeatTime;
$this->info = $info;
$this->status = $status;
$this->createTime = $createTime;
$this->lastModifyTime = $lastModifyTime;
}
public function getUuid(){
return $this->uuid;
}
public function setUuid($uuid){
$this->uuid = $uuid;
}
public function getLastHeartbeatTime(){
return $this->lastHeartbeatTime;
}
public function setLastHeartbeatTime($lastHeartbeatTime){
$this->lastHeartbeatTime = $lastHeartbeatTime;
}
public function getInfo(){
return $this->info;
}
public function setInfo($info){
$this->info = $info;
}
public function getStatus(){
return $this->status;
}
public function setStatus($status){
$this->status = $status;
}
public function getCreateTime(){
return $this->createTime;
}
public function setCreateTime($createTime){
$this->createTime = $createTime;
}
public function getLastModifyTime(){
return $this->lastModifyTime;
}
public function setLastModifyTime($lastModifyTime){
$this->lastModifyTime = $lastModifyTime;
}
public function toArray(){
$resArr = array();
if($this->uuid!==null)
$resArr['uuid'] = $this->uuid;
if($this->lastHeartbeatTime!==null)
$resArr['lastHeartbeatTime'] = $this->lastHeartbeatTime;
if($this->info!==null)
$resArr['info'] = $this->info->toArray();
if($this->status!==null)
$resArr['status'] = $this->status->toArray();
if($this->createTime!==null)
$resArr['createTime'] = $this->createTime;
if($this->lastModifyTime!==null)
$resArr['lastModifyTime'] = $this->lastModifyTime;
return $resArr;
}
public function setFromArray($resp){
$info=null;
if(isset($resp['info'])){
$ip=(isset($resp['info']['ip']))?$resp['info']['ip']:null;
$os=(isset($resp['info']['os']))?$resp['info']['os']:null;
$hostName=(isset($resp['info']['hostName']))?$resp['info']['hostName']:null;
$info = new Aliyun_Log_Models_Machine_Info($ip,$os,$hostName);
}
$status = null;
if(isset($resp['status'])){
$binaryCurVersion=(isset($resp['status']['binaryCurVersion']))?$resp['status']['binaryCurVersion']:null;
$binaryDeployVersion=(isset($resp['status']['binaryDeployVersion']))?$resp['status']['binaryDeployVersion']:null;
$status = new Aliyun_Log_Models_Machine_Status($binaryCurVersion,$binaryDeployVersion);
}
$uuid=(isset($resp['uuid']))?$resp['uuid']:null;
$lastHeartbeatTime=(isset($resp['lastHeartbeatTime']))?$resp['lastHeartbeatTime']:null;
$createTime=(isset($resp['createTime']))?$resp['createTime']:null;
$lastModifyTime=(isset($resp['lastModifyTime']))?$resp['lastModifyTime']:null;
$this->setUuid($uuid);
$this->setLastHeartbeatTime($lastHeartbeatTime);
$this->setInfo($info);
$this->setStatus($status);
$this->setCreateTime($createTime);
$this->setLastModifyTime($lastModifyTime);
}
}

@ -0,0 +1,132 @@
<?php
/**
* Copyright (C) Alibaba Cloud Computing
* All rights reserved
*/
class Aliyun_Log_Models_MachineGroup_GroupAttribute {
public $externalName;
public $groupTopic;
public function __construct($externalName=null,$groupTopic=null){
$this->externalName = $externalName;
$this->groupTopic = $groupTopic;
}
public function toArray(){
$resArray = array();
if($this->externalName!==null)
$resArray['externalName'] = $this->externalName;
if($this->groupTopic!==null)
$resArray['groupTopic'] = $this->groupTopic;
return $resArray;
}
}
class Aliyun_Log_Models_MachineGroup {
private $groupName;
private $groupType;
private $groupAttribute;
private $machineList;
private $createTime;
private $lastModifyTime;
public function __construct($groupName='',$groupType='',$groupAttribute=null,
$machineList=null,$createTime=null,$lastModifyTime=null) {
$this->groupName = $groupName;
$this->groupType = $groupType;
$this->groupAttribute = $groupAttribute;
$this->machineList = $machineList;
$this->createTime = $createTime;
$this->lastModifyTime = $lastModifyTime;
}
public function getGroupName(){
return $this->groupName;
}
public function setGroupName($groupName){
$this->groupName = $groupName;
}
public function getGroupType(){
return $this->groupType;
}
public function setGroupType($groupType){
$this->groupType = $groupType;
}
public function getGroupAttribute(){
return $this->groupAttribute;
}
public function setGroupAttribute($groupAttribute){
$this->groupAttribute = $groupAttribute;
}
public function getMachineList(){
return $this->machineList;
}
public function setMachineList($machineList){
$this->machineList = $machineList;
}
public function getCreateTime(){
return $this->createTime;
}
public function setCreateTime($createTime){
$this->createTime = $createTime;
}
public function getLastModifyTime(){
return $this->lastModifyTime;
}
public function setLastModifyTime($lastModifyTime){
$this->lastModifyTime = $lastModifyTime;
}
public function toArray(){
$format_array = array();
if($this->groupName!==null)
$format_array['groupName'] = $this->groupName;
if($this->groupType!==null)
$format_array['groupType'] = $this->groupType;
if($this->groupAttribute!==null)
$format_array['groupAttribute'] = $this->groupAttribute->toArray();
if($this->machineList!==null){
$mlArr = array();
foreach($this->machineList as $value){
$mlArr[] = $value->toArray();
}
$format_array['machineList'] = $mlArr;
}
if($this->createTime!==null)
$format_array['createTime'] = $this->createTime;
if($this->lastModifyTime!==null)
$format_array['lastModifyTime'] = $this->lastModifyTime;
return $format_array;
}
public function setFromArray($resp){
$groupAttribute = null;
if(isset($resp['groupAttribute'])){
$groupAttributeArr = $resp['groupAttribute'];
$groupAttribute = new Aliyun_Log_Models_MachineGroup_GroupAttribute();
if(isset($groupAttributeArr['externalName']))
$groupAttribute->externalName = $groupAttributeArr['externalName'];
if(isset($groupAttributeArr['groupTopic']))
$groupAttribute->groupTopic = $groupAttributeArr['groupTopic'];
}
$groupName = ($resp['groupName']!==null)?$resp['groupName']:null;
$groupType = ($resp['groupType']!==null)?$resp['groupType']:null;
$machineList = array();
if(isset($resp['machineList']) && is_array($resp['machineList']) && count($resp['machineList'])>0){
foreach($resp['machineList'] as $value){
$machine = new Aliyun_Log_Models_Machine();
$machine->setFromArray($value);
$machineList[] = $machine;
}
}
$createTime = ($resp['createTime']!==null)?$resp['createTime']:null;
$lastModifyTime = ($resp['lastModifyTime']!==null)?$resp['lastModifyTime']:null;
$this->setGroupName($groupName);
$this->setGroupType($groupType);
$this->setGroupAttribute($groupAttribute);
$this->setMachineList($machineList);
$this->setCreateTime($createTime);
$this->setLastModifyTime($lastModifyTime);
}
}

@ -0,0 +1,166 @@
<?php
/**
* Copyright (C) Alibaba Cloud Computing
* All rights reserved
*/
class Aliyun_Log_Models_OssShipperConfig{
private $ossBucket;
private $ossPrefix;
private $bufferInterval = 300;
private $bufferSize;
private $compressType;
private $roleArn;
private $pathFormat;
private $storage;
/**
* @return mixed
*/
public function getRoleArn()
{
return $this->roleArn;
}
/**
* @param mixed $roleArn
*/
public function setRoleArn($roleArn)
{
$this->roleArn = $roleArn;
}
/**
* @return mixed
*/
public function getPathFormat()
{
return $this->pathFormat;
}
/**
* @param mixed $pathFormat
*/
public function setPathFormat($pathFormat)
{
$this->pathFormat = $pathFormat;
}
/**
* @return mixed
*/
public function getStorage()
{
return $this->storage;
}
/**
* @param mixed $storage
*/
public function setStorage($storage)
{
$this->storage = $storage;
}
/**
* @return mixed
*/
public function getOssBucket()
{
return $this->ossBucket;
}
/**
* @param mixed $ossBucket
*/
public function setOssBucket($ossBucket)
{
$this->ossBucket = $ossBucket;
}
/**
* @return mixed
*/
public function getOssPrefix()
{
return $this->ossPrefix;
}
/**
* @param mixed $ossPrefix
*/
public function setOssPrefix($ossPrefix)
{
$this->ossPrefix = $ossPrefix;
}
/**
* @return mixed
*/
public function getBufferInterval()
{
return $this->bufferInterval;
}
/**
* @param mixed $bufferInterval
*/
public function setBufferInterval($bufferInterval)
{
$this->bufferInterval = $bufferInterval;
}
/**
* @return mixed
*/
public function getBufferSize()
{
return $this->bufferSize;
}
/**
* @param mixed $bufferSize
*/
public function setBufferSize($bufferSize)
{
if($bufferSize > 256 || $bufferSize < 5){
throw new Exception("buffSize is not valide, must between 5 and 256");
}
$this->bufferSize = $bufferSize;
}
/**
* @return mixed
*/
public function getCompressType()
{
return $this->compressType;
}
/**
* @param mixed $compressType
*/
public function setCompressType($compressType)
{
$this->compressType = $compressType;
}
public function to_json_object() {
$json = array(
'ossBucket' => $this->ossBucket,
'ossPrefix' => $this->ossPrefix,
'bufferInterval' => $this->bufferInterval,
'bufferSize' => $this->bufferSize,
'compressType' => $this->compressType,
'roleArn' => $this->roleArn,
'pathFormat' => $this->pathFormat,
'storage' => $this->storage->to_json_object()
);
if($this->storage->getFormat() == 'json'){
unset($json['storage']);
}
return $json;
}
}

@ -0,0 +1,107 @@
<?php
/**
* Copyright (C) Alibaba Cloud Computing
* All rights reserved
*/
class Aliyun_Log_Models_OssShipperCsvStorage extends Aliyun_Log_Models_OssShipperStorage{
private $columns;
private $delimiter = ',';
private $quote = '';
private $nullIdentifier = '';
private $header = false;
/**
* @return mixed
*/
public function getColumns()
{
return $this->columns;
}
/**
* @param mixed $columns
*/
public function setColumns($columns)
{
$this->columns = $columns;
}
/**
* @return string
*/
public function getDelimiter(): string
{
return $this->delimiter;
}
/**
* @param string $delimiter
*/
public function setDelimiter(string $delimiter)
{
$this->delimiter = $delimiter;
}
/**
* @return string
*/
public function getQuote(): string
{
return $this->quote;
}
/**
* @param string $quote
*/
public function setQuote(string $quote)
{
$this->quote = $quote;
}
/**
* @return string
*/
public function getNullIdentifier(): string
{
return $this->nullIdentifier;
}
/**
* @param string $nullIdentifier
*/
public function setNullIdentifier(string $nullIdentifier)
{
$this->nullIdentifier = $nullIdentifier;
}
/**
* @return bool
*/
public function isHeader(): bool
{
return $this->header;
}
/**
* @param bool $header
*/
public function setHeader(bool $header)
{
$this->header = $header;
}
public function to_json_object(){
$detail = array(
'columns' => $this->columns,
'delimiter' => $this->delimiter,
'quote' => $this->quote,
'nullIdentifier' => $this->nullIdentifier,
'header' => $this->header
);
return array(
'detail' => $detail,
'format' => parent::getFormat()
);
}
}

@ -0,0 +1,12 @@
<?php
/**
* Copyright (C) Alibaba Cloud Computing
* All rights reserved
*/
class Aliyun_Log_Models_OssShipperJsonStorage extends Aliyun_Log_Models_OssShipperStorage{
public function to_json_object(){
return array();
}
}

@ -0,0 +1,35 @@
<?php
/**
* Copyright (C) Alibaba Cloud Computing
* All rights reserved
*/
class Aliyun_Log_Models_OssShipperParquetStorage extends Aliyun_Log_Models_OssShipperStorage{
private $columns;
/**
* @return mixed
*/
public function getColumns()
{
return $this->columns;
}
/**
* @param mixed $columns
*/
public function setColumns($columns)
{
$this->columns = $columns;
}
public function to_json_object(){
$detail = array(
'columns' => $this->columns
);
return array(
'detail' => $detail,
'format' => parent::getFormat()
);
}
}

@ -0,0 +1,27 @@
<?php
/**
* Copyright (C) Alibaba Cloud Computing
* All rights reserved
*/
class Aliyun_Log_Models_OssShipperStorage{
private $format;
/**
* @return mixed
*/
public function getFormat()
{
return $this->format;
}
/**
* @param mixed $format
*/
public function setFormat($format)
{
$this->format = $format;
}
}

@ -0,0 +1,39 @@
<?php
/**
* Copyright (C) Alibaba Cloud Computing
* All rights reserved
*/
require_once realpath(dirname(__FILE__) . '/Request.php');
/**
*
*
* @author log service dev
*/
class Aliyun_Log_Models_ApplyConfigToMachineGroupRequest extends Aliyun_Log_Models_Request {
private $groupName;
private $configName;
/**
* Aliyun_Log_Models_ApplyConfigToMachineGroupRequest Constructor
*
*/
public function __construct($groupName=null,$configName=null) {
$this->groupName = $groupName;
$this->configName = $configName;
}
public function getGroupName(){
return $this->groupName;
}
public function setGroupName($groupName){
$this->groupName = $groupName;
}
public function getConfigName(){
return $this->configName;
}
public function setConfigName($configName){
$this->configName = $configName;
}
}

@ -0,0 +1,160 @@
<?php
/**
* Copyright (C) Alibaba Cloud Computing
* All rights reserved
*/
require_once realpath(dirname(__FILE__) . '/Request.php');
/**
* The request used to get logs by logstore and shardId from log service.
*
* @author log service dev
*/
class Aliyun_Log_Models_BatchGetLogsRequest extends Aliyun_Log_Models_Request {
/**
* @var string logstore name
*/
private $logstore;
/**
* @var string shard ID
*/
private $shardId;
/**
* @var integer max line number of return logs
*/
private $count;
/**
* @var string start cursor
*/
private $cursor;
/**
* @var string end cursor
*/
private $endCursor;
/**
* Aliyun_Log_Models_BatchGetLogsRequest Constructor
*
* @param string $project
* project name
* @param string $logStore
* logstore name
* @param string $shardId
* shard ID
* @param integer $count
* return max loggroup numbers
* @param string $cursor
* start cursor
* @param string $end_cursor
* end cursor
*/
public function __construct($project = null, $logstore = null, $shardId = null, $count = null, $cursor = null, $end_cursor = null) {
parent::__construct ( $project );
$this->logstore = $logstore;
$this->shardId = $shardId;
$this->count = $count;
$this->cursor = $cursor;
$this->endCursor = $end_cursor;
}
/**
* Get logstore name
*
* @return string logstore name
*/
public function getLogstore() {
return $this->logstore;
}
/**
* Set logstore name
*
* @param string $logstore
* logstore name
*/
public function setLogstore($logstore) {
$this->logstore = $logstore;
}
/**
* Get shard ID
*
* @return string shardId
*/
public function getShardId() {
return $this->shardId;
}
/**
* Set shard ID
*
* @param string $shardId
* shard ID
*/
public function setShardId($shardId) {
$this->shardId = $shardId;
}
/**
* Get max return loggroup number
*
* @return integer count
*/
public function getCount() {
return $this->count;
}
/**
* Set max return loggroup number
*
* @param integer $count
* max return loggroup number
*/
public function setCount($count) {
$this->count = $count;
}
/**
* Get start cursor
*
* @return string cursor
*/
public function getCursor() {
return $this->cursor;
}
/**
* Get end cursor
*
* @return string cursor
*/
public function getEndCursor() {
return $this->endCursor;
}
/**
* Set start cursor
*
* @param string $cursor
* start cursor
*/
public function setCursor($cursor) {
$this->cursor = $cursor;
}
/**
* Set end cursor
*
* @param string $cursor
* end cursor
*/
public function setEndCursor($cursor) {
$this->endCursor = $cursor;
}
}

@ -0,0 +1,32 @@
<?php
/**
* Copyright (C) Alibaba Cloud Computing
* All rights reserved
*/
require_once realpath(dirname(__FILE__) . '/Request.php');
/**
*
*
* @author log service dev
*/
class Aliyun_Log_Models_CreateACLRequest extends Aliyun_Log_Models_Request {
private $acl;
/**
* Aliyun_Log_Models_CreateACLRequest Constructor
*
*/
public function __construct($acl=null) {
$this->acl = $acl;
}
public function getAcl(){
return $this->acl;
}
public function setAcl($acl){
$this->acl = $acl;
}
}

@ -0,0 +1,35 @@
<?php
/**
* Copyright (C) Alibaba Cloud Computing
* All rights reserved
*/
require_once realpath(dirname(__FILE__) . '/Request.php');
/**
*
*
* @author log service dev
*/
class Aliyun_Log_Models_CreateConfigRequest extends Aliyun_Log_Models_Request {
private $config;
/**
* Aliyun_Log_Models_CreateConfigRequest Constructor
*
*/
public function __construct($config) {
$this->config = $config;
}
public function getConfig(){
return $this->config;
}
public function setConfig($config){
$this->config = $config;
}
}

@ -0,0 +1,42 @@
<?php
/**
* Copyright (C) Alibaba Cloud Computing
* All rights reserved
*/
require_once realpath(dirname(__FILE__) . '/Request.php');
/**
* The request used to create logstore from log service.
*
* @author log service dev
*/
class Aliyun_Log_Models_CreateLogstoreRequest extends Aliyun_Log_Models_Request{
private $logstore;
private $ttl;
private $shardCount;
/**
* Aliyun_Log_Models_CreateLogstoreRequest constructor
*
* @param string $project project name
*/
public function __construct($project=null,$logstore = null,$ttl = null,$shardCount = null) {
parent::__construct($project);
$this -> logstore = $logstore;
$this -> ttl = $ttl;
$this -> shardCount = $shardCount;
}
public function getLogstore()
{
return $this -> logstore;
}
public function getTtl()
{
return $this -> ttl;
}
public function getShardCount()
{
return $this -> shardCount;
}
}

@ -0,0 +1,31 @@
<?php
/**
* Copyright (C) Alibaba Cloud Computing
* All rights reserved
*/
require_once realpath(dirname(__FILE__) . '/Request.php');
/**
*
*
* @author log service dev
*/
class Aliyun_Log_Models_CreateMachineGroupRequest extends Aliyun_Log_Models_Request {
private $machineGroup;
/**
* Aliyun_Log_Models_CreateMachineGroupRequest Constructor
*
*/
public function __construct($machineGroup=null) {
$this->machineGroup = $machineGroup;
}
public function getMachineGroup(){
return $this->machineGroup;
}
public function setMachineGroup($machineGroup){
$this->machineGroup = $machineGroup;
}
}

@ -0,0 +1,94 @@
<?php
/**
* Copyright (C) Alibaba Cloud Computing
* All rights reserved
*/
require_once realpath(dirname(__FILE__) . '/Request.php');
/**
*
*
* @author log service dev
*/
class Aliyun_Log_Models_CreateShipperRequest extends Aliyun_Log_Models_Request {
private $shipperName;
private $targetType;
private $targetConfigration;
private $logStore;
/**
* @return mixed
*/
public function getLogStore()
{
return $this->logStore;
}
/**
* @param mixed $logStore
*/
public function setLogStore($logStore)
{
$this->logStore = $logStore;
}
/**
* Aliyun_Log_Models_CreateShipperRequest Constructor
*
*/
public function __construct($project) {
parent::__construct ( $project );
}
/**
* @return mixed
*/
public function getShipperName()
{
return $this->shipperName;
}
/**
* @param mixed $shipperName
*/
public function setShipperName($shipperName)
{
$this->shipperName = $shipperName;
}
/**
* @return mixed
*/
public function getTargetType()
{
return $this->targetType;
}
/**
* @param mixed $targetType
*/
public function setTargetType($targetType)
{
$this->targetType = $targetType;
}
/**
* @return mixed
*/
public function getTargetConfigration()
{
return $this->targetConfigration;
}
/**
* @param mixed $targetConfigration
*/
public function setTargetConfigration($targetConfigration)
{
$this->targetConfigration = $targetConfigration;
}
}

@ -0,0 +1,31 @@
<?php
/**
* Copyright (C) Alibaba Cloud Computing
* All rights reserved
*/
require_once realpath(dirname(__FILE__) . '/Request.php');
/**
*
*
* @author log service dev
*/
class Aliyun_Log_Models_DeleteACLRequest extends Aliyun_Log_Models_Request {
private $aclId;
/**
* Aliyun_Log_Models_DeleteACLRequest Constructor
*
*/
public function __construct($aclId=null) {
$this->aclId = $aclId;
}
public function getAclId(){
return $this->aclId;
}
public function setAclId($aclId){
$this->aclId = $aclId;
}
}

@ -0,0 +1,33 @@
<?php
/**
* Copyright (C) Alibaba Cloud Computing
* All rights reserved
*/
require_once realpath(dirname(__FILE__) . '/Request.php');
/**
*
*
* @author log service dev
*/
class Aliyun_Log_Models_DeleteConfigRequest extends Aliyun_Log_Models_Request {
private $configName;
/**
* Aliyun_Log_Models_DeleteConfigRequest Constructor
*
*/
public function __construct($configName=null) {
$this->configName = $configName;
}
public function getConfigName(){
return $this->configName;
}
public function setConfigName($configName){
$this->configName=$configName;
}
}

@ -0,0 +1,30 @@
<?php
/**
* Copyright (C) Alibaba Cloud Computing
* All rights reserved
*/
require_once realpath(dirname(__FILE__) . '/Request.php');
/**
* The request used to delete logstore from log service.
*
* @author log service dev
*/
class Aliyun_Log_Models_DeleteLogstoreRequest extends Aliyun_Log_Models_Request{
private $logstore;
/**
* Aliyun_Log_Models_DeleteLogstoreRequest constructor
*
* @param string $project project name
*/
public function __construct($project=null,$logstore = null) {
parent::__construct($project);
$this -> logstore = $logstore;
}
public function getLogstore()
{
return $this -> logstore;
}
}

@ -0,0 +1,34 @@
<?php
/**
* Copyright (C) Alibaba Cloud Computing
* All rights reserved
*/
require_once realpath(dirname(__FILE__) . '/Request.php');
/**
*
*
* @author log service dev
*/
class Aliyun_Log_Models_DeleteMachineGroupRequest extends Aliyun_Log_Models_Request {
private $groupName;
/**
* Aliyun_Log_Models_DeleteMachineGroupRequest Constructor
*
*/
public function __construct($groupName) {
$this->groupName = $groupName;
}
public function getGroupName(){
return $this->groupName;
}
public function setGroupName($groupName){
$this->groupName = $groupName;
}
}

@ -0,0 +1,39 @@
<?php
/**
* Copyright (C) Alibaba Cloud Computing
* All rights reserved
*/
require_once realpath(dirname(__FILE__) . '/Request.php');
/**
*
*
* @author log service dev
*/
class Aliyun_Log_Models_DeleteShardRequest extends Aliyun_Log_Models_Request {
private $logstore;
/**
* Aliyun_Log_Models_DeleteShardRequest Constructor
*
*/
public function __construct($project,$logstore,$shardId) {
parent::__construct ( $project );
$this->logstore = $logstore;
$this->shardId = $shardId;
}
public function getLogstore(){
return $this->logstore;
}
public function setLogstore($logstore){
$this->logstore = $logstore;
}
public function getShardId(){
return $this->shardId;
}
}

@ -0,0 +1,53 @@
<?php
/**
* Copyright (C) Alibaba Cloud Computing
* All rights reserved
*/
require_once realpath(dirname(__FILE__) . '/Request.php');
class Aliyun_Log_Models_DeleteShipperRequest extends Aliyun_Log_Models_Request {
private $shipperName;
private $logStore;
/**
* @return mixed
*/
public function getLogStore()
{
return $this->logStore;
}
/**
* @param mixed $logStore
*/
public function setLogStore($logStore)
{
$this->logStore = $logStore;
}
/**
* @return mixed
*/
public function getShipperName()
{
return $this->shipperName;
}
/**
* @param mixed $shipperName
*/
public function setShipperName($shipperName)
{
$this->shipperName = $shipperName;
}
/**
* Aliyun_Log_Models_CreateShipperRequest Constructor
*
*/
public function __construct($project) {
parent::__construct ( $project );
}
}

@ -0,0 +1,30 @@
<?php
/**
* Copyright (C) Alibaba Cloud Computing
* All rights reserved
*/
require_once realpath(dirname(__FILE__) . '/Request.php');
/**
*
*
* @author log service dev
*/
class Aliyun_Log_Models_GetACLRequest extends Aliyun_Log_Models_Request {
private $aclId;
/**
* Aliyun_Log_Models_GetACLRequest Constructor
*
*/
public function __construct($aclId=null) {
$this->aclId = $aclId;
}
public function getAclId(){
return $this->aclId;
}
public function setAclId($aclId){
$this->aclId = $aclId;
}
}

@ -0,0 +1,34 @@
<?php
/**
* Copyright (C) Alibaba Cloud Computing
* All rights reserved
*/
require_once realpath(dirname(__FILE__) . '/Request.php');
/**
*
*
* @author log service dev
*/
class Aliyun_Log_Models_GetConfigRequest extends Aliyun_Log_Models_Request {
private $configName;
/**
* Aliyun_Log_Models_GetConfigRequest Constructor
*
*/
public function __construct($configName = null) {
$this->configName = $configName;
}
public function getConfigName(){
return $this->configName;
}
public function setConfigName($configName){
$this->configName = $configName;
}
}

@ -0,0 +1,138 @@
<?php
/**
* Copyright (C) Alibaba Cloud Computing
* All rights reserved
*/
require_once realpath(dirname(__FILE__) . '/Request.php');
/**
* The request used to get cursor by fromTime or begin/end mode
*
* @author log service dev
*/
class Aliyun_Log_Models_GetCursorRequest extends Aliyun_Log_Models_Request {
/**
* @var string logstore name
*/
private $logstore;
/**
* @var string shard id
*/
private $shardId;
//mode and fromTime: choose one and another remains null
/**
* @var string value should be 'begin' or 'end'
* begin:return cursor point to first loggroup
* end:return cursor point to position after last loggroup
* if $mode is set to not null,$fromTime must be set null
*/
private $mode;
/**
* @var integer unix_timestamp
* return cursor point to first loggroup whose time after $fromTime
*/
private $fromTime;
/**
* Aliyun_Log_Models_GetCursorRequest Constructor
* @param string $project
* project name
* @param string $logstore
* logstore name
* @param string $shardId
* shard id
* @param string $mode
* query mode,value must be 'begin' or 'end'
* @param string $fromTime
* query by from time,unix_timestamp
*/
public function __construct($project,$logstore,$shardId,$mode=null,$fromTime=-1) {
parent::__construct ( $project );
$this->logstore = $logstore;
$this->shardId = $shardId;
$this->mode = $mode;
$this->fromTime = $fromTime;
}
/**
* Get logstore name
*
* @return string logstore name
*/
public function getLogstore(){
return $this->logstore;
}
/**
* Set logstore name
*
* @param string $logstore
* logstore name
*/
public function setLogstore($logstore){
$this->logstore = $logstore;
}
/**
* Get shard id
*
* @return string shard id
*/
public function getShardId(){
return $this->shardId;
}
/**
* Set shard id
*
* @param string $shardId
* shard id
*/
public function setShardId($shardId){
$this->shardId = $shardId;
}
/**
* Get mode
*
* @return string mode
*/
public function getMode(){
return $this->mode;
}
/**
* Set mode
*
* @param string $mode
* value must be 'begin' or 'end'
*/
public function setMode($mode){
$this->mode = $mode;
}
/**
* Get from time
*
* @return integer(unix_timestamp) from time
*/
public function getFromTime(){
return $this->fromTime;
}
/**
* Set from time
*
* @param integer $fromTime
* from time (unix_timestamp)
*/
public function setFromTime($fromTime){
$this->fromTime = $fromTime;
}
}

@ -0,0 +1,161 @@
<?php
/**
* Copyright (C) Alibaba Cloud Computing
* All rights reserved
*/
require_once realpath(dirname(__FILE__) . '/Request.php');
/**
* The request used to get histograms of a query from log service.
*
* @author log service dev
*/
class Aliyun_Log_Models_GetHistogramsRequest extends Aliyun_Log_Models_Request {
/**
* @var string logstore name
*/
private $logstore;
/**
* @var string topic name of logs
*/
private $topic;
/**
* @var integer the begin time
*/
private $from;
/**
* @var integer the end time
*/
private $to;
/**
* @var string user defined query
*/
private $query;
/**
* Aliyun_Log_Models_GetHistogramsRequest constructor
*
* @param string $project
* project name
* @param string $logstore
* logstore name
* @param integer $from
* the begin time
* @param integer $to
* the end time
* @param string $topic
* topic name of logs
* @param string $query
* user defined query
*/
public function __construct($project = null, $logstore = null, $from = null, $to = null, $topic = null, $query = null) {
parent::__construct ( $project );
$this->logstore = $logstore;
$this->from = $from;
$this->to = $to;
$this->topic = $topic;
$this->query = $query;
}
/**
* Get logstore name
*
* @return string logstore name
*/
public function getLogstore() {
return $this->logstore;
}
/**
* Set logstore name
*
* @param string $logstore
* logstore name
*/
public function setLogstore($logstore) {
$this->logstore = $logstore;
}
/**
* Get topic name
*
* @return string topic name
*/
public function getTopic() {
return $this->topic;
}
/**
* Set topic name
*
* @param string $topic
* topic name
*/
public function setTopic($topic) {
$this->topic = $topic;
}
/**
* Get begin time
*
* @return integer begin time
*/
public function getFrom() {
return $this->from;
}
/**
* Set begin time
*
* @param integer $from
* begin time
*/
public function setFrom($from) {
$this->from = $from;
}
/**
* Get end time
*
* @return integer end time
*/
public function getTo() {
return $this->to;
}
/**
* Set end time
*
* @param integer $to
* end time
*/
public function setTo($to) {
$this->to = $to;
}
/**
* Get user defined query
*
* @return string user defined query
*/
public function getQuery() {
return $this->query;
}
/**
* Set user defined query
*
* @param string $query
* user defined query
*/
public function setQuery($query) {
$this->query = $query;
}
}

@ -0,0 +1,242 @@
<?php
/**
* Copyright (C) Alibaba Cloud Computing
* All rights reserved
*/
require_once realpath(dirname(__FILE__) . '/Request.php');
/**
* The request used to get logs by a query from log service.
*
* @author log service dev
*/
class Aliyun_Log_Models_GetLogsRequest extends Aliyun_Log_Models_Request {
/**
* @var string logstore name
*/
private $logstore;
/**
* @var string topic name of logs
*/
private $topic;
/**
* @var integer the begin time
*/
private $from;
/**
* @var integer the end time
*/
private $to;
/**
* @var string user defined query
*/
private $query;
/**
* @var integer max line number of return logs
*/
private $line;
/**
* @var integer line offset of return logs
*/
private $offset;
/**
* @var bool if reverse is set to true, the query will return the latest logs first
*/
private $reverse;
/**
* Aliyun_Log_Models_GetLogsRequest Constructor
*
* @param string $project
* project name
* @param string $logStore
* logstore name
* @param integer $from
* the begin time
* @param integer $to
* the end time
* @param string $topic
* topic name of logs
* @param string $query
* user defined query
* @param integer $line
* query return line number
* @param integer $offset
* the log offset to return
* @param bool $reverse
* if reverse is set to true, the query will return the latest logs first
*/
public function __construct($project = null, $logstore = null, $from = null, $to = null, $topic = null, $query = null, $line = null, $offset = null, $reverse = null) {
parent::__construct ( $project );
$this->logstore = $logstore;
$this->from = $from;
$this->to = $to;
$this->topic = $topic;
$this->query = $query;
$this->line = $line;
$this->offset = $offset;
$this->reverse = $reverse;
}
/**
* Get logstore name
*
* @return string logstore name
*/
public function getLogstore() {
return $this->logstore;
}
/**
* Set logstore name
*
* @param string $logstore
* logstore name
*/
public function setLogstore($logstore) {
$this->logstore = $logstore;
}
/**
* Get topic name
*
* @return string topic name
*/
public function getTopic() {
return $this->topic;
}
/**
* Set topic name
*
* @param string $topic
* topic name
*/
public function setTopic($topic) {
$this->topic = $topic;
}
/**
* Get begin time
*
* @return integer begin time
*/
public function getFrom() {
return $this->from;
}
/**
* Set begin time
*
* @param integer $from
* begin time
*/
public function setFrom($from) {
$this->from = $from;
}
/**
* Get end time
*
* @return integer end time
*/
public function getTo() {
return $this->to;
}
/**
* Set end time
*
* @param integer $to
* end time
*/
public function setTo($to) {
$this->to = $to;
}
/**
* Get user defined query
*
* @return string user defined query
*/
public function getQuery() {
return $this->query;
}
/**
* Set user defined query
*
* @param string $query
* user defined query
*/
public function setQuery($query) {
$this->query = $query;
}
/**
* Get max line number of return logs
*
* @return integer max line number of return logs
*/
public function getLine() {
return $this->line;
}
/**
* Set max line number of return logs
*
* @param integer $line
* max line number of return logs
*/
public function setLine($line) {
$this->line = $line;
}
/**
* Get line offset of return logs
*
* @return integer line offset of return logs
*/
public function getOffset() {
return $this->offset;
}
/**
* Set request line offset of return logs
*
* @param integer $offset
* line offset of return logs
*/
public function setOffset($offset) {
$this->offset = $offset;
}
/**
* Get request reverse flag
*
* @return bool reverse flag
*/
public function getReverse() {
return $this->reverse;
}
/**
* Set request reverse flag
*
* @param bool $reverse
* reverse flag
*/
public function setReverse($reverse) {
$this->reverse = $reverse;
}
}

@ -0,0 +1,31 @@
<?php
/**
* Copyright (C) Alibaba Cloud Computing
* All rights reserved
*/
require_once realpath(dirname(__FILE__) . '/Request.php');
/**
*
*
* @author log service dev
*/
class Aliyun_Log_Models_GetMachineGroupRequest extends Aliyun_Log_Models_Request {
private $groupName;
/**
* Aliyun_Log_Models_GetMachineGroupRequest Constructor
*
*/
public function __construct($groupName=null) {
$this->groupName = $groupName;
}
public function getGroupName(){
return $this->groupName;
}
public function setGroupName($groupName){
$this->groupName = $groupName;
}
}

@ -0,0 +1,34 @@
<?php
/**
* Copyright (C) Alibaba Cloud Computing
* All rights reserved
*/
require_once realpath(dirname(__FILE__) . '/Request.php');
/**
*
*
* @author log service dev
*/
class Aliyun_Log_Models_GetMachineRequest extends Aliyun_Log_Models_Request {
private $uuid;
/**
* Aliyun_Log_Models_GetMachineRequest Constructor
*
*/
public function __construct($uuid=null) {
$this->uuid = $uuid;
}
public function getUuid(){
return $this->uuid;
}
public function setUuid($uuid){
$this->uuid = $uuid;
}
}

@ -0,0 +1,45 @@
<?php
/**
* Copyright (C) Alibaba Cloud Computing
* All rights reserved
*/
require_once realpath(dirname(__FILE__) . '/Request.php');
/**
* The request used to get logs by a query from log service.
*
* @author log service dev
*/
class Aliyun_Log_Models_GetProjectLogsRequest extends Aliyun_Log_Models_Request {
/**
* @var string user defined query
*/
private $query;
/**
* Aliyun_Log_Models_GetProjectLogsRequest Constructor
* @param string $query
* user defined query
*/
public function __construct($project = null, $query = null ) {
parent::__construct ( $project );
$this->query = $query;
}
/**
* Get user defined query
*
* @return string user defined query
*/
public function getQuery() {
return $this->query;
}
}

@ -0,0 +1,53 @@
<?php
/**
* Copyright (C) Alibaba Cloud Computing
* All rights reserved
*/
require_once realpath(dirname(__FILE__) . '/Request.php');
class Aliyun_Log_Models_GetShipperConfigRequest extends Aliyun_Log_Models_Request {
private $shipperName;
private $logStore;
/**
* @return mixed
*/
public function getLogStore()
{
return $this->logStore;
}
/**
* @param mixed $logStore
*/
public function setLogStore($logStore)
{
$this->logStore = $logStore;
}
/**
* @return mixed
*/
public function getShipperName()
{
return $this->shipperName;
}
/**
* @param mixed $shipperName
*/
public function setShipperName($shipperName)
{
$this->shipperName = $shipperName;
}
/**
* Aliyun_Log_Models_CreateShipperRequest Constructor
*
*/
public function __construct($project) {
parent::__construct ( $project );
}
}

@ -0,0 +1,146 @@
<?php
/**
* Copyright (C) Alibaba Cloud Computing
* All rights reserved
*/
require_once realpath(dirname(__FILE__) . '/Request.php');
class Aliyun_Log_Models_GetShipperTasksRequest extends Aliyun_Log_Models_Request{
private $shipperName;
private $logStore;
private $startTime;
private $endTime;
/**
* @var support one of ['', 'fail', 'success', 'running'] , if the status_type = '' , return all kinds of status type
*/
private $statusType;
private $offset;
private $size;
/**
* @return mixed
*/
public function getStartTime()
{
return $this->startTime;
}
/**
* @param mixed $startTime
*/
public function setStartTime($startTime)
{
$this->startTime = $startTime;
}
/**
* @return mixed
*/
public function getEndTime()
{
return $this->endTime;
}
/**
* @param mixed $endTime
*/
public function setEndTime($endTime)
{
$this->endTime = $endTime;
}
/**
* @return
*/
public function getStatusType()
{
return $this->statusType;
}
/**
* @param $statusType
*/
public function setStatusType($statusType)
{
$this->statusType = $statusType;
}
/**
* @return mixed
*/
public function getOffset()
{
return $this->offset;
}
/**
* @param mixed $offset
*/
public function setOffset($offset)
{
$this->offset = $offset;
}
/**
* @return mixed
*/
public function getSize()
{
return $this->size;
}
/**
* @param mixed $size
*/
public function setSize($size)
{
$this->size = $size;
}
/**
* @return mixed
*/
public function getLogStore()
{
return $this->logStore;
}
/**
* @param mixed $logStore
*/
public function setLogStore($logStore)
{
$this->logStore = $logStore;
}
/**
* @return mixed
*/
public function getShipperName()
{
return $this->shipperName;
}
/**
* @param mixed $shipperName
*/
public function setShipperName($shipperName)
{
$this->shipperName = $shipperName;
}
/**
* Aliyun_Log_Models_CreateShipperRequest Constructor
*
*/
public function __construct($project) {
parent::__construct ( $project );
}
}

@ -0,0 +1,51 @@
<?php
/**
* Copyright (C) Alibaba Cloud Computing
* All rights reserved
*/
require_once realpath(dirname(__FILE__) . '/Request.php');
/**
*
*
* @author log service dev
*/
class Aliyun_Log_Models_ListACLsRequest extends Aliyun_Log_Models_Request {
private $offset;
private $size;
private $principleId;
/**
* Aliyun_Log_Models_ListACLsRequest Constructor
*
*/
public function __construct($principleId=null,$offset=null,$size=null) {
$this->offset = $offset;
$this->size = $size;
$this->principleId = $principleId;
}
public function getOffset(){
return $this->offset;
}
public function setOffset($offset){
$this->offset = $offset;
}
public function getSize(){
return $this->size;
}
public function setSize($size){
$this->size = $size;
}
public function getPrincipleId(){
return $this->principleId;
}
public function setPrincipleId($principleId){
$this->principleId = $principleId;
}
}

@ -0,0 +1,54 @@
<?php
/**
* Copyright (C) Alibaba Cloud Computing
* All rights reserved
*/
require_once realpath(dirname(__FILE__) . '/Request.php');
/**
*
*
* @author log service dev
*/
class Aliyun_Log_Models_ListConfigsRequest extends Aliyun_Log_Models_Request {
private $configName;
private $offset;
private $size;
/**
* Aliyun_Log_Models_ListConfigsRequest Constructor
*
*/
public function __construct($configName=null,$offset=null,$size=null) {
//parent::__construct ( $project );
$this->configName = $configName;
$this->offset = $offset;
$this->size = $size;
}
public function getConfigName(){
return $this->configName;
}
public function setConfigName($configName){
$this->configName = $configName;
}
public function getOffset(){
return $this->offset;
}
public function setOffset($offset){
$this->offset = $offset;
}
public function getSize(){
return $this->size;
}
public function setSize($size){
$this->size = $size;
}
}

@ -0,0 +1,24 @@
<?php
/**
* Copyright (C) Alibaba Cloud Computing
* All rights reserved
*/
require_once realpath(dirname(__FILE__) . '/Request.php');
/**
* The request used to list logstore from log service.
*
* @author log service dev
*/
class Aliyun_Log_Models_ListLogstoresRequest extends Aliyun_Log_Models_Request{
/**
* Aliyun_Log_Models_ListLogstoresRequest constructor
*
* @param string $project project name
*/
public function __construct($project=null) {
parent::__construct($project);
}
}

@ -0,0 +1,53 @@
<?php
/**
* Copyright (C) Alibaba Cloud Computing
* All rights reserved
*/
require_once realpath(dirname(__FILE__) . '/Request.php');
/**
*
*
* @author log service dev
*/
class Aliyun_Log_Models_ListMachineGroupsRequest extends Aliyun_Log_Models_Request {
private $groupName;
private $offset;
private $size;
/**
* Aliyun_Log_Models_ListMachineGroupsRequest Constructor
*
*/
public function __construct($groupName=null,$offset=null,$size=null) {
$this->groupName = $groupName;
$this->offset = $offset;
$this->size = $size;
}
public function getGroupName(){
return $this->groupName;
}
public function setGroupName($groupName){
$this->groupName = $groupName;
}
public function getOffset(){
return $this->offset;
}
public function setOffset($offset){
$this->offset = $offset;
}
public function getSize(){
return $this->size;
}
public function setSize($size){
$this->size = $size;
}
}

@ -0,0 +1,36 @@
<?php
/**
* Copyright (C) Alibaba Cloud Computing
* All rights reserved
*/
require_once realpath(dirname(__FILE__) . '/Request.php');
/**
*
*
* @author log service dev
*/
class Aliyun_Log_Models_ListShardsRequest extends Aliyun_Log_Models_Request {
private $logstore;
/**
* Aliyun_Log_Models_ListShardsRequest Constructor
*
*/
public function __construct($project,$logstore) {
parent::__construct ( $project );
$this->logstore = $logstore;
}
public function getLogstore(){
return $this->logstore;
}
public function setLogstore($logstore){
$this->logstore = $logstore;
}
}

@ -0,0 +1,37 @@
<?php
/**
* Copyright (C) Alibaba Cloud Computing
* All rights reserved
*/
require_once realpath(dirname(__FILE__) . '/Request.php');
class Aliyun_Log_Models_ListShipperRequest extends Aliyun_Log_Models_Request{
private $logStore;
/**
* Aliyun_Log_Models_CreateShipperRequest Constructor
*
*/
public function __construct($project) {
parent::__construct ( $project );
}
/**
* @return mixed
*/
public function getLogStore()
{
return $this->logStore;
}
/**
* @param mixed $logStore
*/
public function setLogStore($logStore)
{
$this->logStore = $logStore;
}
}

@ -0,0 +1,102 @@
<?php
/**
* Copyright (C) Alibaba Cloud Computing
* All rights reserved
*/
require_once realpath(dirname(__FILE__) . '/Request.php');
/**
* The Request used to list topics from log service.
*
* @author log service dev
*/
class Aliyun_Log_Models_ListTopicsRequest extends Aliyun_Log_Models_Request {
/**
* @var string $logstore logstore name
*/
private $logstore;
/**
* @var string $token the start token to list topics
*/
private $token;
/**
* @var integer $line max topic counts to return
*/
private $line;
/**
* Aliyun_Log_Models_ListTopicsRequest constructor
*
* @param string $project project name
* @param string $logstore logstore name
* @param string $token the start token to list topics
* @param integer $line max topic counts to return
*/
public function __construct($project=null, $logstore=null, $token=null, $line=null) {
parent::__construct($project);
$this->logstore = $logstore;
$this->token = $token;
$this->line = $line;
}
/**
* Get logstroe name
*
* @return string logstore name
*/
public function getLogstore() {
return $this->logstore;
}
/**
* Set logstore name
*
* @param string $logstore
* logstore name
*/
public function setLogstore($logstore) {
$this->logstore = $logstore;
}
/**
* Get start token to list topics
*
* @return string start token to list topics
*/
public function getToken() {
return $this->token;
}
/**
* Set start token to list topics
*
* @param string $token start token to list topics
*/
public function setToken($token) {
$this->token = $token;
}
/**
* Get max topic counts to return
*
* @return integer max topic counts to return
*/
public function getLine() {
return $this->line;
}
/**
* Set max topic counts to return
*
* @param integer $line max topic counts to return
*/
public function setLine($line) {
$this->line = $line;
}
}

@ -0,0 +1,39 @@
<?php
/**
* Copyright (C) Alibaba Cloud Computing
* All rights reserved
*/
require_once realpath(dirname(__FILE__) . '/Request.php');
/**
*
*
* @author log service dev
*/
class Aliyun_Log_Models_MergeShardsRequest extends Aliyun_Log_Models_Request {
private $logstore;
/**
* Aliyun_Log_Models_MergeShardsRequest Constructor
*
*/
public function __construct($project,$logstore,$shardId) {
parent::__construct ( $project );
$this->logstore = $logstore;
$this->shardId = $shardId;
}
public function getLogstore(){
return $this->logstore;
}
public function setLogstore($logstore){
$this->logstore = $logstore;
}
public function getShardId(){
return $this->shardId;
}
}

@ -0,0 +1,156 @@
<?php
/**
* Copyright (C) Alibaba Cloud Computing
* All rights reserved
*/
require_once realpath(dirname(__FILE__) . '/Request.php');
/**
* The request used to send data to log server.
*
* @author log service dev
*/
class Aliyun_Log_Models_PutLogsRequest extends Aliyun_Log_Models_Request {
/**
* @var string logstore name
*/
private $logstore;
/**
* @var string topic name
*/
private $topic;
/**
* @var string source of the logs
*/
private $source;
/**
* @var array LogItem array, log data
*/
private $logitems;
/**
* @var string shardKey putlogs shard hash key
*/
private $shardKey;
/**
* Aliyun_Log_Models_PutLogsRequest cnstructor
*
* @param string $project
* project name
* @param string $logstore
* logstore name
* @param string $topic
* topic name
* @param string $source
* source of the log
* @param array $logitems
* LogItem array,log data
*/
public function __construct($project = null, $logstore = null, $topic = null, $source = null, $logitems = null,$shardKey=null) {
parent::__construct ( $project );
$this->logstore = $logstore;
$this->topic = $topic;
$this->source = $source;
$this->logitems = $logitems;
$this->shardKey = $shardKey;
}
/**
* Get logstroe name
*
* @return string logstore name
*/
public function getLogstore() {
return $this->logstore;
}
/**
* Set logstore name
*
* @param string $logstore
* logstore name
*/
public function setLogstore($logstore) {
$this->logstore = $logstore;
}
/**
* Get topic name
*
* @return string topic name
*/
public function getTopic() {
return $this->topic;
}
/**
* Set topic name
*
* @param string $topic
* topic name
*/
public function setTopic($topic) {
$this->topic = $topic;
}
/**
* Get all the log data
*
* @return array LogItem array, log data
*/
public function getLogItems() {
return $this->logitems;
}
/**
* Set the log data
*
* @param array $logitems
* LogItem array, log data
*/
public function setLogItems($logitems) {
$this->logitems = $logitems;
}
/**
* Get log source
*
* @return string log source
*/
public function getSource() {
return $this->source;
}
/**
* set log source
*
* @param string $source
* log source
*/
public function setSource($source) {
$this->source = $source;
}
/**
* set shard key
*
* @param string shardkey
*/
public function setShardKey($key){
$this -> shardKey=$key;
}
/**
* get shard key
*
* @return string shardKey
*/
public function getShardKey(){
return $this ->shardKey;
}
}

@ -0,0 +1,40 @@
<?php
/**
* Copyright (C) Alibaba Cloud Computing
* All rights reserved
*/
require_once realpath(dirname(__FILE__) . '/Request.php');
/**
*
*
* @author log service dev
*/
class Aliyun_Log_Models_RemoveConfigFromMachineGroupRequest extends Aliyun_Log_Models_Request {
private $groupName;
private $configName;
/**
* Aliyun_Log_Models_RemoveConfigFromMachineGroupRequest Constructor
*
*/
public function __construct($groupName=null,$configName=null) {
$this->groupName = $groupName;
$this->configName = $configName;
}
public function getGroupName(){
return $this->groupName;
}
public function setGroupName($groupName){
$this->groupName = $groupName;
}
public function getConfigName(){
return $this->configName;
}
public function setConfigName($configName){
$this->configName = $configName;
}
}

@ -0,0 +1,47 @@
<?php
/**
* Copyright (C) Alibaba Cloud Computing
* All rights reserved
*/
/**
* The base request of all log request.
*
* @author log service dev
*/
class Aliyun_Log_Models_Request {
/**
* @var string project name
*/
private $project;
/**
* Aliyun_Log_Models_Request constructor
*
* @param string $project
* project name
*/
public function __construct($project) {
$this->project = $project;
}
/**
* Get project name
*
* @return string project name
*/
public function getProject() {
return $this->project;
}
/**
* Set project name
*
* @param string $project
* project name
*/
public function setProject($project) {
$this->project = $project;
}
}

@ -0,0 +1,70 @@
<?php
/**
* Copyright (C) Alibaba Cloud Computing
* All rights reserved
*/
require_once realpath(dirname(__FILE__) . '/Request.php');
class Aliyun_Log_Models_RetryShipperTasksRequest extends Aliyun_Log_Models_Request{
private $shipperName;
private $logStore;
private $taskLists;
/**
* @return mixed
*/
public function getTaskLists()
{
return $this->taskLists;
}
/**
* @param mixed $taskLists
*/
public function setTaskLists($taskLists)
{
$this->taskLists = $taskLists;
}
/**
* @return mixed
*/
public function getLogStore()
{
return $this->logStore;
}
/**
* @param mixed $logStore
*/
public function setLogStore($logStore)
{
$this->logStore = $logStore;
}
/**
* @return mixed
*/
public function getShipperName()
{
return $this->shipperName;
}
/**
* @param mixed $shipperName
*/
public function setShipperName($shipperName)
{
$this->shipperName = $shipperName;
}
/**
* Aliyun_Log_Models_CreateShipperRequest Constructor
*
*/
public function __construct($project) {
parent::__construct ( $project );
}
}

@ -0,0 +1,44 @@
<?php
/**
* Copyright (C) Alibaba Cloud Computing
* All rights reserved
*/
require_once realpath(dirname(__FILE__) . '/Request.php');
/**
*
*
* @author log service dev
*/
class Aliyun_Log_Models_SplitShardRequest extends Aliyun_Log_Models_Request {
private $logstore;
/**
* Aliyun_Log_Models_SplitShardRequest Constructor
*
*/
public function __construct($project,$logstore,$shardId,$midHash) {
parent::__construct ( $project );
$this->logstore = $logstore;
$this->shardId = $shardId;
$this->midHash = $midHash;
}
public function getLogstore(){
return $this->logstore;
}
public function setLogstore($logstore){
$this->logstore = $logstore;
}
public function getShardId(){
return $this->shardId;
}
public function getMidHash(){
return $this->midHash;
}
}

@ -0,0 +1,31 @@
<?php
/**
* Copyright (C) Alibaba Cloud Computing
* All rights reserved
*/
require_once realpath(dirname(__FILE__) . '/Request.php');
/**
*
*
* @author log service dev
*/
class Aliyun_Log_Models_UpdateACLRequest extends Aliyun_Log_Models_Request {
private $acl;
/**
* Aliyun_Log_Models_UpdateACLRequest Constructor
*
*/
public function __construct($acl) {
$this->acl = $acl;
}
public function getAcl(){
return $this->acl;
}
public function setAcl($acl){
$this->acl = $acl;
}
}

@ -0,0 +1,33 @@
<?php
/**
* Copyright (C) Alibaba Cloud Computing
* All rights reserved
*/
require_once realpath(dirname(__FILE__) . '/Request.php');
/**
*
*
* @author log service dev
*/
class Aliyun_Log_Models_UpdateConfigRequest extends Aliyun_Log_Models_Request {
private $config;
/**
* Aliyun_Log_Models_UpdateConfigRequest Constructor
*
*/
public function __construct($config) {
$this->config = $config;
}
public function getConfig(){
return $this->config;
}
public function setConfig($config){
$this->config = $config;
}
}

@ -0,0 +1,42 @@
<?php
/**
* Copyright (C) Alibaba Cloud Computing
* All rights reserved
*/
require_once realpath(dirname(__FILE__) . '/Request.php');
/**
* The request used to Update logstore from log service.
*
* @author log service dev
*/
class Aliyun_Log_Models_UpdateLogstoreRequest extends Aliyun_Log_Models_Request{
private $logstore;
private $ttl;
private $shardCount;
/**
* Aliyun_Log_Models_UpdateLogstoreRequest constructor
*
* @param string $project project name
*/
public function __construct($project=null,$logstore = null,$ttl = null,$shardCount = null) {
parent::__construct($project);
$this -> logstore = $logstore;
$this -> ttl = $ttl;
$this -> shardCount = $shardCount;
}
public function getLogstore()
{
return $this -> logstore;
}
public function getTtl()
{
return $this -> ttl;
}
public function getShardCount()
{
return $this -> shardCount;
}
}

@ -0,0 +1,34 @@
<?php
/**
* Copyright (C) Alibaba Cloud Computing
* All rights reserved
*/
require_once realpath(dirname(__FILE__) . '/Request.php');
/**
*
*
* @author log service dev
*/
class Aliyun_Log_Models_UpdateMachineGroupRequest extends Aliyun_Log_Models_Request {
private $machineGroup;
/**
* Aliyun_Log_Models_UpdateMachineGroupRequest Constructor
*
*/
public function __construct($machineGroup) {
$this->machineGroup = $machineGroup;
}
public function getMachineGroup(){
return $this->machineGroup;
}
public function setMachineGroup($machineGroup){
$this->machineGroup = $machineGroup;
}
}

@ -0,0 +1,89 @@
<?php
/**
* Copyright (C) Alibaba Cloud Computing
* All rights reserved
*/
require_once realpath(dirname(__FILE__) . '/Request.php');
class Aliyun_Log_Models_UpdateShipperRequest extends Aliyun_Log_Models_Request{
private $shipperName;
private $targetType;
private $targetConfigration;
private $logStore;
/**
* @return mixed
*/
public function getLogStore()
{
return $this->logStore;
}
/**
* @param mixed $logStore
*/
public function setLogStore($logStore)
{
$this->logStore = $logStore;
}
/**
* Aliyun_Log_Models_CreateShipperRequest Constructor
*
*/
public function __construct($project) {
parent::__construct ( $project );
}
/**
* @return mixed
*/
public function getShipperName()
{
return $this->shipperName;
}
/**
* @param mixed $shipperName
*/
public function setShipperName($shipperName)
{
$this->shipperName = $shipperName;
}
/**
* @return mixed
*/
public function getTargetType()
{
return $this->targetType;
}
/**
* @param mixed $targetType
*/
public function setTargetType($targetType)
{
$this->targetType = $targetType;
}
/**
* @return mixed
*/
public function getTargetConfigration()
{
return $this->targetConfigration;
}
/**
* @param mixed $targetConfigration
*/
public function setTargetConfigration($targetConfigration)
{
$this->targetConfigration = $targetConfigration;
}
}

@ -0,0 +1,29 @@
<?php
/**
* Copyright (C) Alibaba Cloud Computing
* All rights reserved
*/
require_once realpath(dirname(__FILE__) . '/Response.php');
/**
* The response of the GetLog API from log service.
*
* @author log service dev
*/
class Aliyun_Log_Models_ApplyConfigToMachineGroupResponse extends Aliyun_Log_Models_Response {
/**
* Aliyun_Log_Models_ApplyConfigToMachineGroupResponse constructor
*
* @param array $resp
* GetLogs HTTP response body
* @param array $header
* GetLogs HTTP response header
*/
public function __construct($header) {
parent::__construct ( $header );
}
}

@ -0,0 +1,73 @@
<?php
/**
* Copyright (C) Alibaba Cloud Computing
* All rights reserved
*/
require_once realpath(dirname(__FILE__) . '/Response.php');
require_once realpath ( dirname ( __FILE__ ) . '/../../sls.proto.php' );
require_once realpath ( dirname ( __FILE__ ) . '/../../protocolbuffers.inc.php' );
/**
* The response of the GetLog API from log service.
*
* @author log service dev
*/
class Aliyun_Log_Models_BatchGetLogsResponse extends Aliyun_Log_Models_Response {
/**
* @var array compressed Loggroup array
*/
private $logPackageList;
private $nextCursor;
/**
* Aliyun_Log_Models_BatchGetLogsResponse constructor
*
* @param array $resp
* GetLogs HTTP response body
* @param array $header
* GetLogs HTTP response header
*/
public function __construct($resp, $header) {
parent::__construct ( $header );
$this->logPackageList = $resp->getLogGroupListArray();
$this->nextCursor = (isset($header['x-log-cursor']))?$header['x-log-cursor']:null;
}
public function getLogPackageList(){
return $this->logPackageList;
}
public function getNextCursor(){
return $this->nextCursor;
}
public function getCount() {
return count($this->logPackageList);
}
public function getLogPackage($index){
if($index<$this->getCount()){
return $this->logPackageList[$index];
}
else{
throw new OutOfBoundsException('Index must less than size of logPackageList');
}
}
public function getLogGroupList(){
return $this->logPackageList;
}
public function getLogGroup($index){
if($index<$this->getCount()){
return $this->logPackageList[$index];
}
else{
throw new OutOfBoundsException('Index must less than size of logPackageList');
}
}
}

@ -0,0 +1,33 @@
<?php
/**
* Copyright (C) Alibaba Cloud Computing
* All rights reserved
*/
require_once realpath(dirname(__FILE__) . '/Response.php');
/**
* The response of the GetLog API from log service.
*
* @author log service dev
*/
class Aliyun_Log_Models_CreateACLResponse extends Aliyun_Log_Models_Response {
private $aclId;
/**
* Aliyun_Log_Models_Response constructor
*
* @param array $resp
* GetLogs HTTP response body
* @param array $header
* GetLogs HTTP response header
*/
public function __construct($resp, $header) {
parent::__construct ( $header );
$this->aclId = $resp['aclId'];
}
public function getAclId(){
return $this->aclId;
}
}

@ -0,0 +1,29 @@
<?php
/**
* Copyright (C) Alibaba Cloud Computing
* All rights reserved
*/
require_once realpath(dirname(__FILE__) . '/Response.php');
/**
* The response of the GetLog API from log service.
*
* @author log service dev
*/
class Aliyun_Log_Models_CreateConfigResponse extends Aliyun_Log_Models_Response {
/**
* Aliyun_Log_Models_CreateConfigResponse constructor
*
* @param array $resp
* GetLogs HTTP response body
* @param array $header
* GetLogs HTTP response header
*/
public function __construct($header) {
parent::__construct ( $header );
}
}

@ -0,0 +1,28 @@
<?php
/**
* Copyright (C) Alibaba Cloud Computing
* All rights reserved
*/
require_once realpath(dirname(__FILE__) . '/Response.php');
/**
* The response of the CreateLogstore API from log service.
*
* @author log service dev
*/
class Aliyun_Log_Models_CreateLogstoreResponse extends Aliyun_Log_Models_Response {
/**
* Aliyun_Log_Models_CreateLogstoreResponse constructor
*
* @param array $resp
* CreateLogstore HTTP response body
* @param array $header
* CreateLogstore HTTP response header
*/
public function __construct($resp, $header) {
parent::__construct ( $header );
}
}

@ -0,0 +1,29 @@
<?php
/**
* Copyright (C) Alibaba Cloud Computing
* All rights reserved
*/
require_once realpath(dirname(__FILE__) . '/Response.php');
/**
* The response of the GetLog API from log service.
*
* @author log service dev
*/
class Aliyun_Log_Models_CreateMachineGroupResponse extends Aliyun_Log_Models_Response {
/**
* Aliyun_Log_Models_CreateMachineGroupResponse constructor
*
* @param array $resp
* GetLogs HTTP response body
* @param array $header
* GetLogs HTTP response header
*/
public function __construct($header) {
parent::__construct ( $header );
}
}

@ -0,0 +1,22 @@
<?php
/**
* Copyright (C) Alibaba Cloud Computing
* All rights reserved
*/
require_once realpath(dirname(__FILE__) . '/Response.php');
class Aliyun_Log_Models_CreateShipperResponse extends Aliyun_Log_Models_Response{
/**
* Aliyun_Log_Models_CreateShipperResponse constructor
*
* @param array $resp
* GetLogs HTTP response body
* @param array $header
* GetLogs HTTP response header
*/
public function __construct($resp, $header) {
parent::__construct ( $header );
}
}

@ -0,0 +1,29 @@
<?php
/**
* Copyright (C) Alibaba Cloud Computing
* All rights reserved
*/
require_once realpath(dirname(__FILE__) . '/Response.php');
/**
* The response of the GetLog API from log service.
*
* @author log service dev
*/
class Aliyun_Log_Models_DeleteACLResponse extends Aliyun_Log_Models_Response {
/**
* Aliyun_Log_Models_DeleteACLResponse constructor
*
* @param array $resp
* GetLogs HTTP response body
* @param array $header
* GetLogs HTTP response header
*/
public function __construct($header) {
parent::__construct ( $header );
}
}

@ -0,0 +1,28 @@
<?php
/**
* Copyright (C) Alibaba Cloud Computing
* All rights reserved
*/
require_once realpath(dirname(__FILE__) . '/Response.php');
/**
* The response of the GetLog API from log service.
*
* @author log service dev
*/
class Aliyun_Log_Models_DeleteConfigResponse extends Aliyun_Log_Models_Response {
/**
* Aliyun_Log_Models_DeleteConfigResponse constructor
*
* @param array $resp
* GetLogs HTTP response body
* @param array $header
* GetLogs HTTP response header
*/
public function __construct($header) {
parent::__construct ( $header );
}
}

@ -0,0 +1,28 @@
<?php
/**
* Copyright (C) Alibaba Cloud Computing
* All rights reserved
*/
require_once realpath(dirname(__FILE__) . '/Response.php');
/**
* The response of the DeleteLogstore API from log service.
*
* @author log service dev
*/
class Aliyun_Log_Models_DeleteLogstoreResponse extends Aliyun_Log_Models_Response {
/**
* Aliyun_Log_Models_DeleteLogstoreResponse constructor
*
* @param array $resp
* DeleteLogstore HTTP response body
* @param array $header
* DeleteLogstore HTTP response header
*/
public function __construct($resp, $header) {
parent::__construct ( $header );
}
}

@ -0,0 +1,29 @@
<?php
/**
* Copyright (C) Alibaba Cloud Computing
* All rights reserved
*/
require_once realpath(dirname(__FILE__) . '/Response.php');
/**
* The response of the GetLog API from log service.
*
* @author log service dev
*/
class Aliyun_Log_Models_DeleteMachineGroupResponse extends Aliyun_Log_Models_Response {
/**
* Aliyun_Log_Models_DeleteMachineGroupResponse constructor
*
* @param array $resp
* GetLogs HTTP response body
* @param array $header
* GetLogs HTTP response header
*/
public function __construct($header) {
parent::__construct ( $header );
}
}

@ -0,0 +1,24 @@
<?php
/**
* Copyright (C) Alibaba Cloud Computing
* All rights reserved
*/
require_once realpath(dirname(__FILE__) . '/Response.php');
/**
* The response of the DeleteShard API from log service.
*
* @author log service dev
*/
class Aliyun_Log_Models_DeleteShardResponse extends Aliyun_Log_Models_Response {
/**
* Aliyun_Log_Models_DeleteShardResponse constructor
*
* @param array $header
* DeleteShard HTTP response header
*/
public function __construct($headers) {
parent::__construct ( $headers );
}
}

@ -0,0 +1,22 @@
<?php
/**
* Copyright (C) Alibaba Cloud Computing
* All rights reserved
*/
require_once realpath(dirname(__FILE__) . '/Response.php');
class Aliyun_Log_Models_DeleteShipperResponse extends Aliyun_Log_Models_Response {
/**
* Aliyun_Log_Models_DeleteShipperResponse constructor
*
* @param array $resp
* GetLogs HTTP response body
* @param array $header
* GetLogs HTTP response header
*/
public function __construct($resp, $header) {
parent::__construct ( $header );
}
}

@ -0,0 +1,40 @@
<?php
/**
* Copyright (C) Alibaba Cloud Computing
* All rights reserved
*/
require_once realpath(dirname(__FILE__) . '/Response.php');
/**
* The response of the GetLog API from log service.
*
* @author log service dev
*/
class Aliyun_Log_Models_GetACLResponse extends Aliyun_Log_Models_Response {
private $acl;
/**
* Aliyun_Log_Models_GetACLResponse constructor
*
* @param array $resp
* GetLogs HTTP response body
* @param array $header
* GetLogs HTTP response header
*/
public function __construct($resp, $header) {
parent::__construct ( $header );
$this->acl = null;
if($resp!==null){
$this->acl = new Aliyun_Log_Models_ACL();
$this->acl->setFromArray($resp);
}
}
public function getAcl(){
return $this->acl;
}
}

@ -0,0 +1,37 @@
<?php
/**
* Copyright (C) Alibaba Cloud Computing
* All rights reserved
*/
require_once realpath(dirname(__FILE__) . '/Response.php');
require_once realpath(dirname(__FILE__) . '/Config.php');
/**
* The response of the GetLog API from log service.
*
* @author log service dev
*/
class Aliyun_Log_Models_GetConfigResponse extends Aliyun_Log_Models_Response {
private $config;
/**
* Aliyun_Log_Models_GetConfigResponse constructor
*
* @param array $resp
* GetLogs HTTP response body
* @param array $header
* GetLogs HTTP response header
*/
public function __construct($resp, $header) {
parent::__construct ( $header );
$this->config = new Aliyun_Log_Models_Config();
$this->config->setFromArray($resp);
}
public function getConfig(){
return $this->config;
}
}

@ -0,0 +1,41 @@
<?php
/**
* Copyright (C) Alibaba Cloud Computing
* All rights reserved
*/
require_once realpath(dirname(__FILE__) . '/Response.php');
/**
* The response of the GetCursor API from log service.
*
* @author log service dev
*/
class Aliyun_Log_Models_GetCursorResponse extends Aliyun_Log_Models_Response {
/**
* @var string cursor
*
*/
private $cursor;
/**
* Aliyun_Log_Models_GetCursorResponse constructor
*
* @param array $resp
* GetLogs HTTP response body
* @param array $header
* GetLogs HTTP response header
*/
public function __construct($resp, $header) {
parent::__construct ( $header );
$this->cursor = $resp['cursor'];
}
/**
* Get cursor from the response
*
* @return string cursor
*/
public function getCursor(){
return $this->cursor;
}
}

@ -0,0 +1,77 @@
<?php
/**
* Copyright (C) Alibaba Cloud Computing
* All rights reserved
*/
require_once realpath(dirname(__FILE__) . '/Response.php');
require_once realpath(dirname(__FILE__) . '/../Histogram.php');
/**
* The response of the GetHistograms API from log service.
*
* @author log service dev
*/
class Aliyun_Log_Models_GetHistogramsResponse extends Aliyun_Log_Models_Response {
/**
* @var string histogram query status(Complete or InComplete)
*/
private $progress;
/**
* @var integer logs' count that current query hits
*/
private $count;
/**
* @var array Aliyun_Log_Models_Histogram array, histograms on the requested time range: [from, to)
*/
private $histograms; // List<Aliyun_Log_Models_Histogram>
/**
* Aliyun_Log_Models_GetHistogramsResponse constructor
*
* @param array $resp
* GetHistogramsResponse HTTP response body
* @param array $header
* GetHistogramsResponse HTTP response header
*/
public function __construct($resp, $header) {
parent::__construct ( $header );
$this->progress = $header ['x-log-progress'];
$this->count = $header ['x-log-count'];
$this->histograms = array ();
foreach ( $resp as $data )
$this->histograms [] = new Aliyun_Log_Models_Histogram ( $data ['from'], $data ['to'], $data ['count'], $data ['progress'] );
}
/**
* Check if the histogram is completed
*
* @return bool true if this histogram is completed
*/
public function isCompleted() {
return $this->progress == 'Complete';
}
/**
* Get total logs' count that current query hits
*
* @return integer total logs' count that current query hits
*/
public function getTotalCount() {
return $this->count;
}
/**
* Get histograms on the requested time range: [from, to)
*
* @return array Aliyun_Log_Models_Histogram array, histograms on the requested time range
*/
public function getHistograms() {
return $this->histograms;
}
}

@ -0,0 +1,81 @@
<?php
/**
* Copyright (C) Alibaba Cloud Computing
* All rights reserved
*/
require_once realpath(dirname(__FILE__) . '/Response.php');
require_once realpath(dirname(__FILE__) . '/QueriedLog.php');
/**
* The response of the GetLog API from log service.
*
* @author log service dev
*/
class Aliyun_Log_Models_GetLogsResponse extends Aliyun_Log_Models_Response {
/**
* @var integer log number
*/
private $count;
/**
* @var string logs query status(Complete or InComplete)
*/
private $progress;
/**
* @var array Aliyun_Log_Models_QueriedLog array, all log data
*/
private $logs;
/**
* Aliyun_Log_Models_GetLogsResponse constructor
*
* @param array $resp
* GetLogs HTTP response body
* @param array $header
* GetLogs HTTP response header
*/
public function __construct($resp, $header) {
parent::__construct ( $header );
$this->count = $header['x-log-count'];
$this->progress = $header ['x-log-progress'];
$this->logs = array ();
foreach ( $resp as $data ) {
$contents = $data;
$time = $data ['__time__'];
$source = $data ['__source__'];
unset ( $contents ['__time__'] );
unset ( $contents ['__source__'] );
$this->logs [] = new Aliyun_Log_Models_QueriedLog ( $time, $source, $contents );
}
}
/**
* Get log number from the response
*
* @return integer log number
*/
public function getCount() {
return $this->count;
}
/**
* Check if the get logs query is completed
*
* @return bool true if this logs query is completed
*/
public function isCompleted() {
return $this->progress == 'Complete';
}
/**
* Get all logs from the response
*
* @return array Aliyun_Log_Models_QueriedLog array, all log data
*/
public function getLogs() {
return $this->logs;
}
}

@ -0,0 +1,36 @@
<?php
/**
* Copyright (C) Alibaba Cloud Computing
* All rights reserved
*/
require_once realpath(dirname(__FILE__) . '/Response.php');
/**
* The response of the GetLog API from log service.
*
* @author log service dev
*/
class Aliyun_Log_Models_GetMachineGroupResponse extends Aliyun_Log_Models_Response {
private $machineGroup;
/**
* Aliyun_Log_Models_GetMachineGroupResponse constructor
*
* @param array $resp
* GetLogs HTTP response body
* @param array $header
* GetLogs HTTP response header
*/
public function __construct($resp, $header) {
parent::__construct ( $header );
$this->machineGroup = new Aliyun_Log_Models_MachineGroup();
$this->machineGroup->setFromArray($resp);
}
public function getMachineGroup(){
return $this->machineGroup;
}
}

@ -0,0 +1,38 @@
<?php
/**
* Copyright (C) Alibaba Cloud Computing
* All rights reserved
*/
require_once realpath(dirname(__FILE__) . '/Response.php');
/**
* The response of the GetLog API from log service.
*
* @author log service dev
*/
class Aliyun_Log_Models_GetMachineResponse extends Aliyun_Log_Models_Response {
private $machine;
/**
* Aliyun_Log_Models_GetMachineResponse constructor
*
* @param array $resp
* GetLogs HTTP response body
* @param array $header
* GetLogs HTTP response header
*/
public function __construct($resp, $header) {
parent::__construct ( $header );
//echo json_encode($resp);
$this->machine = new Aliyun_Log_Models_Machine();
$this->machine->setFromArray($resp);
}
public function getMachine(){
return $this->machine;
}
}

@ -0,0 +1,81 @@
<?php
/**
* Copyright (C) Alibaba Cloud Computing
* All rights reserved
*/
require_once realpath(dirname(__FILE__) . '/Response.php');
class Aliyun_Log_Models_GetShipperConfigResponse extends Aliyun_Log_Models_Response {
private $shipperName;
private $targetType;
private $targetConfigration;
/**
* @return mixed
*/
public function getShipperName()
{
return $this->shipperName;
}
/**
* @param mixed $shipperName
*/
public function setShipperName($shipperName)
{
$this->shipperName = $shipperName;
}
/**
* @return mixed
*/
public function getTargetType()
{
return $this->targetType;
}
/**
* @param mixed $targetType
*/
public function setTargetType($targetType)
{
$this->targetType = $targetType;
}
/**
* @return mixed
*/
public function getTargetConfigration()
{
return $this->targetConfigration;
}
/**
* @param mixed $targetConfigration
*/
public function setTargetConfigration($targetConfigration)
{
$this->targetConfigration = $targetConfigration;
}
/**
* Aliyun_Log_Models_GetShipperConfigResponse constructor
*
* @param array $resp
* GetLogs HTTP response body
* @param array $header
* GetLogs HTTP response header
*/
public function __construct($resp, $header) {
parent::__construct ( $header );
$this->shipperName = $resp['shipperName'];
$this->targetConfigration = $resp['targetConfiguration'];
$this->targetType = $resp['targetType'];
}
}

@ -0,0 +1,97 @@
<?php
/**
* Copyright (C) Alibaba Cloud Computing
* All rights reserved
*/
require_once realpath(dirname(__FILE__) . '/Response.php');
class Aliyun_Log_Models_GetShipperTasksResponse extends Aliyun_Log_Models_Response {
private $count;
private $total;
private $statistics;
private $tasks;
/**
* Aliyun_Log_Models_GetShipperTasksResponse constructor
*
* @param array $resp
* GetLogs HTTP response body
* @param array $header
* GetLogs HTTP response header
*/
public function __construct($resp, $header) {
parent::__construct ( $header );
$this->total = $resp['total'];
$this->count = $resp['count'];
$this->statistics = $resp['statistics'];
$this->tasks = $resp['tasks'];
}
/**
* @return mixed
*/
public function getCount()
{
return $this->count;
}
/**
* @param mixed $count
*/
public function setCount($count)
{
$this->count = $count;
}
/**
* @return mixed
*/
public function getTotal()
{
return $this->total;
}
/**
* @param mixed $total
*/
public function setTotal($total)
{
$this->total = $total;
}
/**
* @return mixed
*/
public function getStatistics()
{
return $this->statistics;
}
/**
* @param mixed $statistics
*/
public function setStatistics($statistics)
{
$this->statistics = $statistics;
}
/**
* @return mixed
*/
public function getTasks()
{
return $this->tasks;
}
/**
* @param mixed $tasks
*/
public function setTasks($tasks)
{
$this->tasks = $tasks;
}
}

@ -0,0 +1,44 @@
<?php
/**
* Copyright (C) Alibaba Cloud Computing
* All rights reserved
*/
require_once realpath(dirname(__FILE__) . '/Response.php');
/**
* The response of the GetLog API from log service.
*
* @author log service dev
*/
class Aliyun_Log_Models_ListACLsResponse extends Aliyun_Log_Models_Response {
private $acls;
/**
* Aliyun_Log_Models_ListACLsResponse constructor
*
* @param array $resp
* GetLogs HTTP response body
* @param array $header
* GetLogs HTTP response header
*/
public function __construct($resp, $header) {
parent::__construct ( $header );
$aclArr = array();
if(isset($resp['acls'])){
foreach($resp['acls'] as $value){
$aclObj = new Aliyun_Log_Models_ACL();
$aclObj->setFromArray($value);
$aclArr[]=$aclObj;
}
}
$this->acls = $aclArr;
}
public function getAcls(){
return $this->acls;
}
}

@ -0,0 +1,44 @@
<?php
/**
* Copyright (C) Alibaba Cloud Computing
* All rights reserved
*/
require_once realpath(dirname(__FILE__) . '/Response.php');
/**
*
* @author log service dev
*/
class Aliyun_Log_Models_ListConfigsResponse extends Aliyun_Log_Models_Response {
private $total;
private $configs;
/**
* Aliyun_Log_Models_ListConfigsResponse constructor
*
* @param array $resp
* GetLogs HTTP response body
* @param array $header
* GetLogs HTTP response header
*/
public function __construct($resp, $header) {
parent::__construct ( $header );
$this->size = $resp['total'];
$this->configs = $resp['configs'];
}
public function getSize(){
return count($this->configs);
}
public function getTotal(){
return $this ->total;
}
public function getConfigs(){
return $this->configs;
}
}

@ -0,0 +1,57 @@
<?php
/**
* Copyright (C) Alibaba Cloud Computing
* All rights reserved
*/
require_once realpath(dirname(__FILE__) . '/Response.php');
/**
* The response of the ListLogstores API from log service.
*
* @author log service dev
*/
class Aliyun_Log_Models_ListLogstoresResponse extends Aliyun_Log_Models_Response {
/**
* @var integer the number of total logstores from the response
*/
private $count;
/**
* @var array all logstore
*/
private $logstores;
/**
* Aliyun_Log_Models_ListLogstoresResponse constructor
*
* @param array $resp
* ListLogstores HTTP response body
* @param array $header
* ListLogstores HTTP response header
*/
public function __construct($resp, $header) {
parent::__construct ( $header );
$this->count = $resp ['total'];
$this->logstores = $resp ['logstores'];
}
/**
* Get total count of logstores from the response
*
* @return integer the number of total logstores from the response
*/
public function getCount() {
return $this->count;
}
/**
* Get all the logstores from the response
*
* @return array all logstore
*/
public function getLogstores() {
return $this->logstores;
}
}

@ -0,0 +1,45 @@
<?php
/**
* Copyright (C) Alibaba Cloud Computing
* All rights reserved
*/
require_once realpath(dirname(__FILE__) . '/Response.php');
/**
* The response of the GetLog API from log service.
*
* @author log service dev
*/
class Aliyun_Log_Models_ListMachineGroupsResponse extends Aliyun_Log_Models_Response {
private $offset;
private $size;
private $machineGroups;
/**
* Aliyun_Log_Models_ListMachineGroupsResponse constructor
*
* @param array $resp
* GetLogs HTTP response body
* @param array $header
* GetLogs HTTP response header
*/
public function __construct($resp, $header) {
parent::__construct ( $header );
$this->offset = $resp['offset'];
$this->size = $resp['size'];
$this->machineGroups = $resp['machinegroups'];
}
public function getOffset(){
return $this->offset;
}
public function getSize(){
return $this->size;
}
public function getMachineGroups(){
return $this->machineGroups;
}
}

@ -0,0 +1,42 @@
<?php
/**
* Copyright (C) Alibaba Cloud Computing
* All rights reserved
*/
require_once realpath(dirname(__FILE__) . '/Response.php');
require_once realpath(dirname(__FILE__) . '/Shard.php');
/**
* The response of the GetLog API from log service.
*
* @author log service dev
*/
class Aliyun_Log_Models_ListShardsResponse extends Aliyun_Log_Models_Response {
private $shardIds;
/**
* Aliyun_Log_Models_ListShardsResponse constructor
*
* @param array $resp
* GetLogs HTTP response body
* @param array $header
* GetLogs HTTP response header
*/
public function __construct($resp, $header) {
parent::__construct ( $header );
foreach($resp as $key=>$value){
$this->shardIds[] = $value['shardID'];
$this->shards[] = new Aliyun_Log_Models_Shard($value['shardID'],$value["status"],$value["inclusiveBeginKey"],$value["exclusiveEndKey"],$value["createTime"]);
}
}
public function getShardIds(){
return $this-> shardIds;
}
public function getShards()
{
return $this -> shards;
}
}

@ -0,0 +1,78 @@
<?php
/**
* Copyright (C) Alibaba Cloud Computing
* All rights reserved
*/
require_once realpath(dirname(__FILE__) . '/Response.php');
class Aliyun_Log_Models_ListShipperResponse extends Aliyun_Log_Models_Response {
private $count;
private $total;
private $shippers;
/**
* @return mixed
*/
public function getCount()
{
return $this->count;
}
/**
* @param mixed $count
*/
public function setCount($count)
{
$this->count = $count;
}
/**
* @return mixed
*/
public function getTotal()
{
return $this->total;
}
/**
* @param mixed $total
*/
public function setTotal($total)
{
$this->total = $total;
}
/**
* @return mixed
*/
public function getShippers()
{
return $this->shippers;
}
/**
* @param mixed $shippers
*/
public function setShippers($shippers)
{
$this->shippers = $shippers;
}
/**
* Aliyun_Log_Models_ListShipperResponse constructor
*
* @param array $resp
* GetLogs HTTP response body
* @param array $header
* GetLogs HTTP response header
*/
public function __construct($resp, $header) {
parent::__construct ( $header );
$this->count = $resp['count'];
$this->total = $resp['total'];
$this->shippers = $resp['shipper'];
}
}

@ -0,0 +1,73 @@
<?php
/**
* Copyright (C) Alibaba Cloud Computing
* All rights reserved
*/
require_once realpath(dirname(__FILE__) . '/Response.php');
/**
* The response of the ListTopics API from log service.
*
* @author log service dev
*/
class Aliyun_Log_Models_ListTopicsResponse extends Aliyun_Log_Models_Response {
/**
* @var integer the number of all the topics from the response
*/
private $count;
/**
* @var array topics list
*/
private $topics;
/**
* @var string/null the next token from the response. If there is no more topic to list, it will return None
*/
private $nextToken;
/**
* Aliyun_Log_Models_ListTopicsResponse constructor
*
* @param array $resp
* ListTopics HTTP response body
* @param array $header
* ListTopics HTTP response header
*/
public function __construct($resp, $header) {
parent::__construct ( $header );
$this->count = $header['x-log-count'];
$this->topics = $resp ;
$this->nextToken = isset ( $header['x-log-nexttoken'] ) ? $header['x-log-nexttoken'] : NULL;
}
/**
* Get the number of all the topics from the response
*
* @return integer the number of all the topics from the response
*/
public function getCount() {
return $this->count;
}
/**
* Get all the topics from the response
*
* @return array topics list
*/
public function getTopics() {
return $this->topics;
}
/**
* Return the next token from the response. If there is no more topic to list, it will return None
*
* @return string/null next token used to list more topics
*/
public function getNextToken() {
return $this->nextToken;
}
}

@ -0,0 +1,24 @@
<?php
/**
* Copyright (C) Alibaba Cloud Computing
* All rights reserved
*/
require_once realpath(dirname(__FILE__) . '/Response.php');
/**
* The response of the PutLogs API from log service.
*
* @author log service dev
*/
class Aliyun_Log_Models_PutLogsResponse extends Aliyun_Log_Models_Response {
/**
* Aliyun_Log_Models_PutLogsResponse constructor
*
* @param array $header
* PutLogs HTTP response header
*/
public function __construct($headers) {
parent::__construct ( $headers );
}
}

@ -0,0 +1,72 @@
<?php
/**
* Copyright (C) Alibaba Cloud Computing
* All rights reserved
*/
/**
* The QueriedLog is a log of the Aliyun_Log_Models_GetLogsResponse which obtained from the log.
*
* @author log service dev
*/
class Aliyun_Log_Models_QueriedLog {
/**
* @var integer log timestamp
*/
private $time;
/**
* @var string log source
*/
private $source;
/**
* @var array log contents, content many key/value pair
*/
private $contents;
/**
* Aliyun_Log_Models_QueriedLog constructor
*
* @param integer $time
* log time stamp
* @param string $source
* log source
* @param array $contents
* log contents, content many key/value pair
*/
public function __construct($time, $source, $contents) {
$this->time = $time;
$this->source = $source;
$this->contents = $contents; // deep copy
}
/**
* Get log source
*
* @return string log source
*/
public function getSource() {
return $this->source;
}
/**
* Get log time
*
* @return integer log time
*/
public function getTime() {
return $this->time;
}
/**
* Get log contents, content many key/value pair.
*
* @return array log contents
*/
public function getContents() {
return $this->contents;
}
}

@ -0,0 +1,28 @@
<?php
/**
* Copyright (C) Alibaba Cloud Computing
* All rights reserved
*/
require_once realpath(dirname(__FILE__) . '/Response.php');
/**
* The response of the GetLog API from log service.
*
* @author log service dev
*/
class Aliyun_Log_Models_RemoveConfigFromMachineGroupResponse extends Aliyun_Log_Models_Response {
/**
* Aliyun_Log_Models_Response constructor
*
* @param array $resp
* GetLogs HTTP response body
* @param array $header
* GetLogs HTTP response header
*/
public function __construct($header) {
parent::__construct ( $header );
}
}

@ -0,0 +1,58 @@
<?php
/**
* Copyright (C) Alibaba Cloud Computing
* All rights reserved
*/
/**
* The base response class of all log response.
*
* @author log service dev
*/
class Aliyun_Log_Models_Response {
/**
* @var array HTTP response header
*/
private $headers;
/**
* Aliyun_Log_Models_Response constructor
*
* @param array $header
* HTTP response header
*/
public function __construct($headers) {
$this->headers = $headers;
}
/**
* Get all http headers
*
* @return array HTTP response header
*/
public function getAllHeaders() {
return $this->headers;
}
/**
* Get specified http header
*
* @param string $key
* key to get header
*
* @return string HTTP response header. '' will be return if not set.
*/
public function getHeader($key) {
return isset ($this->headers[$key]) ? $this->headers [$key] : '';
}
/**
* Get the request id of the response. '' will be return if not set.
*
* @return string request id
*/
public function getRequestId() {
return isset ( $this->headers ['x-log-requestid'] ) ? $this->headers ['x-log-requestid'] : '';
}
}

@ -0,0 +1,22 @@
<?php
/**
* Copyright (C) Alibaba Cloud Computing
* All rights reserved
*/
require_once realpath(dirname(__FILE__) . '/Response.php');
class Aliyun_Log_Models_RetryShipperTasksResponse extends Aliyun_Log_Models_Response{
/**
* Aliyun_Log_Models_RetryShipperTasksResponse constructor
*
* @param array $resp
* GetLogs HTTP response body
* @param array $header
* GetLogs HTTP response header
*/
public function __construct($resp, $header) {
parent::__construct ( $header );
}
}

@ -0,0 +1,95 @@
<?php
/**
* The class used to present the shard detail, for every shard ,it contains id , status , begin Range, end range, createtime
*
* @author log service dev
*/
class Aliyun_Log_Models_Shard{
/**
* @var interger the shard id
*/
private $shardId;
/**
* @var string shard status (readwrite or readonly)
*/
private $status;
/**
* @var string shard inclusive begin key
*/
private $inclusiveBeginKey;
/**
* @var string shard exclusive begin key
*/
private $exclusiveEndKey;
/**
* @var integer shard create time
*/
private $createTime;
/**
* Aliyun_Log_Models_Shhard constructor
*
* @param integer $shardId
* the shard id
* @param string $status
* the shard status
* @param string $inclusiveBeginKey
* the shard inclusive begin key
* @param string $exclusiveEndKey
* the shard exclusive end key
* @para integer @createTime
* the shard create time
*/
public function __construct($shardId,$status,$inclusiveBeginKey,$exclusiveEndKey,$createTime) {
$this->shardId=$shardId;
$this->status = $status;
$this->inclusiveBeginKey = $inclusiveBeginKey;
$this->exclusiveEndKey = $exclusiveEndKey;
$this->createTime = $createTime;
}
/**
* Get the shardId
*
* @return integer the shard id
*/
public function getShardId(){
return $this -> shardId;
}
/**
* Get the shard status
*
* @return string the shard status
*/
public function getStatus(){
return $this -> status;
}
/**
* Get the shard inclusive begin key
*
* @return string inclusive begin key
*/
public function getInclusiveBeginKey(){
return $this -> inclusiveBeginKey;
}
/**
* Get the shard exclusive begin key
*
* @return string exclusive begin key
*/
public function getExclusiveBeginKey(){
return $this -> exclusiveBeginKey;
}
/**
* Get the shard create time
*
* @return integer createTime
*/
public function getCreateTime(){
return $this -> createTime;
}
}

@ -0,0 +1,29 @@
<?php
/**
* Copyright (C) Alibaba Cloud Computing
* All rights reserved
*/
require_once realpath(dirname(__FILE__) . '/Response.php');
/**
* The response of the GetLog API from log service.
*
* @author log service dev
*/
class Aliyun_Log_Models_UpdateACLResponse extends Aliyun_Log_Models_Response {
/**
* Aliyun_Log_Models_UpdateACLResponse constructor
*
* @param array $resp
* GetLogs HTTP response body
* @param array $header
* GetLogs HTTP response header
*/
public function __construct($header) {
parent::__construct ( $header );
}
}

@ -0,0 +1,29 @@
<?php
/**
* Copyright (C) Alibaba Cloud Computing
* All rights reserved
*/
require_once realpath(dirname(__FILE__) . '/Response.php');
/**
* The response of the GetLog API from log service.
*
* @author log service dev
*/
class Aliyun_Log_Models_UpdateConfigResponse extends Aliyun_Log_Models_Response {
/**
* Aliyun_Log_Models_UpdateConfigResponse constructor
*
* @param array $resp
* GetLogs HTTP response body
* @param array $header
* GetLogs HTTP response header
*/
public function __construct($header) {
parent::__construct ( $header );
}
}

@ -0,0 +1,28 @@
<?php
/**
* Copyright (C) Alibaba Cloud Computing
* All rights reserved
*/
require_once realpath(dirname(__FILE__) . '/Response.php');
/**
* The response of the UpdateLogstore API from log service.
*
* @author log service dev
*/
class Aliyun_Log_Models_UpdateLogstoreResponse extends Aliyun_Log_Models_Response {
/**
* Aliyun_Log_Models_UpdateLogstoreResponse constructor
*
* @param array $resp
* UpdateLogstore HTTP response body
* @param array $header
* UpdateLogstore HTTP response header
*/
public function __construct($resp, $header) {
parent::__construct ( $header );
}
}

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save