Commit 97491df7b97fb26f8c48918a3f74f2e41da3493d

Authored by teemitop
1 parent 4807c4fb

阿里云日志抓取

Showing 50 changed files with 4804 additions and 0 deletions

Too many changes to show.

To preserve performance only 50 of 50+ files are displayed.

@@ -53,4 +53,79 @@ class System extends Common @@ -53,4 +53,79 @@ class System extends Common
53 } 53 }
54 } 54 }
55 55
  56 + /**
  57 + * 获取日志列表
  58 + */
  59 + public function log(){
  60 + //基础参数
  61 + /* 使用autoloader类自动加载所有需要的PHP模块。注意使用合适的路径指向autoloader类所在文件*/
  62 + $DOCUMENT_ROOT = str_replace('public','',$_SERVER['DOCUMENT_ROOT']);
  63 + require_once $DOCUMENT_ROOT.'vendor/aliyunlog/Log_Autoload.php';
  64 + //require_once realpath(dirname(__FILE__) . '/../Log_Autoload.php');
  65 + $endpoint = 'cn-beijing.log.aliyuncs.com'; // 选择与上面步骤创建project所属区域匹配的Endpoint
  66 + $accessKeyId = 'LTAI4Fivq9UqCkAnCgDKqMBC'; // 使用你的阿里云访问密钥AccessKeyId
  67 + $accessKey = 'AdmOpP2LzbbbY6N9BaGnIE3UBzI62E'; // 使用你的阿里云访问密钥AccessKeySecret
  68 + $project = '101-dc-api-log'; // 上面步骤创建的项目名称
  69 + $logstore = 'info-log'; // 上面步骤创建的日志库名称
  70 + $client = new \Aliyun_Log_Client($endpoint, $accessKeyId, $accessKey);
  71 +
  72 + if(Request::isAjax()) {
  73 + $data = Request::except('file');
  74 + #查询日志数据
  75 + $topic = "";
  76 + $total_query_str= '* | select count(1) as count';
  77 + $key_query_str = '';
  78 + $from = time()-2592000;
  79 + $to = time();
  80 + $total = NULL;
  81 + $key_query = NULL;
  82 + while (is_null($total) || (! $total->isCompleted()))
  83 + {
  84 + $total = new \Aliyun_Log_Models_GetLogsRequest($project, $logstore, $from, $to, $topic, $total_query_str, 0, 0, true);
  85 + $total = $client->getLogs($total);
  86 +
  87 + }
  88 +
  89 + while (is_null($key_query) || (! $key_query->isCompleted()))
  90 + {
  91 + $key_query = new \Aliyun_Log_Models_GetLogsRequest($project, $logstore, $from, $to, $topic, $key_query_str, $data['limit'], $data['page'], true);
  92 + $key_query = $client->getLogs($key_query);
  93 + }
  94 + $result = array();
  95 + $count = 0;
  96 + try {
  97 + foreach($total -> getLogs() as $log)
  98 + {
  99 + foreach($log -> getContents() as $key => $value){
  100 + $count = $value; //总数
  101 + }
  102 + }
  103 + foreach($key_query -> getLogs() as $k=>$v)
  104 + {
  105 + foreach($v -> getContents() as $key => $value){
  106 + $result['list'][$k][$key] = $value;
  107 + }
  108 + }
  109 + } catch (Aliyun_Log_Exception $ex) {
  110 + logVarDump($ex);
  111 + } catch (Exception $ex) {
  112 + logVarDump($ex);
  113 + }
  114 + return ['code'=>0,'msg'=>'获取成功!','data'=>$result['list'],'count'=>$count,'rel'=>1];
  115 + }
  116 + return $this->fetch();
  117 + }
  118 +
  119 + //PHP stdClass Object转array
  120 +
  121 + public function objectToArray($e){
  122 + $e=(array)$e;
  123 + foreach($e as $k=>$v){
  124 + if( gettype($v)=='resource' ) return;
  125 + if( gettype($v)=='object' || gettype($v)=='array' )
  126 + $e[$k]=(array)self::objectToArray($v);
  127 + }
  128 + return $e;
  129 + }
  130 +
56 } 131 }
  1 +{include file="common/head"/}
  2 +<div class="admin-main layui-anim layui-anim-upbit">
  3 + <fieldset class="layui-elem-field layui-field-title">
  4 + <legend>{:$title}</legend>
  5 + </fieldset>
  6 + <div class="demoTable">
  7 + <!--商家:
  8 + <div class="layui-input-inline">
  9 + <input class="layui-input" name="key" id="key" placeholder="{:lang('pleaseEnter')}店铺名称" autocomplete="off">
  10 + </div>
  11 + 日期范围:
  12 + <div class="layui-input-inline" >
  13 + <input type="text" style = "width:300px"; class="layui-input" id="time" placeholder="默认为当天的统计情况">
  14 + </div>
  15 + 商家来源:
  16 + <div class="layui-input-inline layui-form">
  17 + <div class="layui-input-8">
  18 + <select name="class" id="channel" lay-filter="myselect">
  19 + <option value="-1">全部</option>
  20 + <option value="1" selected>合作</option>
  21 + <option value="2">推广</option>
  22 + <option value="3">测试</option>
  23 + </select>
  24 + </div>
  25 + </div>
  26 + 筛选条件:
  27 + <div class="layui-input-inline layui-form">
  28 + <div class="layui-input-8">
  29 + <select name="class" id="time_type" lay-filter="myselect">
  30 + <option value="1">录入时间</option>
  31 + <option value="2">到店时间</option>
  32 + </select>
  33 + </div>
  34 + </div>-->
  35 + <!--地区:
  36 + <div class="layui-input-inline">
  37 + <input type="text" class="layui-input" id="area" placeholder="地区暂未开放">
  38 + </div>
  39 + <button class="layui-btn" id="search" data-type="reload">查询统计</button>-->
  40 + </div>
  41 + <table class="layui-table" id="list" lay-filter="list"></table>
  42 +</div>
  43 +<script type="text/html" id="toolbarDemo">
  44 +</script>
  45 +{include file="common/foot"/}
  46 +<script>
  47 + layui.use(['table','form','laydate'], function() {
  48 + var table = layui.table,laydate = layui.laydate,$ = layui.jquery;
  49 + console.log(layui);
  50 + var tableIn = table.render({
  51 + elem: '#list',
  52 + url: '{:url("log")}',
  53 + method: 'post',
  54 + title: '日志记录',
  55 + page:true,
  56 + toolbar: '#toolbarDemo',
  57 + cols: [[
  58 + {field: 'parm', align: 'center',title: '内容'},
  59 + {field: 'time',width:210, title: '时间'},
  60 + ]],
  61 + done: function(res, curr, count){
  62 + //code
  63 + }
  64 + ,id: 'testReload'
  65 + ,page: true
  66 + ,limit:15
  67 + });
  68 +
  69 + /*//日期时间范围
  70 + laydate.render({
  71 + elem: '#time'
  72 + ,type: 'datetime'
  73 + ,range: true
  74 + });
  75 +
  76 + //搜索
  77 + $('#search').on('click', function() {
  78 + //关键字
  79 + var key = $('#key').val();
  80 + //选中的商家ID
  81 + var checkStatus = table.checkStatus('testReload'); //test即为参数id设定的值
  82 + var a = [];
  83 + $(checkStatus.data).each(function(i,o){
  84 + a.push(o.id);
  85 + });
  86 + console.log(a);
  87 + var time = $('#time').val();
  88 + console.log(time);
  89 + //商家来源
  90 + var channel = $('#channel').val();
  91 + console.log(channel);
  92 + //筛选条件
  93 + var time_type = $('#time_type').val();
  94 + console.log(time_type);
  95 + //传参
  96 + tableIn.reload({ page: {page: 1},where: {key: key,sid: a,time: time,time_type: time_type,channel: channel}});
  97 + });
  98 +
  99 + var $ = layui.$, active = {
  100 + reload: function(){
  101 + var key = $('#key');
  102 + //执行重载
  103 + table.reload('testReload', {
  104 + page: {
  105 + curr: 1 //重新从第 1 页开始
  106 + }
  107 + ,where: {
  108 + key: {
  109 + id: key.val()
  110 + }
  111 + }
  112 + });
  113 + }
  114 + };*/
  115 + })
  116 +</script>
  1 +<?php
  2 +/**
  3 + * Copyright (C) Alibaba Cloud Computing
  4 + * All rights reserved
  5 + */
  6 +date_default_timezone_set ( 'Asia/Shanghai' );
  7 +
  8 +require_once realpath ( dirname ( __FILE__ ) . '/../../Log_Autoload.php' );
  9 +require_once realpath ( dirname ( __FILE__ ) . '/requestcore.class.php' );
  10 +require_once realpath ( dirname ( __FILE__ ) . '/sls.proto.php' );
  11 +require_once realpath ( dirname ( __FILE__ ) . '/protocolbuffers.inc.php' );
  12 +
  13 +if(!defined('API_VERSION'))
  14 + define('API_VERSION', '0.6.0');
  15 +if(!defined('USER_AGENT'))
  16 + define('USER_AGENT', 'log-php-sdk-v-0.6.0');
  17 +
  18 +/**
  19 + * Aliyun_Log_Client class is the main class in the SDK. It can be used to
  20 + * communicate with LOG server to put/get data.
  21 + *
  22 + * @author log_dev
  23 + */
  24 +class Aliyun_Log_Client {
  25 +
  26 + /**
  27 + * @var string aliyun accessKey
  28 + */
  29 + protected $accessKey;
  30 +
  31 + /**
  32 + * @var string aliyun accessKeyId
  33 + */
  34 + protected $accessKeyId;
  35 +
  36 + /**
  37 + *@var string aliyun sts token
  38 + */
  39 + protected $stsToken;
  40 +
  41 + /**
  42 + * @var string LOG endpoint
  43 + */
  44 + protected $endpoint;
  45 +
  46 + /**
  47 + * @var string Check if the host if row ip.
  48 + */
  49 + protected $isRowIp;
  50 +
  51 + /**
  52 + * @var integer Http send port. The dafault value is 80.
  53 + */
  54 + protected $port;
  55 +
  56 + /**
  57 + * @var string log sever host.
  58 + */
  59 + protected $logHost;
  60 +
  61 + /**
  62 + * @var string the local machine ip address.
  63 + */
  64 + protected $source;
  65 +
  66 + /**
  67 + * Aliyun_Log_Client constructor
  68 + *
  69 + * @param string $endpoint
  70 + * LOG host name, for example, http://cn-hangzhou.sls.aliyuncs.com
  71 + * @param string $accessKeyId
  72 + * aliyun accessKeyId
  73 + * @param string $accessKey
  74 + * aliyun accessKey
  75 + */
  76 + public function __construct($endpoint, $accessKeyId, $accessKey,$token = "") {
  77 + $this->setEndpoint ( $endpoint ); // set $this->logHost
  78 + $this->accessKeyId = $accessKeyId;
  79 + $this->accessKey = $accessKey;
  80 + $this->stsToken = $token;
  81 + $this->source = Aliyun_Log_Util::getLocalIp();
  82 + }
  83 + private function setEndpoint($endpoint) {
  84 + $pos = strpos ( $endpoint, "://" );
  85 + if ($pos !== false) { // be careful, !==
  86 + $pos += 3;
  87 + $endpoint = substr ( $endpoint, $pos );
  88 + }
  89 + $pos = strpos ( $endpoint, "/" );
  90 + if ($pos !== false) // be careful, !==
  91 + $endpoint = substr ( $endpoint, 0, $pos );
  92 + $pos = strpos ( $endpoint, ':' );
  93 + if ($pos !== false) { // be careful, !==
  94 + $this->port = ( int ) substr ( $endpoint, $pos + 1 );
  95 + $endpoint = substr ( $endpoint, 0, $pos );
  96 + } else
  97 + $this->port = 80;
  98 + $this->isRowIp = Aliyun_Log_Util::isIp ( $endpoint );
  99 + $this->logHost = $endpoint;
  100 + $this->endpoint = $endpoint . ':' . ( string ) $this->port;
  101 + }
  102 +
  103 + /**
  104 + * GMT format time string.
  105 + *
  106 + * @return string
  107 + */
  108 + protected function getGMT() {
  109 + return gmdate ( 'D, d M Y H:i:s' ) . ' GMT';
  110 + }
  111 +
  112 +
  113 + /**
  114 + * Decodes a JSON string to a JSON Object.
  115 + * Unsuccessful decode will cause an Aliyun_Log_Exception.
  116 + *
  117 + * @return string
  118 + * @throws Aliyun_Log_Exception
  119 + */
  120 + protected function parseToJson($resBody, $requestId) {
  121 + if (! $resBody)
  122 + return NULL;
  123 +
  124 + $result = json_decode ( $resBody, true );
  125 + if ($result === NULL){
  126 + throw new Aliyun_Log_Exception ( 'BadResponse', "Bad format,not json: $resBody", $requestId );
  127 + }
  128 + return $result;
  129 + }
  130 +
  131 + /**
  132 + * @return array
  133 + */
  134 + protected function getHttpResponse($method, $url, $body, $headers) {
  135 + $request = new RequestCore ( $url );
  136 + foreach ( $headers as $key => $value )
  137 + $request->add_header ( $key, $value );
  138 + $request->set_method ( $method );
  139 + $request->set_useragent(USER_AGENT);
  140 + if ($method == "POST" || $method == "PUT")
  141 + $request->set_body ( $body );
  142 + $request->send_request ();
  143 + $response = array ();
  144 + $response [] = ( int ) $request->get_response_code ();
  145 + $response [] = $request->get_response_header ();
  146 + $response [] = $request->get_response_body ();
  147 + return $response;
  148 + }
  149 +
  150 + /**
  151 + * @return array
  152 + * @throws Aliyun_Log_Exception
  153 + */
  154 + private function sendRequest($method, $url, $body, $headers) {
  155 + try {
  156 + list ( $responseCode, $header, $resBody ) =
  157 + $this->getHttpResponse ( $method, $url, $body, $headers );
  158 + } catch ( Exception $ex ) {
  159 + throw new Aliyun_Log_Exception ( $ex->getMessage (), $ex->__toString () );
  160 + }
  161 +
  162 + $requestId = isset ( $header ['x-log-requestid'] ) ? $header ['x-log-requestid'] : '';
  163 +
  164 + if ($responseCode == 200) {
  165 + return array ($resBody,$header);
  166 + }
  167 + else {
  168 + $exJson = $this->parseToJson ( $resBody, $requestId );
  169 + if (isset($exJson ['error_code']) && isset($exJson ['error_message'])) {
  170 + throw new Aliyun_Log_Exception ( $exJson ['error_code'],
  171 + $exJson ['error_message'], $requestId );
  172 + } else {
  173 + if ($exJson) {
  174 + $exJson = ' The return json is ' . json_encode($exJson);
  175 + } else {
  176 + $exJson = '';
  177 + }
  178 + throw new Aliyun_Log_Exception ( 'RequestError',
  179 + "Request is failed. Http code is $responseCode.$exJson", $requestId );
  180 + }
  181 + }
  182 + }
  183 +
  184 + /**
  185 + * @return array
  186 + * @throws Aliyun_Log_Exception
  187 + */
  188 + private function send($method, $project, $body, $resource, $params, $headers) {
  189 + if ($body) {
  190 + $headers ['Content-Length'] = strlen ( $body );
  191 + if(isset($headers ["x-log-bodyrawsize"])==false)
  192 + $headers ["x-log-bodyrawsize"] = 0;
  193 + $headers ['Content-MD5'] = Aliyun_Log_Util::calMD5 ( $body );
  194 + } else {
  195 + $headers ['Content-Length'] = 0;
  196 + $headers ["x-log-bodyrawsize"] = 0;
  197 + $headers ['Content-Type'] = ''; // If not set, http request will add automatically.
  198 + }
  199 +
  200 + $headers ['x-log-apiversion'] = API_VERSION;
  201 + $headers ['x-log-signaturemethod'] = 'hmac-sha1';
  202 + if(strlen($this->stsToken) >0)
  203 + $headers ['x-acs-security-token'] = $this -> stsToken;
  204 + if(is_null($project))$headers ['Host'] = $this->logHost;
  205 + else $headers ['Host'] = "$project.$this->logHost";
  206 + $headers ['Date'] = $this->GetGMT ();
  207 + $signature = Aliyun_Log_Util::getRequestAuthorization ( $method, $resource, $this->accessKey,$this->stsToken, $params, $headers );
  208 + $headers ['Authorization'] = "LOG $this->accessKeyId:$signature";
  209 +
  210 + $url = $resource;
  211 + if ($params)
  212 + $url .= '?' . Aliyun_Log_Util::urlEncode ( $params );
  213 + if ($this->isRowIp)
  214 + $url = "http://$this->endpoint$url";
  215 + else{
  216 + if(is_null($project))
  217 + $url = "http://$this->endpoint$url";
  218 + else $url = "http://$project.$this->endpoint$url";
  219 + }
  220 + return $this->sendRequest ( $method, $url, $body, $headers );
  221 + }
  222 +
  223 + /**
  224 + * Put logs to Log Service.
  225 + * Unsuccessful opertaion will cause an Aliyun_Log_Exception.
  226 + *
  227 + * @param Aliyun_Log_Models_PutLogsRequest $request the PutLogs request parameters class
  228 + * @throws Aliyun_Log_Exception
  229 + * @return Aliyun_Log_Models_PutLogsResponse
  230 + */
  231 + public function putLogs(Aliyun_Log_Models_PutLogsRequest $request) {
  232 + if (count ( $request->getLogitems () ) > 4096)
  233 + throw new Aliyun_Log_Exception ( 'InvalidLogSize', "logItems' length exceeds maximum limitation: 4096 lines." );
  234 +
  235 + $logGroup = new LogGroup ();
  236 + $topic = $request->getTopic () !== null ? $request->getTopic () : '';
  237 + $logGroup->setTopic ( $request->getTopic () );
  238 + $source = $request->getSource ();
  239 +
  240 + if ( ! $source )
  241 + $source = $this->source;
  242 + $logGroup->setSource ( $source );
  243 + $logitems = $request->getLogitems ();
  244 + foreach ( $logitems as $logItem ) {
  245 + $log = new Log ();
  246 + $log->setTime ( $logItem->getTime () );
  247 + $content = $logItem->getContents ();
  248 + foreach ( $content as $key => $value ) {
  249 + $content = new Log_Content ();
  250 + $content->setKey ( $key );
  251 + $content->setValue ( $value );
  252 + $log->addContents ( $content );
  253 + }
  254 +
  255 + $logGroup->addLogs ( $log );
  256 + }
  257 +
  258 + $body = Aliyun_Log_Util::toBytes( $logGroup );
  259 + unset ( $logGroup );
  260 +
  261 + $bodySize = strlen ( $body );
  262 + if ($bodySize > 3 * 1024 * 1024) // 3 MB
  263 + throw new Aliyun_Log_Exception ( 'InvalidLogSize', "logItems' size exceeds maximum limitation: 3 MB." );
  264 + $params = array ();
  265 + $headers = array ();
  266 + $headers ["x-log-bodyrawsize"] = $bodySize;
  267 + $headers ['x-log-compresstype'] = 'deflate';
  268 + $headers ['Content-Type'] = 'application/x-protobuf';
  269 + $body = gzcompress ( $body, 6 );
  270 +
  271 + $logstore = $request->getLogstore () !== null ? $request->getLogstore () : '';
  272 + $project = $request->getProject () !== null ? $request->getProject () : '';
  273 + $shardKey = $request -> getShardKey();
  274 + $resource = "/logstores/" . $logstore.($shardKey== null?"/shards/lb":"/shards/route");
  275 + if($shardKey)
  276 + $params["key"]=$shardKey;
  277 + list ( $resp, $header ) = $this->send ( "POST", $project, $body, $resource, $params, $headers );
  278 + $requestId = isset ( $header ['x-log-requestid'] ) ? $header ['x-log-requestid'] : '';
  279 + $resp = $this->parseToJson ( $resp, $requestId );
  280 + return new Aliyun_Log_Models_PutLogsResponse ( $header );
  281 + }
  282 +
  283 + /**
  284 + * create shipper service
  285 + * @param Aliyun_Log_Models_CreateShipperRequest $request
  286 + * return Aliyun_Log_Models_CreateShipperResponse
  287 + */
  288 + public function createShipper(Aliyun_Log_Models_CreateShipperRequest $request){
  289 + $headers = array();
  290 + $params = array();
  291 + $resource = "/logstores/".$request->getLogStore()."/shipper";
  292 + $project = $request->getProject () !== null ? $request->getProject () : '';
  293 + $headers["Content-Type"] = "application/json";
  294 +
  295 + $body = array(
  296 + "shipperName" => $request->getShipperName(),
  297 + "targetType" => $request->getTargetType(),
  298 + "targetConfiguration" => $request->getTargetConfigration()
  299 + );
  300 + $body_str = json_encode($body);
  301 + $headers["x-log-bodyrawsize"] = strlen($body_str);
  302 + list($resp, $header) = $this->send("POST", $project,$body_str,$resource,$params,$headers);
  303 + $requestId = isset($header['x-log-requestid']) ? $header ['x-log-requestid'] : '';
  304 + $resp = $this->parseToJson($resp, $requestId);
  305 + return new Aliyun_Log_Models_CreateShipperResponse($resp, $header);
  306 + }
  307 +
  308 + /**
  309 + * create shipper service
  310 + * @param Aliyun_Log_Models_UpdateShipperRequest $request
  311 + * return Aliyun_Log_Models_UpdateShipperResponse
  312 + */
  313 + public function updateShipper(Aliyun_Log_Models_UpdateShipperRequest $request){
  314 + $headers = array();
  315 + $params = array();
  316 + $resource = "/logstores/".$request->getLogStore()."/shipper/".$request->getShipperName();
  317 + $project = $request->getProject () !== null ? $request->getProject () : '';
  318 + $headers["Content-Type"] = "application/json";
  319 +
  320 + $body = array(
  321 + "shipperName" => $request->getShipperName(),
  322 + "targetType" => $request->getTargetType(),
  323 + "targetConfiguration" => $request->getTargetConfigration()
  324 + );
  325 + $body_str = json_encode($body);
  326 + $headers["x-log-bodyrawsize"] = strlen($body_str);
  327 + list($resp, $header) = $this->send("PUT", $project,$body_str,$resource,$params,$headers);
  328 + $requestId = isset($header['x-log-requestid']) ? $header ['x-log-requestid'] : '';
  329 + $resp = $this->parseToJson($resp, $requestId);
  330 + return new Aliyun_Log_Models_UpdateShipperResponse($resp, $header);
  331 + }
  332 +
  333 + /**
  334 + * get shipper tasks list, max 48 hours duration supported
  335 + * @param Aliyun_Log_Models_GetShipperTasksRequest $request
  336 + * return Aliyun_Log_Models_GetShipperTasksResponse
  337 + */
  338 + public function getShipperTasks(Aliyun_Log_Models_GetShipperTasksRequest $request){
  339 + $headers = array();
  340 + $params = array(
  341 + 'from' => $request->getStartTime(),
  342 + 'to' => $request->getEndTime(),
  343 + 'status' => $request->getStatusType(),
  344 + 'offset' => $request->getOffset(),
  345 + 'size' => $request->getSize()
  346 + );
  347 + $resource = "/logstores/".$request->getLogStore()."/shipper/".$request->getShipperName()."/tasks";
  348 + $project = $request->getProject () !== null ? $request->getProject () : '';
  349 + $headers["x-log-bodyrawsize"] = 0;
  350 + $headers["Content-Type"] = "application/json";
  351 +
  352 + list($resp, $header) = $this->send("GET", $project,null,$resource,$params,$headers);
  353 + $requestId = isset($header['x-log-requestid']) ? $header ['x-log-requestid'] : '';
  354 + $resp = $this->parseToJson($resp, $requestId);
  355 + return new Aliyun_Log_Models_GetShipperTasksResponse($resp, $header);
  356 + }
  357 +
  358 + /**
  359 + * retry shipper tasks list by task ids
  360 + * @param Aliyun_Log_Models_RetryShipperTasksRequest $request
  361 + * return Aliyun_Log_Models_RetryShipperTasksResponse
  362 + */
  363 + public function retryShipperTasks(Aliyun_Log_Models_RetryShipperTasksRequest $request){
  364 + $headers = array();
  365 + $params = array();
  366 + $resource = "/logstores/".$request->getLogStore()."/shipper/".$request->getShipperName()."/tasks";
  367 + $project = $request->getProject () !== null ? $request->getProject () : '';
  368 +
  369 + $headers["Content-Type"] = "application/json";
  370 + $body = $request->getTaskLists();
  371 + $body_str = json_encode($body);
  372 + $headers["x-log-bodyrawsize"] = strlen($body_str);
  373 + list($resp, $header) = $this->send("PUT", $project,$body_str,$resource,$params,$headers);
  374 + $requestId = isset($header['x-log-requestid']) ? $header ['x-log-requestid'] : '';
  375 + $resp = $this->parseToJson($resp, $requestId);
  376 + return new Aliyun_Log_Models_RetryShipperTasksResponse($resp, $header);
  377 + }
  378 +
  379 + /**
  380 + * delete shipper service
  381 + * @param Aliyun_Log_Models_DeleteShipperRequest $request
  382 + * return Aliyun_Log_Models_DeleteShipperResponse
  383 + */
  384 + public function deleteShipper(Aliyun_Log_Models_DeleteShipperRequest $request){
  385 + $headers = array();
  386 + $params = array();
  387 + $resource = "/logstores/".$request->getLogStore()."/shipper/".$request->getShipperName();
  388 + $project = $request->getProject () !== null ? $request->getProject () : '';
  389 + $headers["x-log-bodyrawsize"] = 0;
  390 + $headers["Content-Type"] = "application/json";
  391 +
  392 + list($resp, $header) = $this->send("DELETE", $project,null,$resource,$params,$headers);
  393 + $requestId = isset($header['x-log-requestid']) ? $header ['x-log-requestid'] : '';
  394 + $resp = $this->parseToJson($resp, $requestId);
  395 + return new Aliyun_Log_Models_DeleteShipperResponse($resp, $header);
  396 + }
  397 +
  398 + /**
  399 + * get shipper config service
  400 + * @param Aliyun_Log_Models_GetShipperConfigRequest $request
  401 + * return Aliyun_Log_Models_GetShipperConfigResponse
  402 + */
  403 + public function getShipperConfig(Aliyun_Log_Models_GetShipperConfigRequest $request){
  404 + $headers = array();
  405 + $params = array();
  406 + $resource = "/logstores/".$request->getLogStore()."/shipper/".$request->getShipperName();
  407 + $project = $request->getProject () !== null ? $request->getProject () : '';
  408 + $headers["x-log-bodyrawsize"] = 0;
  409 + $headers["Content-Type"] = "application/json";
  410 +
  411 + list($resp, $header) = $this->send("GET", $project,null,$resource,$params,$headers);
  412 + $requestId = isset($header['x-log-requestid']) ? $header ['x-log-requestid'] : '';
  413 + $resp = $this->parseToJson($resp, $requestId);
  414 + return new Aliyun_Log_Models_GetShipperConfigResponse($resp, $header);
  415 + }
  416 +
  417 + /**
  418 + * list shipper service
  419 + * @param Aliyun_Log_Models_ListShipperRequest $request
  420 + * return Aliyun_Log_Models_ListShipperResponse
  421 + */
  422 + public function listShipper(Aliyun_Log_Models_ListShipperRequest $request){
  423 + $headers = array();
  424 + $params = array();
  425 + $resource = "/logstores/".$request->getLogStore()."/shipper";
  426 + $project = $request->getProject () !== null ? $request->getProject () : '';
  427 + $headers["x-log-bodyrawsize"] = 0;
  428 + $headers["Content-Type"] = "application/json";
  429 +
  430 + list($resp, $header) = $this->send("GET", $project,null,$resource,$params,$headers);
  431 + $requestId = isset($header['x-log-requestid']) ? $header ['x-log-requestid'] : '';
  432 + $resp = $this->parseToJson($resp, $requestId);
  433 + return new Aliyun_Log_Models_ListShipperResponse($resp, $header);
  434 + }
  435 +
  436 + /**
  437 + * create logstore
  438 + * Unsuccessful opertaion will cause an Aliyun_Log_Exception.
  439 + *
  440 + * @param Aliyun_Log_Models_CreateLogstoreRequest $request the CreateLogStore request parameters class.
  441 + * @throws Aliyun_Log_Exception
  442 + * return Aliyun_Log_Models_CreateLogstoreResponse
  443 + */
  444 + public function createLogstore(Aliyun_Log_Models_CreateLogstoreRequest $request){
  445 + $headers = array ();
  446 + $params = array ();
  447 + $resource = '/logstores';
  448 + $project = $request->getProject () !== null ? $request->getProject () : '';
  449 + $headers["x-log-bodyrawsize"] = 0;
  450 + $headers["Content-Type"] = "application/json";
  451 + $body = array(
  452 + "logstoreName" => $request -> getLogstore(),
  453 + "ttl" => (int)($request -> getTtl()),
  454 + "shardCount" => (int)($request -> getShardCount())
  455 + );
  456 + $body_str = json_encode($body);
  457 + $headers["x-log-bodyrawsize"] = strlen($body_str);
  458 + list($resp,$header) = $this -> send("POST",$project,$body_str,$resource,$params,$headers);
  459 + $requestId = isset ( $header ['x-log-requestid'] ) ? $header ['x-log-requestid'] : '';
  460 + $resp = $this->parseToJson ( $resp, $requestId );
  461 + return new Aliyun_Log_Models_CreateLogstoreResponse($resp,$header);
  462 + }
  463 + /**
  464 + * update logstore
  465 + * Unsuccessful opertaion will cause an Aliyun_Log_Exception.
  466 + *
  467 + * @param Aliyun_Log_Models_UpdateLogstoreRequest $request the UpdateLogStore request parameters class.
  468 + * @throws Aliyun_Log_Exception
  469 + * return Aliyun_Log_Models_UpdateLogstoreResponse
  470 + */
  471 + public function updateLogstore(Aliyun_Log_Models_UpdateLogstoreRequest $request){
  472 + $headers = array ();
  473 + $params = array ();
  474 + $project = $request->getProject () !== null ? $request->getProject () : '';
  475 + $headers["Content-Type"] = "application/json";
  476 + $body = array(
  477 + "logstoreName" => $request -> getLogstore(),
  478 + "ttl" => (int)($request -> getTtl()),
  479 + "shardCount" => (int)($request -> getShardCount())
  480 + );
  481 + $resource = '/logstores/'.$request -> getLogstore();
  482 + $body_str = json_encode($body);
  483 + $headers["x-log-bodyrawsize"] = strlen($body_str);
  484 + list($resp,$header) = $this -> send("PUT",$project,$body_str,$resource,$params,$headers);
  485 + $requestId = isset ( $header ['x-log-requestid'] ) ? $header ['x-log-requestid'] : '';
  486 + $resp = $this->parseToJson ( $resp, $requestId );
  487 + return new Aliyun_Log_Models_UpdateLogstoreResponse($resp,$header);
  488 + }
  489 + /**
  490 + * List all logstores of requested project.
  491 + * Unsuccessful opertaion will cause an Aliyun_Log_Exception.
  492 + *
  493 + * @param Aliyun_Log_Models_ListLogstoresRequest $request the ListLogstores request parameters class.
  494 + * @throws Aliyun_Log_Exception
  495 + * @return Aliyun_Log_Models_ListLogstoresResponse
  496 + */
  497 + public function listLogstores(Aliyun_Log_Models_ListLogstoresRequest $request) {
  498 + $headers = array ();
  499 + $params = array ();
  500 + $resource = '/logstores';
  501 + $project = $request->getProject () !== null ? $request->getProject () : '';
  502 + list ( $resp, $header ) = $this->send ( "GET", $project, NULL, $resource, $params, $headers );
  503 + $requestId = isset ( $header ['x-log-requestid'] ) ? $header ['x-log-requestid'] : '';
  504 + $resp = $this->parseToJson ( $resp, $requestId );
  505 + return new Aliyun_Log_Models_ListLogstoresResponse ( $resp, $header );
  506 + }
  507 +
  508 + /**
  509 + * Delete logstore
  510 + * Unsuccessful opertaion will cause an Aliyun_Log_Exception.
  511 + *
  512 + * @param Aliyun_Log_Models_DeleteLogstoreRequest $request the DeleteLogstores request parameters class.
  513 + * @throws Aliyun_Log_Exception
  514 + * @return Aliyun_Log_Models_DeleteLogstoresResponse
  515 + */
  516 + public function deleteLogstore(Aliyun_Log_Models_DeleteLogstoreRequest $request) {
  517 + $headers = array ();
  518 + $params = array ();
  519 + $project = $request->getProject () !== null ? $request->getProject () : '';
  520 + $logstore = $request -> getLogstore() != null ? $request -> getLogstore() :"";
  521 + $resource = "/logstores/$logstore";
  522 + list ( $resp, $header ) = $this->send ( "DELETE", $project, NULL, $resource, $params, $headers );
  523 + $requestId = isset ( $header ['x-log-requestid'] ) ? $header ['x-log-requestid'] : '';
  524 + $resp = $this->parseToJson ( $resp, $requestId );
  525 + return new Aliyun_Log_Models_DeleteLogstoreResponse ( $resp, $header );
  526 + }
  527 +
  528 + /**
  529 + * List all topics in a logstore.
  530 + * Unsuccessful opertaion will cause an Aliyun_Log_Exception.
  531 + *
  532 + * @param Aliyun_Log_Models_ListTopicsRequest $request the ListTopics request parameters class.
  533 + * @throws Aliyun_Log_Exception
  534 + * @return Aliyun_Log_Models_ListTopicsResponse
  535 + */
  536 + public function listTopics(Aliyun_Log_Models_ListTopicsRequest $request) {
  537 + $headers = array ();
  538 + $params = array ();
  539 + if ($request->getToken () !== null)
  540 + $params ['token'] = $request->getToken ();
  541 + if ($request->getLine () !== null)
  542 + $params ['line'] = $request->getLine ();
  543 + $params ['type'] = 'topic';
  544 + $logstore = $request->getLogstore () !== null ? $request->getLogstore () : '';
  545 + $project = $request->getProject () !== null ? $request->getProject () : '';
  546 + $resource = "/logstores/$logstore";
  547 + list ( $resp, $header ) = $this->send ( "GET", $project, NULL, $resource, $params, $headers );
  548 + $requestId = isset ( $header ['x-log-requestid'] ) ? $header ['x-log-requestid'] : '';
  549 + $resp = $this->parseToJson ( $resp, $requestId );
  550 + return new Aliyun_Log_Models_ListTopicsResponse ( $resp, $header );
  551 + }
  552 +
  553 + /**
  554 + * Get histograms of requested query from log service.
  555 + * Unsuccessful opertaion will cause an Aliyun_Log_Exception.
  556 + *
  557 + * @param Aliyun_Log_Models_GetHistogramsRequest $request the GetHistograms request parameters class.
  558 + * @throws Aliyun_Log_Exception
  559 + * @return array(json body, http header)
  560 + */
  561 + public function getHistogramsJson(Aliyun_Log_Models_GetHistogramsRequest $request) {
  562 + $headers = array ();
  563 + $params = array ();
  564 + if ($request->getTopic () !== null)
  565 + $params ['topic'] = $request->getTopic ();
  566 + if ($request->getFrom () !== null)
  567 + $params ['from'] = $request->getFrom ();
  568 + if ($request->getTo () !== null)
  569 + $params ['to'] = $request->getTo ();
  570 + if ($request->getQuery () !== null)
  571 + $params ['query'] = $request->getQuery ();
  572 + $params ['type'] = 'histogram';
  573 + $logstore = $request->getLogstore () !== null ? $request->getLogstore () : '';
  574 + $project = $request->getProject () !== null ? $request->getProject () : '';
  575 + $resource = "/logstores/$logstore";
  576 + list ( $resp, $header ) = $this->send ( "GET", $project, NULL, $resource, $params, $headers );
  577 + $requestId = isset ( $header ['x-log-requestid'] ) ? $header ['x-log-requestid'] : '';
  578 + $resp = $this->parseToJson ( $resp, $requestId );
  579 + return array($resp, $header);
  580 + }
  581 +
  582 + /**
  583 + * Get histograms of requested query from log service.
  584 + * Unsuccessful opertaion will cause an Aliyun_Log_Exception.
  585 + *
  586 + * @param Aliyun_Log_Models_GetHistogramsRequest $request the GetHistograms request parameters class.
  587 + * @throws Aliyun_Log_Exception
  588 + * @return Aliyun_Log_Models_GetHistogramsResponse
  589 + */
  590 + public function getHistograms(Aliyun_Log_Models_GetHistogramsRequest $request) {
  591 + $ret = $this->getHistogramsJson($request);
  592 + $resp = $ret[0];
  593 + $header = $ret[1];
  594 + return new Aliyun_Log_Models_GetHistogramsResponse ( $resp, $header );
  595 + }
  596 +
  597 + /**
  598 + * Get logs from Log service.
  599 + * Unsuccessful opertaion will cause an Aliyun_Log_Exception.
  600 + *
  601 + * @param Aliyun_Log_Models_GetLogsRequest $request the GetLogs request parameters class.
  602 + * @throws Aliyun_Log_Exception
  603 + * @return array(json body, http header)
  604 + */
  605 + public function getLogsJson(Aliyun_Log_Models_GetLogsRequest $request) {
  606 + $headers = array ();
  607 + $params = array ();
  608 + if ($request->getTopic () !== null)
  609 + $params ['topic'] = $request->getTopic ();
  610 + if ($request->getFrom () !== null)
  611 + $params ['from'] = $request->getFrom ();
  612 + if ($request->getTo () !== null)
  613 + $params ['to'] = $request->getTo ();
  614 + if ($request->getQuery () !== null)
  615 + $params ['query'] = $request->getQuery ();
  616 + $params ['type'] = 'log';
  617 + if ($request->getLine () !== null)
  618 + $params ['line'] = $request->getLine ();
  619 + if ($request->getOffset () !== null)
  620 + $params ['offset'] = $request->getOffset ();
  621 + if ($request->getOffset () !== null)
  622 + $params ['reverse'] = $request->getReverse () ? 'true' : 'false';
  623 + $logstore = $request->getLogstore () !== null ? $request->getLogstore () : '';
  624 + $project = $request->getProject () !== null ? $request->getProject () : '';
  625 + $resource = "/logstores/$logstore";
  626 + list ( $resp, $header ) = $this->send ( "GET", $project, NULL, $resource, $params, $headers );
  627 + $requestId = isset ( $header ['x-log-requestid'] ) ? $header ['x-log-requestid'] : '';
  628 + $resp = $this->parseToJson ( $resp, $requestId );
  629 + return array($resp, $header);
  630 + //return new Aliyun_Log_Models_GetLogsResponse ( $resp, $header );
  631 + }
  632 +
  633 + /**
  634 + * Get logs from Log service.
  635 + * Unsuccessful opertaion will cause an Aliyun_Log_Exception.
  636 + *
  637 + * @param Aliyun_Log_Models_GetLogsRequest $request the GetLogs request parameters class.
  638 + * @throws Aliyun_Log_Exception
  639 + * @return Aliyun_Log_Models_GetLogsResponse
  640 + */
  641 + public function getLogs(Aliyun_Log_Models_GetLogsRequest $request) {
  642 + $ret = $this->getLogsJson($request);
  643 + $resp = $ret[0];
  644 + $header = $ret[1];
  645 + return new Aliyun_Log_Models_GetLogsResponse ( $resp, $header );
  646 + }
  647 +
  648 + /**
  649 + * Get logs from Log service.
  650 + * Unsuccessful opertaion will cause an Aliyun_Log_Exception.
  651 + *
  652 + * @param Aliyun_Log_Models_GetProjectLogsRequest $request the GetLogs request parameters class.
  653 + * @throws Aliyun_Log_Exception
  654 + * @return array(json body, http header)
  655 + */
  656 + public function getProjectLogsJson(Aliyun_Log_Models_GetProjectLogsRequest $request) {
  657 + $headers = array ();
  658 + $params = array ();
  659 + if ($request->getQuery () !== null)
  660 + $params ['query'] = $request->getQuery ();
  661 + $project = $request->getProject () !== null ? $request->getProject () : '';
  662 + $resource = "/logs";
  663 + list ( $resp, $header ) = $this->send ( "GET", $project, NULL, $resource, $params, $headers );
  664 + $requestId = isset ( $header ['x-log-requestid'] ) ? $header ['x-log-requestid'] : '';
  665 + $resp = $this->parseToJson ( $resp, $requestId );
  666 + return array($resp, $header);
  667 + //return new Aliyun_Log_Models_GetLogsResponse ( $resp, $header );
  668 + }
  669 + /**
  670 + * Get logs from Log service.
  671 + * Unsuccessful opertaion will cause an Aliyun_Log_Exception.
  672 + *
  673 + * @param Aliyun_Log_Models_GetProjectLogsRequest $request the GetLogs request parameters class.
  674 + * @throws Aliyun_Log_Exception
  675 + * @return Aliyun_Log_Models_GetLogsResponse
  676 + */
  677 + public function getProjectLogs(Aliyun_Log_Models_GetProjectLogsRequest $request) {
  678 + $ret = $this->getProjectLogsJson($request);
  679 + $resp = $ret[0];
  680 + $header = $ret[1];
  681 + return new Aliyun_Log_Models_GetLogsResponse ( $resp, $header );
  682 + }
  683 +
  684 + /**
  685 + * Get logs from Log service with shardid conditions.
  686 + * Unsuccessful opertaion will cause an Aliyun_Log_Exception.
  687 + *
  688 + * @param Aliyun_Log_Models_BatchGetLogsRequest $request the BatchGetLogs request parameters class.
  689 + * @throws Aliyun_Log_Exception
  690 + * @return Aliyun_Log_Models_BatchGetLogsResponse
  691 + */
  692 + public function batchGetLogs(Aliyun_Log_Models_BatchGetLogsRequest $request) {
  693 + $params = array();
  694 + $headers = array();
  695 + $project = $request->getProject()!==null?$request->getProject():'';
  696 + $logstore = $request->getLogstore()!==null?$request->getLogstore():'';
  697 + $shardId = $request->getShardId()!==null?$request->getShardId():'';
  698 + if($request->getCount()!==null)
  699 + $params['count']=$request->getCount();
  700 + if($request->getCursor()!==null)
  701 + $params['cursor']=$request->getCursor();
  702 + if($request->getEndCursor()!==null)
  703 + $params['end_cursor']=$request->getEndCursor();
  704 + $params['type']='log';
  705 + $headers['Accept-Encoding']='gzip';
  706 + $headers['accept']='application/x-protobuf';
  707 +
  708 + $resource = "/logstores/$logstore/shards/$shardId";
  709 + list($resp,$header) = $this->send("GET",$project,NULL,$resource,$params,$headers);
  710 + //$resp is a byteArray
  711 + $resp = gzuncompress($resp);
  712 + if($resp===false)$resp = new LogGroupList();
  713 +
  714 + else {
  715 + $resp = new LogGroupList($resp);
  716 + }
  717 + return new Aliyun_Log_Models_BatchGetLogsResponse ( $resp, $header );
  718 + }
  719 +
  720 + /**
  721 + * List Shards from Log service with Project and logstore conditions.
  722 + * Unsuccessful opertaion will cause an Aliyun_Log_Exception.
  723 + *
  724 + * @param Aliyun_Log_Models_ListShardsRequest $request the ListShards request parameters class.
  725 + * @throws Aliyun_Log_Exception
  726 + * @return Aliyun_Log_Models_ListShardsResponse
  727 + */
  728 + public function listShards(Aliyun_Log_Models_ListShardsRequest $request) {
  729 + $params = array();
  730 + $headers = array();
  731 + $project = $request->getProject()!==null?$request->getProject():'';
  732 + $logstore = $request->getLogstore()!==null?$request->getLogstore():'';
  733 +
  734 + $resource='/logstores/'.$logstore.'/shards';
  735 + list($resp,$header) = $this->send("GET",$project,NULL,$resource,$params,$headers);
  736 + $requestId = isset ( $header ['x-log-requestid'] ) ? $header ['x-log-requestid'] : '';
  737 + $resp = $this->parseToJson ( $resp, $requestId );
  738 + return new Aliyun_Log_Models_ListShardsResponse ( $resp, $header );
  739 + }
  740 +
  741 + /**
  742 + * split a shard into two shards with Project and logstore and shardId and midHash conditions.
  743 + * Unsuccessful opertaion will cause an Aliyun_Log_Exception.
  744 + *
  745 + * @param Aliyun_Log_Models_SplitShardRequest $request the SplitShard request parameters class.
  746 + * @throws Aliyun_Log_Exception
  747 + * @return Aliyun_Log_Models_ListShardsResponse
  748 + */
  749 + public function splitShard(Aliyun_Log_Models_SplitShardRequest $request) {
  750 + $params = array();
  751 + $headers = array();
  752 + $project = $request->getProject()!==null?$request->getProject():'';
  753 + $logstore = $request->getLogstore()!==null?$request->getLogstore():'';
  754 + $shardId = $request -> getShardId()!== null ? $request -> getShardId():-1;
  755 + $midHash = $request -> getMidHash()!= null?$request -> getMidHash():"";
  756 +
  757 + $resource='/logstores/'.$logstore.'/shards/'.$shardId;
  758 + $params["action"] = "split";
  759 + $params["key"] = $midHash;
  760 + list($resp,$header) = $this->send("POST",$project,NULL,$resource,$params,$headers);
  761 + $requestId = isset ( $header ['x-log-requestid'] ) ? $header ['x-log-requestid'] : '';
  762 + $resp = $this->parseToJson ( $resp, $requestId );
  763 + return new Aliyun_Log_Models_ListShardsResponse ( $resp, $header );
  764 + }
  765 + /**
  766 + * merge two shards into one shard with Project and logstore and shardId and conditions.
  767 + * Unsuccessful opertaion will cause an Aliyun_Log_Exception.
  768 + *
  769 + * @param Aliyun_Log_Models_MergeShardsRequest $request the MergeShards request parameters class.
  770 + * @throws Aliyun_Log_Exception
  771 + * @return Aliyun_Log_Models_ListShardsResponse
  772 + */
  773 + public function MergeShards(Aliyun_Log_Models_MergeShardsRequest $request) {
  774 + $params = array();
  775 + $headers = array();
  776 + $project = $request->getProject()!==null?$request->getProject():'';
  777 + $logstore = $request->getLogstore()!==null?$request->getLogstore():'';
  778 + $shardId = $request -> getShardId()!= null ? $request -> getShardId():-1;
  779 +
  780 + $resource='/logstores/'.$logstore.'/shards/'.$shardId;
  781 + $params["action"] = "merge";
  782 + list($resp,$header) = $this->send("POST",$project,NULL,$resource,$params,$headers);
  783 + $requestId = isset ( $header ['x-log-requestid'] ) ? $header ['x-log-requestid'] : '';
  784 + $resp = $this->parseToJson ( $resp, $requestId );
  785 + return new Aliyun_Log_Models_ListShardsResponse ( $resp, $header );
  786 + }
  787 + /**
  788 + * delete a read only shard with Project and logstore and shardId conditions.
  789 + * Unsuccessful opertaion will cause an Aliyun_Log_Exception.
  790 + *
  791 + * @param Aliyun_Log_Models_DeleteShardRequest $request the DeleteShard request parameters class.
  792 + * @throws Aliyun_Log_Exception
  793 + * @return Aliyun_Log_Models_ListShardsResponse
  794 + */
  795 + public function DeleteShard(Aliyun_Log_Models_DeleteShardRequest $request) {
  796 + $params = array();
  797 + $headers = array();
  798 + $project = $request->getProject()!==null?$request->getProject():'';
  799 + $logstore = $request->getLogstore()!==null?$request->getLogstore():'';
  800 + $shardId = $request -> getShardId()!= null ? $request -> getShardId():-1;
  801 +
  802 + $resource='/logstores/'.$logstore.'/shards/'.$shardId;
  803 + list($resp,$header) = $this->send("DELETE",$project,NULL,$resource,$params,$headers);
  804 + $requestId = isset ( $header ['x-log-requestid'] ) ? $header ['x-log-requestid'] : '';
  805 + return new Aliyun_Log_Models_DeleteShardResponse ( $header );
  806 + }
  807 +
  808 + /**
  809 + * Get cursor from Log service.
  810 + * Unsuccessful opertaion will cause an Aliyun_Log_Exception.
  811 + *
  812 + * @param Aliyun_Log_Models_GetCursorRequest $request the GetCursor request parameters class.
  813 + * @throws Aliyun_Log_Exception
  814 + * @return Aliyun_Log_Models_GetCursorResponse
  815 + */
  816 + public function getCursor(Aliyun_Log_Models_GetCursorRequest $request){
  817 + $params = array();
  818 + $headers = array();
  819 + $project = $request->getProject()!==null?$request->getProject():'';
  820 + $logstore = $request->getLogstore()!==null?$request->getLogstore():'';
  821 + $shardId = $request->getShardId()!==null?$request->getShardId():'';
  822 + $mode = $request->getMode()!==null?$request->getMode():'';
  823 + $fromTime = $request->getFromTime()!==null?$request->getFromTime():-1;
  824 +
  825 + if((empty($mode) xor $fromTime==-1)==false){
  826 + if(!empty($mode))
  827 + throw new Aliyun_Log_Exception ( 'RequestError',"Request is failed. Mode and fromTime can not be not empty simultaneously");
  828 + else
  829 + throw new Aliyun_Log_Exception ( 'RequestError',"Request is failed. Mode and fromTime can not be empty simultaneously");
  830 + }
  831 + if(!empty($mode) && strcmp($mode,'begin')!==0 && strcmp($mode,'end')!==0)
  832 + throw new Aliyun_Log_Exception ( 'RequestError',"Request is failed. Mode value invalid:$mode");
  833 + if($fromTime!==-1 && (is_integer($fromTime)==false || $fromTime<0))
  834 + throw new Aliyun_Log_Exception ( 'RequestError',"Request is failed. FromTime value invalid:$fromTime");
  835 + $params['type']='cursor';
  836 + if($fromTime!==-1)$params['from']=$fromTime;
  837 + else $params['mode'] = $mode;
  838 + $resource='/logstores/'.$logstore.'/shards/'.$shardId;
  839 + list($resp,$header) = $this->send("GET",$project,NULL,$resource,$params,$headers);
  840 + $requestId = isset ( $header ['x-log-requestid'] ) ? $header ['x-log-requestid'] : '';
  841 + $resp = $this->parseToJson ( $resp, $requestId );
  842 + return new Aliyun_Log_Models_GetCursorResponse($resp,$header);
  843 + }
  844 +
  845 + public function createConfig(Aliyun_Log_Models_CreateConfigRequest $request){
  846 + $params = array();
  847 + $headers = array();
  848 + $body=null;
  849 + if($request->getConfig()!==null){
  850 + $body = json_encode($request->getConfig()->toArray());
  851 + }
  852 + $headers ['Content-Type'] = 'application/json';
  853 + $resource = '/configs';
  854 + list($resp,$header) = $this->send("POST",NULL,$body,$resource,$params,$headers);
  855 + return new Aliyun_Log_Models_CreateConfigResponse($header);
  856 + }
  857 +
  858 + public function updateConfig(Aliyun_Log_Models_UpdateConfigRequest $request){
  859 + $params = array();
  860 + $headers = array();
  861 + $body=null;
  862 + $configName='';
  863 + if($request->getConfig()!==null){
  864 + $body = json_encode($request->getConfig()->toArray());
  865 + $configName=($request->getConfig()->getConfigName()!==null)?$request->getConfig()->getConfigName():'';
  866 + }
  867 + $headers ['Content-Type'] = 'application/json';
  868 + $resource = '/configs/'.$configName;
  869 + list($resp,$header) = $this->send("PUT",NULL,$body,$resource,$params,$headers);
  870 + return new Aliyun_Log_Models_UpdateConfigResponse($header);
  871 + }
  872 +
  873 + public function getConfig(Aliyun_Log_Models_GetConfigRequest $request){
  874 + $params = array();
  875 + $headers = array();
  876 +
  877 + $configName = ($request->getConfigName()!==null)?$request->getConfigName():'';
  878 +
  879 + $resource = '/configs/'.$configName;
  880 + list($resp,$header) = $this->send("GET",NULL,NULL,$resource,$params,$headers);
  881 + $requestId = isset ( $header ['x-log-requestid'] ) ? $header ['x-log-requestid'] : '';
  882 + $resp = $this->parseToJson ( $resp, $requestId );
  883 + return new Aliyun_Log_Models_GetConfigResponse($resp,$header);
  884 + }
  885 +
  886 + public function deleteConfig(Aliyun_Log_Models_DeleteConfigRequest $request){
  887 + $params = array();
  888 + $headers = array();
  889 + $configName = ($request->getConfigName()!==null)?$request->getConfigName():'';
  890 + $resource = '/configs/'.$configName;
  891 + list($resp,$header) = $this->send("DELETE",NULL,NULL,$resource,$params,$headers);
  892 + return new Aliyun_Log_Models_DeleteConfigResponse($header);
  893 + }
  894 +
  895 + public function listConfigs(Aliyun_Log_Models_ListConfigsRequest $request){
  896 + $params = array();
  897 + $headers = array();
  898 +
  899 + if($request->getConfigName()!==null)$params['configName'] = $request->getConfigName();
  900 + if($request->getOffset()!==null)$params['offset'] = $request->getOffset();
  901 + if($request->getSize()!==null)$params['size'] = $request->getSize();
  902 +
  903 + $resource = '/configs';
  904 + list($resp,$header) = $this->send("GET",NULL,NULL,$resource,$params,$headers);
  905 + $requestId = isset ( $header ['x-log-requestid'] ) ? $header ['x-log-requestid'] : '';
  906 + $resp = $this->parseToJson ( $resp, $requestId );
  907 + return new Aliyun_Log_Models_ListConfigsResponse($resp,$header);
  908 + }
  909 +
  910 + public function createMachineGroup(Aliyun_Log_Models_CreateMachineGroupRequest $request){
  911 + $params = array();
  912 + $headers = array();
  913 + $body=null;
  914 + if($request->getMachineGroup()!==null){
  915 + $body = json_encode($request->getMachineGroup()->toArray());
  916 + }
  917 + $headers ['Content-Type'] = 'application/json';
  918 + $resource = '/machinegroups';
  919 + list($resp,$header) = $this->send("POST",NULL,$body,$resource,$params,$headers);
  920 +
  921 + return new Aliyun_Log_Models_CreateMachineGroupResponse($header);
  922 + }
  923 +
  924 + public function updateMachineGroup(Aliyun_Log_Models_UpdateMachineGroupRequest $request){
  925 + $params = array();
  926 + $headers = array();
  927 + $body=null;
  928 + $groupName='';
  929 + if($request->getMachineGroup()!==null){
  930 + $body = json_encode($request->getMachineGroup()->toArray());
  931 + $groupName=($request->getMachineGroup()->getGroupName()!==null)?$request->getMachineGroup()->getGroupName():'';
  932 + }
  933 + $headers ['Content-Type'] = 'application/json';
  934 + $resource = '/machinegroups/'.$groupName;
  935 + list($resp,$header) = $this->send("PUT",NULL,$body,$resource,$params,$headers);
  936 + return new Aliyun_Log_Models_UpdateMachineGroupResponse($header);
  937 + }
  938 +
  939 + public function getMachineGroup(Aliyun_Log_Models_GetMachineGroupRequest $request){
  940 + $params = array();
  941 + $headers = array();
  942 +
  943 + $groupName = ($request->getGroupName()!==null)?$request->getGroupName():'';
  944 +
  945 + $resource = '/machinegroups/'.$groupName;
  946 + list($resp,$header) = $this->send("GET",NULL,NULL,$resource,$params,$headers);
  947 + $requestId = isset ( $header ['x-log-requestid'] ) ? $header ['x-log-requestid'] : '';
  948 + $resp = $this->parseToJson ( $resp, $requestId );
  949 + return new Aliyun_Log_Models_GetMachineGroupResponse($resp,$header);
  950 + }
  951 +
  952 + public function deleteMachineGroup(Aliyun_Log_Models_DeleteMachineGroupRequest $request){
  953 + $params = array();
  954 + $headers = array();
  955 +
  956 + $groupName = ($request->getGroupName()!==null)?$request->getGroupName():'';
  957 + $resource = '/machinegroups/'.$groupName;
  958 + list($resp,$header) = $this->send("DELETE",NULL,NULL,$resource,$params,$headers);
  959 + return new Aliyun_Log_Models_DeleteMachineGroupResponse($header);
  960 + }
  961 +
  962 + public function listMachineGroups(Aliyun_Log_Models_ListMachineGroupsRequest $request){
  963 + $params = array();
  964 + $headers = array();
  965 +
  966 + if($request->getGroupName()!==null)$params['groupName'] = $request->getGroupName();
  967 + if($request->getOffset()!==null)$params['offset'] = $request->getOffset();
  968 + if($request->getSize()!==null)$params['size'] = $request->getSize();
  969 +
  970 + $resource = '/machinegroups';
  971 + list($resp,$header) = $this->send("GET",NULL,NULL,$resource,$params,$headers);
  972 + $requestId = isset ( $header ['x-log-requestid'] ) ? $header ['x-log-requestid'] : '';
  973 + $resp = $this->parseToJson ( $resp, $requestId );
  974 +
  975 + return new Aliyun_Log_Models_ListMachineGroupsResponse($resp,$header);
  976 + }
  977 +
  978 + public function applyConfigToMachineGroup(Aliyun_Log_Models_ApplyConfigToMachineGroupRequest $request){
  979 + $params = array();
  980 + $headers = array();
  981 + $configName=$request->getConfigName();
  982 + $groupName=$request->getGroupName();
  983 + $headers ['Content-Type'] = 'application/json';
  984 + $resource = '/machinegroups/'.$groupName.'/configs/'.$configName;
  985 + list($resp,$header) = $this->send("PUT",NULL,NULL,$resource,$params,$headers);
  986 + return new Aliyun_Log_Models_ApplyConfigToMachineGroupResponse($header);
  987 + }
  988 +
  989 + public function removeConfigFromMachineGroup(Aliyun_Log_Models_RemoveConfigFromMachineGroupRequest $request){
  990 + $params = array();
  991 + $headers = array();
  992 + $configName=$request->getConfigName();
  993 + $groupName=$request->getGroupName();
  994 + $headers ['Content-Type'] = 'application/json';
  995 + $resource = '/machinegroups/'.$groupName.'/configs/'.$configName;
  996 + list($resp,$header) = $this->send("DELETE",NULL,NULL,$resource,$params,$headers);
  997 + return new Aliyun_Log_Models_RemoveConfigFromMachineGroupResponse($header);
  998 + }
  999 +
  1000 + public function getMachine(Aliyun_Log_Models_GetMachineRequest $request){
  1001 + $params = array();
  1002 + $headers = array();
  1003 +
  1004 + $uuid = ($request->getUuid()!==null)?$request->getUuid():'';
  1005 +
  1006 + $resource = '/machines/'.$uuid;
  1007 + list($resp,$header) = $this->send("GET",NULL,NULL,$resource,$params,$headers);
  1008 + $requestId = isset ( $header ['x-log-requestid'] ) ? $header ['x-log-requestid'] : '';
  1009 + $resp = $this->parseToJson ( $resp, $requestId );
  1010 + return new Aliyun_Log_Models_GetMachineResponse($resp,$header);
  1011 + }
  1012 +
  1013 + public function createACL(Aliyun_Log_Models_CreateACLRequest $request){
  1014 + $params = array();
  1015 + $headers = array();
  1016 + $body=null;
  1017 + if($request->getAcl()!==null){
  1018 + $body = json_encode($request->getAcl()->toArray());
  1019 + }
  1020 + $headers ['Content-Type'] = 'application/json';
  1021 + $resource = '/acls';
  1022 + list($resp,$header) = $this->send("POST",NULL,$body,$resource,$params,$headers);
  1023 + $requestId = isset ( $header ['x-log-requestid'] ) ? $header ['x-log-requestid'] : '';
  1024 + $resp = $this->parseToJson ( $resp, $requestId );
  1025 + return new Aliyun_Log_Models_CreateACLResponse($resp,$header);
  1026 + }
  1027 +
  1028 + public function updateACL(Aliyun_Log_Models_UpdateACLRequest $request){
  1029 + $params = array();
  1030 + $headers = array();
  1031 + $body=null;
  1032 + $aclId='';
  1033 + if($request->getAcl()!==null){
  1034 + $body = json_encode($request->getAcl()->toArray());
  1035 + $aclId=($request->getAcl()->getAclId()!==null)?$request->getAcl()->getAclId():'';
  1036 + }
  1037 + $headers ['Content-Type'] = 'application/json';
  1038 + $resource = '/acls/'.$aclId;
  1039 + list($resp,$header) = $this->send("PUT",NULL,$body,$resource,$params,$headers);
  1040 + return new Aliyun_Log_Models_UpdateACLResponse($header);
  1041 + }
  1042 +
  1043 + public function getACL(Aliyun_Log_Models_GetACLRequest $request){
  1044 + $params = array();
  1045 + $headers = array();
  1046 +
  1047 + $aclId = ($request->getAclId()!==null)?$request->getAclId():'';
  1048 +
  1049 + $resource = '/acls/'.$aclId;
  1050 + list($resp,$header) = $this->send("GET",NULL,NULL,$resource,$params,$headers);
  1051 + $requestId = isset ( $header ['x-log-requestid'] ) ? $header ['x-log-requestid'] : '';
  1052 + $resp = $this->parseToJson ( $resp, $requestId );
  1053 +
  1054 + return new Aliyun_Log_Models_GetACLResponse($resp,$header);
  1055 + }
  1056 +
  1057 + public function deleteACL(Aliyun_Log_Models_DeleteACLRequest $request){
  1058 + $params = array();
  1059 + $headers = array();
  1060 + $aclId = ($request->getAclId()!==null)?$request->getAclId():'';
  1061 + $resource = '/acls/'.$aclId;
  1062 + list($resp,$header) = $this->send("DELETE",NULL,NULL,$resource,$params,$headers);
  1063 + return new Aliyun_Log_Models_DeleteACLResponse($header);
  1064 + }
  1065 +
  1066 + public function listACLs(Aliyun_Log_Models_ListACLsRequest $request){
  1067 + $params = array();
  1068 + $headers = array();
  1069 + if($request->getPrincipleId()!==null)$params['principleId'] = $request->getPrincipleId();
  1070 + if($request->getOffset()!==null)$params['offset'] = $request->getOffset();
  1071 + if($request->getSize()!==null)$params['size'] = $request->getSize();
  1072 +
  1073 + $resource = '/acls';
  1074 + list($resp,$header) = $this->send("GET",NULL,NULL,$resource,$params,$headers);
  1075 + $requestId = isset ( $header ['x-log-requestid'] ) ? $header ['x-log-requestid'] : '';
  1076 + $resp = $this->parseToJson ( $resp, $requestId );
  1077 + return new Aliyun_Log_Models_ListACLsResponse($resp,$header);
  1078 + }
  1079 +
  1080 +}
  1081 +
  1 +<?php
  2 +/**
  3 + * Copyright (C) Alibaba Cloud Computing
  4 + * All rights reserved
  5 + */
  6 +
  7 +/**
  8 + * The Exception of the log serivce request & response.
  9 + *
  10 + * @author log service dev
  11 + */
  12 +class Aliyun_Log_Exception extends Exception{
  13 + /**
  14 + * @var string
  15 + */
  16 + private $requestId;
  17 +
  18 + /**
  19 + * Aliyun_Log_Exception constructor
  20 + *
  21 + * @param string $code
  22 + * log service error code.
  23 + * @param string $message
  24 + * detailed information for the exception.
  25 + * @param string $requestId
  26 + * the request id of the response, '' is set if client error.
  27 + */
  28 + public function __construct($code, $message, $requestId='') {
  29 + parent::__construct($message);
  30 + $this->code = $code;
  31 + $this->message = $message;
  32 + $this->requestId = $requestId;
  33 + }
  34 +
  35 + /**
  36 + * The __toString() method allows a class to decide how it will react when
  37 + * it is treated like a string.
  38 + *
  39 + * @return string
  40 + */
  41 + public function __toString() {
  42 + return "Aliyun_Log_Exception: \n{\n ErrorCode: $this->code,\n ErrorMessage: $this->message\n RequestId: $this->requestId\n}\n";
  43 + }
  44 +
  45 + /**
  46 + * Get Aliyun_Log_Exception error code.
  47 + *
  48 + * @return string
  49 + */
  50 + public function getErrorCode() {
  51 + return $this->code;
  52 + }
  53 +
  54 + /**
  55 + * Get Aliyun_Log_Exception error message.
  56 + *
  57 + * @return string
  58 + */
  59 + public function getErrorMessage() {
  60 + return $this->message;
  61 + }
  62 +
  63 + /**
  64 + * Get log service sever requestid, '' is set if client or Http error.
  65 + *
  66 + * @return string
  67 + */
  68 + public function getRequestId() {
  69 + return $this->requestId;
  70 + }
  71 +}
  72 +
  1 +<?php
  2 +/**
  3 + * Copyright (C) Alibaba Cloud Computing
  4 + * All rights reserved
  5 + */
  6 +
  7 +/**
  8 + * Class Aliyun_Log_LoggerFactory
  9 + * Factory for creating logger instance, with $client, $project, $logstore, $topic configurable.
  10 + * Will flush current logger when the factory instance was recycled.
  11 + */
  12 +class Aliyun_Log_LoggerFactory{
  13 +
  14 + private static $loggerMap = array();
  15 +
  16 + /**
  17 + * Get logger instance
  18 + * @param $client valid log client
  19 + * @param $project which could be created in AliYun Logger Server configuration page
  20 + * @param $logstore which could be created in AliYun Logger Server configuration page
  21 + * @param null $topic used to specified the log by TOPIC field
  22 + * @return mixed return logger instance
  23 + * @throws Exception if the input parameter is invalid, throw exception
  24 + */
  25 + public static function getLogger($client, $project, $logstore, $topic = null){
  26 + if($project === null || $project == ''){
  27 + throw new Exception('project name is blank!');
  28 + }
  29 + if($logstore === null || $logstore == ''){
  30 + throw new Exception('logstore name is blank!');
  31 + }
  32 + if($topic === null){
  33 + $topic = '';
  34 + }
  35 + $loggerKey = $project.'#'.$logstore.'#'.$topic;
  36 + if (!array_key_exists($loggerKey, static::$loggerMap))
  37 + {
  38 + $instanceSimpleLogger = new Aliyun_Log_SimpleLogger($client,$project,$logstore,$topic);
  39 + static::$loggerMap[$loggerKey] = $instanceSimpleLogger;
  40 + }
  41 + return static::$loggerMap[$loggerKey];
  42 + }
  43 +
  44 + /**
  45 + * set modifier to protected for singleton pattern
  46 + * Aliyun_Log_LoggerFactory constructor.
  47 + */
  48 + protected function __construct()
  49 + {
  50 +
  51 + }
  52 +
  53 + /**
  54 + * set clone function to private for singleton pattern
  55 + */
  56 + private function __clone()
  57 + {}
  58 +
  59 + /**
  60 + * flush current logger in destruct function
  61 + */
  62 + function __destruct() {
  63 + if(static::$loggerMap != null){
  64 + foreach (static::$loggerMap as $innerLogger){
  65 + $innerLogger->logFlush();
  66 + }
  67 + }
  68 + }
  69 +}
  1 +<?php
  2 +/**
  3 + * Copyright (C) Alibaba Cloud Computing
  4 + * All rights reserved
  5 + */
  6 +
  7 +class Aliyun_Log_Models_ACL {
  8 + private $principleType;
  9 + private $principleId;
  10 + private $object;
  11 + private $privilege;
  12 + private $aclId;
  13 +
  14 + private $createTime;
  15 + private $lastModifyTime;
  16 +
  17 + public function __construct($principleType='',$principleId='',$object='',
  18 + $privilege=array(),$aclId=null,$createTime=null,$lastModifyTime=null) {
  19 + $this->principleType = $principleType;
  20 + $this->principleId = $principleId;
  21 + $this->object = $object;
  22 + $this->privilege = $privilege;
  23 + $this->aclId = $aclId;
  24 +
  25 + $this->createTime = $createTime;
  26 + $this->lastModifyTime = $lastModifyTime;
  27 + }
  28 +
  29 + public function getPrincipleType(){
  30 + return $this->principleType;
  31 + }
  32 + public function setPrincipleType($principleType){
  33 + $this->principleType = $principleType;
  34 + }
  35 +
  36 + public function getPrincipleId(){
  37 + return $this->principleId;
  38 + }
  39 + public function setPrincipleId($principleId){
  40 + $this->principleId = $principleId;
  41 + }
  42 +
  43 + public function getObject(){
  44 + return $this->object;
  45 + }
  46 + public function setObject($object){
  47 + $this->object = $object;
  48 + }
  49 + public function getPrivilege(){
  50 + return $this->privilege;
  51 + }
  52 + public function setPrivilege($privilege){
  53 + $this->privilege = $privilege;
  54 + }
  55 + public function getAclId(){
  56 + return $this->aclId;
  57 + }
  58 + public function setAclId($aclId){
  59 + $this->aclId = $aclId;
  60 + }
  61 + public function getCreateTime(){
  62 + return $this->createTime;
  63 + }
  64 + public function setCreateTime($createTime){
  65 + $this->createTime = $createTime;
  66 + }
  67 + public function getLastModifyTime(){
  68 + return $this->lastModifyTime;
  69 + }
  70 + public function setLastModifyTime($lastModifyTime){
  71 + $this->lastModifyTime = $lastModifyTime;
  72 + }
  73 +
  74 + public function toArray(){
  75 + $format_array = array();
  76 + if($this->principleType!==null)
  77 + $format_array['principleType'] = $this->principleType;
  78 + if($this->principleId!==null)
  79 + $format_array['principleId'] = $this->principleId;
  80 + if($this->object!==null)
  81 + $format_array['object'] = $this->object;
  82 + if($this->privilege!==null)
  83 + $format_array['privilege'] = $this->privilege;
  84 + if($this->aclId!==null)
  85 + $format_array['aclId'] = $this->aclId;
  86 + if($this->createTime!==null)
  87 + $format_array['createTime'] = $this->createTime;
  88 + if($this->lastModifyTime!==null)
  89 + $format_array['lastModifyTime'] = $this->lastModifyTime;
  90 + return $format_array;
  91 + }
  92 +
  93 + public function setFromArray($resp){
  94 + $principleType = ($resp['principleType']!==null)?$resp['principleType']:null;
  95 + $principleId = ($resp['principleId']!==null)?$resp['principleId']:null;
  96 + $object = ($resp['object']!==null)?$resp['object']:null;
  97 + $privilege = ($resp['privilege']!==null)?$resp['privilege']:array();
  98 + $aclId = ($resp['aclId']!==null)?$resp['aclId']:null;
  99 + $createTime = ($resp['createTime']!==null)?$resp['createTime']:null;
  100 + $lastModifyTime = ($resp['lastModifyTime']!==null)?$resp['lastModifyTime']:null;
  101 +
  102 + $this->setPrincipleType($principleType);
  103 + $this->setPrincipleId($principleId);
  104 + $this->setObject($object);
  105 + $this->setPrivilege($privilege);
  106 + $this->setAclId($aclId);
  107 + $this->setCreateTime($createTime);
  108 + $this->setLastModifyTime($lastModifyTime);
  109 + }
  110 +}
  1 +<?php
  2 +/**
  3 + * Copyright (C) Alibaba Cloud Computing
  4 + * All rights reserved
  5 + */
  6 +
  7 +/**
  8 + * Aliyun_Log_Models_CompressedLogGroup is compressed LogGroup,
  9 + * LogGroup infomation please refer to Aliyun_Log_Models_LogGroup
  10 + *
  11 + * @author log service dev
  12 + */
  13 +class Aliyun_Log_Models_CompressedLogGroup {
  14 +
  15 + /**
  16 + * @var integer uncompressed LogGroup size
  17 + *
  18 + */
  19 + protected $uncompressedSize;
  20 +
  21 + /**
  22 + * @var integer uncompressed LogGroup size
  23 + *
  24 + */
  25 + protected $compressedData;
  26 +
  27 +
  28 + public function __construct($time = null, $contents = null) {
  29 + if (! $time)
  30 + $time = time ();
  31 + $this->time = $time;
  32 + if ($contents)
  33 + $this->contents = $contents;
  34 + else
  35 + $this->contents = array ();
  36 + }
  37 +
  38 +}
  1 +<?php
  2 +/**
  3 + * Copyright (C) Alibaba Cloud Computing
  4 + * All rights reserved
  5 + */
  6 +
  7 +class Aliyun_Log_Models_Config_InputDetail {
  8 + public $filePattern;
  9 + public $key;
  10 + public $localStorage;
  11 + public $logBeginRegex;
  12 + public $logPath;
  13 + public $logType;
  14 + public $regex;
  15 + public $timeFormat;
  16 + public $filterRegex;
  17 + public $filterKey;
  18 + public $topicFormat;
  19 +
  20 + public function __construct($filePattern='',$key=array(),$localStorage=true,
  21 + $logBeginRegex='',$logPath='',$logType='',$regex='',
  22 + $timeFormat='',$filterRegex=array(),$filterKey=array(),$topicFormat='none'){
  23 + $this->filePattern=$filePattern;
  24 + $this->key=$key;
  25 + $this->localStorage=$localStorage;
  26 + $this->logBeginRegex=$logBeginRegex;
  27 + $this->logPath=$logPath;
  28 + $this->logType=$logType;
  29 + $this->regex=$regex;
  30 + $this->timeFormat=$timeFormat;
  31 + $this->filterRegex=$filterRegex;
  32 + $this->filterKey=$filterKey;
  33 + $this->topicFormat=$topicFormat;
  34 + }
  35 +
  36 + public function toArray(){
  37 + $resArray = array();
  38 + if($this->filePattern!==null)
  39 + $resArray['filePattern'] = $this->filePattern;
  40 + if($this->key!==null)
  41 + $resArray['key'] = $this->key;
  42 + if($this->localStorage!==null)
  43 + $resArray['localStorage'] = $this->localStorage;
  44 + if($this->logBeginRegex!==null)
  45 + $resArray['logBeginRegex'] = $this->logBeginRegex;
  46 + if($this->logPath!==null)
  47 + $resArray['logPath'] = $this->logPath;
  48 + if($this->logType!==null)
  49 + $resArray['logType'] = $this->logType;
  50 + if($this->regex!==null)
  51 + $resArray['regex'] = $this->regex;
  52 + if($this->timeFormat!==null)
  53 + $resArray['timeFormat'] = $this->timeFormat;
  54 + if($this->filterRegex!==null)
  55 + $resArray['filterRegex'] = $this->filterRegex;
  56 + if($this->filterKey!==null)
  57 + $resArray['filterKey'] = $this->filterKey;
  58 + if($this->topicFormat!==null)
  59 + $resArray['topicFormat'] = $this->topicFormat;
  60 + return $resArray;
  61 + }
  62 +}
  63 +
  64 +class Aliyun_Log_Models_Config_OutputDetail {
  65 + public $projectName;
  66 + public $logstoreName;
  67 +
  68 + public function __construct($projectName='',$logstoreName=''){
  69 + $this->projectName = $projectName;
  70 + $this->logstoreName = $logstoreName;
  71 + }
  72 + public function toArray(){
  73 + $resArray = array();
  74 + if($this->projectName!==null)
  75 + $resArray['projectName'] = $this->projectName;
  76 + if($this->logstoreName!==null)
  77 + $resArray['logstoreName'] = $this->logstoreName;
  78 + return $resArray;
  79 + }
  80 +}
  81 +
  82 +class Aliyun_Log_Models_Config {
  83 +
  84 + private $configName;
  85 + private $inputType;
  86 + private $inputDetail;
  87 + private $outputType;
  88 + private $outputDetail;
  89 +
  90 + private $createTime;
  91 + private $lastModifyTime;
  92 +
  93 + public function __construct($configName='',$inputType='',$inputDetail=null,
  94 + $outputType='',$outputDetail=null,$createTime=null,$lastModifyTime=null) {
  95 + $this->configName = $configName;
  96 + $this->inputType = $inputType;
  97 + $this->inputDetail = $inputDetail;
  98 + $this->outputType = $outputType;
  99 + $this->outputDetail = $outputDetail;
  100 + $this->createTime = $createTime;
  101 + $this->lastModifyTime = $lastModifyTime;
  102 +
  103 + }
  104 +
  105 + public function getConfigName(){
  106 + return $this->configName;
  107 + }
  108 + public function setConfigName($configName){
  109 + $this->configName = $configName;
  110 + }
  111 + public function getInputType(){
  112 + return $this->inputType;
  113 + }
  114 + public function setInputType($inputType){
  115 + $this->inputType = $inputType;
  116 + }
  117 + public function getInputDetail(){
  118 + return $this->inputDetail;
  119 + }
  120 + public function setInputDetail($inputDetail){
  121 + $this->inputDetail = $inputDetail;
  122 + }
  123 + public function getOutputType(){
  124 + return $this->outputType;
  125 + }
  126 + public function setOutputType($outputType){
  127 + $this->outputType = $outputType;
  128 + }
  129 + public function getOutputDetail(){
  130 + return $this->outputDetail;
  131 + }
  132 + public function setOutputDetail($outputDetail){
  133 + $this->outputDetail = $outputDetail;
  134 + }
  135 + public function getCreateTime(){
  136 + return $this->createTime;
  137 + }
  138 + public function setCreateTime($createTime){
  139 + $this->createTime = $createTime;
  140 + }
  141 +
  142 + public function getLastModifyTime(){
  143 + return $this->lastModifyTime;
  144 + }
  145 + public function setLastModifyTime($lastModifyTime){
  146 + $this->lastModifyTime = $lastModifyTime;
  147 + }
  148 +
  149 + public function toArray(){
  150 + $format_array = array();
  151 + if($this->configName!==null)
  152 + $format_array['configName'] = $this->configName;
  153 + if($this->inputType!==null)
  154 + $format_array['inputType'] = $this->inputType;
  155 + if($this->inputDetail!==null)
  156 + $format_array['inputDetail'] = $this->inputDetail->toArray();
  157 + if($this->outputType!==null)
  158 + $format_array['outputType'] = $this->outputType;
  159 + if($this->outputDetail!==null)
  160 + $format_array['outputDetail'] = $this->outputDetail->toArray();
  161 + if($this->createTime!==null)
  162 + $format_array['createTime'] = $this->createTime;
  163 + if($this->lastModifyTime!==null)
  164 + $format_array['lastModifyTime'] = $this->lastModifyTime;
  165 + return $format_array;
  166 + }
  167 +
  168 + public function setFromArray($resp){
  169 + $inputDetail = new Aliyun_Log_Models_Config_InputDetail();
  170 + $inputDetail->filePattern = $resp['inputDetail']['filePattern'];
  171 + $inputDetail->key = $resp['inputDetail']['key'];
  172 + $inputDetail->localStorage = $resp['inputDetail']['localStorage'];
  173 + $inputDetail->logBeginRegex = $resp['inputDetail']['logBeginRegex'];
  174 + $inputDetail->logPath = $resp['inputDetail']['logPath'];
  175 + $inputDetail->logType = $resp['inputDetail']['logType'];
  176 + $inputDetail->regex = $resp['inputDetail']['regex'];
  177 + $inputDetail->timeFormat = $resp['inputDetail']['timeFormat'];
  178 + $inputDetail->filterRegex = $resp['inputDetail']['filterRegex'];
  179 + $inputDetail->filterKey = $resp['inputDetail']['filterKey'];
  180 + $inputDetail->topicFormat = $resp['inputDetail']['topicFormat'];
  181 +
  182 + $outputDetail = new Aliyun_Log_Models_Config_OutputDetail();
  183 + $outputDetail->projectName = $resp['outputDetail']['projectName'];
  184 + $outputDetail->logstoreName = $resp['outputDetail']['logstoreName'];
  185 +
  186 + $configName=$resp['configName'];
  187 + $inputType=$resp['inputType'];
  188 + $outputType=$resp['outputType'];
  189 +
  190 + $this->setConfigName($configName);
  191 + $this->setInputType($inputType);
  192 + $this->setInputDetail($inputDetail);
  193 + $this->setOutputType($outputType);
  194 + $this->setOutputDetail($outputDetail);
  195 +
  196 + }
  197 +
  198 +}
  1 +<?php
  2 +/**
  3 + * Copyright (C) Alibaba Cloud Computing
  4 + * All rights reserved
  5 + */
  6 +
  7 +/**
  8 + * The class used to present the result of log histogram status. For every log
  9 + * histogram, it contains : from/to time range, hit log count and query
  10 + * completed status.
  11 + *
  12 + * @author log service dev
  13 + */
  14 +class Aliyun_Log_Models_Histogram {
  15 +
  16 + /**
  17 + * @var integer the begin time
  18 + */
  19 + private $from;
  20 +
  21 + /**
  22 + * @var integer the end time
  23 + */
  24 + private $to;
  25 +
  26 + /**
  27 + * @var integer log count of histogram that query hits
  28 + */
  29 + private $count;
  30 +
  31 + /**
  32 + * @var string histogram query status(Complete or InComplete)
  33 + */
  34 + private $progress;
  35 +
  36 + /**
  37 + * Aliyun_Log_Models_Histogram constructor
  38 + *
  39 + * @param integer $from
  40 + * the begin time
  41 + * @param integer $to
  42 + * the end time
  43 + * @param integer $count
  44 + * log count of histogram that query hits
  45 + * @param string $progress
  46 + * histogram query status(Complete or InComplete)
  47 + */
  48 + public function __construct($from, $to, $count, $progress) {
  49 + $this->from = $from;
  50 + $this->to = $to;
  51 + $this->count = $count;
  52 + $this->progress = $progress;
  53 + }
  54 +
  55 + /**
  56 + * Get begin time
  57 + *
  58 + * @return integer the begin time
  59 + */
  60 + public function getFrom() {
  61 + return $this->from;
  62 + }
  63 +
  64 + /**
  65 + * Get the end time
  66 + *
  67 + * @return integer the end time
  68 + */
  69 + public function getTo() {
  70 + return $this->to;
  71 + }
  72 +
  73 + /**
  74 + * Get log count of histogram that query hits
  75 + *
  76 + * @return integer log count of histogram that query hits
  77 + */
  78 + public function getCount() {
  79 + return $this->count;
  80 + }
  81 +
  82 + /**
  83 + * Check if the histogram is completed
  84 + *
  85 + * @return bool true if this histogram is completed
  86 + */
  87 + public function isCompleted() {
  88 + return $this->progress == 'Complete';
  89 + }
  90 +}
  1 +<?php
  2 +/**
  3 + * Copyright (C) Alibaba Cloud Computing
  4 + * All rights reserved
  5 + */
  6 +
  7 +/**
  8 + * Aliyun_Log_Models_LogItem used to present a log, it contains log time and multiple
  9 + * key/value pairs to present the log contents.
  10 + *
  11 + * @author log service dev
  12 + */
  13 +class Aliyun_Log_Models_LogItem {
  14 +
  15 + /**
  16 + * @var integer time of the log item, the default time if the now time.
  17 + */
  18 + private $time;
  19 +
  20 + /**
  21 + * @var array the data of the log item, including many key/value pairs.
  22 + */
  23 + private $contents;
  24 +
  25 + /**
  26 + * Aliyun_Log_Models_LogItem cnostructor
  27 + *
  28 + * @param array $contents
  29 + * the data of the log item, including many key/value pairs.
  30 + * @param integer $time
  31 + * time of the log item, the default time if the now time.
  32 + */
  33 + public function __construct($time = null, $contents = null) {
  34 + if (! $time)
  35 + $time = time ();
  36 + $this->time = $time;
  37 + if ($contents)
  38 + $this->contents = $contents;
  39 + else
  40 + $this->contents = array ();
  41 + }
  42 +
  43 + /**
  44 + * Get log time
  45 + *
  46 + * @return integer log time
  47 + */
  48 + public function getTime() {
  49 + return $this->time;
  50 + }
  51 +
  52 + /**
  53 + * Set log time
  54 + *
  55 + * @param integer $time
  56 + * log time
  57 + */
  58 + public function setTime($time) {
  59 + $this->time = $time;
  60 + }
  61 +
  62 + /**
  63 + * Get log contents
  64 + *
  65 + * @return array log contents
  66 + */
  67 + public function getContents() {
  68 + return $this->contents;
  69 + }
  70 +
  71 + /**
  72 + * Set log contents
  73 + *
  74 + * @param array $contents
  75 + * log contents
  76 + */
  77 + public function setContents($contents) {
  78 + $this->contents = $contents;
  79 + }
  80 +
  81 + /**
  82 + * Add a key/value pair as log content to the log
  83 + *
  84 + * @param string $key
  85 + * log content key
  86 + * @param string $value
  87 + * log content value
  88 + */
  89 + public function pushBack($key, $value) {
  90 + $this->contents [$key] = $value;
  91 + }
  92 +}
  1 +<?php
  2 +/**
  3 + * Copyright (C) Alibaba Cloud Computing
  4 + * All rights reserved
  5 + */
  6 +
  7 +class Aliyun_Log_Models_LogLevel_LogLevel{
  8 + const debug = 'debug';
  9 + const info = 'info';
  10 + const warn = 'warn';
  11 + const error = 'error';
  12 +
  13 + private static $constCacheArray = NULL;
  14 +
  15 + private $level;
  16 +
  17 + /**
  18 + * Constructor
  19 + *
  20 + * @param string $level
  21 + */
  22 + private function __construct($level) {
  23 + $this->level = $level;
  24 + }
  25 +
  26 + /**
  27 + * Compares two logger levels.
  28 + *
  29 + * @param LoggerLevels $other
  30 + * @return boolean
  31 + */
  32 + public function equals($other) {
  33 + if($other instanceof Aliyun_Log_Models_LogLevel_LogLevel) {
  34 + if($this->level == $other->level) {
  35 + return true;
  36 + }
  37 + } else {
  38 + return false;
  39 + }
  40 + }
  41 +
  42 + public static function getLevelDebug(){
  43 + if(!isset(self::$constCacheArray[Aliyun_Log_Models_LogLevel_LogLevel::debug])){
  44 + self::$constCacheArray[Aliyun_Log_Models_LogLevel_LogLevel::debug] = new Aliyun_Log_Models_LogLevel_LogLevel('debug');
  45 + }
  46 + return self::$constCacheArray[Aliyun_Log_Models_LogLevel_LogLevel::debug];
  47 + }
  48 +
  49 + public static function getLevelInfo(){
  50 + if(!isset(self::$constCacheArray[Aliyun_Log_Models_LogLevel_LogLevel::info])){
  51 + self::$constCacheArray[Aliyun_Log_Models_LogLevel_LogLevel::info] = new Aliyun_Log_Models_LogLevel_LogLevel('info');
  52 + }
  53 + return self::$constCacheArray[Aliyun_Log_Models_LogLevel_LogLevel::info];
  54 + }
  55 +
  56 + public static function getLevelWarn(){
  57 + if(!isset(self::$constCacheArray[Aliyun_Log_Models_LogLevel_LogLevel::warn])){
  58 + self::$constCacheArray[Aliyun_Log_Models_LogLevel_LogLevel::warn] = new Aliyun_Log_Models_LogLevel_LogLevel('warn');
  59 + }
  60 + return self::$constCacheArray[Aliyun_Log_Models_LogLevel_LogLevel::warn];
  61 + }
  62 +
  63 + public static function getLevelError(){
  64 + if(!isset(self::$constCacheArray[Aliyun_Log_Models_LogLevel_LogLevel::error])){
  65 + self::$constCacheArray[Aliyun_Log_Models_LogLevel_LogLevel::error] = new Aliyun_Log_Models_LogLevel_LogLevel('error');
  66 + }
  67 + return self::$constCacheArray[Aliyun_Log_Models_LogLevel_LogLevel::error];
  68 + }
  69 +
  70 + public static function getLevelStr(Aliyun_Log_Models_LogLevel_LogLevel $logLevel){
  71 +
  72 + $logLevelStr = '';
  73 + if(null === $logLevel){
  74 + $logLevelStr = 'info';
  75 + }
  76 + switch ($logLevel->level){
  77 + case "error":
  78 + $logLevelStr= 'error';
  79 + break;
  80 + case "warn":
  81 + $logLevelStr= 'warn';
  82 + break;
  83 + case "info":
  84 + $logLevelStr= 'info';
  85 + break;
  86 + case "debug":
  87 + $logLevelStr= 'debug';
  88 + break;
  89 + }
  90 + return $logLevelStr;
  91 + }
  92 +}
  1 +<?php
  2 +/**
  3 + * Copyright (C) Alibaba Cloud Computing
  4 + * All rights reserved
  5 + */
  6 +
  7 +class Aliyun_Log_Models_Machine_Info{
  8 + public $ip;
  9 + public $os;
  10 + public $hostName;
  11 +
  12 + public function __construct($ip=null,$os=null,$hostName=null){
  13 + $this->ip = $ip;
  14 + $this->os = $os;
  15 + $this->hostName = $hostName;
  16 + }
  17 +
  18 + public function getIp(){
  19 + return $this->ip;
  20 + }
  21 + public function setIp($ip){
  22 + $this->ip = $ip;
  23 + }
  24 +
  25 +
  26 + public function getOs(){
  27 + return $this->os;
  28 + }
  29 + public function setOs($os){
  30 + $this->os = $os;
  31 + }
  32 +
  33 + public function getHostName(){
  34 + return $this->hostName;
  35 + }
  36 + public function setHostName($hostname){
  37 + $this->hostName = $hostName;
  38 + }
  39 + public function toArray(){
  40 + $resArr = array();
  41 + if($this->ip!==null)
  42 + $resArr['ip'] = $this->ip;
  43 + if($this->os!==null)
  44 + $resArr['os'] = $this->os;
  45 + if($this->hostName!==null)
  46 + $resArr['hostName'] = $this->hostName;
  47 + return $resArr;
  48 + }
  49 +}
  50 +
  51 +class Aliyun_Log_Models_Machine_Status{
  52 + public $binaryCurVersion;
  53 + public $binaryDeployVersion;
  54 +
  55 + public function __construct($binaryCurVersion=null,$binaryDeployVersion=null){
  56 + $this->binaryCurVersion = $binaryCurVersion;
  57 + $this->binaryDeployVersion = $binaryDeployVersion;
  58 + }
  59 +
  60 + public function toArray(){
  61 + $resArr = array();
  62 + if($this->binaryCurVersion!==null)
  63 + $resArr['binaryCurVersion'] = $this->binaryCurVersion;
  64 + if($this->binaryDeployVersion!==null)
  65 + $resArr['binaryDeployVersion'] = $this->binaryDeployVersion;
  66 + return $resArr;
  67 + }
  68 +}
  69 +
  70 +
  71 +class Aliyun_Log_Models_Machine {
  72 + private $uuid;
  73 + private $lastHeartbeatTime;
  74 + private $info;
  75 + private $status;
  76 +
  77 + private $createTime;
  78 + private $lastModifyTime;
  79 +
  80 + public function __construct($uuid=null,$lastHeartbeatTime=null,$info=null,
  81 + $status=null,$createTime=null,$lastModifyTime=null) {
  82 + $this->uuid = $uuid;
  83 + $this->lastHeartbeatTime = $lastHeartbeatTime;
  84 + $this->info = $info;
  85 + $this->status = $status;
  86 +
  87 + $this->createTime = $createTime;
  88 + $this->lastModifyTime = $lastModifyTime;
  89 + }
  90 +
  91 + public function getUuid(){
  92 + return $this->uuid;
  93 + }
  94 + public function setUuid($uuid){
  95 + $this->uuid = $uuid;
  96 + }
  97 + public function getLastHeartbeatTime(){
  98 + return $this->lastHeartbeatTime;
  99 + }
  100 + public function setLastHeartbeatTime($lastHeartbeatTime){
  101 + $this->lastHeartbeatTime = $lastHeartbeatTime;
  102 + }
  103 + public function getInfo(){
  104 + return $this->info;
  105 + }
  106 + public function setInfo($info){
  107 + $this->info = $info;
  108 + }
  109 + public function getStatus(){
  110 + return $this->status;
  111 + }
  112 + public function setStatus($status){
  113 + $this->status = $status;
  114 + }
  115 +
  116 + public function getCreateTime(){
  117 + return $this->createTime;
  118 + }
  119 + public function setCreateTime($createTime){
  120 + $this->createTime = $createTime;
  121 + }
  122 + public function getLastModifyTime(){
  123 + return $this->lastModifyTime;
  124 + }
  125 + public function setLastModifyTime($lastModifyTime){
  126 + $this->lastModifyTime = $lastModifyTime;
  127 + }
  128 +
  129 + public function toArray(){
  130 + $resArr = array();
  131 + if($this->uuid!==null)
  132 + $resArr['uuid'] = $this->uuid;
  133 + if($this->lastHeartbeatTime!==null)
  134 + $resArr['lastHeartbeatTime'] = $this->lastHeartbeatTime;
  135 + if($this->info!==null)
  136 + $resArr['info'] = $this->info->toArray();
  137 + if($this->status!==null)
  138 + $resArr['status'] = $this->status->toArray();
  139 + if($this->createTime!==null)
  140 + $resArr['createTime'] = $this->createTime;
  141 + if($this->lastModifyTime!==null)
  142 + $resArr['lastModifyTime'] = $this->lastModifyTime;
  143 + return $resArr;
  144 + }
  145 +
  146 + public function setFromArray($resp){
  147 + $info=null;
  148 + if(isset($resp['info'])){
  149 + $ip=(isset($resp['info']['ip']))?$resp['info']['ip']:null;
  150 + $os=(isset($resp['info']['os']))?$resp['info']['os']:null;
  151 + $hostName=(isset($resp['info']['hostName']))?$resp['info']['hostName']:null;
  152 + $info = new Aliyun_Log_Models_Machine_Info($ip,$os,$hostName);
  153 + }
  154 + $status = null;
  155 + if(isset($resp['status'])){
  156 + $binaryCurVersion=(isset($resp['status']['binaryCurVersion']))?$resp['status']['binaryCurVersion']:null;
  157 + $binaryDeployVersion=(isset($resp['status']['binaryDeployVersion']))?$resp['status']['binaryDeployVersion']:null;
  158 + $status = new Aliyun_Log_Models_Machine_Status($binaryCurVersion,$binaryDeployVersion);
  159 + }
  160 + $uuid=(isset($resp['uuid']))?$resp['uuid']:null;
  161 + $lastHeartbeatTime=(isset($resp['lastHeartbeatTime']))?$resp['lastHeartbeatTime']:null;
  162 + $createTime=(isset($resp['createTime']))?$resp['createTime']:null;
  163 + $lastModifyTime=(isset($resp['lastModifyTime']))?$resp['lastModifyTime']:null;
  164 +
  165 + $this->setUuid($uuid);
  166 + $this->setLastHeartbeatTime($lastHeartbeatTime);
  167 + $this->setInfo($info);
  168 + $this->setStatus($status);
  169 + $this->setCreateTime($createTime);
  170 + $this->setLastModifyTime($lastModifyTime);
  171 + }
  172 +
  173 +}
  1 +<?php
  2 +/**
  3 + * Copyright (C) Alibaba Cloud Computing
  4 + * All rights reserved
  5 + */
  6 +
  7 +class Aliyun_Log_Models_MachineGroup_GroupAttribute {
  8 + public $externalName;
  9 + public $groupTopic;
  10 + public function __construct($externalName=null,$groupTopic=null){
  11 + $this->externalName = $externalName;
  12 + $this->groupTopic = $groupTopic;
  13 + }
  14 + public function toArray(){
  15 + $resArray = array();
  16 + if($this->externalName!==null)
  17 + $resArray['externalName'] = $this->externalName;
  18 + if($this->groupTopic!==null)
  19 + $resArray['groupTopic'] = $this->groupTopic;
  20 + return $resArray;
  21 + }
  22 +}
  23 +
  24 +class Aliyun_Log_Models_MachineGroup {
  25 + private $groupName;
  26 + private $groupType;
  27 + private $groupAttribute;
  28 + private $machineList;
  29 +
  30 + private $createTime;
  31 + private $lastModifyTime;
  32 +
  33 + public function __construct($groupName='',$groupType='',$groupAttribute=null,
  34 + $machineList=null,$createTime=null,$lastModifyTime=null) {
  35 + $this->groupName = $groupName;
  36 + $this->groupType = $groupType;
  37 + $this->groupAttribute = $groupAttribute;
  38 + $this->machineList = $machineList;
  39 + $this->createTime = $createTime;
  40 + $this->lastModifyTime = $lastModifyTime;
  41 + }
  42 +
  43 + public function getGroupName(){
  44 + return $this->groupName;
  45 + }
  46 + public function setGroupName($groupName){
  47 + $this->groupName = $groupName;
  48 + }
  49 + public function getGroupType(){
  50 + return $this->groupType;
  51 + }
  52 + public function setGroupType($groupType){
  53 + $this->groupType = $groupType;
  54 + }
  55 + public function getGroupAttribute(){
  56 + return $this->groupAttribute;
  57 + }
  58 + public function setGroupAttribute($groupAttribute){
  59 + $this->groupAttribute = $groupAttribute;
  60 + }
  61 + public function getMachineList(){
  62 + return $this->machineList;
  63 + }
  64 + public function setMachineList($machineList){
  65 + $this->machineList = $machineList;
  66 + }
  67 + public function getCreateTime(){
  68 + return $this->createTime;
  69 + }
  70 + public function setCreateTime($createTime){
  71 + $this->createTime = $createTime;
  72 + }
  73 + public function getLastModifyTime(){
  74 + return $this->lastModifyTime;
  75 + }
  76 + public function setLastModifyTime($lastModifyTime){
  77 + $this->lastModifyTime = $lastModifyTime;
  78 + }
  79 +
  80 + public function toArray(){
  81 + $format_array = array();
  82 + if($this->groupName!==null)
  83 + $format_array['groupName'] = $this->groupName;
  84 + if($this->groupType!==null)
  85 + $format_array['groupType'] = $this->groupType;
  86 + if($this->groupAttribute!==null)
  87 + $format_array['groupAttribute'] = $this->groupAttribute->toArray();
  88 + if($this->machineList!==null){
  89 + $mlArr = array();
  90 + foreach($this->machineList as $value){
  91 + $mlArr[] = $value->toArray();
  92 + }
  93 + $format_array['machineList'] = $mlArr;
  94 + }
  95 + if($this->createTime!==null)
  96 + $format_array['createTime'] = $this->createTime;
  97 + if($this->lastModifyTime!==null)
  98 + $format_array['lastModifyTime'] = $this->lastModifyTime;
  99 + return $format_array;
  100 + }
  101 +
  102 + public function setFromArray($resp){
  103 + $groupAttribute = null;
  104 + if(isset($resp['groupAttribute'])){
  105 + $groupAttributeArr = $resp['groupAttribute'];
  106 + $groupAttribute = new Aliyun_Log_Models_MachineGroup_GroupAttribute();
  107 + if(isset($groupAttributeArr['externalName']))
  108 + $groupAttribute->externalName = $groupAttributeArr['externalName'];
  109 + if(isset($groupAttributeArr['groupTopic']))
  110 + $groupAttribute->groupTopic = $groupAttributeArr['groupTopic'];
  111 + }
  112 + $groupName = ($resp['groupName']!==null)?$resp['groupName']:null;
  113 + $groupType = ($resp['groupType']!==null)?$resp['groupType']:null;
  114 + $machineList = array();
  115 + if(isset($resp['machineList']) && is_array($resp['machineList']) && count($resp['machineList'])>0){
  116 + foreach($resp['machineList'] as $value){
  117 + $machine = new Aliyun_Log_Models_Machine();
  118 + $machine->setFromArray($value);
  119 + $machineList[] = $machine;
  120 + }
  121 + }
  122 +
  123 + $createTime = ($resp['createTime']!==null)?$resp['createTime']:null;
  124 + $lastModifyTime = ($resp['lastModifyTime']!==null)?$resp['lastModifyTime']:null;
  125 + $this->setGroupName($groupName);
  126 + $this->setGroupType($groupType);
  127 + $this->setGroupAttribute($groupAttribute);
  128 + $this->setMachineList($machineList);
  129 + $this->setCreateTime($createTime);
  130 + $this->setLastModifyTime($lastModifyTime);
  131 + }
  132 +}
  1 +<?php
  2 +/**
  3 + * Copyright (C) Alibaba Cloud Computing
  4 + * All rights reserved
  5 + */
  6 +
  7 +class Aliyun_Log_Models_OssShipperConfig{
  8 +
  9 + private $ossBucket;
  10 + private $ossPrefix;
  11 + private $bufferInterval = 300;
  12 + private $bufferSize;
  13 + private $compressType;
  14 + private $roleArn;
  15 + private $pathFormat;
  16 + private $storage;
  17 +
  18 + /**
  19 + * @return mixed
  20 + */
  21 + public function getRoleArn()
  22 + {
  23 + return $this->roleArn;
  24 + }
  25 +
  26 + /**
  27 + * @param mixed $roleArn
  28 + */
  29 + public function setRoleArn($roleArn)
  30 + {
  31 + $this->roleArn = $roleArn;
  32 + }
  33 +
  34 + /**
  35 + * @return mixed
  36 + */
  37 + public function getPathFormat()
  38 + {
  39 + return $this->pathFormat;
  40 + }
  41 +
  42 + /**
  43 + * @param mixed $pathFormat
  44 + */
  45 + public function setPathFormat($pathFormat)
  46 + {
  47 + $this->pathFormat = $pathFormat;
  48 + }
  49 +
  50 + /**
  51 + * @return mixed
  52 + */
  53 + public function getStorage()
  54 + {
  55 + return $this->storage;
  56 + }
  57 +
  58 + /**
  59 + * @param mixed $storage
  60 + */
  61 + public function setStorage($storage)
  62 + {
  63 + $this->storage = $storage;
  64 + }
  65 +
  66 + /**
  67 + * @return mixed
  68 + */
  69 + public function getOssBucket()
  70 + {
  71 + return $this->ossBucket;
  72 + }
  73 +
  74 + /**
  75 + * @param mixed $ossBucket
  76 + */
  77 + public function setOssBucket($ossBucket)
  78 + {
  79 + $this->ossBucket = $ossBucket;
  80 + }
  81 +
  82 + /**
  83 + * @return mixed
  84 + */
  85 + public function getOssPrefix()
  86 + {
  87 + return $this->ossPrefix;
  88 + }
  89 +
  90 + /**
  91 + * @param mixed $ossPrefix
  92 + */
  93 + public function setOssPrefix($ossPrefix)
  94 + {
  95 + $this->ossPrefix = $ossPrefix;
  96 + }
  97 +
  98 + /**
  99 + * @return mixed
  100 + */
  101 + public function getBufferInterval()
  102 + {
  103 + return $this->bufferInterval;
  104 + }
  105 +
  106 + /**
  107 + * @param mixed $bufferInterval
  108 + */
  109 + public function setBufferInterval($bufferInterval)
  110 + {
  111 + $this->bufferInterval = $bufferInterval;
  112 + }
  113 +
  114 + /**
  115 + * @return mixed
  116 + */
  117 + public function getBufferSize()
  118 + {
  119 + return $this->bufferSize;
  120 + }
  121 +
  122 + /**
  123 + * @param mixed $bufferSize
  124 + */
  125 + public function setBufferSize($bufferSize)
  126 + {
  127 + if($bufferSize > 256 || $bufferSize < 5){
  128 + throw new Exception("buffSize is not valide, must between 5 and 256");
  129 + }
  130 + $this->bufferSize = $bufferSize;
  131 + }
  132 +
  133 + /**
  134 + * @return mixed
  135 + */
  136 + public function getCompressType()
  137 + {
  138 + return $this->compressType;
  139 + }
  140 +
  141 + /**
  142 + * @param mixed $compressType
  143 + */
  144 + public function setCompressType($compressType)
  145 + {
  146 + $this->compressType = $compressType;
  147 + }
  148 +
  149 +
  150 + public function to_json_object() {
  151 + $json = array(
  152 + 'ossBucket' => $this->ossBucket,
  153 + 'ossPrefix' => $this->ossPrefix,
  154 + 'bufferInterval' => $this->bufferInterval,
  155 + 'bufferSize' => $this->bufferSize,
  156 + 'compressType' => $this->compressType,
  157 + 'roleArn' => $this->roleArn,
  158 + 'pathFormat' => $this->pathFormat,
  159 + 'storage' => $this->storage->to_json_object()
  160 + );
  161 + if($this->storage->getFormat() == 'json'){
  162 + unset($json['storage']);
  163 + }
  164 + return $json;
  165 + }
  166 +}
  1 +<?php
  2 +/**
  3 + * Copyright (C) Alibaba Cloud Computing
  4 + * All rights reserved
  5 + */
  6 +
  7 +class Aliyun_Log_Models_OssShipperCsvStorage extends Aliyun_Log_Models_OssShipperStorage{
  8 + private $columns;
  9 + private $delimiter = ',';
  10 + private $quote = '';
  11 + private $nullIdentifier = '';
  12 + private $header = false;
  13 +
  14 + /**
  15 + * @return mixed
  16 + */
  17 + public function getColumns()
  18 + {
  19 + return $this->columns;
  20 + }
  21 +
  22 + /**
  23 + * @param mixed $columns
  24 + */
  25 + public function setColumns($columns)
  26 + {
  27 + $this->columns = $columns;
  28 + }
  29 +
  30 + /**
  31 + * @return string
  32 + */
  33 + public function getDelimiter(): string
  34 + {
  35 + return $this->delimiter;
  36 + }
  37 +
  38 + /**
  39 + * @param string $delimiter
  40 + */
  41 + public function setDelimiter(string $delimiter)
  42 + {
  43 + $this->delimiter = $delimiter;
  44 + }
  45 +
  46 + /**
  47 + * @return string
  48 + */
  49 + public function getQuote(): string
  50 + {
  51 + return $this->quote;
  52 + }
  53 +
  54 + /**
  55 + * @param string $quote
  56 + */
  57 + public function setQuote(string $quote)
  58 + {
  59 + $this->quote = $quote;
  60 + }
  61 +
  62 + /**
  63 + * @return string
  64 + */
  65 + public function getNullIdentifier(): string
  66 + {
  67 + return $this->nullIdentifier;
  68 + }
  69 +
  70 + /**
  71 + * @param string $nullIdentifier
  72 + */
  73 + public function setNullIdentifier(string $nullIdentifier)
  74 + {
  75 + $this->nullIdentifier = $nullIdentifier;
  76 + }
  77 +
  78 + /**
  79 + * @return bool
  80 + */
  81 + public function isHeader(): bool
  82 + {
  83 + return $this->header;
  84 + }
  85 +
  86 + /**
  87 + * @param bool $header
  88 + */
  89 + public function setHeader(bool $header)
  90 + {
  91 + $this->header = $header;
  92 + }
  93 +
  94 + public function to_json_object(){
  95 + $detail = array(
  96 + 'columns' => $this->columns,
  97 + 'delimiter' => $this->delimiter,
  98 + 'quote' => $this->quote,
  99 + 'nullIdentifier' => $this->nullIdentifier,
  100 + 'header' => $this->header
  101 + );
  102 + return array(
  103 + 'detail' => $detail,
  104 + 'format' => parent::getFormat()
  105 + );
  106 + }
  107 +}
  1 +<?php
  2 +/**
  3 + * Copyright (C) Alibaba Cloud Computing
  4 + * All rights reserved
  5 + */
  6 +
  7 +class Aliyun_Log_Models_OssShipperJsonStorage extends Aliyun_Log_Models_OssShipperStorage{
  8 +
  9 + public function to_json_object(){
  10 + return array();
  11 + }
  12 +}
  1 +<?php
  2 +/**
  3 + * Copyright (C) Alibaba Cloud Computing
  4 + * All rights reserved
  5 + */
  6 +
  7 +class Aliyun_Log_Models_OssShipperParquetStorage extends Aliyun_Log_Models_OssShipperStorage{
  8 + private $columns;
  9 +
  10 + /**
  11 + * @return mixed
  12 + */
  13 + public function getColumns()
  14 + {
  15 + return $this->columns;
  16 + }
  17 +
  18 + /**
  19 + * @param mixed $columns
  20 + */
  21 + public function setColumns($columns)
  22 + {
  23 + $this->columns = $columns;
  24 + }
  25 +
  26 + public function to_json_object(){
  27 + $detail = array(
  28 + 'columns' => $this->columns
  29 + );
  30 + return array(
  31 + 'detail' => $detail,
  32 + 'format' => parent::getFormat()
  33 + );
  34 + }
  35 +}
  1 +<?php
  2 +/**
  3 + * Copyright (C) Alibaba Cloud Computing
  4 + * All rights reserved
  5 + */
  6 +
  7 +class Aliyun_Log_Models_OssShipperStorage{
  8 + private $format;
  9 +
  10 + /**
  11 + * @return mixed
  12 + */
  13 + public function getFormat()
  14 + {
  15 + return $this->format;
  16 + }
  17 +
  18 + /**
  19 + * @param mixed $format
  20 + */
  21 + public function setFormat($format)
  22 + {
  23 + $this->format = $format;
  24 + }
  25 +
  26 +
  27 +}
  1 +<?php
  2 +/**
  3 + * Copyright (C) Alibaba Cloud Computing
  4 + * All rights reserved
  5 + */
  6 +
  7 +require_once realpath(dirname(__FILE__) . '/Request.php');
  8 +
  9 +/**
  10 + *
  11 + *
  12 + * @author log service dev
  13 + */
  14 +class Aliyun_Log_Models_ApplyConfigToMachineGroupRequest extends Aliyun_Log_Models_Request {
  15 + private $groupName;
  16 + private $configName;
  17 + /**
  18 + * Aliyun_Log_Models_ApplyConfigToMachineGroupRequest Constructor
  19 + *
  20 + */
  21 + public function __construct($groupName=null,$configName=null) {
  22 + $this->groupName = $groupName;
  23 + $this->configName = $configName;
  24 + }
  25 + public function getGroupName(){
  26 + return $this->groupName;
  27 + }
  28 + public function setGroupName($groupName){
  29 + $this->groupName = $groupName;
  30 + }
  31 +
  32 + public function getConfigName(){
  33 + return $this->configName;
  34 + }
  35 + public function setConfigName($configName){
  36 + $this->configName = $configName;
  37 + }
  38 +
  39 +}
  1 +<?php
  2 +/**
  3 + * Copyright (C) Alibaba Cloud Computing
  4 + * All rights reserved
  5 + */
  6 +
  7 +require_once realpath(dirname(__FILE__) . '/Request.php');
  8 +
  9 +/**
  10 + * The request used to get logs by logstore and shardId from log service.
  11 + *
  12 + * @author log service dev
  13 + */
  14 +class Aliyun_Log_Models_BatchGetLogsRequest extends Aliyun_Log_Models_Request {
  15 +
  16 + /**
  17 + * @var string logstore name
  18 + */
  19 + private $logstore;
  20 +
  21 + /**
  22 + * @var string shard ID
  23 + */
  24 + private $shardId;
  25 +
  26 + /**
  27 + * @var integer max line number of return logs
  28 + */
  29 + private $count;
  30 +
  31 + /**
  32 + * @var string start cursor
  33 + */
  34 + private $cursor;
  35 +
  36 + /**
  37 + * @var string end cursor
  38 + */
  39 + private $endCursor;
  40 +
  41 + /**
  42 + * Aliyun_Log_Models_BatchGetLogsRequest Constructor
  43 + *
  44 + * @param string $project
  45 + * project name
  46 + * @param string $logStore
  47 + * logstore name
  48 + * @param string $shardId
  49 + * shard ID
  50 + * @param integer $count
  51 + * return max loggroup numbers
  52 + * @param string $cursor
  53 + * start cursor
  54 + * @param string $end_cursor
  55 + * end cursor
  56 + */
  57 + public function __construct($project = null, $logstore = null, $shardId = null, $count = null, $cursor = null, $end_cursor = null) {
  58 + parent::__construct ( $project );
  59 + $this->logstore = $logstore;
  60 + $this->shardId = $shardId;
  61 + $this->count = $count;
  62 + $this->cursor = $cursor;
  63 + $this->endCursor = $end_cursor;
  64 + }
  65 +
  66 + /**
  67 + * Get logstore name
  68 + *
  69 + * @return string logstore name
  70 + */
  71 + public function getLogstore() {
  72 + return $this->logstore;
  73 + }
  74 +
  75 + /**
  76 + * Set logstore name
  77 + *
  78 + * @param string $logstore
  79 + * logstore name
  80 + */
  81 + public function setLogstore($logstore) {
  82 + $this->logstore = $logstore;
  83 + }
  84 +
  85 + /**
  86 + * Get shard ID
  87 + *
  88 + * @return string shardId
  89 + */
  90 + public function getShardId() {
  91 + return $this->shardId;
  92 + }
  93 +
  94 + /**
  95 + * Set shard ID
  96 + *
  97 + * @param string $shardId
  98 + * shard ID
  99 + */
  100 + public function setShardId($shardId) {
  101 + $this->shardId = $shardId;
  102 + }
  103 +
  104 + /**
  105 + * Get max return loggroup number
  106 + *
  107 + * @return integer count
  108 + */
  109 + public function getCount() {
  110 + return $this->count;
  111 + }
  112 +
  113 + /**
  114 + * Set max return loggroup number
  115 + *
  116 + * @param integer $count
  117 + * max return loggroup number
  118 + */
  119 + public function setCount($count) {
  120 + $this->count = $count;
  121 + }
  122 +
  123 + /**
  124 + * Get start cursor
  125 + *
  126 + * @return string cursor
  127 + */
  128 + public function getCursor() {
  129 + return $this->cursor;
  130 + }
  131 +
  132 + /**
  133 + * Get end cursor
  134 + *
  135 + * @return string cursor
  136 + */
  137 + public function getEndCursor() {
  138 + return $this->endCursor;
  139 + }
  140 +
  141 + /**
  142 + * Set start cursor
  143 + *
  144 + * @param string $cursor
  145 + * start cursor
  146 + */
  147 + public function setCursor($cursor) {
  148 + $this->cursor = $cursor;
  149 + }
  150 +
  151 + /**
  152 + * Set end cursor
  153 + *
  154 + * @param string $cursor
  155 + * end cursor
  156 + */
  157 + public function setEndCursor($cursor) {
  158 + $this->endCursor = $cursor;
  159 + }
  160 +}
  1 +<?php
  2 +/**
  3 + * Copyright (C) Alibaba Cloud Computing
  4 + * All rights reserved
  5 + */
  6 +
  7 +require_once realpath(dirname(__FILE__) . '/Request.php');
  8 +
  9 +/**
  10 + *
  11 + *
  12 + * @author log service dev
  13 + */
  14 +class Aliyun_Log_Models_CreateACLRequest extends Aliyun_Log_Models_Request {
  15 +
  16 + private $acl;
  17 + /**
  18 + * Aliyun_Log_Models_CreateACLRequest Constructor
  19 + *
  20 + */
  21 + public function __construct($acl=null) {
  22 + $this->acl = $acl;
  23 + }
  24 +
  25 + public function getAcl(){
  26 + return $this->acl;
  27 + }
  28 + public function setAcl($acl){
  29 + $this->acl = $acl;
  30 + }
  31 +
  32 +}
  1 +<?php
  2 +/**
  3 + * Copyright (C) Alibaba Cloud Computing
  4 + * All rights reserved
  5 + */
  6 +
  7 +require_once realpath(dirname(__FILE__) . '/Request.php');
  8 +
  9 +/**
  10 + *
  11 + *
  12 + * @author log service dev
  13 + */
  14 +class Aliyun_Log_Models_CreateConfigRequest extends Aliyun_Log_Models_Request {
  15 +
  16 + private $config;
  17 +
  18 + /**
  19 + * Aliyun_Log_Models_CreateConfigRequest Constructor
  20 + *
  21 + */
  22 + public function __construct($config) {
  23 + $this->config = $config;
  24 + }
  25 +
  26 + public function getConfig(){
  27 + return $this->config;
  28 +
  29 + }
  30 +
  31 + public function setConfig($config){
  32 + $this->config = $config;
  33 + }
  34 +
  35 +}
  1 +<?php
  2 +/**
  3 + * Copyright (C) Alibaba Cloud Computing
  4 + * All rights reserved
  5 + */
  6 +
  7 +require_once realpath(dirname(__FILE__) . '/Request.php');
  8 +
  9 +/**
  10 + * The request used to create logstore from log service.
  11 + *
  12 + * @author log service dev
  13 + */
  14 +class Aliyun_Log_Models_CreateLogstoreRequest extends Aliyun_Log_Models_Request{
  15 +
  16 + private $logstore;
  17 + private $ttl;
  18 + private $shardCount;
  19 + /**
  20 + * Aliyun_Log_Models_CreateLogstoreRequest constructor
  21 + *
  22 + * @param string $project project name
  23 + */
  24 + public function __construct($project=null,$logstore = null,$ttl = null,$shardCount = null) {
  25 + parent::__construct($project);
  26 + $this -> logstore = $logstore;
  27 + $this -> ttl = $ttl;
  28 + $this -> shardCount = $shardCount;
  29 + }
  30 + public function getLogstore()
  31 + {
  32 + return $this -> logstore;
  33 + }
  34 + public function getTtl()
  35 + {
  36 + return $this -> ttl;
  37 + }
  38 + public function getShardCount()
  39 + {
  40 + return $this -> shardCount;
  41 + }
  42 +}
  1 +<?php
  2 +/**
  3 + * Copyright (C) Alibaba Cloud Computing
  4 + * All rights reserved
  5 + */
  6 +
  7 +require_once realpath(dirname(__FILE__) . '/Request.php');
  8 +
  9 +/**
  10 + *
  11 + *
  12 + * @author log service dev
  13 + */
  14 +class Aliyun_Log_Models_CreateMachineGroupRequest extends Aliyun_Log_Models_Request {
  15 +
  16 + private $machineGroup;
  17 + /**
  18 + * Aliyun_Log_Models_CreateMachineGroupRequest Constructor
  19 + *
  20 + */
  21 + public function __construct($machineGroup=null) {
  22 + $this->machineGroup = $machineGroup;
  23 + }
  24 + public function getMachineGroup(){
  25 + return $this->machineGroup;
  26 + }
  27 + public function setMachineGroup($machineGroup){
  28 + $this->machineGroup = $machineGroup;
  29 + }
  30 +
  31 +}
  1 +<?php
  2 +/**
  3 + * Copyright (C) Alibaba Cloud Computing
  4 + * All rights reserved
  5 + */
  6 +
  7 +require_once realpath(dirname(__FILE__) . '/Request.php');
  8 +
  9 +/**
  10 + *
  11 + *
  12 + * @author log service dev
  13 + */
  14 +class Aliyun_Log_Models_CreateShipperRequest extends Aliyun_Log_Models_Request {
  15 + private $shipperName;
  16 +
  17 + private $targetType;
  18 +
  19 + private $targetConfigration;
  20 +
  21 + private $logStore;
  22 +
  23 + /**
  24 + * @return mixed
  25 + */
  26 + public function getLogStore()
  27 + {
  28 + return $this->logStore;
  29 + }
  30 +
  31 + /**
  32 + * @param mixed $logStore
  33 + */
  34 + public function setLogStore($logStore)
  35 + {
  36 + $this->logStore = $logStore;
  37 + }
  38 +
  39 + /**
  40 + * Aliyun_Log_Models_CreateShipperRequest Constructor
  41 + *
  42 + */
  43 + public function __construct($project) {
  44 + parent::__construct ( $project );
  45 + }
  46 +
  47 + /**
  48 + * @return mixed
  49 + */
  50 + public function getShipperName()
  51 + {
  52 + return $this->shipperName;
  53 + }
  54 +
  55 + /**
  56 + * @param mixed $shipperName
  57 + */
  58 + public function setShipperName($shipperName)
  59 + {
  60 + $this->shipperName = $shipperName;
  61 + }
  62 +
  63 + /**
  64 + * @return mixed
  65 + */
  66 + public function getTargetType()
  67 + {
  68 + return $this->targetType;
  69 + }
  70 +
  71 + /**
  72 + * @param mixed $targetType
  73 + */
  74 + public function setTargetType($targetType)
  75 + {
  76 + $this->targetType = $targetType;
  77 + }
  78 +
  79 + /**
  80 + * @return mixed
  81 + */
  82 + public function getTargetConfigration()
  83 + {
  84 + return $this->targetConfigration;
  85 + }
  86 +
  87 + /**
  88 + * @param mixed $targetConfigration
  89 + */
  90 + public function setTargetConfigration($targetConfigration)
  91 + {
  92 + $this->targetConfigration = $targetConfigration;
  93 + }
  94 +}
  1 +<?php
  2 +/**
  3 + * Copyright (C) Alibaba Cloud Computing
  4 + * All rights reserved
  5 + */
  6 +
  7 +require_once realpath(dirname(__FILE__) . '/Request.php');
  8 +
  9 +/**
  10 + *
  11 + *
  12 + * @author log service dev
  13 + */
  14 +class Aliyun_Log_Models_DeleteACLRequest extends Aliyun_Log_Models_Request {
  15 +
  16 + private $aclId;
  17 + /**
  18 + * Aliyun_Log_Models_DeleteACLRequest Constructor
  19 + *
  20 + */
  21 + public function __construct($aclId=null) {
  22 + $this->aclId = $aclId;
  23 + }
  24 + public function getAclId(){
  25 + return $this->aclId;
  26 + }
  27 + public function setAclId($aclId){
  28 + $this->aclId = $aclId;
  29 + }
  30 +
  31 +}
  1 +<?php
  2 +/**
  3 + * Copyright (C) Alibaba Cloud Computing
  4 + * All rights reserved
  5 + */
  6 +
  7 +require_once realpath(dirname(__FILE__) . '/Request.php');
  8 +
  9 +/**
  10 + *
  11 + *
  12 + * @author log service dev
  13 + */
  14 +class Aliyun_Log_Models_DeleteConfigRequest extends Aliyun_Log_Models_Request {
  15 +
  16 + private $configName;
  17 + /**
  18 + * Aliyun_Log_Models_DeleteConfigRequest Constructor
  19 + *
  20 + */
  21 + public function __construct($configName=null) {
  22 + $this->configName = $configName;
  23 + }
  24 +
  25 + public function getConfigName(){
  26 + return $this->configName;
  27 + }
  28 +
  29 + public function setConfigName($configName){
  30 + $this->configName=$configName;
  31 + }
  32 +
  33 +}
  1 +<?php
  2 +/**
  3 + * Copyright (C) Alibaba Cloud Computing
  4 + * All rights reserved
  5 + */
  6 +
  7 +require_once realpath(dirname(__FILE__) . '/Request.php');
  8 +
  9 +/**
  10 + * The request used to delete logstore from log service.
  11 + *
  12 + * @author log service dev
  13 + */
  14 +class Aliyun_Log_Models_DeleteLogstoreRequest extends Aliyun_Log_Models_Request{
  15 +
  16 + private $logstore;
  17 + /**
  18 + * Aliyun_Log_Models_DeleteLogstoreRequest constructor
  19 + *
  20 + * @param string $project project name
  21 + */
  22 + public function __construct($project=null,$logstore = null) {
  23 + parent::__construct($project);
  24 + $this -> logstore = $logstore;
  25 + }
  26 + public function getLogstore()
  27 + {
  28 + return $this -> logstore;
  29 + }
  30 +}
  1 +<?php
  2 +/**
  3 + * Copyright (C) Alibaba Cloud Computing
  4 + * All rights reserved
  5 + */
  6 +
  7 +require_once realpath(dirname(__FILE__) . '/Request.php');
  8 +
  9 +/**
  10 + *
  11 + *
  12 + * @author log service dev
  13 + */
  14 +class Aliyun_Log_Models_DeleteMachineGroupRequest extends Aliyun_Log_Models_Request {
  15 +
  16 +
  17 + private $groupName;
  18 + /**
  19 + * Aliyun_Log_Models_DeleteMachineGroupRequest Constructor
  20 + *
  21 + */
  22 + public function __construct($groupName) {
  23 + $this->groupName = $groupName;
  24 + }
  25 +
  26 + public function getGroupName(){
  27 + return $this->groupName;
  28 + }
  29 +
  30 + public function setGroupName($groupName){
  31 + $this->groupName = $groupName;
  32 + }
  33 +
  34 +}
  1 +<?php
  2 +/**
  3 + * Copyright (C) Alibaba Cloud Computing
  4 + * All rights reserved
  5 + */
  6 +
  7 +require_once realpath(dirname(__FILE__) . '/Request.php');
  8 +
  9 +/**
  10 + *
  11 + *
  12 + * @author log service dev
  13 + */
  14 +class Aliyun_Log_Models_DeleteShardRequest extends Aliyun_Log_Models_Request {
  15 +
  16 + private $logstore;
  17 +
  18 + /**
  19 + * Aliyun_Log_Models_DeleteShardRequest Constructor
  20 + *
  21 + */
  22 + public function __construct($project,$logstore,$shardId) {
  23 + parent::__construct ( $project );
  24 + $this->logstore = $logstore;
  25 + $this->shardId = $shardId;
  26 + }
  27 +
  28 + public function getLogstore(){
  29 + return $this->logstore;
  30 + }
  31 +
  32 + public function setLogstore($logstore){
  33 + $this->logstore = $logstore;
  34 + }
  35 +
  36 + public function getShardId(){
  37 + return $this->shardId;
  38 + }
  39 +}
  1 +<?php
  2 +/**
  3 + * Copyright (C) Alibaba Cloud Computing
  4 + * All rights reserved
  5 + */
  6 +
  7 +require_once realpath(dirname(__FILE__) . '/Request.php');
  8 +
  9 +class Aliyun_Log_Models_DeleteShipperRequest extends Aliyun_Log_Models_Request {
  10 + private $shipperName;
  11 + private $logStore;
  12 +
  13 + /**
  14 + * @return mixed
  15 + */
  16 + public function getLogStore()
  17 + {
  18 + return $this->logStore;
  19 + }
  20 +
  21 + /**
  22 + * @param mixed $logStore
  23 + */
  24 + public function setLogStore($logStore)
  25 + {
  26 + $this->logStore = $logStore;
  27 + }
  28 +
  29 +
  30 + /**
  31 + * @return mixed
  32 + */
  33 + public function getShipperName()
  34 + {
  35 + return $this->shipperName;
  36 + }
  37 +
  38 + /**
  39 + * @param mixed $shipperName
  40 + */
  41 + public function setShipperName($shipperName)
  42 + {
  43 + $this->shipperName = $shipperName;
  44 + }
  45 +
  46 + /**
  47 + * Aliyun_Log_Models_CreateShipperRequest Constructor
  48 + *
  49 + */
  50 + public function __construct($project) {
  51 + parent::__construct ( $project );
  52 + }
  53 +}
  1 +<?php
  2 +/**
  3 + * Copyright (C) Alibaba Cloud Computing
  4 + * All rights reserved
  5 + */
  6 +
  7 +require_once realpath(dirname(__FILE__) . '/Request.php');
  8 +
  9 +/**
  10 + *
  11 + *
  12 + * @author log service dev
  13 + */
  14 +class Aliyun_Log_Models_GetACLRequest extends Aliyun_Log_Models_Request {
  15 +
  16 + private $aclId;
  17 + /**
  18 + * Aliyun_Log_Models_GetACLRequest Constructor
  19 + *
  20 + */
  21 + public function __construct($aclId=null) {
  22 + $this->aclId = $aclId;
  23 + }
  24 + public function getAclId(){
  25 + return $this->aclId;
  26 + }
  27 + public function setAclId($aclId){
  28 + $this->aclId = $aclId;
  29 + }
  30 +}
  1 +<?php
  2 +/**
  3 + * Copyright (C) Alibaba Cloud Computing
  4 + * All rights reserved
  5 + */
  6 +
  7 +require_once realpath(dirname(__FILE__) . '/Request.php');
  8 +
  9 +/**
  10 + *
  11 + *
  12 + * @author log service dev
  13 + */
  14 +class Aliyun_Log_Models_GetConfigRequest extends Aliyun_Log_Models_Request {
  15 +
  16 + private $configName;
  17 +
  18 + /**
  19 + * Aliyun_Log_Models_GetConfigRequest Constructor
  20 + *
  21 + */
  22 + public function __construct($configName = null) {
  23 + $this->configName = $configName;
  24 + }
  25 +
  26 + public function getConfigName(){
  27 + return $this->configName;
  28 + }
  29 +
  30 + public function setConfigName($configName){
  31 + $this->configName = $configName;
  32 + }
  33 +
  34 +}
  1 +<?php
  2 +/**
  3 + * Copyright (C) Alibaba Cloud Computing
  4 + * All rights reserved
  5 + */
  6 +
  7 +require_once realpath(dirname(__FILE__) . '/Request.php');
  8 +
  9 +/**
  10 + * The request used to get cursor by fromTime or begin/end mode
  11 + *
  12 + * @author log service dev
  13 + */
  14 +class Aliyun_Log_Models_GetCursorRequest extends Aliyun_Log_Models_Request {
  15 +
  16 + /**
  17 + * @var string logstore name
  18 + */
  19 + private $logstore;
  20 +
  21 + /**
  22 + * @var string shard id
  23 + */
  24 + private $shardId;
  25 +
  26 + //mode and fromTime: choose one and another remains null
  27 + /**
  28 + * @var string value should be 'begin' or 'end'
  29 + * begin:return cursor point to first loggroup
  30 + * end:return cursor point to position after last loggroup
  31 + * if $mode is set to not null,$fromTime must be set null
  32 + */
  33 + private $mode;
  34 +
  35 + /**
  36 + * @var integer unix_timestamp
  37 + * return cursor point to first loggroup whose time after $fromTime
  38 + */
  39 + private $fromTime;
  40 +
  41 + /**
  42 + * Aliyun_Log_Models_GetCursorRequest Constructor
  43 + * @param string $project
  44 + * project name
  45 + * @param string $logstore
  46 + * logstore name
  47 + * @param string $shardId
  48 + * shard id
  49 + * @param string $mode
  50 + * query mode,value must be 'begin' or 'end'
  51 + * @param string $fromTime
  52 + * query by from time,unix_timestamp
  53 + */
  54 + public function __construct($project,$logstore,$shardId,$mode=null,$fromTime=-1) {
  55 + parent::__construct ( $project );
  56 + $this->logstore = $logstore;
  57 + $this->shardId = $shardId;
  58 + $this->mode = $mode;
  59 + $this->fromTime = $fromTime;
  60 + }
  61 +
  62 + /**
  63 + * Get logstore name
  64 + *
  65 + * @return string logstore name
  66 + */
  67 + public function getLogstore(){
  68 + return $this->logstore;
  69 + }
  70 +
  71 + /**
  72 + * Set logstore name
  73 + *
  74 + * @param string $logstore
  75 + * logstore name
  76 + */
  77 + public function setLogstore($logstore){
  78 + $this->logstore = $logstore;
  79 + }
  80 +
  81 + /**
  82 + * Get shard id
  83 + *
  84 + * @return string shard id
  85 + */
  86 + public function getShardId(){
  87 + return $this->shardId;
  88 + }
  89 +
  90 + /**
  91 + * Set shard id
  92 + *
  93 + * @param string $shardId
  94 + * shard id
  95 + */
  96 + public function setShardId($shardId){
  97 + $this->shardId = $shardId;
  98 + }
  99 +
  100 + /**
  101 + * Get mode
  102 + *
  103 + * @return string mode
  104 + */
  105 + public function getMode(){
  106 + return $this->mode;
  107 + }
  108 +
  109 + /**
  110 + * Set mode
  111 + *
  112 + * @param string $mode
  113 + * value must be 'begin' or 'end'
  114 + */
  115 + public function setMode($mode){
  116 + $this->mode = $mode;
  117 + }
  118 +
  119 + /**
  120 + * Get from time
  121 + *
  122 + * @return integer(unix_timestamp) from time
  123 + */
  124 + public function getFromTime(){
  125 + return $this->fromTime;
  126 + }
  127 +
  128 + /**
  129 + * Set from time
  130 + *
  131 + * @param integer $fromTime
  132 + * from time (unix_timestamp)
  133 + */
  134 + public function setFromTime($fromTime){
  135 + $this->fromTime = $fromTime;
  136 + }
  137 +
  138 +}
  1 +<?php
  2 +/**
  3 + * Copyright (C) Alibaba Cloud Computing
  4 + * All rights reserved
  5 + */
  6 +
  7 +require_once realpath(dirname(__FILE__) . '/Request.php');
  8 +
  9 +/**
  10 + * The request used to get histograms of a query from log service.
  11 + *
  12 + * @author log service dev
  13 + */
  14 +class Aliyun_Log_Models_GetHistogramsRequest extends Aliyun_Log_Models_Request {
  15 +
  16 + /**
  17 + * @var string logstore name
  18 + */
  19 + private $logstore;
  20 +
  21 + /**
  22 + * @var string topic name of logs
  23 + */
  24 + private $topic;
  25 +
  26 + /**
  27 + * @var integer the begin time
  28 + */
  29 + private $from;
  30 +
  31 + /**
  32 + * @var integer the end time
  33 + */
  34 + private $to;
  35 +
  36 + /**
  37 + * @var string user defined query
  38 + */
  39 + private $query;
  40 +
  41 +
  42 + /**
  43 + * Aliyun_Log_Models_GetHistogramsRequest constructor
  44 + *
  45 + * @param string $project
  46 + * project name
  47 + * @param string $logstore
  48 + * logstore name
  49 + * @param integer $from
  50 + * the begin time
  51 + * @param integer $to
  52 + * the end time
  53 + * @param string $topic
  54 + * topic name of logs
  55 + * @param string $query
  56 + * user defined query
  57 + */
  58 + public function __construct($project = null, $logstore = null, $from = null, $to = null, $topic = null, $query = null) {
  59 + parent::__construct ( $project );
  60 + $this->logstore = $logstore;
  61 + $this->from = $from;
  62 + $this->to = $to;
  63 + $this->topic = $topic;
  64 + $this->query = $query;
  65 + }
  66 +
  67 + /**
  68 + * Get logstore name
  69 + *
  70 + * @return string logstore name
  71 + */
  72 + public function getLogstore() {
  73 + return $this->logstore;
  74 + }
  75 +
  76 + /**
  77 + * Set logstore name
  78 + *
  79 + * @param string $logstore
  80 + * logstore name
  81 + */
  82 + public function setLogstore($logstore) {
  83 + $this->logstore = $logstore;
  84 + }
  85 +
  86 + /**
  87 + * Get topic name
  88 + *
  89 + * @return string topic name
  90 + */
  91 + public function getTopic() {
  92 + return $this->topic;
  93 + }
  94 +
  95 + /**
  96 + * Set topic name
  97 + *
  98 + * @param string $topic
  99 + * topic name
  100 + */
  101 + public function setTopic($topic) {
  102 + $this->topic = $topic;
  103 + }
  104 +
  105 + /**
  106 + * Get begin time
  107 + *
  108 + * @return integer begin time
  109 + */
  110 + public function getFrom() {
  111 + return $this->from;
  112 + }
  113 +
  114 + /**
  115 + * Set begin time
  116 + *
  117 + * @param integer $from
  118 + * begin time
  119 + */
  120 + public function setFrom($from) {
  121 + $this->from = $from;
  122 + }
  123 +
  124 + /**
  125 + * Get end time
  126 + *
  127 + * @return integer end time
  128 + */
  129 + public function getTo() {
  130 + return $this->to;
  131 + }
  132 +
  133 + /**
  134 + * Set end time
  135 + *
  136 + * @param integer $to
  137 + * end time
  138 + */
  139 + public function setTo($to) {
  140 + $this->to = $to;
  141 + }
  142 +
  143 + /**
  144 + * Get user defined query
  145 + *
  146 + * @return string user defined query
  147 + */
  148 + public function getQuery() {
  149 + return $this->query;
  150 + }
  151 +
  152 + /**
  153 + * Set user defined query
  154 + *
  155 + * @param string $query
  156 + * user defined query
  157 + */
  158 + public function setQuery($query) {
  159 + $this->query = $query;
  160 + }
  161 +}
  1 +<?php
  2 +/**
  3 + * Copyright (C) Alibaba Cloud Computing
  4 + * All rights reserved
  5 + */
  6 +
  7 +require_once realpath(dirname(__FILE__) . '/Request.php');
  8 +
  9 +/**
  10 + * The request used to get logs by a query from log service.
  11 + *
  12 + * @author log service dev
  13 + */
  14 +class Aliyun_Log_Models_GetLogsRequest extends Aliyun_Log_Models_Request {
  15 +
  16 + /**
  17 + * @var string logstore name
  18 + */
  19 + private $logstore;
  20 +
  21 + /**
  22 + * @var string topic name of logs
  23 + */
  24 + private $topic;
  25 +
  26 + /**
  27 + * @var integer the begin time
  28 + */
  29 + private $from;
  30 +
  31 + /**
  32 + * @var integer the end time
  33 + */
  34 + private $to;
  35 +
  36 + /**
  37 + * @var string user defined query
  38 + */
  39 + private $query;
  40 +
  41 + /**
  42 + * @var integer max line number of return logs
  43 + */
  44 + private $line;
  45 +
  46 + /**
  47 + * @var integer line offset of return logs
  48 + */
  49 + private $offset;
  50 +
  51 + /**
  52 + * @var bool if reverse is set to true, the query will return the latest logs first
  53 + */
  54 + private $reverse;
  55 +
  56 + /**
  57 + * Aliyun_Log_Models_GetLogsRequest Constructor
  58 + *
  59 + * @param string $project
  60 + * project name
  61 + * @param string $logStore
  62 + * logstore name
  63 + * @param integer $from
  64 + * the begin time
  65 + * @param integer $to
  66 + * the end time
  67 + * @param string $topic
  68 + * topic name of logs
  69 + * @param string $query
  70 + * user defined query
  71 + * @param integer $line
  72 + * query return line number
  73 + * @param integer $offset
  74 + * the log offset to return
  75 + * @param bool $reverse
  76 + * if reverse is set to true, the query will return the latest logs first
  77 + */
  78 + public function __construct($project = null, $logstore = null, $from = null, $to = null, $topic = null, $query = null, $line = null, $offset = null, $reverse = null) {
  79 + parent::__construct ( $project );
  80 +
  81 + $this->logstore = $logstore;
  82 + $this->from = $from;
  83 + $this->to = $to;
  84 + $this->topic = $topic;
  85 + $this->query = $query;
  86 + $this->line = $line;
  87 + $this->offset = $offset;
  88 + $this->reverse = $reverse;
  89 + }
  90 +
  91 + /**
  92 + * Get logstore name
  93 + *
  94 + * @return string logstore name
  95 + */
  96 + public function getLogstore() {
  97 + return $this->logstore;
  98 + }
  99 +
  100 + /**
  101 + * Set logstore name
  102 + *
  103 + * @param string $logstore
  104 + * logstore name
  105 + */
  106 + public function setLogstore($logstore) {
  107 + $this->logstore = $logstore;
  108 + }
  109 +
  110 + /**
  111 + * Get topic name
  112 + *
  113 + * @return string topic name
  114 + */
  115 + public function getTopic() {
  116 + return $this->topic;
  117 + }
  118 +
  119 + /**
  120 + * Set topic name
  121 + *
  122 + * @param string $topic
  123 + * topic name
  124 + */
  125 + public function setTopic($topic) {
  126 + $this->topic = $topic;
  127 + }
  128 +
  129 + /**
  130 + * Get begin time
  131 + *
  132 + * @return integer begin time
  133 + */
  134 + public function getFrom() {
  135 + return $this->from;
  136 + }
  137 +
  138 + /**
  139 + * Set begin time
  140 + *
  141 + * @param integer $from
  142 + * begin time
  143 + */
  144 + public function setFrom($from) {
  145 + $this->from = $from;
  146 + }
  147 +
  148 + /**
  149 + * Get end time
  150 + *
  151 + * @return integer end time
  152 + */
  153 + public function getTo() {
  154 + return $this->to;
  155 + }
  156 +
  157 + /**
  158 + * Set end time
  159 + *
  160 + * @param integer $to
  161 + * end time
  162 + */
  163 + public function setTo($to) {
  164 + $this->to = $to;
  165 + }
  166 +
  167 + /**
  168 + * Get user defined query
  169 + *
  170 + * @return string user defined query
  171 + */
  172 + public function getQuery() {
  173 + return $this->query;
  174 + }
  175 +
  176 + /**
  177 + * Set user defined query
  178 + *
  179 + * @param string $query
  180 + * user defined query
  181 + */
  182 + public function setQuery($query) {
  183 + $this->query = $query;
  184 + }
  185 +
  186 + /**
  187 + * Get max line number of return logs
  188 + *
  189 + * @return integer max line number of return logs
  190 + */
  191 + public function getLine() {
  192 + return $this->line;
  193 + }
  194 +
  195 + /**
  196 + * Set max line number of return logs
  197 + *
  198 + * @param integer $line
  199 + * max line number of return logs
  200 + */
  201 + public function setLine($line) {
  202 + $this->line = $line;
  203 + }
  204 +
  205 + /**
  206 + * Get line offset of return logs
  207 + *
  208 + * @return integer line offset of return logs
  209 + */
  210 + public function getOffset() {
  211 + return $this->offset;
  212 + }
  213 +
  214 + /**
  215 + * Set request line offset of return logs
  216 + *
  217 + * @param integer $offset
  218 + * line offset of return logs
  219 + */
  220 + public function setOffset($offset) {
  221 + $this->offset = $offset;
  222 + }
  223 +
  224 + /**
  225 + * Get request reverse flag
  226 + *
  227 + * @return bool reverse flag
  228 + */
  229 + public function getReverse() {
  230 + return $this->reverse;
  231 + }
  232 +
  233 + /**
  234 + * Set request reverse flag
  235 + *
  236 + * @param bool $reverse
  237 + * reverse flag
  238 + */
  239 + public function setReverse($reverse) {
  240 + $this->reverse = $reverse;
  241 + }
  242 +}
  1 +<?php
  2 +/**
  3 + * Copyright (C) Alibaba Cloud Computing
  4 + * All rights reserved
  5 + */
  6 +
  7 +require_once realpath(dirname(__FILE__) . '/Request.php');
  8 +
  9 +/**
  10 + *
  11 + *
  12 + * @author log service dev
  13 + */
  14 +class Aliyun_Log_Models_GetMachineGroupRequest extends Aliyun_Log_Models_Request {
  15 +
  16 + private $groupName;
  17 + /**
  18 + * Aliyun_Log_Models_GetMachineGroupRequest Constructor
  19 + *
  20 + */
  21 + public function __construct($groupName=null) {
  22 + $this->groupName = $groupName;
  23 + }
  24 + public function getGroupName(){
  25 + return $this->groupName;
  26 + }
  27 + public function setGroupName($groupName){
  28 + $this->groupName = $groupName;
  29 + }
  30 +
  31 +}
  1 +<?php
  2 +/**
  3 + * Copyright (C) Alibaba Cloud Computing
  4 + * All rights reserved
  5 + */
  6 +
  7 +require_once realpath(dirname(__FILE__) . '/Request.php');
  8 +
  9 +/**
  10 + *
  11 + *
  12 + * @author log service dev
  13 + */
  14 +class Aliyun_Log_Models_GetMachineRequest extends Aliyun_Log_Models_Request {
  15 +
  16 + private $uuid;
  17 +
  18 + /**
  19 + * Aliyun_Log_Models_GetMachineRequest Constructor
  20 + *
  21 + */
  22 + public function __construct($uuid=null) {
  23 + $this->uuid = $uuid;
  24 + }
  25 +
  26 + public function getUuid(){
  27 + return $this->uuid;
  28 + }
  29 +
  30 + public function setUuid($uuid){
  31 + $this->uuid = $uuid;
  32 + }
  33 +
  34 +}
  1 +<?php
  2 +/**
  3 + * Copyright (C) Alibaba Cloud Computing
  4 + * All rights reserved
  5 + */
  6 +
  7 +require_once realpath(dirname(__FILE__) . '/Request.php');
  8 +
  9 +/**
  10 + * The request used to get logs by a query from log service.
  11 + *
  12 + * @author log service dev
  13 + */
  14 +class Aliyun_Log_Models_GetProjectLogsRequest extends Aliyun_Log_Models_Request {
  15 +
  16 + /**
  17 + * @var string user defined query
  18 + */
  19 + private $query;
  20 +
  21 +
  22 + /**
  23 + * Aliyun_Log_Models_GetProjectLogsRequest Constructor
  24 + * @param string $query
  25 + * user defined query
  26 + */
  27 + public function __construct($project = null, $query = null ) {
  28 + parent::__construct ( $project );
  29 +
  30 + $this->query = $query;
  31 + }
  32 +
  33 +
  34 +
  35 + /**
  36 + * Get user defined query
  37 + *
  38 + * @return string user defined query
  39 + */
  40 + public function getQuery() {
  41 + return $this->query;
  42 + }
  43 +
  44 +
  45 +}
  1 +<?php
  2 +/**
  3 + * Copyright (C) Alibaba Cloud Computing
  4 + * All rights reserved
  5 + */
  6 +
  7 +require_once realpath(dirname(__FILE__) . '/Request.php');
  8 +
  9 +class Aliyun_Log_Models_GetShipperConfigRequest extends Aliyun_Log_Models_Request {
  10 + private $shipperName;
  11 + private $logStore;
  12 +
  13 + /**
  14 + * @return mixed
  15 + */
  16 + public function getLogStore()
  17 + {
  18 + return $this->logStore;
  19 + }
  20 +
  21 + /**
  22 + * @param mixed $logStore
  23 + */
  24 + public function setLogStore($logStore)
  25 + {
  26 + $this->logStore = $logStore;
  27 + }
  28 +
  29 +
  30 + /**
  31 + * @return mixed
  32 + */
  33 + public function getShipperName()
  34 + {
  35 + return $this->shipperName;
  36 + }
  37 +
  38 + /**
  39 + * @param mixed $shipperName
  40 + */
  41 + public function setShipperName($shipperName)
  42 + {
  43 + $this->shipperName = $shipperName;
  44 + }
  45 +
  46 + /**
  47 + * Aliyun_Log_Models_CreateShipperRequest Constructor
  48 + *
  49 + */
  50 + public function __construct($project) {
  51 + parent::__construct ( $project );
  52 + }
  53 +}
  1 +<?php
  2 +/**
  3 + * Copyright (C) Alibaba Cloud Computing
  4 + * All rights reserved
  5 + */
  6 +
  7 +require_once realpath(dirname(__FILE__) . '/Request.php');
  8 +
  9 +class Aliyun_Log_Models_GetShipperTasksRequest extends Aliyun_Log_Models_Request{
  10 + private $shipperName;
  11 + private $logStore;
  12 +
  13 + private $startTime;
  14 +
  15 + private $endTime;
  16 + /**
  17 + * @var support one of ['', 'fail', 'success', 'running'] , if the status_type = '' , return all kinds of status type
  18 +
  19 + */
  20 + private $statusType;
  21 +
  22 + private $offset;
  23 +
  24 + private $size;
  25 +
  26 + /**
  27 + * @return mixed
  28 + */
  29 + public function getStartTime()
  30 + {
  31 + return $this->startTime;
  32 + }
  33 +
  34 + /**
  35 + * @param mixed $startTime
  36 + */
  37 + public function setStartTime($startTime)
  38 + {
  39 + $this->startTime = $startTime;
  40 + }
  41 +
  42 + /**
  43 + * @return mixed
  44 + */
  45 + public function getEndTime()
  46 + {
  47 + return $this->endTime;
  48 + }
  49 +
  50 + /**
  51 + * @param mixed $endTime
  52 + */
  53 + public function setEndTime($endTime)
  54 + {
  55 + $this->endTime = $endTime;
  56 + }
  57 +
  58 + /**
  59 + * @return
  60 + */
  61 + public function getStatusType()
  62 + {
  63 + return $this->statusType;
  64 + }
  65 +
  66 + /**
  67 + * @param $statusType
  68 + */
  69 + public function setStatusType($statusType)
  70 + {
  71 + $this->statusType = $statusType;
  72 + }
  73 +
  74 + /**
  75 + * @return mixed
  76 + */
  77 + public function getOffset()
  78 + {
  79 + return $this->offset;
  80 + }
  81 +
  82 + /**
  83 + * @param mixed $offset
  84 + */
  85 + public function setOffset($offset)
  86 + {
  87 + $this->offset = $offset;
  88 + }
  89 +
  90 + /**
  91 + * @return mixed
  92 + */
  93 + public function getSize()
  94 + {
  95 + return $this->size;
  96 + }
  97 +
  98 + /**
  99 + * @param mixed $size
  100 + */
  101 + public function setSize($size)
  102 + {
  103 + $this->size = $size;
  104 + }
  105 +
  106 + /**
  107 + * @return mixed
  108 + */
  109 + public function getLogStore()
  110 + {
  111 + return $this->logStore;
  112 + }
  113 +
  114 + /**
  115 + * @param mixed $logStore
  116 + */
  117 + public function setLogStore($logStore)
  118 + {
  119 + $this->logStore = $logStore;
  120 + }
  121 +
  122 +
  123 + /**
  124 + * @return mixed
  125 + */
  126 + public function getShipperName()
  127 + {
  128 + return $this->shipperName;
  129 + }
  130 +
  131 + /**
  132 + * @param mixed $shipperName
  133 + */
  134 + public function setShipperName($shipperName)
  135 + {
  136 + $this->shipperName = $shipperName;
  137 + }
  138 +
  139 + /**
  140 + * Aliyun_Log_Models_CreateShipperRequest Constructor
  141 + *
  142 + */
  143 + public function __construct($project) {
  144 + parent::__construct ( $project );
  145 + }
  146 +}
  1 +<?php
  2 +/**
  3 + * Copyright (C) Alibaba Cloud Computing
  4 + * All rights reserved
  5 + */
  6 +
  7 +require_once realpath(dirname(__FILE__) . '/Request.php');
  8 +
  9 +/**
  10 + *
  11 + *
  12 + * @author log service dev
  13 + */
  14 +class Aliyun_Log_Models_ListACLsRequest extends Aliyun_Log_Models_Request {
  15 +
  16 + private $offset;
  17 + private $size;
  18 + private $principleId;
  19 +
  20 + /**
  21 + * Aliyun_Log_Models_ListACLsRequest Constructor
  22 + *
  23 + */
  24 + public function __construct($principleId=null,$offset=null,$size=null) {
  25 + $this->offset = $offset;
  26 + $this->size = $size;
  27 + $this->principleId = $principleId;
  28 + }
  29 +
  30 + public function getOffset(){
  31 + return $this->offset;
  32 + }
  33 + public function setOffset($offset){
  34 + $this->offset = $offset;
  35 + }
  36 +
  37 + public function getSize(){
  38 + return $this->size;
  39 + }
  40 + public function setSize($size){
  41 + $this->size = $size;
  42 + }
  43 +
  44 + public function getPrincipleId(){
  45 + return $this->principleId;
  46 + }
  47 + public function setPrincipleId($principleId){
  48 + $this->principleId = $principleId;
  49 + }
  50 +
  51 +}
  1 +<?php
  2 +/**
  3 + * Copyright (C) Alibaba Cloud Computing
  4 + * All rights reserved
  5 + */
  6 +
  7 +require_once realpath(dirname(__FILE__) . '/Request.php');
  8 +
  9 +/**
  10 + *
  11 + *
  12 + * @author log service dev
  13 + */
  14 +class Aliyun_Log_Models_ListConfigsRequest extends Aliyun_Log_Models_Request {
  15 +
  16 + private $configName;
  17 + private $offset;
  18 + private $size;
  19 +
  20 + /**
  21 + * Aliyun_Log_Models_ListConfigsRequest Constructor
  22 + *
  23 + */
  24 + public function __construct($configName=null,$offset=null,$size=null) {
  25 + //parent::__construct ( $project );
  26 + $this->configName = $configName;
  27 + $this->offset = $offset;
  28 + $this->size = $size;
  29 + }
  30 +
  31 + public function getConfigName(){
  32 + return $this->configName;
  33 + }
  34 +
  35 + public function setConfigName($configName){
  36 + $this->configName = $configName;
  37 + }
  38 +
  39 + public function getOffset(){
  40 + return $this->offset;
  41 + }
  42 +
  43 + public function setOffset($offset){
  44 + $this->offset = $offset;
  45 + }
  46 +
  47 + public function getSize(){
  48 + return $this->size;
  49 + }
  50 +
  51 + public function setSize($size){
  52 + $this->size = $size;
  53 + }
  54 +}
  1 +<?php
  2 +/**
  3 + * Copyright (C) Alibaba Cloud Computing
  4 + * All rights reserved
  5 + */
  6 +
  7 +require_once realpath(dirname(__FILE__) . '/Request.php');
  8 +
  9 +/**
  10 + * The request used to list logstore from log service.
  11 + *
  12 + * @author log service dev
  13 + */
  14 +class Aliyun_Log_Models_ListLogstoresRequest extends Aliyun_Log_Models_Request{
  15 +
  16 + /**
  17 + * Aliyun_Log_Models_ListLogstoresRequest constructor
  18 + *
  19 + * @param string $project project name
  20 + */
  21 + public function __construct($project=null) {
  22 + parent::__construct($project);
  23 + }
  24 +}
  1 +<?php
  2 +/**
  3 + * Copyright (C) Alibaba Cloud Computing
  4 + * All rights reserved
  5 + */
  6 +
  7 +require_once realpath(dirname(__FILE__) . '/Request.php');
  8 +
  9 +/**
  10 + *
  11 + *
  12 + * @author log service dev
  13 + */
  14 +class Aliyun_Log_Models_ListMachineGroupsRequest extends Aliyun_Log_Models_Request {
  15 +
  16 + private $groupName;
  17 + private $offset;
  18 + private $size;
  19 +
  20 + /**
  21 + * Aliyun_Log_Models_ListMachineGroupsRequest Constructor
  22 + *
  23 + */
  24 + public function __construct($groupName=null,$offset=null,$size=null) {
  25 + $this->groupName = $groupName;
  26 + $this->offset = $offset;
  27 + $this->size = $size;
  28 + }
  29 +
  30 + public function getGroupName(){
  31 + return $this->groupName;
  32 + }
  33 +
  34 + public function setGroupName($groupName){
  35 + $this->groupName = $groupName;
  36 + }
  37 +
  38 + public function getOffset(){
  39 + return $this->offset;
  40 + }
  41 +
  42 + public function setOffset($offset){
  43 + $this->offset = $offset;
  44 + }
  45 +
  46 + public function getSize(){
  47 + return $this->size;
  48 + }
  49 +
  50 + public function setSize($size){
  51 + $this->size = $size;
  52 + }
  53 +}
  1 +<?php
  2 +/**
  3 + * Copyright (C) Alibaba Cloud Computing
  4 + * All rights reserved
  5 + */
  6 +
  7 +require_once realpath(dirname(__FILE__) . '/Request.php');
  8 +
  9 +/**
  10 + *
  11 + *
  12 + * @author log service dev
  13 + */
  14 +class Aliyun_Log_Models_ListShardsRequest extends Aliyun_Log_Models_Request {
  15 +
  16 + private $logstore;
  17 +
  18 + /**
  19 + * Aliyun_Log_Models_ListShardsRequest Constructor
  20 + *
  21 + */
  22 + public function __construct($project,$logstore) {
  23 + parent::__construct ( $project );
  24 + $this->logstore = $logstore;
  25 + }
  26 +
  27 + public function getLogstore(){
  28 + return $this->logstore;
  29 + }
  30 +
  31 + public function setLogstore($logstore){
  32 + $this->logstore = $logstore;
  33 + }
  34 +
  35 +
  36 +}
  1 +<?php
  2 +/**
  3 + * Copyright (C) Alibaba Cloud Computing
  4 + * All rights reserved
  5 + */
  6 +
  7 +require_once realpath(dirname(__FILE__) . '/Request.php');
  8 +
  9 +class Aliyun_Log_Models_ListShipperRequest extends Aliyun_Log_Models_Request{
  10 + private $logStore;
  11 +
  12 + /**
  13 + * Aliyun_Log_Models_CreateShipperRequest Constructor
  14 + *
  15 + */
  16 + public function __construct($project) {
  17 + parent::__construct ( $project );
  18 + }
  19 +
  20 + /**
  21 + * @return mixed
  22 + */
  23 + public function getLogStore()
  24 + {
  25 + return $this->logStore;
  26 + }
  27 +
  28 + /**
  29 + * @param mixed $logStore
  30 + */
  31 + public function setLogStore($logStore)
  32 + {
  33 + $this->logStore = $logStore;
  34 + }
  35 +
  36 +
  37 +}
  1 +<?php
  2 +/**
  3 + * Copyright (C) Alibaba Cloud Computing
  4 + * All rights reserved
  5 + */
  6 +
  7 +require_once realpath(dirname(__FILE__) . '/Request.php');
  8 +
  9 +/**
  10 + * The Request used to list topics from log service.
  11 + *
  12 + * @author log service dev
  13 + */
  14 +class Aliyun_Log_Models_ListTopicsRequest extends Aliyun_Log_Models_Request {
  15 +
  16 + /**
  17 + * @var string $logstore logstore name
  18 + */
  19 + private $logstore;
  20 +
  21 + /**
  22 + * @var string $token the start token to list topics
  23 + */
  24 + private $token;
  25 +
  26 + /**
  27 + * @var integer $line max topic counts to return
  28 + */
  29 + private $line;
  30 +
  31 + /**
  32 + * Aliyun_Log_Models_ListTopicsRequest constructor
  33 + *
  34 + * @param string $project project name
  35 + * @param string $logstore logstore name
  36 + * @param string $token the start token to list topics
  37 + * @param integer $line max topic counts to return
  38 + */
  39 + public function __construct($project=null, $logstore=null, $token=null, $line=null) {
  40 + parent::__construct($project);
  41 + $this->logstore = $logstore;
  42 + $this->token = $token;
  43 + $this->line = $line;
  44 + }
  45 +
  46 + /**
  47 + * Get logstroe name
  48 + *
  49 + * @return string logstore name
  50 + */
  51 + public function getLogstore() {
  52 + return $this->logstore;
  53 + }
  54 +
  55 + /**
  56 + * Set logstore name
  57 + *
  58 + * @param string $logstore
  59 + * logstore name
  60 + */
  61 + public function setLogstore($logstore) {
  62 + $this->logstore = $logstore;
  63 + }
  64 +
  65 +
  66 + /**
  67 + * Get start token to list topics
  68 + *
  69 + * @return string start token to list topics
  70 + */
  71 + public function getToken() {
  72 + return $this->token;
  73 + }
  74 +
  75 + /**
  76 + * Set start token to list topics
  77 + *
  78 + * @param string $token start token to list topics
  79 + */
  80 + public function setToken($token) {
  81 + $this->token = $token;
  82 + }
  83 +
  84 +
  85 + /**
  86 + * Get max topic counts to return
  87 + *
  88 + * @return integer max topic counts to return
  89 + */
  90 + public function getLine() {
  91 + return $this->line;
  92 + }
  93 +
  94 + /**
  95 + * Set max topic counts to return
  96 + *
  97 + * @param integer $line max topic counts to return
  98 + */
  99 + public function setLine($line) {
  100 + $this->line = $line;
  101 + }
  102 +}
  1 +<?php
  2 +/**
  3 + * Copyright (C) Alibaba Cloud Computing
  4 + * All rights reserved
  5 + */
  6 +
  7 +require_once realpath(dirname(__FILE__) . '/Request.php');
  8 +
  9 +/**
  10 + *
  11 + *
  12 + * @author log service dev
  13 + */
  14 +class Aliyun_Log_Models_MergeShardsRequest extends Aliyun_Log_Models_Request {
  15 +
  16 + private $logstore;
  17 +
  18 + /**
  19 + * Aliyun_Log_Models_MergeShardsRequest Constructor
  20 + *
  21 + */
  22 + public function __construct($project,$logstore,$shardId) {
  23 + parent::__construct ( $project );
  24 + $this->logstore = $logstore;
  25 + $this->shardId = $shardId;
  26 + }
  27 +
  28 + public function getLogstore(){
  29 + return $this->logstore;
  30 + }
  31 +
  32 + public function setLogstore($logstore){
  33 + $this->logstore = $logstore;
  34 + }
  35 +
  36 + public function getShardId(){
  37 + return $this->shardId;
  38 + }
  39 +}
  1 +<?php
  2 +
  3 +/**
  4 + * Copyright (C) Alibaba Cloud Computing
  5 + * All rights reserved
  6 + */
  7 +
  8 +require_once realpath(dirname(__FILE__) . '/Request.php');
  9 +
  10 +/**
  11 + * The request used to send data to log server.
  12 + *
  13 + * @author log service dev
  14 + */
  15 +class Aliyun_Log_Models_PutLogsRequest extends Aliyun_Log_Models_Request {
  16 +
  17 + /**
  18 + * @var string logstore name
  19 + */
  20 + private $logstore;
  21 +
  22 + /**
  23 + * @var string topic name
  24 + */
  25 + private $topic;
  26 +
  27 + /**
  28 + * @var string source of the logs
  29 + */
  30 + private $source;
  31 +
  32 + /**
  33 + * @var array LogItem array, log data
  34 + */
  35 + private $logitems;
  36 +
  37 + /**
  38 + * @var string shardKey putlogs shard hash key
  39 + */
  40 + private $shardKey;
  41 +
  42 + /**
  43 + * Aliyun_Log_Models_PutLogsRequest cnstructor
  44 + *
  45 + * @param string $project
  46 + * project name
  47 + * @param string $logstore
  48 + * logstore name
  49 + * @param string $topic
  50 + * topic name
  51 + * @param string $source
  52 + * source of the log
  53 + * @param array $logitems
  54 + * LogItem array,log data
  55 + */
  56 + public function __construct($project = null, $logstore = null, $topic = null, $source = null, $logitems = null,$shardKey=null) {
  57 + parent::__construct ( $project );
  58 + $this->logstore = $logstore;
  59 + $this->topic = $topic;
  60 + $this->source = $source;
  61 + $this->logitems = $logitems;
  62 + $this->shardKey = $shardKey;
  63 + }
  64 +
  65 + /**
  66 + * Get logstroe name
  67 + *
  68 + * @return string logstore name
  69 + */
  70 + public function getLogstore() {
  71 + return $this->logstore;
  72 + }
  73 +
  74 + /**
  75 + * Set logstore name
  76 + *
  77 + * @param string $logstore
  78 + * logstore name
  79 + */
  80 + public function setLogstore($logstore) {
  81 + $this->logstore = $logstore;
  82 + }
  83 +
  84 + /**
  85 + * Get topic name
  86 + *
  87 + * @return string topic name
  88 + */
  89 + public function getTopic() {
  90 + return $this->topic;
  91 + }
  92 +
  93 + /**
  94 + * Set topic name
  95 + *
  96 + * @param string $topic
  97 + * topic name
  98 + */
  99 + public function setTopic($topic) {
  100 + $this->topic = $topic;
  101 + }
  102 +
  103 + /**
  104 + * Get all the log data
  105 + *
  106 + * @return array LogItem array, log data
  107 + */
  108 + public function getLogItems() {
  109 + return $this->logitems;
  110 + }
  111 +
  112 + /**
  113 + * Set the log data
  114 + *
  115 + * @param array $logitems
  116 + * LogItem array, log data
  117 + */
  118 + public function setLogItems($logitems) {
  119 + $this->logitems = $logitems;
  120 + }
  121 +
  122 + /**
  123 + * Get log source
  124 + *
  125 + * @return string log source
  126 + */
  127 + public function getSource() {
  128 + return $this->source;
  129 + }
  130 +
  131 + /**
  132 + * set log source
  133 + *
  134 + * @param string $source
  135 + * log source
  136 + */
  137 + public function setSource($source) {
  138 + $this->source = $source;
  139 + }
  140 + /**
  141 + * set shard key
  142 + *
  143 + * @param string shardkey
  144 + */
  145 + public function setShardKey($key){
  146 + $this -> shardKey=$key;
  147 + }
  148 + /**
  149 + * get shard key
  150 + *
  151 + * @return string shardKey
  152 + */
  153 + public function getShardKey(){
  154 + return $this ->shardKey;
  155 + }
  156 +}