PutLogsRequest.php 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157
  1. <?php
  2. /**
  3. * Copyright (C) Alibaba Cloud Computing
  4. * All rights reserved
  5. */
  6. require_once realpath(dirname(__FILE__) . '/Request.php');
  7. /**
  8. * The request used to send data to log server.
  9. *
  10. * @author log service dev
  11. */
  12. class Aliyun_Log_Models_PutLogsRequest extends Aliyun_Log_Models_Request {
  13. /**
  14. * @var string logstore name
  15. */
  16. private $logstore;
  17. /**
  18. * @var string topic name
  19. */
  20. private $topic;
  21. /**
  22. * @var string source of the logs
  23. */
  24. private $source;
  25. /**
  26. * @var array LogItem array, log data
  27. */
  28. private $logitems;
  29. /**
  30. * @var string shardKey putlogs shard hash key
  31. */
  32. private $shardKey;
  33. /**
  34. * Aliyun_Log_Models_PutLogsRequest cnstructor
  35. *
  36. * @param string $project
  37. * project name
  38. * @param string $logstore
  39. * logstore name
  40. * @param string $topic
  41. * topic name
  42. * @param string $source
  43. * source of the log
  44. * @param array $logitems
  45. * LogItem array,log data
  46. */
  47. public function __construct($project = null, $logstore = null, $topic = null, $source = null, $logitems = null,$shardKey=null) {
  48. parent::__construct ( $project );
  49. $this->logstore = $logstore;
  50. $this->topic = $topic;
  51. $this->source = $source;
  52. $this->logitems = $logitems;
  53. $this->shardKey = $shardKey;
  54. }
  55. /**
  56. * Get logstroe name
  57. *
  58. * @return string logstore name
  59. */
  60. public function getLogstore() {
  61. return $this->logstore;
  62. }
  63. /**
  64. * Set logstore name
  65. *
  66. * @param string $logstore
  67. * logstore name
  68. */
  69. public function setLogstore($logstore) {
  70. $this->logstore = $logstore;
  71. }
  72. /**
  73. * Get topic name
  74. *
  75. * @return string topic name
  76. */
  77. public function getTopic() {
  78. return $this->topic;
  79. }
  80. /**
  81. * Set topic name
  82. *
  83. * @param string $topic
  84. * topic name
  85. */
  86. public function setTopic($topic) {
  87. $this->topic = $topic;
  88. }
  89. /**
  90. * Get all the log data
  91. *
  92. * @return array LogItem array, log data
  93. */
  94. public function getLogItems() {
  95. return $this->logitems;
  96. }
  97. /**
  98. * Set the log data
  99. *
  100. * @param array $logitems
  101. * LogItem array, log data
  102. */
  103. public function setLogItems($logitems) {
  104. $this->logitems = $logitems;
  105. }
  106. /**
  107. * Get log source
  108. *
  109. * @return string log source
  110. */
  111. public function getSource() {
  112. return $this->source;
  113. }
  114. /**
  115. * set log source
  116. *
  117. * @param string $source
  118. * log source
  119. */
  120. public function setSource($source) {
  121. $this->source = $source;
  122. }
  123. /**
  124. * set shard key
  125. *
  126. * @param string shardkey
  127. */
  128. public function setShardKey($key){
  129. $this -> shardKey=$key;
  130. }
  131. /**
  132. * get shard key
  133. *
  134. * @return string shardKey
  135. */
  136. public function getShardKey(){
  137. return $this ->shardKey;
  138. }
  139. }