Config.php 6.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199
  1. <?php
  2. /**
  3. * Copyright (C) Alibaba Cloud Computing
  4. * All rights reserved
  5. */
  6. class Aliyun_Log_Models_Config_InputDetail {
  7. public $filePattern;
  8. public $key;
  9. public $localStorage;
  10. public $logBeginRegex;
  11. public $logPath;
  12. public $logType;
  13. public $regex;
  14. public $timeFormat;
  15. public $filterRegex;
  16. public $filterKey;
  17. public $topicFormat;
  18. public function __construct($filePattern='',$key=array(),$localStorage=true,
  19. $logBeginRegex='',$logPath='',$logType='',$regex='',
  20. $timeFormat='',$filterRegex=array(),$filterKey=array(),$topicFormat='none'){
  21. $this->filePattern=$filePattern;
  22. $this->key=$key;
  23. $this->localStorage=$localStorage;
  24. $this->logBeginRegex=$logBeginRegex;
  25. $this->logPath=$logPath;
  26. $this->logType=$logType;
  27. $this->regex=$regex;
  28. $this->timeFormat=$timeFormat;
  29. $this->filterRegex=$filterRegex;
  30. $this->filterKey=$filterKey;
  31. $this->topicFormat=$topicFormat;
  32. }
  33. public function toArray(){
  34. $resArray = array();
  35. if($this->filePattern!==null)
  36. $resArray['filePattern'] = $this->filePattern;
  37. if($this->key!==null)
  38. $resArray['key'] = $this->key;
  39. if($this->localStorage!==null)
  40. $resArray['localStorage'] = $this->localStorage;
  41. if($this->logBeginRegex!==null)
  42. $resArray['logBeginRegex'] = $this->logBeginRegex;
  43. if($this->logPath!==null)
  44. $resArray['logPath'] = $this->logPath;
  45. if($this->logType!==null)
  46. $resArray['logType'] = $this->logType;
  47. if($this->regex!==null)
  48. $resArray['regex'] = $this->regex;
  49. if($this->timeFormat!==null)
  50. $resArray['timeFormat'] = $this->timeFormat;
  51. if($this->filterRegex!==null)
  52. $resArray['filterRegex'] = $this->filterRegex;
  53. if($this->filterKey!==null)
  54. $resArray['filterKey'] = $this->filterKey;
  55. if($this->topicFormat!==null)
  56. $resArray['topicFormat'] = $this->topicFormat;
  57. return $resArray;
  58. }
  59. }
  60. class Aliyun_Log_Models_Config_OutputDetail {
  61. public $projectName;
  62. public $logstoreName;
  63. public function __construct($projectName='',$logstoreName=''){
  64. $this->projectName = $projectName;
  65. $this->logstoreName = $logstoreName;
  66. }
  67. public function toArray(){
  68. $resArray = array();
  69. if($this->projectName!==null)
  70. $resArray['projectName'] = $this->projectName;
  71. if($this->logstoreName!==null)
  72. $resArray['logstoreName'] = $this->logstoreName;
  73. return $resArray;
  74. }
  75. }
  76. class Aliyun_Log_Models_Config {
  77. private $configName;
  78. private $inputType;
  79. private $inputDetail;
  80. private $outputType;
  81. private $outputDetail;
  82. private $createTime;
  83. private $lastModifyTime;
  84. public function __construct($configName='',$inputType='',$inputDetail=null,
  85. $outputType='',$outputDetail=null,$createTime=null,$lastModifyTime=null) {
  86. $this->configName = $configName;
  87. $this->inputType = $inputType;
  88. $this->inputDetail = $inputDetail;
  89. $this->outputType = $outputType;
  90. $this->outputDetail = $outputDetail;
  91. $this->createTime = $createTime;
  92. $this->lastModifyTime = $lastModifyTime;
  93. }
  94. public function getConfigName(){
  95. return $this->configName;
  96. }
  97. public function setConfigName($configName){
  98. $this->configName = $configName;
  99. }
  100. public function getInputType(){
  101. return $this->inputType;
  102. }
  103. public function setInputType($inputType){
  104. $this->inputType = $inputType;
  105. }
  106. public function getInputDetail(){
  107. return $this->inputDetail;
  108. }
  109. public function setInputDetail($inputDetail){
  110. $this->inputDetail = $inputDetail;
  111. }
  112. public function getOutputType(){
  113. return $this->outputType;
  114. }
  115. public function setOutputType($outputType){
  116. $this->outputType = $outputType;
  117. }
  118. public function getOutputDetail(){
  119. return $this->outputDetail;
  120. }
  121. public function setOutputDetail($outputDetail){
  122. $this->outputDetail = $outputDetail;
  123. }
  124. public function getCreateTime(){
  125. return $this->createTime;
  126. }
  127. public function setCreateTime($createTime){
  128. $this->createTime = $createTime;
  129. }
  130. public function getLastModifyTime(){
  131. return $this->lastModifyTime;
  132. }
  133. public function setLastModifyTime($lastModifyTime){
  134. $this->lastModifyTime = $lastModifyTime;
  135. }
  136. public function toArray(){
  137. $format_array = array();
  138. if($this->configName!==null)
  139. $format_array['configName'] = $this->configName;
  140. if($this->inputType!==null)
  141. $format_array['inputType'] = $this->inputType;
  142. if($this->inputDetail!==null)
  143. $format_array['inputDetail'] = $this->inputDetail->toArray();
  144. if($this->outputType!==null)
  145. $format_array['outputType'] = $this->outputType;
  146. if($this->outputDetail!==null)
  147. $format_array['outputDetail'] = $this->outputDetail->toArray();
  148. if($this->createTime!==null)
  149. $format_array['createTime'] = $this->createTime;
  150. if($this->lastModifyTime!==null)
  151. $format_array['lastModifyTime'] = $this->lastModifyTime;
  152. return $format_array;
  153. }
  154. public function setFromArray($resp){
  155. $inputDetail = new Aliyun_Log_Models_Config_InputDetail();
  156. $inputDetail->filePattern = $resp['inputDetail']['filePattern'];
  157. $inputDetail->key = $resp['inputDetail']['key'];
  158. $inputDetail->localStorage = $resp['inputDetail']['localStorage'];
  159. $inputDetail->logBeginRegex = $resp['inputDetail']['logBeginRegex'];
  160. $inputDetail->logPath = $resp['inputDetail']['logPath'];
  161. $inputDetail->logType = $resp['inputDetail']['logType'];
  162. $inputDetail->regex = $resp['inputDetail']['regex'];
  163. $inputDetail->timeFormat = $resp['inputDetail']['timeFormat'];
  164. $inputDetail->filterRegex = $resp['inputDetail']['filterRegex'];
  165. $inputDetail->filterKey = $resp['inputDetail']['filterKey'];
  166. $inputDetail->topicFormat = $resp['inputDetail']['topicFormat'];
  167. $outputDetail = new Aliyun_Log_Models_Config_OutputDetail();
  168. $outputDetail->projectName = $resp['outputDetail']['projectName'];
  169. $outputDetail->logstoreName = $resp['outputDetail']['logstoreName'];
  170. $configName=$resp['configName'];
  171. $inputType=$resp['inputType'];
  172. $outputType=$resp['outputType'];
  173. $this->setConfigName($configName);
  174. $this->setInputType($inputType);
  175. $this->setInputDetail($inputDetail);
  176. $this->setOutputType($outputType);
  177. $this->setOutputDetail($outputDetail);
  178. }
  179. }