/* * Copyright (C) Alibaba Cloud Computing * All rights reserved. * * 版权所有 (C)阿里云计算有限公司 */ using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace Aliyun.Api.LOG.Request { /// /// The Request used to get data of a query from sls server /// public class GetLogsRequest : LogRequest { private String _logstore; private String _topic; private uint? _from; private uint? _to; private String _query; private int? _lines; private long? _offset; private bool? _reverse; /// /// default constructor. /// please set required fileds(project, logstore, from, to) initialized by this default constructor before /// using it to send request. Otherwise, request will be failed with exception. /// public GetLogsRequest() { } /// /// constructor with all required fileds /// /// project name /// logstore name /// begin timestamp of time range to query /// end timestamp of time range to query public GetLogsRequest(String project, String logstore, uint from, uint to) :base(project) { _logstore = logstore; _from = from; _to = to; } /// /// constructor with all possible fileds /// /// project name /// logstore name /// begin timestamp of time range to query /// end timestamp of time range to query /// log topic to query /// query string to run /// count of logs to request /// offset of logs to request /// flag indicates whether logs in response are in reversed order public GetLogsRequest(String project, String logstore, uint from, uint to, String topic, String query, int lines, int offset, bool reverse) :base(project) { _logstore = logstore; _from = from; _to = to; _topic = topic; _query = query; _lines = lines; _offset = offset; _reverse = reverse; } /// /// The logstore name /// public String Logstore { get { return _logstore; } set { _logstore = value; } } internal bool IsSetLogstore() { return _logstore != null; } /// /// The log topic to query /// public String Topic { get { return _topic; } set { _topic = value; } } internal bool IsSetTopic() { return _topic != null; } /// /// The begin timestamp of time range to query /// public uint From { get { return _from ?? default(uint); } set { _from = value; } } internal bool IsSetFrom() { return _from.HasValue; } /// /// The end timestamp of time range to query /// public uint To { get { return _to ?? default(uint); } set { _to = value; } } internal bool IsSetTo() { return _to.HasValue; } /// /// The query string to run /// public String Query { get { return _query; } set { _query = value; } } internal bool IsSetQuery() { return _query != null; } /// /// The count of logs to request /// public int Lines { get { return _lines ?? default(int); } set { _lines = value; } } internal bool IsSetLines() { return _lines.HasValue; } /// /// The offset of logs to request /// public long Offset { get { return _offset ?? default(long); } set { _offset = value; } } internal bool IsSetOffset() { return _offset.HasValue; } /// /// flag of logs' order int response. /// If reverse is true, the query will return the latest logs. /// public bool Reverse { get { return _reverse ?? false; } set { _reverse = value; } } internal bool IsSetReverse() { return _reverse.HasValue; } } }