初始化
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user