初始化
This commit is contained in:
127
Aliyun.Api.LogService/Domain/Config/ConfigInputDetailInfo.cs
Normal file
127
Aliyun.Api.LogService/Domain/Config/ConfigInputDetailInfo.cs
Normal file
@@ -0,0 +1,127 @@
|
||||
//
|
||||
// ConfigInputDetailInfo.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;
|
||||
|
||||
namespace Aliyun.Api.LogService.Domain.Config
|
||||
{
|
||||
public class ConfigInputDetailInfo
|
||||
{
|
||||
public const Boolean DefaultPreserve = true;
|
||||
|
||||
/// <summary>
|
||||
/// 日志类型,现在只支持 common_reg_log。
|
||||
/// </summary>
|
||||
public String LogType { get; }
|
||||
|
||||
/// <summary>
|
||||
/// 日志所在的父目录,例如 /var/logs/。
|
||||
/// </summary>
|
||||
public String LogPath { get; }
|
||||
|
||||
/// <summary>
|
||||
/// 日志文件的Pattern,例如 access*.log。
|
||||
/// </summary>
|
||||
public String FilePattern { get; }
|
||||
|
||||
/// <summary>
|
||||
/// 是否打开本地缓存,在服务端之间链路断开的情况下,本地可以缓存 1GB 日志。
|
||||
/// </summary>
|
||||
public Boolean LocalStorage { get; }
|
||||
|
||||
/// <summary>
|
||||
/// 日志时间格式, 如 %Y/%m/%d %H:%M:%S。
|
||||
/// </summary>
|
||||
public String TimeFormat { get; }
|
||||
|
||||
/// <summary>
|
||||
/// 日志首行特征(正则表达式),由于匹配多行日志组成一条 log 的情况。
|
||||
/// </summary>
|
||||
public String LogBeginRegex { get; }
|
||||
|
||||
/// <summary>
|
||||
/// 日志对提取正则表达式。
|
||||
/// </summary>
|
||||
public String Regex { get; }
|
||||
|
||||
/// <summary>
|
||||
/// 日志提取后所生成的 Key。
|
||||
/// </summary>
|
||||
public IList<String> Key { get; }
|
||||
|
||||
/// <summary>
|
||||
/// 用于过滤日志所用到的 key,只有 key 的值满足对应 filterRegex 列中设定的正则表达式日志才是符合要求的。
|
||||
/// </summary>
|
||||
public IList<String> FilterKey { get; }
|
||||
|
||||
/// <summary>
|
||||
/// 和每个 filterKey 对应的正则表达式, filterRegex 的长度和 filterKey 的长度必须相同。
|
||||
/// </summary>
|
||||
public IList<String> FilterRegex { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Topic 生成方式,支持以下四种类型:
|
||||
/// <list type="bullet">
|
||||
/// <item><description>用于将日志文件路径的某部分作为 topic,如 /var/log/(.*).log。</description></item>
|
||||
/// <item><description>none,表示 topic 为空。</description></item>
|
||||
/// <item><description>default,表示将日志文件路径作为 topic。</description></item>
|
||||
/// <item><description>group_topic,表示将应用该配置的机器组 topic 属性作为 topic。</description></item>
|
||||
/// </list>
|
||||
/// </summary>
|
||||
public String TopicFormat { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// true 代表监控目录永不超时,false 代表监控目录 30 分钟超时,默认值为 true。
|
||||
/// </summary>
|
||||
public Boolean Preserve { get; set; } = DefaultPreserve;
|
||||
|
||||
/// <summary>
|
||||
/// 当设置 preserve 为 false 时,指定监控不超时目录的深度,最大深度支持 3。
|
||||
/// </summary>
|
||||
public Int32 PreserveDepth { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 支持两种类型:utf8、gbk。
|
||||
/// </summary>
|
||||
public String FileEncoding { get; set; }
|
||||
|
||||
public ConfigInputDetailInfo(String logType, String logPath, String filePattern, Boolean localStorage, String timeFormat, String logBeginRegex, String regex, IEnumerable<String> key, IEnumerable<String> filterKey, IEnumerable<String> filterRegex)
|
||||
{
|
||||
this.LogType = logType;
|
||||
this.LogPath = logPath;
|
||||
this.FilePattern = filePattern;
|
||||
this.LocalStorage = localStorage;
|
||||
this.TimeFormat = timeFormat;
|
||||
this.LogBeginRegex = logBeginRegex;
|
||||
this.Regex = regex;
|
||||
this.Key = key?.ToList();
|
||||
this.FilterKey = filterKey?.ToList();
|
||||
this.FilterRegex = filterRegex?.ToList();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,40 @@
|
||||
//
|
||||
// ConfigOutputDetailInfo.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.Config
|
||||
{
|
||||
public class ConfigOutputDetailInfo
|
||||
{
|
||||
public String LogstoreName { get; }
|
||||
|
||||
public ConfigOutputDetailInfo(String logstoreName)
|
||||
{
|
||||
this.LogstoreName = logstoreName;
|
||||
}
|
||||
}
|
||||
}
|
||||
73
Aliyun.Api.LogService/Domain/Config/CreateConfigRequest.cs
Normal file
73
Aliyun.Api.LogService/Domain/Config/CreateConfigRequest.cs
Normal file
@@ -0,0 +1,73 @@
|
||||
//
|
||||
// CreateConfigRequest.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.Config
|
||||
{
|
||||
public class CreateConfigRequest : ProjectScopedRequest
|
||||
{
|
||||
/// <summary>
|
||||
/// 日志配置名称, Project 下唯一。
|
||||
/// </summary>
|
||||
public String ConfigName { get; }
|
||||
|
||||
/// <summary>
|
||||
/// 输入类型,现在只支持 file。
|
||||
/// </summary>
|
||||
public String InputType { get; }
|
||||
|
||||
/// <summary>
|
||||
/// 输入详情。
|
||||
/// </summary>
|
||||
public ConfigInputDetailInfo InputDetail { get; }
|
||||
|
||||
/// <summary>
|
||||
/// 输出类型,现在只支持 LogService。
|
||||
/// </summary>
|
||||
public String OutputType { get; }
|
||||
|
||||
/// <summary>
|
||||
/// 输出详情。
|
||||
/// </summary>
|
||||
public ConfigOutputDetailInfo OutputDetail { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Logtail 配置日志样例,最大支持 1000 字节。
|
||||
/// </summary>
|
||||
public String LogSample { get; set; }
|
||||
|
||||
public CreateConfigRequest(String configName, String inputType, ConfigInputDetailInfo inputDetail, String outputType, ConfigOutputDetailInfo outputDetail)
|
||||
{
|
||||
this.ConfigName = configName;
|
||||
this.InputType = inputType;
|
||||
this.InputDetail = inputDetail;
|
||||
this.OutputType = outputType;
|
||||
this.OutputDetail = outputDetail;
|
||||
}
|
||||
}
|
||||
}
|
||||
44
Aliyun.Api.LogService/Domain/Config/DeleteConfigRequest.cs
Normal file
44
Aliyun.Api.LogService/Domain/Config/DeleteConfigRequest.cs
Normal file
@@ -0,0 +1,44 @@
|
||||
//
|
||||
// DeleteConfigRequest.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.Config
|
||||
{
|
||||
public class DeleteConfigRequest : ProjectScopedRequest
|
||||
{
|
||||
/// <summary>
|
||||
/// 日志配置名称。
|
||||
/// </summary>
|
||||
public String ConfigName { get; }
|
||||
|
||||
public DeleteConfigRequest(String configName)
|
||||
{
|
||||
this.ConfigName = configName;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,44 @@
|
||||
//
|
||||
// GetAppliedMachineGroupsRequest.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.Config
|
||||
{
|
||||
public class GetAppliedMachineGroupsRequest : ProjectScopedRequest
|
||||
{
|
||||
/// <summary>
|
||||
/// 日志配置名称。
|
||||
/// </summary>
|
||||
public String ConfigName { get; }
|
||||
|
||||
public GetAppliedMachineGroupsRequest(String configName)
|
||||
{
|
||||
this.ConfigName = configName;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,50 @@
|
||||
//
|
||||
// GetAppliedMachineGroupsResult.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.Config
|
||||
{
|
||||
public class GetAppliedMachineGroupsResult
|
||||
{
|
||||
/// <summary>
|
||||
/// 返回的 machineGroup 数目。
|
||||
/// </summary>
|
||||
public Int32 Count { get; }
|
||||
|
||||
/// <summary>
|
||||
/// 返回的 machineGroup 名称列表。
|
||||
/// </summary>
|
||||
public IList<String> MachineGroups { get; }
|
||||
|
||||
public GetAppliedMachineGroupsResult(Int32 count, IList<String> machineGroups)
|
||||
{
|
||||
this.Count = count;
|
||||
this.MachineGroups = machineGroups;
|
||||
}
|
||||
}
|
||||
}
|
||||
44
Aliyun.Api.LogService/Domain/Config/GetConfigRequest.cs
Normal file
44
Aliyun.Api.LogService/Domain/Config/GetConfigRequest.cs
Normal file
@@ -0,0 +1,44 @@
|
||||
//
|
||||
// GetConfigRequest.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.Config
|
||||
{
|
||||
public class GetConfigRequest : ProjectScopedRequest
|
||||
{
|
||||
/// <summary>
|
||||
/// 日志配置名称。
|
||||
/// </summary>
|
||||
public String ConfigName { get; }
|
||||
|
||||
public GetConfigRequest(String configName)
|
||||
{
|
||||
this.ConfigName = configName;
|
||||
}
|
||||
}
|
||||
}
|
||||
93
Aliyun.Api.LogService/Domain/Config/GetConfigResult.cs
Normal file
93
Aliyun.Api.LogService/Domain/Config/GetConfigResult.cs
Normal file
@@ -0,0 +1,93 @@
|
||||
//
|
||||
// GetConfigResult.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.Config
|
||||
{
|
||||
public class GetConfigResult
|
||||
{
|
||||
/// <summary>
|
||||
/// 日志配置名称, Project 下唯一。
|
||||
/// </summary>
|
||||
public String ConfigName { get; }
|
||||
|
||||
/// <summary>
|
||||
/// 输入类型,现在只支持 file。
|
||||
/// </summary>
|
||||
public String InputType { get; }
|
||||
|
||||
/// <summary>
|
||||
/// 输入详情。
|
||||
/// </summary>
|
||||
public ConfigInputDetailInfo InputDetail { get; }
|
||||
|
||||
/// <summary>
|
||||
/// 输出类型,现在只支持 LogService。
|
||||
/// </summary>
|
||||
public String OutputType { get; }
|
||||
|
||||
/// <summary>
|
||||
/// 输出详情。
|
||||
/// </summary>
|
||||
public ConfigOutputDetailExtInfo OutputDetail { get; }
|
||||
|
||||
/// <summary>
|
||||
/// 配置创建时间。
|
||||
/// </summary>
|
||||
public Int32 CreateTime { get; }
|
||||
|
||||
/// <summary>
|
||||
/// 该资源服务端更新时间。
|
||||
/// </summary>
|
||||
public Int32 LastModifyTime { get; }
|
||||
|
||||
public GetConfigResult(String configName, String inputType, ConfigInputDetailInfo inputDetail, String outputType, ConfigOutputDetailExtInfo outputDetail, Int32 createTime, Int32 lastModifyTime)
|
||||
{
|
||||
this.ConfigName = configName;
|
||||
this.InputType = inputType;
|
||||
this.InputDetail = inputDetail;
|
||||
this.OutputType = outputType;
|
||||
this.OutputDetail = outputDetail;
|
||||
this.CreateTime = createTime;
|
||||
this.LastModifyTime = lastModifyTime;
|
||||
}
|
||||
|
||||
public class ConfigOutputDetailExtInfo : ConfigOutputDetailInfo
|
||||
{
|
||||
/// <summary>
|
||||
/// Project 所在的访问地址。
|
||||
/// </summary>
|
||||
public String Endpoint { get; }
|
||||
|
||||
public ConfigOutputDetailExtInfo(String logstoreName, String endpoint)
|
||||
: base(logstoreName)
|
||||
{
|
||||
this.Endpoint = endpoint;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
47
Aliyun.Api.LogService/Domain/Config/ListConfigRequest.cs
Normal file
47
Aliyun.Api.LogService/Domain/Config/ListConfigRequest.cs
Normal file
@@ -0,0 +1,47 @@
|
||||
//
|
||||
// ListConfigRequest.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.Config
|
||||
{
|
||||
public class ListConfigRequest : ProjectScopedRequest
|
||||
{
|
||||
public const Int32 DefaultOffset = 0;
|
||||
public const Int32 DefaultSize = 500;
|
||||
|
||||
/// <summary>
|
||||
/// 返回记录的起始位置,默认为 0。
|
||||
/// </summary>
|
||||
public Int32 Offset { get; set; } = DefaultOffset;
|
||||
|
||||
/// <summary>
|
||||
/// 每页返回最大条目,默认 500(最大值)。
|
||||
/// </summary>
|
||||
public Int32 Size { get; set; } = DefaultSize;
|
||||
}
|
||||
}
|
||||
56
Aliyun.Api.LogService/Domain/Config/ListConfigResult.cs
Normal file
56
Aliyun.Api.LogService/Domain/Config/ListConfigResult.cs
Normal file
@@ -0,0 +1,56 @@
|
||||
//
|
||||
// ListConfigResult.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.Config
|
||||
{
|
||||
public class ListConfigResult
|
||||
{
|
||||
/// <summary>
|
||||
/// 返回的 config 数目。
|
||||
/// </summary>
|
||||
public Int32 Count { get; }
|
||||
|
||||
/// <summary>
|
||||
/// 在服务端 config 总数。
|
||||
/// </summary>
|
||||
public Int32 Total { get; }
|
||||
|
||||
/// <summary>
|
||||
/// 返回的 config 名称列表。
|
||||
/// </summary>
|
||||
public IList<String> Configs { get; }
|
||||
|
||||
public ListConfigResult(Int32 count, Int32 total, IList<String> configs)
|
||||
{
|
||||
this.Count = count;
|
||||
this.Total = total;
|
||||
this.Configs = configs;
|
||||
}
|
||||
}
|
||||
}
|
||||
68
Aliyun.Api.LogService/Domain/Config/UpdateConfigRequest.cs
Normal file
68
Aliyun.Api.LogService/Domain/Config/UpdateConfigRequest.cs
Normal file
@@ -0,0 +1,68 @@
|
||||
//
|
||||
// UpdateConfigRequest.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.Config
|
||||
{
|
||||
public class UpdateConfigRequest : ProjectScopedRequest
|
||||
{
|
||||
/// <summary>
|
||||
/// 日志配置名称, Project 下唯一。
|
||||
/// </summary>
|
||||
public String ConfigName { get; }
|
||||
|
||||
/// <summary>
|
||||
/// 输入类型,现在只支持 file。
|
||||
/// </summary>
|
||||
public String InputType { get; }
|
||||
|
||||
/// <summary>
|
||||
/// 输入详情。
|
||||
/// </summary>
|
||||
public ConfigInputDetailInfo InputDetail { get; }
|
||||
|
||||
/// <summary>
|
||||
/// 输出类型,现在只支持 LogService。
|
||||
/// </summary>
|
||||
public String OutputType { get; }
|
||||
|
||||
/// <summary>
|
||||
/// 输出详情。
|
||||
/// </summary>
|
||||
public ConfigOutputDetailInfo OutputDetail { get; }
|
||||
|
||||
public UpdateConfigRequest(String configName, String inputType, ConfigInputDetailInfo inputDetail, String outputType, ConfigOutputDetailInfo outputDetail)
|
||||
{
|
||||
this.ConfigName = configName;
|
||||
this.InputType = inputType;
|
||||
this.InputDetail = inputDetail;
|
||||
this.OutputType = outputType;
|
||||
this.OutputDetail = outputDetail;
|
||||
}
|
||||
}
|
||||
}
|
||||
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;
|
||||
}
|
||||
}
|
||||
}
|
||||
89
Aliyun.Api.LogService/Domain/LogServiceException.cs
Normal file
89
Aliyun.Api.LogService/Domain/LogServiceException.cs
Normal file
@@ -0,0 +1,89 @@
|
||||
//
|
||||
// LogServiceClientBuilders.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.Infrastructure.Protocol;
|
||||
|
||||
namespace Aliyun.Api.LogService.Domain
|
||||
{
|
||||
/// <summary>
|
||||
/// 日志服务业务异常。
|
||||
/// </summary>
|
||||
public class LogServiceException : Exception
|
||||
{
|
||||
/// <summary>
|
||||
/// 服务端产生的标示该请求的唯一 ID。
|
||||
/// 该响应头与具体应用无关,主要用于跟踪和调查问题。
|
||||
/// 如果用户希望调查出现问题的 API 请求,可以向 Log Service 团队提供该 ID。
|
||||
/// </summary>
|
||||
public String RequestId { get; }
|
||||
|
||||
/// <summary>
|
||||
/// 对应的错误码。
|
||||
/// </summary>
|
||||
public ErrorCode ErrorCode { get; }
|
||||
|
||||
/// <summary>
|
||||
/// 对应的错误消息。
|
||||
/// </summary>
|
||||
public String ErrorMessage { get; }
|
||||
|
||||
public LogServiceException(String requestId, ErrorCode errorCode)
|
||||
: base(FormatMessage(requestId, errorCode))
|
||||
{
|
||||
this.RequestId = requestId;
|
||||
this.ErrorCode = errorCode;
|
||||
this.ErrorMessage = null;
|
||||
}
|
||||
|
||||
public LogServiceException(String requestId, ErrorCode errorCode, String errorMessage)
|
||||
: base(FormatMessage(requestId, errorCode, errorMessage))
|
||||
{
|
||||
this.RequestId = requestId;
|
||||
this.ErrorCode = errorCode;
|
||||
this.ErrorMessage = errorMessage;
|
||||
}
|
||||
|
||||
public LogServiceException(String requestId, ErrorCode errorCode, Exception innerException)
|
||||
: base(FormatMessage(requestId, errorCode), innerException)
|
||||
{
|
||||
this.RequestId = requestId;
|
||||
this.ErrorCode = errorCode;
|
||||
this.ErrorMessage = null;
|
||||
}
|
||||
|
||||
public LogServiceException(String requestId, ErrorCode errorCode, String errorMessage, Exception innerException)
|
||||
: base(FormatMessage(requestId, errorCode), innerException)
|
||||
{
|
||||
this.RequestId = requestId;
|
||||
this.ErrorCode = errorCode;
|
||||
this.ErrorMessage = errorMessage;
|
||||
}
|
||||
|
||||
private static String FormatMessage(String requestId, ErrorCode errorCode, String errorMessage = null)
|
||||
=> $"[{requestId}] {errorCode}{(errorMessage == null ? String.Empty : $" ({errorMessage})")}";
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,56 @@
|
||||
//
|
||||
// CreateLogStoreRequest.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.LogStore
|
||||
{
|
||||
public class CreateLogStoreRequest : ProjectScopedRequest
|
||||
{
|
||||
/// <summary>
|
||||
/// Logstore 的名称,在 Project 下必须唯一。
|
||||
/// </summary>
|
||||
public String LogstoreName { get; }
|
||||
|
||||
/// <summary>
|
||||
/// 数据的保存时间,单位为天,范围1~365(额外需求请提交工单)。
|
||||
/// </summary>
|
||||
public Int32 Ttl { get; }
|
||||
|
||||
/// <summary>
|
||||
/// 该 Logstore 的 Shard 数量,单位为个,范围为 1~10。
|
||||
/// </summary>
|
||||
public Int32 ShardCount { get; }
|
||||
|
||||
public CreateLogStoreRequest(String logstoreName, Int32 ttl, Int32 shardCount)
|
||||
{
|
||||
this.LogstoreName = logstoreName;
|
||||
this.Ttl = ttl;
|
||||
this.ShardCount = shardCount;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,44 @@
|
||||
//
|
||||
// DeleteLogStoreRequest.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.LogStore
|
||||
{
|
||||
public class DeleteLogStoreRequest : ProjectScopedRequest
|
||||
{
|
||||
/// <summary>
|
||||
/// Logstore 的名称,在 Project 下必须唯一。
|
||||
/// </summary>
|
||||
public String LogstoreName { get; }
|
||||
|
||||
public DeleteLogStoreRequest(String logstoreName)
|
||||
{
|
||||
this.LogstoreName = logstoreName;
|
||||
}
|
||||
}
|
||||
}
|
||||
44
Aliyun.Api.LogService/Domain/LogStore/GetLogStoreRequest.cs
Normal file
44
Aliyun.Api.LogService/Domain/LogStore/GetLogStoreRequest.cs
Normal file
@@ -0,0 +1,44 @@
|
||||
//
|
||||
// GetLogStoreRequest.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.LogStore
|
||||
{
|
||||
public class GetLogStoreRequest : ProjectScopedRequest
|
||||
{
|
||||
/// <summary>
|
||||
/// Logstore 的名称,在 Project 下必须唯一。
|
||||
/// </summary>
|
||||
public String LogstoreName { get; }
|
||||
|
||||
public GetLogStoreRequest(String logstoreName)
|
||||
{
|
||||
this.LogstoreName = logstoreName;
|
||||
}
|
||||
}
|
||||
}
|
||||
67
Aliyun.Api.LogService/Domain/LogStore/GetLogStoreResult.cs
Normal file
67
Aliyun.Api.LogService/Domain/LogStore/GetLogStoreResult.cs
Normal file
@@ -0,0 +1,67 @@
|
||||
//
|
||||
// GetLogStoreResult.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.LogStore
|
||||
{
|
||||
public class GetLogStoreResult
|
||||
{
|
||||
///<summary>
|
||||
/// logstore 的名称, 在该 project 下唯一。
|
||||
///</summary>
|
||||
public String LogstoreName { get; }
|
||||
|
||||
///<summary>
|
||||
/// 日志数据生命周期(TTL),单位为天,最小为 1 天。
|
||||
///</summary>
|
||||
public Int32 Ttl { get; }
|
||||
|
||||
///<summary>
|
||||
/// 日志数据 服务单元。
|
||||
///</summary>
|
||||
public Int32 ShardCount { get; }
|
||||
|
||||
///<summary>
|
||||
/// 该资源服务端创建时间。
|
||||
///</summary>
|
||||
public Int32 CreateTime { get; }
|
||||
|
||||
///<summary>
|
||||
/// 该资源服务端更新时间。
|
||||
///</summary>
|
||||
public Int32 LastModifyTime { get; }
|
||||
|
||||
public GetLogStoreResult(String logstoreName, Int32 ttl, Int32 shardCount, Int32 createTime, Int32 lastModifyTime)
|
||||
{
|
||||
this.LogstoreName = logstoreName;
|
||||
this.Ttl = ttl;
|
||||
this.ShardCount = shardCount;
|
||||
this.CreateTime = createTime;
|
||||
this.LastModifyTime = lastModifyTime;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,69 @@
|
||||
//
|
||||
// CreateIndexRequest.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 Aliyun.Api.LogService.Domain.Project;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace Aliyun.Api.LogService.Domain.LogStore.Index
|
||||
{
|
||||
public class CreateIndexRequest : ProjectScopedRequest
|
||||
{
|
||||
/// <summary>
|
||||
/// Logstore 的名称,在 Project 下必须唯一。
|
||||
/// </summary>
|
||||
[JsonIgnore]
|
||||
public String LogstoreName { get; }
|
||||
|
||||
/// <summary>
|
||||
/// 全文索引,对于日志中value的索引属性,全文索引和字段查询必须至少配置一类。
|
||||
/// </summary>
|
||||
public IndexLineInfo Line { get; }
|
||||
|
||||
/// <summary>
|
||||
/// 字段查询,对于具体字段的value索引属性,全文索引和字段查询必须至少配置一类。
|
||||
/// </summary>
|
||||
public IDictionary<String, IndexKeyInfo> Keys { get; }
|
||||
|
||||
public CreateIndexRequest(String logstoreName, IndexLineInfo line) : this(logstoreName, line, null)
|
||||
{
|
||||
// Delegate constructor.
|
||||
}
|
||||
|
||||
public CreateIndexRequest(String logstoreName, IDictionary<String, IndexKeyInfo> keys) : this(logstoreName, null, keys)
|
||||
{
|
||||
// Delegate constructor.
|
||||
}
|
||||
|
||||
public CreateIndexRequest(String logstoreName, IndexLineInfo line, IDictionary<String, IndexKeyInfo> keys)
|
||||
{
|
||||
this.Line = line;
|
||||
this.Keys = keys;
|
||||
this.LogstoreName = logstoreName;
|
||||
}
|
||||
}
|
||||
}
|
||||
139
Aliyun.Api.LogService/Domain/LogStore/Index/IndexKeyInfo.cs
Normal file
139
Aliyun.Api.LogService/Domain/LogStore/Index/IndexKeyInfo.cs
Normal file
@@ -0,0 +1,139 @@
|
||||
//
|
||||
// IndexKeyInfo.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 Aliyun.Api.LogService.Utils;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace Aliyun.Api.LogService.Domain.LogStore.Index
|
||||
{
|
||||
/*****************************************
|
||||
* TODO: Remove the coupling of Json.NET *
|
||||
*****************************************/
|
||||
|
||||
public class IndexKeyInfo
|
||||
{
|
||||
/// <summary>
|
||||
/// 字段类型,目前支持text,long,double和json等四种。
|
||||
/// </summary>
|
||||
public String Type { get; }
|
||||
|
||||
/// <summary>
|
||||
/// 是否支持统计分析,默认值为false,标识不支持。
|
||||
/// </summary>
|
||||
[JsonProperty("doc_value")]
|
||||
public Boolean? DocValue { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 查询别名,默认为空。
|
||||
/// </summary>
|
||||
public String Alias { get; set; }
|
||||
|
||||
public IndexKeyInfo(String type)
|
||||
{
|
||||
this.Type = type;
|
||||
}
|
||||
}
|
||||
|
||||
public class IndexTextKeyInfo : IndexKeyInfo
|
||||
{
|
||||
/// <summary>
|
||||
/// 是否区分大小写,默认值为false,表示不区分。
|
||||
/// </summary>
|
||||
public Boolean? CaseSensitive { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 分词字符列表,只支持单个英文字符。
|
||||
/// </summary>
|
||||
public IEnumerable<Char> Token { get; }
|
||||
|
||||
/// <summary>
|
||||
/// 是否进行中文分词,默认值为false,表示不进行中文分词。
|
||||
/// </summary>
|
||||
public Boolean? Chn { get; set; }
|
||||
|
||||
public IndexTextKeyInfo(IEnumerable<Char> token)
|
||||
: base("text")
|
||||
{
|
||||
this.Token = token.Freeze();
|
||||
}
|
||||
}
|
||||
|
||||
public class IndexLongKeyInfo : IndexKeyInfo
|
||||
{
|
||||
public IndexLongKeyInfo() : base("long")
|
||||
{
|
||||
// Empty constructor.
|
||||
}
|
||||
}
|
||||
|
||||
public class IndexDoubleKeyInfo : IndexKeyInfo
|
||||
{
|
||||
public IndexDoubleKeyInfo() : base("double")
|
||||
{
|
||||
// Empty constructor.
|
||||
}
|
||||
}
|
||||
|
||||
public class IndexJsonKeyInfo : IndexKeyInfo
|
||||
{
|
||||
/// <summary>
|
||||
/// 分词字符列表,只支持单个英文字符。
|
||||
/// </summary>
|
||||
public IEnumerable<Char> Token { get; }
|
||||
|
||||
/// <summary>
|
||||
/// 是否进行中文分词,默认值为false,表示不进行中文分词。
|
||||
/// </summary>
|
||||
public Boolean? Chn { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 是否对所有json key进行索引,默认为否。
|
||||
/// </summary>
|
||||
[JsonProperty("index_all")]
|
||||
public Boolean? IndexAll { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 表示解析json的最大深度。
|
||||
/// </summary>
|
||||
[JsonProperty("max_depth")]
|
||||
public Int32 MaxDepth { get; }
|
||||
|
||||
/// <summary>
|
||||
/// 表示json中具体key的索引属性。 其中object中每个item支持text,long和double三种类型,属性对应类型一致。
|
||||
/// </summary>
|
||||
[JsonProperty("json_keys")]
|
||||
public IDictionary<String, IndexKeyInfo> JsonKeys { get; set; }
|
||||
|
||||
public IndexJsonKeyInfo(IEnumerable<Char> token, Int32 maxDepth)
|
||||
: base("json")
|
||||
{
|
||||
this.Token = token.Freeze();
|
||||
this.MaxDepth = maxDepth;
|
||||
}
|
||||
}
|
||||
}
|
||||
141
Aliyun.Api.LogService/Domain/LogStore/Index/IndexKeysBuilder.cs
Normal file
141
Aliyun.Api.LogService/Domain/LogStore/Index/IndexKeysBuilder.cs
Normal file
@@ -0,0 +1,141 @@
|
||||
//
|
||||
// IndexKeysBuilder.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.LogStore.Index
|
||||
{
|
||||
public class IndexKeysBuilder
|
||||
{
|
||||
private readonly Boolean allowJson;
|
||||
|
||||
private readonly IDictionary<String, IndexKeyInfo> keys = new Dictionary<String, IndexKeyInfo>();
|
||||
|
||||
public IndexKeysBuilder() : this(true)
|
||||
{
|
||||
// Empty constructor.
|
||||
}
|
||||
|
||||
private IndexKeysBuilder(Boolean allowJson)
|
||||
{
|
||||
this.allowJson = allowJson;
|
||||
}
|
||||
|
||||
public IndexKeysBuilder AddText(String key, params Char[] token)
|
||||
{
|
||||
return this.AddText(key, token.AsEnumerable());
|
||||
}
|
||||
|
||||
public IndexKeysBuilder AddText(String key, IEnumerable<Char> token, Boolean? caseSensitive = null, Boolean? chn = null)
|
||||
{
|
||||
var frozenToken = token?.ToArray(); // Avoid recalculate the non-reentranceable IEnumerable.
|
||||
Ensure.NotEmpty(frozenToken, nameof(token));
|
||||
|
||||
var textKeyInfo = new IndexTextKeyInfo(frozenToken)
|
||||
{
|
||||
CaseSensitive = caseSensitive,
|
||||
Chn = chn
|
||||
};
|
||||
|
||||
this.keys.Add(key, textKeyInfo);
|
||||
|
||||
return this;
|
||||
}
|
||||
|
||||
public IndexKeysBuilder AddLong(String key, Boolean? docValue = null, String alias = null)
|
||||
{
|
||||
var longKeyInfo = new IndexLongKeyInfo
|
||||
{
|
||||
DocValue = docValue,
|
||||
Alias = alias
|
||||
};
|
||||
|
||||
this.keys.Add(key, longKeyInfo);
|
||||
|
||||
return this;
|
||||
}
|
||||
|
||||
public IndexKeysBuilder AddDouble(String key, Boolean? docValue = null, String alias = null)
|
||||
{
|
||||
var doubleKeyInfo = new IndexDoubleKeyInfo
|
||||
{
|
||||
DocValue = docValue,
|
||||
Alias = alias
|
||||
};
|
||||
|
||||
this.keys.Add(key, doubleKeyInfo);
|
||||
|
||||
return this;
|
||||
}
|
||||
|
||||
public IndexKeysBuilder AddJson(String key, Int32 maxDepth, params Char[] token)
|
||||
{
|
||||
return this.AddJson(key, token, maxDepth);
|
||||
}
|
||||
|
||||
public IndexKeysBuilder AddJson(String key, IEnumerable<Char> token, Int32 maxDepth,
|
||||
Boolean? chn = null, Boolean? indexAll = null, Action<IndexKeysBuilder> jsonKeys = null)
|
||||
{
|
||||
if (!this.allowJson)
|
||||
{
|
||||
throw new InvalidOperationException("json index info is not support in current state.");
|
||||
}
|
||||
|
||||
var frozenToken = token?.ToArray(); // Avoid recalculate the non-reentranceable IEnumerable.
|
||||
Ensure.NotEmpty(frozenToken, nameof(token));
|
||||
|
||||
IDictionary<String, IndexKeyInfo> subKeys;
|
||||
if (jsonKeys != null)
|
||||
{
|
||||
var subBuilder = new IndexKeysBuilder(false);
|
||||
jsonKeys(subBuilder);
|
||||
subKeys = subBuilder.Build();
|
||||
} else
|
||||
{
|
||||
subKeys = null;
|
||||
}
|
||||
|
||||
var jsonKeyInfo = new IndexJsonKeyInfo(frozenToken, maxDepth)
|
||||
{
|
||||
Chn = chn,
|
||||
IndexAll = indexAll,
|
||||
JsonKeys = subKeys
|
||||
};
|
||||
|
||||
this.keys.Add(key, jsonKeyInfo);
|
||||
|
||||
return this;
|
||||
}
|
||||
|
||||
public IDictionary<String, IndexKeyInfo> Build()
|
||||
{
|
||||
return new Dictionary<String, IndexKeyInfo>(this.keys);
|
||||
}
|
||||
}
|
||||
}
|
||||
55
Aliyun.Api.LogService/Domain/LogStore/Index/IndexLineInfo.cs
Normal file
55
Aliyun.Api.LogService/Domain/LogStore/Index/IndexLineInfo.cs
Normal file
@@ -0,0 +1,55 @@
|
||||
//
|
||||
// IndexLineInfo.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 Aliyun.Api.LogService.Utils;
|
||||
|
||||
namespace Aliyun.Api.LogService.Domain.LogStore.Index
|
||||
{
|
||||
public class IndexLineInfo
|
||||
{
|
||||
/// <summary>
|
||||
/// 是否区分大小写,默认值为false,表示不区分。
|
||||
/// </summary>
|
||||
public Boolean? CaseSensitive { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 分词字符列表,只支持单个英文字符。
|
||||
/// </summary>
|
||||
public IEnumerable<Char> Token { get; }
|
||||
|
||||
/// <summary>
|
||||
/// 是否进行中文分词,默认值为false,表示不进行中文分词。
|
||||
/// </summary>
|
||||
public Boolean? Chn { get; set; }
|
||||
|
||||
public IndexLineInfo(IEnumerable<Char> token)
|
||||
{
|
||||
this.Token = token.Freeze();
|
||||
}
|
||||
}
|
||||
}
|
||||
52
Aliyun.Api.LogService/Domain/LogStore/ListLogStoreRequest.cs
Normal file
52
Aliyun.Api.LogService/Domain/LogStore/ListLogStoreRequest.cs
Normal file
@@ -0,0 +1,52 @@
|
||||
//
|
||||
// ListLogStoreRequest.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.LogStore
|
||||
{
|
||||
public class ListLogStoreRequest : ProjectScopedRequest
|
||||
{
|
||||
internal const Int32 DefaultOffset = 1;
|
||||
internal const Int32 DefaultSize = 500;
|
||||
|
||||
/// <summary>
|
||||
/// 用于请求的 Logstore 名称(支持部分匹配)。
|
||||
/// </summary>
|
||||
public String LogstoreName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 返回记录的起始位置,默认值为 1。
|
||||
/// </summary>
|
||||
public Int32 Offset { get; set; } = DefaultOffset;
|
||||
|
||||
/// <summary>
|
||||
/// 每页返回最大条目,默认 500(最大值)。
|
||||
/// </summary>
|
||||
public Int32 Size { get; set; } = DefaultSize;
|
||||
}
|
||||
}
|
||||
56
Aliyun.Api.LogService/Domain/LogStore/ListLogStoreResult.cs
Normal file
56
Aliyun.Api.LogService/Domain/LogStore/ListLogStoreResult.cs
Normal file
@@ -0,0 +1,56 @@
|
||||
//
|
||||
// ListLogStoreResult.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.LogStore
|
||||
{
|
||||
public class ListLogStoreResult
|
||||
{
|
||||
///<summary>
|
||||
/// 返回的 Logstore 数目。
|
||||
///</summary>
|
||||
public Int32 Count { get; }
|
||||
|
||||
///<summary>
|
||||
/// Logstore 总数。
|
||||
///</summary>
|
||||
public Int32 Total { get; }
|
||||
|
||||
///<summary>
|
||||
/// 返回的 Logstore 名称列表。
|
||||
///</summary>
|
||||
public IList<String> Logstores { get; }
|
||||
|
||||
public ListLogStoreResult(Int32 count, Int32 total, IList<String> logstores)
|
||||
{
|
||||
this.Count = count;
|
||||
this.Total = total;
|
||||
this.Logstores = logstores;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,56 @@
|
||||
//
|
||||
// GetCursorRequest.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.LogStore.Shard
|
||||
{
|
||||
public class GetCursorRequest : ProjectScopedRequest
|
||||
{
|
||||
/// <summary>
|
||||
/// 日志库名称
|
||||
/// </summary>
|
||||
public String LogstoreName { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Shard ID
|
||||
/// </summary>
|
||||
public Int32 ShardId { get; }
|
||||
|
||||
/// <summary>
|
||||
/// 时间点(UNIX下秒数),或 begin,end
|
||||
/// </summary>
|
||||
public String From { get; }
|
||||
|
||||
public GetCursorRequest(String logstoreName, Int32 shardId, String from)
|
||||
{
|
||||
this.LogstoreName = logstoreName;
|
||||
this.ShardId = shardId;
|
||||
this.From = from;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,43 @@
|
||||
//
|
||||
// GetCursorResult.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.LogStore.Shard
|
||||
{
|
||||
public class GetCursorResult
|
||||
{
|
||||
/// <summary>
|
||||
/// 游标
|
||||
/// </summary>
|
||||
public String Cursor { get; }
|
||||
|
||||
public GetCursorResult(String cursor)
|
||||
{
|
||||
this.Cursor = cursor;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,44 @@
|
||||
//
|
||||
// ListShardRequest.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.LogStore.Shard
|
||||
{
|
||||
public class ListShardRequest : ProjectScopedRequest
|
||||
{
|
||||
/// <summary>
|
||||
/// 日志库名称
|
||||
/// </summary>
|
||||
public String LogstoreName { get; }
|
||||
|
||||
public ListShardRequest(String logstoreName)
|
||||
{
|
||||
this.LogstoreName = logstoreName;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,50 @@
|
||||
//
|
||||
// MergeShardRequest.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.LogStore.Shard
|
||||
{
|
||||
public class MergeShardRequest : ProjectScopedRequest
|
||||
{
|
||||
/// <summary>
|
||||
/// 日志库名称
|
||||
/// </summary>
|
||||
public String LogstoreName { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Shard ID
|
||||
/// </summary>
|
||||
public Int32 ShardId { get; }
|
||||
|
||||
public MergeShardRequest(String logstoreName, Int32 shardId)
|
||||
{
|
||||
this.LogstoreName = logstoreName;
|
||||
this.ShardId = shardId;
|
||||
}
|
||||
}
|
||||
}
|
||||
71
Aliyun.Api.LogService/Domain/LogStore/Shard/ShardInfo.cs
Normal file
71
Aliyun.Api.LogService/Domain/LogStore/Shard/ShardInfo.cs
Normal file
@@ -0,0 +1,71 @@
|
||||
//
|
||||
// ShardInfo.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.LogStore.Shard
|
||||
{
|
||||
public class ShardInfo
|
||||
{
|
||||
/// <summary>
|
||||
/// Shard ID,分区号。
|
||||
/// </summary>
|
||||
public Int32 ShardId { get; }
|
||||
|
||||
/// <summary>
|
||||
/// 分区的状态。
|
||||
/// <list type="bullet">
|
||||
/// <item><description>readwrite:可以读写</description></item>
|
||||
/// <item><description>readonly:只读数据</description></item>
|
||||
/// </list>
|
||||
/// </summary>
|
||||
public ShardState Status { get; }
|
||||
|
||||
/// <summary>
|
||||
/// 分区起始的Key值,分区范围中包含该Key值。
|
||||
/// </summary>
|
||||
public String InclusiveBeginKey { get; }
|
||||
|
||||
/// <summary>
|
||||
/// 分区结束的Key值,分区范围中不包含该Key值。
|
||||
/// </summary>
|
||||
public String ExclusiveEndKey { get; }
|
||||
|
||||
/// <summary>
|
||||
/// 分区创建时间。
|
||||
/// </summary>
|
||||
public Int64 CreateTime { get; }
|
||||
|
||||
public ShardInfo(Int32 shardId, ShardState status, String inclusiveBeginKey, String exclusiveEndKey, Int64 createTime)
|
||||
{
|
||||
this.ShardId = shardId;
|
||||
this.Status = status;
|
||||
this.InclusiveBeginKey = inclusiveBeginKey;
|
||||
this.ExclusiveEndKey = exclusiveEndKey;
|
||||
this.CreateTime = createTime;
|
||||
}
|
||||
}
|
||||
}
|
||||
44
Aliyun.Api.LogService/Domain/LogStore/Shard/ShardState.cs
Normal file
44
Aliyun.Api.LogService/Domain/LogStore/Shard/ShardState.cs
Normal file
@@ -0,0 +1,44 @@
|
||||
//
|
||||
// ShardState.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.LogStore.Shard
|
||||
{
|
||||
/// <summary>
|
||||
/// 分区状态。
|
||||
/// </summary>
|
||||
public enum ShardState
|
||||
{
|
||||
/// <summary>
|
||||
/// 只读。
|
||||
/// </summary>
|
||||
ReadOnly,
|
||||
|
||||
/// <summary>
|
||||
/// 可以读写。
|
||||
/// </summary>
|
||||
ReadWrite,
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,56 @@
|
||||
//
|
||||
// SplitShardRequest.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.LogStore.Shard
|
||||
{
|
||||
public class SplitShardRequest : ProjectScopedRequest
|
||||
{
|
||||
/// <summary>
|
||||
/// 日志库名称
|
||||
/// </summary>
|
||||
public String LogstoreName { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Shard ID
|
||||
/// </summary>
|
||||
public Int32 ShardId { get; }
|
||||
|
||||
/// <summary>
|
||||
/// split 切分位置
|
||||
/// </summary>
|
||||
public String SplitKey { get; }
|
||||
|
||||
public SplitShardRequest(String logstoreName, Int32 shardId, String splitKey)
|
||||
{
|
||||
this.LogstoreName = logstoreName;
|
||||
this.ShardId = shardId;
|
||||
this.SplitKey = splitKey;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,81 @@
|
||||
//
|
||||
// GetShipperRequest.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.LogStore.Shipper
|
||||
{
|
||||
public class GetShipperRequest : ProjectScopedRequest
|
||||
{
|
||||
public const Int32 DefaultOffset = 0;
|
||||
|
||||
public const Int32 DefaultSize = 100;
|
||||
|
||||
/// <summary>
|
||||
/// 日志库名称,同一 Project 下唯一。
|
||||
/// </summary>
|
||||
public String LogstoreName { get; }
|
||||
|
||||
/// <summary>
|
||||
/// 日志投递规则名称,同一 Logstore 下唯一。
|
||||
/// </summary>
|
||||
public String ShipperName { get; }
|
||||
|
||||
/// <summary>
|
||||
/// 日志投递任务创建时间区间。
|
||||
/// </summary>
|
||||
public Int32 From { get; }
|
||||
|
||||
/// <summary>
|
||||
/// 日志投递任务创建时间区间。
|
||||
/// </summary>
|
||||
public Int32 To { get; }
|
||||
|
||||
/// <summary>
|
||||
/// 默认为空,表示返回所有状态的任务,目前支持 success/fail/running 等状态。
|
||||
/// </summary>
|
||||
public String Status { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 返回指定时间区间内投递任务的起始数目,默认值为 0。
|
||||
/// </summary>
|
||||
public Int32 Offset { get; set; } = DefaultOffset;
|
||||
|
||||
/// <summary>
|
||||
/// 返回指定时间区间内投递任务的数目,默认值为 100,最大为 500。
|
||||
/// </summary>
|
||||
public Int32 Size { get; set; } = DefaultSize;
|
||||
|
||||
public GetShipperRequest(String logstoreName, String shipperName, Int32 from, Int32 to)
|
||||
{
|
||||
this.LogstoreName = logstoreName;
|
||||
this.ShipperName = shipperName;
|
||||
this.From = from;
|
||||
this.To = to;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,130 @@
|
||||
//
|
||||
// GetShipperResult.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.LogStore.Shipper
|
||||
{
|
||||
public class GetShipperResult
|
||||
{
|
||||
/// <summary>
|
||||
/// 返回的任务个数。
|
||||
/// </summary>
|
||||
public Int32 Count { get; }
|
||||
|
||||
/// <summary>
|
||||
/// 指定范围内任务总数。
|
||||
/// </summary>
|
||||
public Int32 Total { get; }
|
||||
|
||||
/// <summary>
|
||||
/// 指定范围内任务汇总状态,具体请参考下表。
|
||||
/// </summary>
|
||||
public StatisticsResult Statistics { get; }
|
||||
|
||||
/// <summary>
|
||||
/// 指定范围内投递任务具体详情,具体请参考下表。
|
||||
/// </summary>
|
||||
public IList<TasksResult> Tasks { get; }
|
||||
|
||||
public GetShipperResult(Int32 count, Int32 total, StatisticsResult statistics, IList<TasksResult> tasks)
|
||||
{
|
||||
this.Count = count;
|
||||
this.Total = total;
|
||||
this.Statistics = statistics;
|
||||
this.Tasks = tasks;
|
||||
}
|
||||
|
||||
public class StatisticsResult
|
||||
{
|
||||
/// <summary>
|
||||
/// 指定范围内状态为 running 的任务个数。
|
||||
/// </summary>
|
||||
public Int32 Running { get; }
|
||||
|
||||
/// <summary>
|
||||
/// 指定范围内状态为 success 的任务个数。
|
||||
/// </summary>
|
||||
public Int32 Success { get; }
|
||||
|
||||
/// <summary>
|
||||
/// 指定范围内状态为 fail 的任务个数。
|
||||
/// </summary>
|
||||
public Int32 Fail { get; }
|
||||
|
||||
public StatisticsResult(Int32 running, Int32 success, Int32 fail)
|
||||
{
|
||||
this.Running = running;
|
||||
this.Success = success;
|
||||
this.Fail = fail;
|
||||
}
|
||||
}
|
||||
|
||||
public class TasksResult
|
||||
{
|
||||
/// <summary>
|
||||
/// 具体投递任务的任务唯一 ID。
|
||||
/// </summary>
|
||||
public String Id { get; }
|
||||
|
||||
/// <summary>
|
||||
/// 投递任务的具体状态,可能为 running/success/fail 中的一种。
|
||||
/// </summary>
|
||||
public String TaskStatus { get; }
|
||||
|
||||
/// <summary>
|
||||
/// 投递任务失败时的具体错误信息。
|
||||
/// </summary>
|
||||
public String TaskMessage { get; }
|
||||
|
||||
/// <summary>
|
||||
/// 投递任务创建时间。
|
||||
/// </summary>
|
||||
public Int32 TaskCreateTime { get; }
|
||||
|
||||
/// <summary>
|
||||
/// 投递任务中的最近一条日志到达服务端时间(非日志时间,是服务端接收时间)。
|
||||
/// </summary>
|
||||
public Int32 TaskLastDataReceiveTime { get; }
|
||||
|
||||
/// <summary>
|
||||
/// 投递任务结束时间。
|
||||
/// </summary>
|
||||
public Int32 TaskFinishTime { get; }
|
||||
|
||||
public TasksResult(String id, String taskStatus, String taskMessage, Int32 taskCreateTime, Int32 taskLastDataReceiveTime, Int32 taskFinishTime)
|
||||
{
|
||||
this.Id = id;
|
||||
this.TaskStatus = taskStatus;
|
||||
this.TaskMessage = taskMessage;
|
||||
this.TaskCreateTime = taskCreateTime;
|
||||
this.TaskLastDataReceiveTime = taskLastDataReceiveTime;
|
||||
this.TaskFinishTime = taskFinishTime;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,57 @@
|
||||
//
|
||||
// RetryShipperRequest.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 Aliyun.Api.LogService.Domain.Project;
|
||||
|
||||
namespace Aliyun.Api.LogService.Domain.LogStore.Shipper
|
||||
{
|
||||
public class RetryShipperRequest : ProjectScopedRequest
|
||||
{
|
||||
/// <summary>
|
||||
/// 日志库名称,同一 Project 下唯一。
|
||||
/// </summary>
|
||||
public String LogstoreName { get; }
|
||||
|
||||
/// <summary>
|
||||
/// 日志投递规则名称,同一 Logstore 下唯一。
|
||||
/// </summary>
|
||||
public String ShipperName { get; }
|
||||
|
||||
/// <summary>
|
||||
/// 需要重试的任务ID。
|
||||
/// </summary>
|
||||
public IEnumerable<String> TaskIds { get; }
|
||||
|
||||
public RetryShipperRequest(String logstoreName, String shipperName, IEnumerable<String> taskIds)
|
||||
{
|
||||
this.LogstoreName = logstoreName;
|
||||
this.ShipperName = shipperName;
|
||||
this.TaskIds = taskIds;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,56 @@
|
||||
//
|
||||
// UpdateLogStoreRequest.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.LogStore
|
||||
{
|
||||
public class UpdateLogStoreRequest : ProjectScopedRequest
|
||||
{
|
||||
/// <summary>
|
||||
/// Logstore 的名称,在 Project 下必须唯一。
|
||||
/// </summary>
|
||||
public String LogstoreName { get; }
|
||||
|
||||
/// <summary>
|
||||
/// 数据的保存时间,单位为天,范围1~365(额外需求请提交工单)。
|
||||
/// </summary>
|
||||
public Int32 Ttl { get; }
|
||||
|
||||
/// <summary>
|
||||
/// 该 Logstore 的 Shard 数量,单位为个,范围为 1~10。
|
||||
/// </summary>
|
||||
public Int32 ShardCount { get; }
|
||||
|
||||
public UpdateLogStoreRequest(String logstoreName, Int32 ttl, Int32 shardCount)
|
||||
{
|
||||
this.LogstoreName = logstoreName;
|
||||
this.Ttl = ttl;
|
||||
this.ShardCount = shardCount;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,50 @@
|
||||
//
|
||||
// ApplyConfigToMachineGroupRequest.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.MachineGroup
|
||||
{
|
||||
public class ApplyConfigToMachineGroupRequest : ProjectScopedRequest
|
||||
{
|
||||
/// <summary>
|
||||
/// 机器分组名称。
|
||||
/// </summary>
|
||||
public String GroupName { get; }
|
||||
|
||||
/// <summary>
|
||||
/// 日志配置名称。
|
||||
/// </summary>
|
||||
public String ConfigName { get; }
|
||||
|
||||
public ApplyConfigToMachineGroupRequest(String groupName, String configName)
|
||||
{
|
||||
this.GroupName = groupName;
|
||||
this.ConfigName = configName;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,67 @@
|
||||
//
|
||||
// CreateMachineGroupRequest.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 Aliyun.Api.LogService.Domain.Project;
|
||||
|
||||
namespace Aliyun.Api.LogService.Domain.MachineGroup
|
||||
{
|
||||
public class CreateMachineGroupRequest : ProjectScopedRequest
|
||||
{
|
||||
/// <summary>
|
||||
/// 机器分组名称。
|
||||
/// </summary>
|
||||
public String GroupName { get; }
|
||||
|
||||
/// <summary>
|
||||
/// 机器分组类型,默认为空。
|
||||
/// </summary>
|
||||
public String GroupType { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 机器标识类型,分为 IP 和 userdefined 两种。
|
||||
/// </summary>
|
||||
public String MachineIdentifyType { get; }
|
||||
|
||||
/// <summary>
|
||||
/// 机器分组的属性,默认为空。
|
||||
/// </summary>
|
||||
public MachineGroupAttributeInfo GroupAttribute { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 具体的机器标识,可以是 IP 或 userdefined-id。
|
||||
/// </summary>
|
||||
public IEnumerable<String> MachineList { get; }
|
||||
|
||||
public CreateMachineGroupRequest(String groupName, String machineIdentifyType, IEnumerable<String> machineList)
|
||||
{
|
||||
this.GroupName = groupName;
|
||||
this.MachineIdentifyType = machineIdentifyType;
|
||||
this.MachineList = machineList;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,44 @@
|
||||
//
|
||||
// DeleteMachineGroupRequest.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.MachineGroup
|
||||
{
|
||||
public class DeleteMachineGroupRequest : ProjectScopedRequest
|
||||
{
|
||||
/// <summary>
|
||||
/// 机器分组名称。
|
||||
/// </summary>
|
||||
public String GroupName { get; }
|
||||
|
||||
public DeleteMachineGroupRequest(String groupName)
|
||||
{
|
||||
this.GroupName = groupName;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,44 @@
|
||||
//
|
||||
// GetAppliedConfigsRequest.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.MachineGroup
|
||||
{
|
||||
public class GetAppliedConfigsRequest : ProjectScopedRequest
|
||||
{
|
||||
/// <summary>
|
||||
/// 机器分组名称。
|
||||
/// </summary>
|
||||
public String GroupName { get; }
|
||||
|
||||
public GetAppliedConfigsRequest(String groupName)
|
||||
{
|
||||
this.GroupName = groupName;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,50 @@
|
||||
//
|
||||
// GetAppliedConfigsResult.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.MachineGroup
|
||||
{
|
||||
public class GetAppliedConfigsResult
|
||||
{
|
||||
/// <summary>
|
||||
/// 返回的 config 数目。
|
||||
/// </summary>
|
||||
public Int32 Count { get; }
|
||||
|
||||
/// <summary>
|
||||
/// 返回的 config 名称列表。
|
||||
/// </summary>
|
||||
public IList<String> Configs { get; }
|
||||
|
||||
public GetAppliedConfigsResult(Int32 count, IList<String> configs)
|
||||
{
|
||||
this.Count = count;
|
||||
this.Configs = configs;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,44 @@
|
||||
//
|
||||
// GetMachineGroupRequest.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.MachineGroup
|
||||
{
|
||||
public class GetMachineGroupRequest : ProjectScopedRequest
|
||||
{
|
||||
/// <summary>
|
||||
/// 机器分组名称。
|
||||
/// </summary>
|
||||
public String GroupName { get; }
|
||||
|
||||
public GetMachineGroupRequest(String groupName)
|
||||
{
|
||||
this.GroupName = groupName;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,81 @@
|
||||
//
|
||||
// GetMachineGroupResult.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.MachineGroup
|
||||
{
|
||||
public class GetMachineGroupResult
|
||||
{
|
||||
/// <summary>
|
||||
/// 机器分组名称。
|
||||
/// </summary>
|
||||
public String GroupName { get; }
|
||||
|
||||
/// <summary>
|
||||
/// 机器分组类型,默认为空。
|
||||
/// </summary>
|
||||
public String GroupType { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 机器分组的属性,默认为空。
|
||||
/// </summary>
|
||||
public MachineGroupAttributeInfo GroupAttribute { get; }
|
||||
|
||||
/// <summary>
|
||||
/// 机器标识类型,分为 IP 和 userdefined 两种。
|
||||
/// </summary>
|
||||
public String MachineIdentifyType { get; }
|
||||
|
||||
/// <summary>
|
||||
/// 具体的机器标识,可以是 IP 或 userdefined-id。
|
||||
/// </summary>
|
||||
public IEnumerable<String> MachineList { get; }
|
||||
|
||||
/// <summary>
|
||||
/// 机器分组创建时间。
|
||||
/// </summary>
|
||||
public Int32 CreateTime { get; }
|
||||
|
||||
/// <summary>
|
||||
/// 机器分组最近更新时间。
|
||||
/// </summary>
|
||||
public Int32 LastModifyTime { get; }
|
||||
|
||||
public GetMachineGroupResult(String groupName, String groupType, MachineGroupAttributeInfo groupAttribute, String machineIdentifyType,
|
||||
IEnumerable<String> machineList, Int32 createTime, Int32 lastModifyTime)
|
||||
{
|
||||
this.GroupName = groupName;
|
||||
this.GroupType = groupType;
|
||||
this.GroupAttribute = groupAttribute;
|
||||
this.MachineIdentifyType = machineIdentifyType;
|
||||
this.MachineList = machineList;
|
||||
this.CreateTime = createTime;
|
||||
this.LastModifyTime = lastModifyTime;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,52 @@
|
||||
//
|
||||
// ListMachineGroupRequest.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.MachineGroup
|
||||
{
|
||||
public class ListMachineGroupRequest : ProjectScopedRequest
|
||||
{
|
||||
public const Int32 DefaultOffset = 0;
|
||||
public const Int32 DefaultSize = 500;
|
||||
|
||||
/// <summary>
|
||||
/// 用于过滤的机器组名称(支持部分匹配)。
|
||||
/// </summary>
|
||||
public String GroupName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 返回记录的起始位置,默认为 0。
|
||||
/// </summary>
|
||||
public Int32 Offset { get; set; } = DefaultOffset;
|
||||
|
||||
/// <summary>
|
||||
/// 每页返回最大条目,默认 500(最大值)。
|
||||
/// </summary>
|
||||
public Int32 Size { get; set; } = DefaultSize;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,56 @@
|
||||
//
|
||||
// ListMachineGroupResult.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.MachineGroup
|
||||
{
|
||||
public class ListMachineGroupResult
|
||||
{
|
||||
/// <summary>
|
||||
/// 返回的 machinegroup 数目。
|
||||
/// </summary>
|
||||
public Int32 Count { get; }
|
||||
|
||||
/// <summary>
|
||||
/// 返回 machinegroup 总数。
|
||||
/// </summary>
|
||||
public Int32 Total { get; }
|
||||
|
||||
/// <summary>
|
||||
/// 返回的 machinegroup 名称列表。
|
||||
/// </summary>
|
||||
public IList<String> MachineGroups { get; }
|
||||
|
||||
public ListMachineGroupResult(Int32 count, Int32 total, IList<String> machineGroups)
|
||||
{
|
||||
this.Count = count;
|
||||
this.Total = total;
|
||||
this.MachineGroups = machineGroups;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,57 @@
|
||||
//
|
||||
// ListMachinesRequest.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.MachineGroup
|
||||
{
|
||||
public class ListMachinesRequest : ProjectScopedRequest
|
||||
{
|
||||
public const Int32 DefaultOffset = 0;
|
||||
public const Int32 DefaultSize = 500;
|
||||
|
||||
/// <summary>
|
||||
/// 机器分组名称。
|
||||
/// </summary>
|
||||
public String GroupName { get; }
|
||||
|
||||
/// <summary>
|
||||
/// 返回记录的起始位置,默认为 0。
|
||||
/// </summary>
|
||||
public Int32 Offset { get; set; } = DefaultOffset;
|
||||
|
||||
/// <summary>
|
||||
/// 每页返回最大条目,默认 500(最大值)。
|
||||
/// </summary>
|
||||
public Int32 Size { get; set; } = DefaultSize;
|
||||
|
||||
public ListMachinesRequest(String groupName)
|
||||
{
|
||||
this.GroupName = groupName;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,87 @@
|
||||
//
|
||||
// ListMachinesResult.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.MachineGroup
|
||||
{
|
||||
public class ListMachinesResult
|
||||
{
|
||||
/// <summary>
|
||||
/// 返回的 machinegroup 数目。
|
||||
/// </summary>
|
||||
public Int32 Count { get; }
|
||||
|
||||
/// <summary>
|
||||
/// 返回 machinegroup 总数。
|
||||
/// </summary>
|
||||
public Int32 Total { get; }
|
||||
|
||||
/// <summary>
|
||||
/// 返回的 machinegroup 名称列表。
|
||||
/// </summary>
|
||||
public IList<MachineInfo> Machines { get; }
|
||||
|
||||
public ListMachinesResult(Int32 count, Int32 total, IList<MachineInfo> machines)
|
||||
{
|
||||
this.Count = count;
|
||||
this.Total = total;
|
||||
this.Machines = machines;
|
||||
}
|
||||
|
||||
public class MachineInfo
|
||||
{
|
||||
/// <summary>
|
||||
/// 机器的 IP。
|
||||
/// </summary>
|
||||
public String Ip { get; }
|
||||
|
||||
/// <summary>
|
||||
/// 机器 DMI UUID。
|
||||
/// </summary>
|
||||
public String MachineUniqueId { get; }
|
||||
|
||||
/// <summary>
|
||||
/// 机器的用户自定义标识。
|
||||
/// </summary>
|
||||
public String UserDefinedId { get; }
|
||||
|
||||
/// <summary>
|
||||
/// 机器最后的心跳时间。
|
||||
/// </summary>
|
||||
public String LastHeartbeatTime { get; }
|
||||
|
||||
public MachineInfo(String ip, String machineUniqueId, String userDefinedId, String lastHeartbeatTime)
|
||||
{
|
||||
this.Ip = ip;
|
||||
this.MachineUniqueId = machineUniqueId;
|
||||
this.UserDefinedId = userDefinedId;
|
||||
this.LastHeartbeatTime = lastHeartbeatTime;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,43 @@
|
||||
//
|
||||
// MachineGroupAttributeInfo.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.MachineGroup
|
||||
{
|
||||
public class MachineGroupAttributeInfo
|
||||
{
|
||||
/// <summary>
|
||||
/// 机器分组的 topic,默认为空。
|
||||
/// </summary>
|
||||
public String GroupTopic { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 机器分组所依赖的外部管理标识,默认为空。
|
||||
/// </summary>
|
||||
public String ExternalName { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,50 @@
|
||||
//
|
||||
// RemoveConfigFromMachineGroupRequest.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.MachineGroup
|
||||
{
|
||||
public class RemoveConfigFromMachineGroupRequest : ProjectScopedRequest
|
||||
{
|
||||
/// <summary>
|
||||
/// 机器分组名称。
|
||||
/// </summary>
|
||||
public String GroupName { get; }
|
||||
|
||||
/// <summary>
|
||||
/// 日志配置名称。
|
||||
/// </summary>
|
||||
public String ConfigName { get; }
|
||||
|
||||
public RemoveConfigFromMachineGroupRequest(String groupName, String configName)
|
||||
{
|
||||
this.GroupName = groupName;
|
||||
this.ConfigName = configName;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,67 @@
|
||||
//
|
||||
// UpdateMachineGroupRequest.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 Aliyun.Api.LogService.Domain.Project;
|
||||
|
||||
namespace Aliyun.Api.LogService.Domain.MachineGroup
|
||||
{
|
||||
public class UpdateMachineGroupRequest : ProjectScopedRequest
|
||||
{
|
||||
/// <summary>
|
||||
/// 机器分组名称。
|
||||
/// </summary>
|
||||
public String GroupName { get; }
|
||||
|
||||
/// <summary>
|
||||
/// 机器分组类型,默认为空。
|
||||
/// </summary>
|
||||
public String GroupType { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 机器标识类型,分为 IP 和 userdefined 两种。
|
||||
/// </summary>
|
||||
public String MachineIdentifyType { get; }
|
||||
|
||||
/// <summary>
|
||||
/// 机器分组的属性,默认为空。
|
||||
/// </summary>
|
||||
public MachineGroupAttributeInfo GroupAttribute { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 具体的机器标识,可以是 IP 或 userdefined-id。
|
||||
/// </summary>
|
||||
public IEnumerable<String> MachineList { get; }
|
||||
|
||||
public UpdateMachineGroupRequest(String groupName, String machineIdentifyType, IEnumerable<String> machineList)
|
||||
{
|
||||
this.GroupName = groupName;
|
||||
this.MachineIdentifyType = machineIdentifyType;
|
||||
this.MachineList = machineList;
|
||||
}
|
||||
}
|
||||
}
|
||||
49
Aliyun.Api.LogService/Domain/Project/CreateProjectRequest.cs
Normal file
49
Aliyun.Api.LogService/Domain/Project/CreateProjectRequest.cs
Normal file
@@ -0,0 +1,49 @@
|
||||
//
|
||||
// CreateProjectRequest.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.Project
|
||||
{
|
||||
public class CreateProjectRequest
|
||||
{
|
||||
/// <summary>
|
||||
/// project的名称,全局唯一。
|
||||
/// </summary>
|
||||
public String ProjectName { get; }
|
||||
|
||||
/// <summary>
|
||||
/// project描述。
|
||||
/// </summary>
|
||||
public String ProjectDesc { get; }
|
||||
|
||||
public CreateProjectRequest(String projectName, String projectDesc)
|
||||
{
|
||||
this.ProjectName = projectName;
|
||||
this.ProjectDesc = projectDesc;
|
||||
}
|
||||
}
|
||||
}
|
||||
32
Aliyun.Api.LogService/Domain/Project/DeleteProjectRequest.cs
Normal file
32
Aliyun.Api.LogService/Domain/Project/DeleteProjectRequest.cs
Normal file
@@ -0,0 +1,32 @@
|
||||
//
|
||||
// DeleteProjectRequest.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.Project
|
||||
{
|
||||
public class DeleteProjectRequest : ProjectScopedRequest
|
||||
{
|
||||
}
|
||||
}
|
||||
32
Aliyun.Api.LogService/Domain/Project/GetProjectRequest.cs
Normal file
32
Aliyun.Api.LogService/Domain/Project/GetProjectRequest.cs
Normal file
@@ -0,0 +1,32 @@
|
||||
//
|
||||
// GetProjectRequest.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.Project
|
||||
{
|
||||
public class GetProjectRequest : ProjectScopedRequest
|
||||
{
|
||||
}
|
||||
}
|
||||
41
Aliyun.Api.LogService/Domain/Project/GetProjectResult.cs
Normal file
41
Aliyun.Api.LogService/Domain/Project/GetProjectResult.cs
Normal file
@@ -0,0 +1,41 @@
|
||||
//
|
||||
// GetProjectResult.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.Project
|
||||
{
|
||||
public class GetProjectResult
|
||||
{
|
||||
/// <summary>
|
||||
/// Project信息。
|
||||
/// </summary>
|
||||
public ProjectDetailInfo Project { get; }
|
||||
|
||||
public GetProjectResult(ProjectDetailInfo project)
|
||||
{
|
||||
this.Project = project;
|
||||
}
|
||||
}
|
||||
}
|
||||
51
Aliyun.Api.LogService/Domain/Project/ListProjectRequest.cs
Normal file
51
Aliyun.Api.LogService/Domain/Project/ListProjectRequest.cs
Normal file
@@ -0,0 +1,51 @@
|
||||
//
|
||||
// ListProjectRequest.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.Project
|
||||
{
|
||||
public class ListProjectRequest
|
||||
{
|
||||
public const Int32 DefaultOffset = 0;
|
||||
public const Int32 DefaultSize = 500;
|
||||
|
||||
/// <summary>
|
||||
/// 请求结果的起始位置,默认为0。
|
||||
/// </summary>
|
||||
public Int32 Offset { get; set; } = DefaultOffset;
|
||||
|
||||
/// <summary>
|
||||
/// 每次请求返回结果最大数量,默认500(最大值)。
|
||||
/// </summary>
|
||||
public Int32 Size { get; set; } = DefaultSize;
|
||||
|
||||
/// <summary>
|
||||
/// 用于过滤返回结果的project名称(支持部分匹配)。
|
||||
/// </summary>
|
||||
public String ProjectName { get; set; }
|
||||
}
|
||||
}
|
||||
56
Aliyun.Api.LogService/Domain/Project/ListProjectResult.cs
Normal file
56
Aliyun.Api.LogService/Domain/Project/ListProjectResult.cs
Normal file
@@ -0,0 +1,56 @@
|
||||
//
|
||||
// ListProjectResult.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.Project
|
||||
{
|
||||
public class ListProjectResult
|
||||
{
|
||||
/// <summary>
|
||||
/// 返回project数量。
|
||||
/// </summary>
|
||||
public Int32 Count { get; }
|
||||
|
||||
/// <summary>
|
||||
/// project总数。
|
||||
/// </summary>
|
||||
public Int32 Total { get; }
|
||||
|
||||
/// <summary>
|
||||
/// 返回的project属性列表。
|
||||
/// </summary>
|
||||
public IList<ProjectInfo> Projects { get; }
|
||||
|
||||
public ListProjectResult(Int32 count, Int32 total, IList<ProjectInfo> projects)
|
||||
{
|
||||
this.Count = count;
|
||||
this.Total = total;
|
||||
this.Projects = projects;
|
||||
}
|
||||
}
|
||||
}
|
||||
62
Aliyun.Api.LogService/Domain/Project/ProjectDetailInfo.cs
Normal file
62
Aliyun.Api.LogService/Domain/Project/ProjectDetailInfo.cs
Normal file
@@ -0,0 +1,62 @@
|
||||
//
|
||||
// ProjectDetailInfo.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.Project
|
||||
{
|
||||
public class ProjectDetailInfo : ProjectInfo
|
||||
{
|
||||
/// <summary>
|
||||
/// Project所在区域。
|
||||
/// </summary>
|
||||
public String Region { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Project的所有者。
|
||||
/// </summary>
|
||||
public String Owner { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Project创建时间。
|
||||
/// </summary>
|
||||
public String CreateTime { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Project最后修改时间。
|
||||
/// </summary>
|
||||
public String LastModifyTime { get; }
|
||||
|
||||
public ProjectDetailInfo(String projectName, ProjectState status, String description, String region, String owner, String createTime, String lastModifyTime)
|
||||
: base(projectName, status, description)
|
||||
{
|
||||
this.Region = region;
|
||||
this.Owner = owner;
|
||||
this.CreateTime = createTime;
|
||||
this.LastModifyTime = lastModifyTime;
|
||||
}
|
||||
}
|
||||
}
|
||||
55
Aliyun.Api.LogService/Domain/Project/ProjectInfo.cs
Normal file
55
Aliyun.Api.LogService/Domain/Project/ProjectInfo.cs
Normal file
@@ -0,0 +1,55 @@
|
||||
//
|
||||
// ProjectInfo.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.Project
|
||||
{
|
||||
public class ProjectInfo
|
||||
{
|
||||
/// <summary>
|
||||
/// project名称。
|
||||
/// </summary>
|
||||
public String ProjectName { get; }
|
||||
|
||||
/// <summary>
|
||||
/// project状态,分为"Normal"(正常)和"Disable"(欠费停用)。
|
||||
/// </summary>
|
||||
public ProjectState Status { get; }
|
||||
|
||||
/// <summary>
|
||||
/// project描述。
|
||||
/// </summary>
|
||||
public String Description { get; }
|
||||
|
||||
public ProjectInfo(String projectName, ProjectState status, String description)
|
||||
{
|
||||
this.ProjectName = projectName;
|
||||
this.Status = status;
|
||||
this.Description = description;
|
||||
}
|
||||
}
|
||||
}
|
||||
43
Aliyun.Api.LogService/Domain/Project/ProjectScopedRequest.cs
Normal file
43
Aliyun.Api.LogService/Domain/Project/ProjectScopedRequest.cs
Normal file
@@ -0,0 +1,43 @@
|
||||
//
|
||||
// LogServiceClientBuilders.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 Newtonsoft.Json;
|
||||
|
||||
namespace Aliyun.Api.LogService.Domain.Project
|
||||
{
|
||||
/// <summary>
|
||||
/// 限定在指定Project内的请求,可带有 <see cref="ProjectName"/> 属性,覆盖 <see cref="ILogServiceClient"/> 中默认的 Project。
|
||||
/// </summary>
|
||||
public abstract class ProjectScopedRequest
|
||||
{
|
||||
/// <summary>
|
||||
/// 覆盖 <see cref="ILogServiceClient"/> 中默认的 Project。
|
||||
/// </summary>
|
||||
[JsonIgnore]
|
||||
public String ProjectName { get; set; }
|
||||
}
|
||||
}
|
||||
41
Aliyun.Api.LogService/Domain/Project/ProjectState.cs
Normal file
41
Aliyun.Api.LogService/Domain/Project/ProjectState.cs
Normal file
@@ -0,0 +1,41 @@
|
||||
//
|
||||
// ProjectState.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.Project
|
||||
{
|
||||
public enum ProjectState
|
||||
{
|
||||
/// <summary>
|
||||
/// 正常。
|
||||
/// </summary>
|
||||
Normal,
|
||||
|
||||
/// <summary>
|
||||
/// 欠费停用。
|
||||
/// </summary>
|
||||
Disable,
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user