初始化
This commit is contained in:
66
Aliyun.Api.LogService/Domain/Log/GetLogHistogramsRequest.cs
Normal file
66
Aliyun.Api.LogService/Domain/Log/GetLogHistogramsRequest.cs
Normal file
@@ -0,0 +1,66 @@
|
||||
//
|
||||
// GetLogHistogramsRequest.cs
|
||||
//
|
||||
// Author:
|
||||
// MiNG <developer@ming.gz.cn>
|
||||
//
|
||||
// Copyright (c) 2018 Alibaba Cloud
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
// of this software and associated documentation files (the "Software"), to deal
|
||||
// in the Software without restriction, including without limitation the rights
|
||||
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
// copies of the Software, and to permit persons to whom the Software is
|
||||
// furnished to do so, subject to the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be included in
|
||||
// all copies or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
// THE SOFTWARE.
|
||||
|
||||
using System;
|
||||
using Aliyun.Api.LogService.Domain.Project;
|
||||
|
||||
namespace Aliyun.Api.LogService.Domain.Log
|
||||
{
|
||||
public class GetLogHistogramsRequest : ProjectScopedRequest
|
||||
{
|
||||
/// <summary>
|
||||
/// 需要查询日志的 Logstore 名称。
|
||||
/// </summary>
|
||||
public String Logstorename { get; }
|
||||
|
||||
/// <summary>
|
||||
/// 查询开始时间点(精度为秒,从 1970-1-1 00:00:00 UTC 计算起的秒数)。
|
||||
/// </summary>
|
||||
public Int32 From { get; }
|
||||
|
||||
/// <summary>
|
||||
/// 查询结束时间点(精度为秒,从 1970-1-1 00:00:00 UTC 计算起的秒数)。
|
||||
/// </summary>
|
||||
public Int32 To { get; }
|
||||
|
||||
/// <summary>
|
||||
/// 查询日志主题。
|
||||
/// </summary>
|
||||
public String Topic { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 查询表达式。关于查询表达式的详细语法,请参考 查询语法。
|
||||
/// </summary>
|
||||
public String Query { get; set; }
|
||||
|
||||
public GetLogHistogramsRequest(String logstorename, Int32 from, Int32 to)
|
||||
{
|
||||
this.Logstorename = logstorename;
|
||||
this.From = from;
|
||||
this.To = to;
|
||||
}
|
||||
}
|
||||
}
|
||||
54
Aliyun.Api.LogService/Domain/Log/GetLogHistogramsResult.cs
Normal file
54
Aliyun.Api.LogService/Domain/Log/GetLogHistogramsResult.cs
Normal file
@@ -0,0 +1,54 @@
|
||||
//
|
||||
// GetLogHistogramsResult.cs
|
||||
//
|
||||
// Author:
|
||||
// MiNG <developer@ming.gz.cn>
|
||||
//
|
||||
// Copyright (c) 2018 Alibaba Cloud
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
// of this software and associated documentation files (the "Software"), to deal
|
||||
// in the Software without restriction, including without limitation the rights
|
||||
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
// copies of the Software, and to permit persons to whom the Software is
|
||||
// furnished to do so, subject to the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be included in
|
||||
// all copies or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
// THE SOFTWARE.
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Aliyun.Api.LogService.Domain.Log
|
||||
{
|
||||
public class GetLogHistogramsResult
|
||||
{
|
||||
/// <summary>
|
||||
/// 查询结果的状态。可以有 Incomplete 和 Complete 两个选值,表示结果是否完整。
|
||||
/// </summary>
|
||||
public LogProgressState Progress { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 当前查询结果中所有日志总数。
|
||||
/// </summary>
|
||||
public Int32 Count { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 当前查询结果在划分的子时间区间上的分布状况,具体结构见下面的描述。
|
||||
/// </summary>
|
||||
public IList<LogHistogramInfo> Histograms { get; }
|
||||
|
||||
public GetLogHistogramsResult(IList<LogHistogramInfo> histograms)
|
||||
{
|
||||
this.Histograms = histograms;
|
||||
}
|
||||
}
|
||||
}
|
||||
85
Aliyun.Api.LogService/Domain/Log/GetLogsRequest.cs
Normal file
85
Aliyun.Api.LogService/Domain/Log/GetLogsRequest.cs
Normal file
@@ -0,0 +1,85 @@
|
||||
//
|
||||
// GetLogsRequest.cs
|
||||
//
|
||||
// Author:
|
||||
// MiNG <developer@ming.gz.cn>
|
||||
//
|
||||
// Copyright (c) 2018 Alibaba Cloud
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
// of this software and associated documentation files (the "Software"), to deal
|
||||
// in the Software without restriction, including without limitation the rights
|
||||
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
// copies of the Software, and to permit persons to whom the Software is
|
||||
// furnished to do so, subject to the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be included in
|
||||
// all copies or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
// THE SOFTWARE.
|
||||
|
||||
using System;
|
||||
using Aliyun.Api.LogService.Domain.Project;
|
||||
|
||||
namespace Aliyun.Api.LogService.Domain.Log
|
||||
{
|
||||
public class GetLogsRequest : ProjectScopedRequest
|
||||
{
|
||||
public const Int32 DefaultLine = 100;
|
||||
public const Int32 DefaultOffset = 0;
|
||||
public const Boolean DefaultReverse = false;
|
||||
|
||||
/// <summary>
|
||||
/// 需要查询日志的 Logstore 名称。
|
||||
/// </summary>
|
||||
public String Logstorename { get; }
|
||||
|
||||
/// <summary>
|
||||
/// 查询开始时间点(精度为秒,从 1970-1-1 00:00:00 UTC 计算起的秒数)。
|
||||
/// </summary>
|
||||
public Int32 From { get; }
|
||||
|
||||
/// <summary>
|
||||
/// 查询结束时间点(精度为秒,从 1970-1-1 00:00:00 UTC 计算起的秒数)。
|
||||
/// </summary>
|
||||
public Int32 To { get; }
|
||||
|
||||
/// <summary>
|
||||
/// 查询日志主题。
|
||||
/// </summary>
|
||||
public String Topic { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 查询表达式。关于查询表达式的详细语法,请参考 查询语法。
|
||||
/// </summary>
|
||||
public String Query { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 请求返回的最大日志条数。取值范围为 0~100,默认值为 100。
|
||||
/// </summary>
|
||||
public Int32 Line { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 请求返回日志的起始点。取值范围为 0 或正整数,默认值为 0。
|
||||
/// </summary>
|
||||
public Int32 Offset { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 是否按日志时间戳逆序返回日志。true 表示逆序,false 表示顺序,默认值为 false。
|
||||
/// </summary>
|
||||
public Boolean Reverse { get; set; }
|
||||
|
||||
public GetLogsRequest(String logstorename, Int32 from, Int32 to)
|
||||
{
|
||||
this.Logstorename = logstorename;
|
||||
this.From = from;
|
||||
this.To = to;
|
||||
}
|
||||
}
|
||||
}
|
||||
84
Aliyun.Api.LogService/Domain/Log/GetLogsResult.cs
Normal file
84
Aliyun.Api.LogService/Domain/Log/GetLogsResult.cs
Normal file
@@ -0,0 +1,84 @@
|
||||
//
|
||||
// GetLogsResult.cs
|
||||
//
|
||||
// Author:
|
||||
// MiNG <developer@ming.gz.cn>
|
||||
//
|
||||
// Copyright (c) 2018 Alibaba Cloud
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
// of this software and associated documentation files (the "Software"), to deal
|
||||
// in the Software without restriction, including without limitation the rights
|
||||
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
// copies of the Software, and to permit persons to whom the Software is
|
||||
// furnished to do so, subject to the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be included in
|
||||
// all copies or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
// THE SOFTWARE.
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Aliyun.Api.LogService.Domain.Log
|
||||
{
|
||||
public class GetLogsResult
|
||||
{
|
||||
/// <summary>
|
||||
/// 查询结果的状态。可以有 Incomplete 和 Complete 两个选值,表示本次是否完整。
|
||||
/// </summary>
|
||||
public LogProgressState Progress { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 当前查询结果返回的日志总数(非总数)。
|
||||
/// </summary>
|
||||
public Int32 Count { get; set; }
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public Int32 ProcessedRows { get; set; }
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public Int32 ElapsedMillisecond { get; set; }
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public Boolean HasSql { get; set; }
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public String AggQuery { get; set; }
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public String WhereQuery { get; set; }
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public LogQueryInfo QueryInfo { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 日志内容。
|
||||
/// </summary>
|
||||
public IList<IDictionary<String, String>> Logs { get; }
|
||||
|
||||
public GetLogsResult(IList<IDictionary<String, String>> logs)
|
||||
{
|
||||
this.Logs = logs;
|
||||
}
|
||||
}
|
||||
}
|
||||
44
Aliyun.Api.LogService/Domain/Log/GetProjectLogsRequest.cs
Normal file
44
Aliyun.Api.LogService/Domain/Log/GetProjectLogsRequest.cs
Normal file
@@ -0,0 +1,44 @@
|
||||
//
|
||||
// GetProjectLogsRequest.cs
|
||||
//
|
||||
// Author:
|
||||
// MiNG <developer@ming.gz.cn>
|
||||
//
|
||||
// Copyright (c) 2018 Alibaba Cloud
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
// of this software and associated documentation files (the "Software"), to deal
|
||||
// in the Software without restriction, including without limitation the rights
|
||||
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
// copies of the Software, and to permit persons to whom the Software is
|
||||
// furnished to do so, subject to the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be included in
|
||||
// all copies or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
// THE SOFTWARE.
|
||||
|
||||
using System;
|
||||
using Aliyun.Api.LogService.Domain.Project;
|
||||
|
||||
namespace Aliyun.Api.LogService.Domain.Log
|
||||
{
|
||||
public class GetProjectLogsRequest : ProjectScopedRequest
|
||||
{
|
||||
/// <summary>
|
||||
/// 查询sql条件。
|
||||
/// </summary>
|
||||
public String Query { get; }
|
||||
|
||||
public GetProjectLogsRequest(String query)
|
||||
{
|
||||
this.Query = query;
|
||||
}
|
||||
}
|
||||
}
|
||||
48
Aliyun.Api.LogService/Domain/Log/LogGroupInfo.cs
Normal file
48
Aliyun.Api.LogService/Domain/Log/LogGroupInfo.cs
Normal file
@@ -0,0 +1,48 @@
|
||||
//
|
||||
// LogGroupInfo.cs
|
||||
//
|
||||
// Author:
|
||||
// MiNG <developer@ming.gz.cn>
|
||||
//
|
||||
// Copyright (c) 2018 Alibaba Cloud
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
// of this software and associated documentation files (the "Software"), to deal
|
||||
// in the Software without restriction, including without limitation the rights
|
||||
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
// copies of the Software, and to permit persons to whom the Software is
|
||||
// furnished to do so, subject to the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be included in
|
||||
// all copies or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
// THE SOFTWARE.
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Aliyun.Api.LogService.Domain.Log
|
||||
{
|
||||
public class LogGroupInfo
|
||||
{
|
||||
public String Topic { get; set; }
|
||||
|
||||
public String Source { get; set; }
|
||||
|
||||
public IDictionary<String, String> LogTags { get; set; }
|
||||
|
||||
public IList<LogInfo> Logs { get; set; }
|
||||
|
||||
public LogGroupInfo()
|
||||
{
|
||||
this.LogTags = new Dictionary<String, String>();
|
||||
this.Logs = new List<LogInfo>();
|
||||
}
|
||||
}
|
||||
}
|
||||
61
Aliyun.Api.LogService/Domain/Log/LogHistogramInfo.cs
Normal file
61
Aliyun.Api.LogService/Domain/Log/LogHistogramInfo.cs
Normal file
@@ -0,0 +1,61 @@
|
||||
//
|
||||
// LogHistogramInfo.cs
|
||||
//
|
||||
// Author:
|
||||
// MiNG <developer@ming.gz.cn>
|
||||
//
|
||||
// Copyright (c) 2018 Alibaba Cloud
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
// of this software and associated documentation files (the "Software"), to deal
|
||||
// in the Software without restriction, including without limitation the rights
|
||||
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
// copies of the Software, and to permit persons to whom the Software is
|
||||
// furnished to do so, subject to the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be included in
|
||||
// all copies or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
// THE SOFTWARE.
|
||||
|
||||
using System;
|
||||
|
||||
namespace Aliyun.Api.LogService.Domain.Log
|
||||
{
|
||||
public class LogHistogramInfo
|
||||
{
|
||||
/// <summary>
|
||||
/// 子时间区间的开始时间点(精度为秒,从 1970-1-1 00:00:00 UTC 计算起的秒数)。
|
||||
/// </summary>
|
||||
public Int32 From { get; }
|
||||
|
||||
/// <summary>
|
||||
/// 子时间区间的结束时间点(精度为秒,从 1970-1-1 00:00:00 UTC 计算起的秒数)。
|
||||
/// </summary>
|
||||
public Int32 To { get; }
|
||||
|
||||
/// <summary>
|
||||
/// 当前查询结果在该子时间区间内命中的日志条数。
|
||||
/// </summary>
|
||||
public Int32 Count { get; }
|
||||
|
||||
/// <summary>
|
||||
/// 当前查询结果在该子时间区间内的结果是否完整,可以有 Incomplete 和 Complete 两个选值。
|
||||
/// </summary>
|
||||
public LogProgressState Progress { get; }
|
||||
|
||||
public LogHistogramInfo(Int32 from, Int32 to, Int32 count, LogProgressState progress)
|
||||
{
|
||||
this.From = from;
|
||||
this.To = to;
|
||||
this.Count = count;
|
||||
this.Progress = progress;
|
||||
}
|
||||
}
|
||||
}
|
||||
64
Aliyun.Api.LogService/Domain/Log/LogInfo.cs
Normal file
64
Aliyun.Api.LogService/Domain/Log/LogInfo.cs
Normal file
@@ -0,0 +1,64 @@
|
||||
//
|
||||
// LogInfo.cs
|
||||
//
|
||||
// Author:
|
||||
// MiNG <developer@ming.gz.cn>
|
||||
//
|
||||
// Copyright (c) 2018 Alibaba Cloud
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
// of this software and associated documentation files (the "Software"), to deal
|
||||
// in the Software without restriction, including without limitation the rights
|
||||
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
// copies of the Software, and to permit persons to whom the Software is
|
||||
// furnished to do so, subject to the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be included in
|
||||
// all copies or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
// THE SOFTWARE.
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using Aliyun.Api.LogService.Utils;
|
||||
|
||||
namespace Aliyun.Api.LogService.Domain.Log
|
||||
{
|
||||
public class LogInfo
|
||||
{
|
||||
public static IEnumerable<String> InvalidContentKeys { get; } = new HashSet<String>
|
||||
{
|
||||
"__time__",
|
||||
"__source__",
|
||||
"__topic__",
|
||||
"__partition_time__",
|
||||
"_extract_others_",
|
||||
"__extract_others__"
|
||||
};
|
||||
|
||||
public DateTimeOffset Time { get; set; } = DateTime.Now;
|
||||
|
||||
public IDictionary<String, String> Contents { get; set; }
|
||||
|
||||
public LogInfo()
|
||||
{
|
||||
this.Contents = new Dictionary<String, String>();
|
||||
}
|
||||
|
||||
public void Validate()
|
||||
{
|
||||
var invalidKeys = this.Contents.Keys.Intersect(InvalidContentKeys).ToArray();
|
||||
if (invalidKeys.IsNotEmpty())
|
||||
{
|
||||
throw new ArgumentException($"{nameof(this.Contents)} contains forbidden keys: {String.Join(", ", invalidKeys)}.");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
44
Aliyun.Api.LogService/Domain/Log/LogProgressState.cs
Normal file
44
Aliyun.Api.LogService/Domain/Log/LogProgressState.cs
Normal file
@@ -0,0 +1,44 @@
|
||||
//
|
||||
// LogProgressState.cs
|
||||
//
|
||||
// Author:
|
||||
// MiNG <developer@ming.gz.cn>
|
||||
//
|
||||
// Copyright (c) 2018 Alibaba Cloud
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
// of this software and associated documentation files (the "Software"), to deal
|
||||
// in the Software without restriction, including without limitation the rights
|
||||
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
// copies of the Software, and to permit persons to whom the Software is
|
||||
// furnished to do so, subject to the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be included in
|
||||
// all copies or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
// THE SOFTWARE.
|
||||
|
||||
namespace Aliyun.Api.LogService.Domain.Log
|
||||
{
|
||||
/**
|
||||
* 查询结果状态。
|
||||
*/
|
||||
public enum LogProgressState
|
||||
{
|
||||
/**
|
||||
* 本次查询返回的结果是完整的结果。
|
||||
*/
|
||||
Complete,
|
||||
|
||||
/**
|
||||
* 本次查询返回的结果只是部分结果。
|
||||
*/
|
||||
Incomplete
|
||||
}
|
||||
}
|
||||
50
Aliyun.Api.LogService/Domain/Log/LogQueryInfo.cs
Normal file
50
Aliyun.Api.LogService/Domain/Log/LogQueryInfo.cs
Normal file
@@ -0,0 +1,50 @@
|
||||
//
|
||||
// LogQueryInfo.cs
|
||||
//
|
||||
// Author:
|
||||
// MiNG <developer@ming.gz.cn>
|
||||
//
|
||||
// Copyright (c) 2018 Alibaba Cloud
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
// of this software and associated documentation files (the "Software"), to deal
|
||||
// in the Software without restriction, including without limitation the rights
|
||||
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
// copies of the Software, and to permit persons to whom the Software is
|
||||
// furnished to do so, subject to the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be included in
|
||||
// all copies or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
// THE SOFTWARE.
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Aliyun.Api.LogService.Domain.Log
|
||||
{
|
||||
public class LogQueryInfo
|
||||
{
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public IList<String> Keys { get; }
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public IList<IList<String>> Terms { get; }
|
||||
|
||||
public LogQueryInfo(IList<String> keys, IList<IList<String>> terms)
|
||||
{
|
||||
this.Keys = keys;
|
||||
this.Terms = terms;
|
||||
}
|
||||
}
|
||||
}
|
||||
55
Aliyun.Api.LogService/Domain/Log/PostLogsRequest.cs
Normal file
55
Aliyun.Api.LogService/Domain/Log/PostLogsRequest.cs
Normal file
@@ -0,0 +1,55 @@
|
||||
//
|
||||
// PostLogsRequest.cs
|
||||
//
|
||||
// Author:
|
||||
// MiNG <developer@ming.gz.cn>
|
||||
//
|
||||
// Copyright (c) 2018 Alibaba Cloud
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
// of this software and associated documentation files (the "Software"), to deal
|
||||
// in the Software without restriction, including without limitation the rights
|
||||
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
// copies of the Software, and to permit persons to whom the Software is
|
||||
// furnished to do so, subject to the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be included in
|
||||
// all copies or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
// THE SOFTWARE.
|
||||
|
||||
using System;
|
||||
using Aliyun.Api.LogService.Domain.Project;
|
||||
|
||||
namespace Aliyun.Api.LogService.Domain.Log
|
||||
{
|
||||
public class PostLogsRequest : ProjectScopedRequest
|
||||
{
|
||||
/// <summary>
|
||||
/// 日志库名称。
|
||||
/// </summary>
|
||||
public String LogstoreName { get; }
|
||||
|
||||
/// <summary>
|
||||
/// 一组日志。
|
||||
/// </summary>
|
||||
public LogGroupInfo LogGroup { get; }
|
||||
|
||||
/// <summary>
|
||||
///(可选)标记日志应该路由到哪个 shard 的标记。
|
||||
/// </summary>
|
||||
public String HashKey { get; set; }
|
||||
|
||||
public PostLogsRequest(String logstoreName, LogGroupInfo logGroup)
|
||||
{
|
||||
this.LogstoreName = logstoreName;
|
||||
this.LogGroup = logGroup;
|
||||
}
|
||||
}
|
||||
}
|
||||
62
Aliyun.Api.LogService/Domain/Log/PullLogsRequest.cs
Normal file
62
Aliyun.Api.LogService/Domain/Log/PullLogsRequest.cs
Normal file
@@ -0,0 +1,62 @@
|
||||
//
|
||||
// PullLogsRequest.cs
|
||||
//
|
||||
// Author:
|
||||
// MiNG <developer@ming.gz.cn>
|
||||
//
|
||||
// Copyright (c) 2018 Alibaba Cloud
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
// of this software and associated documentation files (the "Software"), to deal
|
||||
// in the Software without restriction, including without limitation the rights
|
||||
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
// copies of the Software, and to permit persons to whom the Software is
|
||||
// furnished to do so, subject to the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be included in
|
||||
// all copies or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
// THE SOFTWARE.
|
||||
|
||||
using System;
|
||||
using Aliyun.Api.LogService.Domain.Project;
|
||||
|
||||
namespace Aliyun.Api.LogService.Domain.Log
|
||||
{
|
||||
public class PullLogsRequest : ProjectScopedRequest
|
||||
{
|
||||
/// <summary>
|
||||
/// 日志库名称
|
||||
/// </summary>
|
||||
public String LogstoreName { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Shard ID
|
||||
/// </summary>
|
||||
public Int32 ShardId { get; }
|
||||
|
||||
/// <summary>
|
||||
/// 游标,用以表示从什么位置开始读取数据,相当于起点。
|
||||
/// </summary>
|
||||
public String Cursor { get; }
|
||||
|
||||
/// <summary>
|
||||
/// 返回的 loggroup 数目,范围为 0~1000。
|
||||
/// </summary>
|
||||
public Int32 Count { get; }
|
||||
|
||||
public PullLogsRequest(String logstoreName, Int32 shardId, String cursor, Int32 count)
|
||||
{
|
||||
this.LogstoreName = logstoreName;
|
||||
this.ShardId = shardId;
|
||||
this.Cursor = cursor;
|
||||
this.Count = count;
|
||||
}
|
||||
}
|
||||
}
|
||||
40
Aliyun.Api.LogService/Domain/Log/PullLogsResult.cs
Normal file
40
Aliyun.Api.LogService/Domain/Log/PullLogsResult.cs
Normal file
@@ -0,0 +1,40 @@
|
||||
//
|
||||
// PullLogsResult.cs
|
||||
//
|
||||
// Author:
|
||||
// MiNG <developer@ming.gz.cn>
|
||||
//
|
||||
// Copyright (c) 2018 Alibaba Cloud
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
// of this software and associated documentation files (the "Software"), to deal
|
||||
// in the Software without restriction, including without limitation the rights
|
||||
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
// copies of the Software, and to permit persons to whom the Software is
|
||||
// furnished to do so, subject to the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be included in
|
||||
// all copies or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
// THE SOFTWARE.
|
||||
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Aliyun.Api.LogService.Domain.Log
|
||||
{
|
||||
public class PullLogsResult
|
||||
{
|
||||
public IList<LogGroupInfo> LogGroups { get; }
|
||||
|
||||
public PullLogsResult(IList<LogGroupInfo> logGroups)
|
||||
{
|
||||
this.LogGroups = logGroups;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user