Browse Source

修改网关配置,将文件分离以便修改,文件允许注释,并监视文件修改,自动生成ocelot.json,自动加载新配置

网关增加settingmanagement的{everything}配置
pull/862/head
李宏 3 years ago
parent
commit
54a431e6a1
  1. 2
      aspnet-core/services/LY.MicroService.TaskManagement.HttpApi.Host/TaskManagementHttpApiHostModule.Configure.cs
  2. 2
      aspnet-core/start-http-api-host.bat
  3. 5
      aspnet-core/start-internal-gateway.bat
  4. 83
      gateways/internal/LINGYUN.MicroService.Internal.ApiGateway/src/LINGYUN.MicroService.Internal.ApiGateway/Ocelot/Configuration/AutoConfigOcelot.cs
  5. 15
      gateways/internal/LINGYUN.MicroService.Internal.ApiGateway/src/LINGYUN.MicroService.Internal.ApiGateway/OcelotConfig/ocelot.aggregate.json
  6. 436
      gateways/internal/LINGYUN.MicroService.Internal.ApiGateway/src/LINGYUN.MicroService.Internal.ApiGateway/OcelotConfig/ocelot.backendadmin.json
  7. 0
      gateways/internal/LINGYUN.MicroService.Internal.ApiGateway/src/LINGYUN.MicroService.Internal.ApiGateway/OcelotConfig/ocelot.global.json
  8. 107
      gateways/internal/LINGYUN.MicroService.Internal.ApiGateway/src/LINGYUN.MicroService.Internal.ApiGateway/OcelotConfig/ocelot.idsadmin.json
  9. 31
      gateways/internal/LINGYUN.MicroService.Internal.ApiGateway/src/LINGYUN.MicroService.Internal.ApiGateway/OcelotConfig/ocelot.localization.json
  10. 226
      gateways/internal/LINGYUN.MicroService.Internal.ApiGateway/src/LINGYUN.MicroService.Internal.ApiGateway/OcelotConfig/ocelot.messages.json
  11. 99
      gateways/internal/LINGYUN.MicroService.Internal.ApiGateway/src/LINGYUN.MicroService.Internal.ApiGateway/OcelotConfig/ocelot.platform.json
  12. 23
      gateways/internal/LINGYUN.MicroService.Internal.ApiGateway/src/LINGYUN.MicroService.Internal.ApiGateway/OcelotConfig/ocelot.task.json
  13. 23
      gateways/internal/LINGYUN.MicroService.Internal.ApiGateway/src/LINGYUN.MicroService.Internal.ApiGateway/OcelotConfig/ocelot.webhook.json
  14. 13
      gateways/internal/LINGYUN.MicroService.Internal.ApiGateway/src/LINGYUN.MicroService.Internal.ApiGateway/Program.cs
  15. 1895
      gateways/internal/LINGYUN.MicroService.Internal.ApiGateway/src/LINGYUN.MicroService.Internal.ApiGateway/ocelot.Development.json
  16. 4347
      gateways/internal/LINGYUN.MicroService.Internal.ApiGateway/src/LINGYUN.MicroService.Internal.ApiGateway/ocelot.json
  17. 2
      starter/70.start-internal-gateway.bat

2
aspnet-core/services/LY.MicroService.TaskManagement.HttpApi.Host/TaskManagementHttpApiHostModule.Configure.cs

@ -251,7 +251,7 @@ public partial class TaskManagementHttpApiHostModule
services.AddSwaggerGen( services.AddSwaggerGen(
options => options =>
{ {
options.SwaggerDoc("v1", new OpenApiInfo { Title = "WorkflowManagement API", Version = "v1" }); options.SwaggerDoc("v1", new OpenApiInfo { Title = "TaskManagement API", Version = "v1" });
options.DocInclusionPredicate((docName, description) => true); options.DocInclusionPredicate((docName, description) => true);
options.CustomSchemaIds(type => type.FullName); options.CustomSchemaIds(type => type.FullName);
options.AddSecurityDefinition("Bearer", new OpenApiSecurityScheme options.AddSecurityDefinition("Bearer", new OpenApiSecurityScheme

2
aspnet-core/start-http-api-host.bat

@ -25,7 +25,7 @@ dotnet run
exit exit
:watchrun :watchrun
dotnet watch run dotnet watch run --no-restore
exit exit
:restore :restore

5
aspnet-core/start-internal-gateway.bat

@ -10,6 +10,7 @@ cd ..\gateways\internal\LINGYUN.MicroService.Internal.ApiGateway\src\LINGYUN.Mic
if '%1' equ '--publish' goto publish if '%1' equ '--publish' goto publish
if '%1' equ '--run' goto run if '%1' equ '--run' goto run
if '%1' equ '--watchrun' goto watchrun
if '%1' equ '--restore' goto restore if '%1' equ '--restore' goto restore
if '%1' equ '' goto run if '%1' equ '' goto run
exit exit
@ -23,6 +24,10 @@ exit
dotnet run dotnet run
exit exit
:watchrun
dotnet watch run --no-restore
exit
:restore :restore
dotnet restore dotnet restore
exit exit

83
gateways/internal/LINGYUN.MicroService.Internal.ApiGateway/src/LINGYUN.MicroService.Internal.ApiGateway/Ocelot/Configuration/AutoConfigOcelot.cs

@ -0,0 +1,83 @@

using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text.RegularExpressions;
using System.Threading;
using Castle.Core.Logging;
using Microsoft.AspNetCore.Hosting;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.Configuration.Memory;
using Newtonsoft.Json;
using Ocelot.Configuration.File;
using Serilog;
using Serilog.Core;
namespace Ocelot.DependencyInjection
{
public static class ConfigurationBuilderExtensions
{
public static IConfigurationBuilder AddAutoOcelotConfig(this IConfigurationBuilder builder, IWebHostEnvironment env)
{
return builder.AddAutoOcelotConfig(".", env);
}
static object locker = new object();
public static IConfigurationBuilder AddAutoOcelotConfig(this IConfigurationBuilder builder, string folder, IWebHostEnvironment env)
{
WriteFile(folder, env);
Action<object, FileSystemEventArgs> fileChanged = (sender, e) =>
{
lock (locker)
{
Log.Debug("Ocelot config regenerate...");
Thread.Sleep(100); //解决vs文件保存时多次触发change事件时引起异常
WriteFile(folder, env);
}
};
FileSystemWatcher watcher = new FileSystemWatcher("OcelotConfig", "*.json");
watcher.Changed += new FileSystemEventHandler(fileChanged);
watcher.Deleted += new FileSystemEventHandler(fileChanged);
watcher.Created += new FileSystemEventHandler(fileChanged);
watcher.Renamed += new RenamedEventHandler(fileChanged);
watcher.EnableRaisingEvents = true;
builder.AddJsonFile("ocelot.json", optional: true, reloadOnChange: true);
return builder;
}
private static void WriteFile(string folder, IWebHostEnvironment env)
{
string excludeConfigName = ((env != null && env.EnvironmentName != null) ? ("ocelot." + env.EnvironmentName + ".json") : string.Empty);
Regex reg = new Regex("^ocelot\\.(.*?)\\.json$", RegexOptions.IgnoreCase | RegexOptions.Singleline);
List<FileInfo> list = (from fi in new DirectoryInfo(folder).EnumerateFiles()
where reg.IsMatch(fi.Name) && fi.Name != excludeConfigName
select fi).ToList();
FileConfiguration fileConfiguration = new FileConfiguration();
foreach (FileInfo item in list)
{
if (list.Count <= 1 || !item.Name.Equals("ocelot.json", StringComparison.OrdinalIgnoreCase))
{
FileConfiguration fileConfiguration2 = JsonConvert.DeserializeObject<FileConfiguration>(File.ReadAllText(item.FullName));
if (fileConfiguration2 == null)
{
Log.Fatal($"Ocelot config file \"{item.FullName}\" is empty");
}
if (item.Name.Equals("ocelot.global.json", StringComparison.OrdinalIgnoreCase))
{
fileConfiguration.GlobalConfiguration = fileConfiguration2.GlobalConfiguration;
}
fileConfiguration.Aggregates.AddRange(fileConfiguration2.Aggregates);
fileConfiguration.Routes.AddRange(fileConfiguration2.Routes);
}
}
string contents = JsonConvert.SerializeObject(fileConfiguration, Formatting.Indented);
File.WriteAllText("ocelot.json", contents);
}
}
}

15
gateways/internal/LINGYUN.MicroService.Internal.ApiGateway/src/LINGYUN.MicroService.Internal.ApiGateway/ocelot.aggregate.json → gateways/internal/LINGYUN.MicroService.Internal.ApiGateway/src/LINGYUN.MicroService.Internal.ApiGateway/OcelotConfig/ocelot.aggregate.json

@ -1,6 +1,5 @@
{ {
"Aggregates": [ "Aggregates": [
// ̬ۺ
{ {
"RouteKeys": [ "RouteKeys": [
"platform-api-definition", "platform-api-definition",
@ -12,10 +11,8 @@
"webhook-api-definition" "webhook-api-definition"
], ],
"UpstreamPathTemplate": "/api/abp/api-definition", "UpstreamPathTemplate": "/api/abp/api-definition",
"Aggregator": "AbpResponseMergeAggregator", "Aggregator": "AbpResponseMergeAggregator"
"Priority": 99
}, },
// þۺ
{ {
"RouteKeys": [ "RouteKeys": [
"platform-configuration", "platform-configuration",
@ -29,11 +26,11 @@
"Aggregator": "AbpResponseMergeAggregator", "Aggregator": "AbpResponseMergeAggregator",
"Priority": 99 "Priority": 99
}, },
// ȫ
{ {
"RouteKeys": [ "RouteKeys": [
"setting-global", "setting-global",
"wechat-setting-global", "wechat-setting-global",
"tencent-cloud-setting-global",
"aliyun-setting-global", "aliyun-setting-global",
"oss-management-setting-global" "oss-management-setting-global"
], ],
@ -41,11 +38,11 @@
"Aggregator": "AbpResponseMergeAggregator", "Aggregator": "AbpResponseMergeAggregator",
"Priority": 99 "Priority": 99
}, },
//
{ {
"RouteKeys": [ "RouteKeys": [
"setting-current-tenant", "setting-current-tenant",
"wechat-setting-current-tenant", "wechat-setting-current-tenant",
"tencent-cloud-setting-current-tenant",
"aliyun-setting-current-tenant", "aliyun-setting-current-tenant",
"oss-management-setting-current-tenant" "oss-management-setting-current-tenant"
], ],
@ -53,13 +50,11 @@
"Aggregator": "AbpResponseMergeAggregator", "Aggregator": "AbpResponseMergeAggregator",
"Priority": 99 "Priority": 99
}, },
// û
{ {
"RouteKeys": [ "RouteKeys": [
"assignables-notifilers", "setting-current-user"
"my-subscribes"
], ],
"UpstreamPathTemplate": "/api/my-subscribes/assignables-notifilers", "UpstreamPathTemplate": "/api/setting-management/settings/by-current-user",
"Aggregator": "AbpResponseMergeAggregator", "Aggregator": "AbpResponseMergeAggregator",
"Priority": 99 "Priority": 99
} }

436
gateways/internal/LINGYUN.MicroService.Internal.ApiGateway/src/LINGYUN.MicroService.Internal.ApiGateway/ocelot.backendadmin.json → gateways/internal/LINGYUN.MicroService.Internal.ApiGateway/src/LINGYUN.MicroService.Internal.ApiGateway/OcelotConfig/ocelot.backendadmin.json

@ -1,6 +1,5 @@
{ {
"Routes": [ "Routes": [
// ܶ˵
{ {
"DownstreamPathTemplate": "/api/abp/application-configuration", "DownstreamPathTemplate": "/api/abp/application-configuration",
"DownstreamScheme": "http", "DownstreamScheme": "http",
@ -11,7 +10,9 @@
} }
], ],
"UpstreamPathTemplate": "/api/abp/backend-admin/application-configuration", "UpstreamPathTemplate": "/api/abp/backend-admin/application-configuration",
"UpstreamHttpMethod": [ "GET" ], "UpstreamHttpMethod": [
"GET"
],
"LoadBalancerOptions": { "LoadBalancerOptions": {
"Type": "RoundRobin" "Type": "RoundRobin"
}, },
@ -26,7 +27,6 @@
}, },
"Key": "backend-admin-configuration" "Key": "backend-admin-configuration"
}, },
// ̬ܶAPI˵
{ {
"DownstreamPathTemplate": "/api/abp/api-definition", "DownstreamPathTemplate": "/api/abp/api-definition",
"DownstreamScheme": "http", "DownstreamScheme": "http",
@ -37,7 +37,9 @@
} }
], ],
"UpstreamPathTemplate": "/api/abp/backend-admin/api-definition", "UpstreamPathTemplate": "/api/abp/backend-admin/api-definition",
"UpstreamHttpMethod": [ "GET" ], "UpstreamHttpMethod": [
"GET"
],
"LoadBalancerOptions": { "LoadBalancerOptions": {
"Type": "RoundRobin" "Type": "RoundRobin"
}, },
@ -52,7 +54,6 @@
}, },
"Key": "backend-admin-api-definition" "Key": "backend-admin-api-definition"
}, },
//
{ {
"DownstreamPathTemplate": "/api/abp/multi-tenancy/{everything}", "DownstreamPathTemplate": "/api/abp/multi-tenancy/{everything}",
"DownstreamScheme": "http", "DownstreamScheme": "http",
@ -63,7 +64,9 @@
} }
], ],
"UpstreamPathTemplate": "/api/abp/multi-tenancy/{everything}", "UpstreamPathTemplate": "/api/abp/multi-tenancy/{everything}",
"UpstreamHttpMethod": [ "GET" ], "UpstreamHttpMethod": [
"GET"
],
"LoadBalancerOptions": { "LoadBalancerOptions": {
"Type": "RoundRobin" "Type": "RoundRobin"
}, },
@ -77,9 +80,8 @@
"UseTracing": true "UseTracing": true
} }
}, },
//
{ {
"DownstreamPathTemplate": "/api/saas/{everything}", "DownstreamPathTemplate": "/api/tenant-management/{everything}",
"DownstreamScheme": "http", "DownstreamScheme": "http",
"DownstreamHostAndPorts": [ "DownstreamHostAndPorts": [
{ {
@ -87,8 +89,13 @@
"Port": 30010 "Port": 30010
} }
], ],
"UpstreamPathTemplate": "/api/saas/{everything}", "UpstreamPathTemplate": "/api/tenant-management/{everything}",
"UpstreamHttpMethod": [ "GET", "POST", "PUT", "DELETE" ], "UpstreamHttpMethod": [
"GET",
"POST",
"PUT",
"DELETE"
],
"LoadBalancerOptions": { "LoadBalancerOptions": {
"Type": "RoundRobin" "Type": "RoundRobin"
}, },
@ -97,7 +104,7 @@
"EnableRateLimiting": true, "EnableRateLimiting": true,
"Period": "1s", "Period": "1s",
"PeriodTimespan": 1, "PeriodTimespan": 1,
"Limit": 5 "Limit": 100
}, },
"QoSOptions": { "QoSOptions": {
"ExceptionsAllowedBeforeBreaking": 10, "ExceptionsAllowedBeforeBreaking": 10,
@ -108,7 +115,6 @@
"UseTracing": true "UseTracing": true
} }
}, },
// Ȩ޹
{ {
"DownstreamPathTemplate": "/api/permission-management/{everything}", "DownstreamPathTemplate": "/api/permission-management/{everything}",
"DownstreamScheme": "http", "DownstreamScheme": "http",
@ -119,7 +125,12 @@
} }
], ],
"UpstreamPathTemplate": "/api/permission-management/{everything}", "UpstreamPathTemplate": "/api/permission-management/{everything}",
"UpstreamHttpMethod": [ "GET", "POST", "PUT", "DELETE" ], "UpstreamHttpMethod": [
"GET",
"POST",
"PUT",
"DELETE"
],
"LoadBalancerOptions": { "LoadBalancerOptions": {
"Type": "RoundRobin" "Type": "RoundRobin"
}, },
@ -128,7 +139,7 @@
"EnableRateLimiting": true, "EnableRateLimiting": true,
"Period": "1s", "Period": "1s",
"PeriodTimespan": 1, "PeriodTimespan": 1,
"Limit": 5 "Limit": 100
}, },
"QoSOptions": { "QoSOptions": {
"ExceptionsAllowedBeforeBreaking": 10, "ExceptionsAllowedBeforeBreaking": 10,
@ -139,7 +150,6 @@
"UseTracing": true "UseTracing": true
} }
}, },
//
{ {
"DownstreamPathTemplate": "/api/setting-management/settings/by-current-tenant", "DownstreamPathTemplate": "/api/setting-management/settings/by-current-tenant",
"DownstreamScheme": "http", "DownstreamScheme": "http",
@ -150,7 +160,9 @@
} }
], ],
"UpstreamPathTemplate": "/api/setting-management/settings/by-current-tenant/app", "UpstreamPathTemplate": "/api/setting-management/settings/by-current-tenant/app",
"UpstreamHttpMethod": [ "GET" ], "UpstreamHttpMethod": [
"GET"
],
"LoadBalancerOptions": { "LoadBalancerOptions": {
"Type": "RoundRobin" "Type": "RoundRobin"
}, },
@ -159,7 +171,7 @@
"EnableRateLimiting": true, "EnableRateLimiting": true,
"Period": "1s", "Period": "1s",
"PeriodTimespan": 1, "PeriodTimespan": 1,
"Limit": 5 "Limit": 100
}, },
"QoSOptions": { "QoSOptions": {
"ExceptionsAllowedBeforeBreaking": 10, "ExceptionsAllowedBeforeBreaking": 10,
@ -171,7 +183,39 @@
}, },
"Key": "setting-current-tenant" "Key": "setting-current-tenant"
}, },
// ȫ {
"DownstreamPathTemplate": "/api/setting-management/settings/by-current-user",
"DownstreamScheme": "http",
"DownstreamHostAndPorts": [
{
"Host": "127.0.0.1",
"Port": 30010
}
],
"UpstreamPathTemplate": "/api/setting-management/settings/by-current-user/app",
"UpstreamHttpMethod": [
"GET"
],
"LoadBalancerOptions": {
"Type": "RoundRobin"
},
"RateLimitOptions": {
"ClientWhitelist": [],
"EnableRateLimiting": true,
"Period": "1s",
"PeriodTimespan": 1,
"Limit": 100
},
"QoSOptions": {
"ExceptionsAllowedBeforeBreaking": 10,
"DurationOfBreak": 1000,
"TimeoutValue": 10000
},
"HttpHandlerOptions": {
"UseTracing": true
},
"Key": "setting-current-user"
},
{ {
"DownstreamPathTemplate": "/api/setting-management/settings/by-global", "DownstreamPathTemplate": "/api/setting-management/settings/by-global",
"DownstreamScheme": "http", "DownstreamScheme": "http",
@ -182,7 +226,9 @@
} }
], ],
"UpstreamPathTemplate": "/api/setting-management/settings/by-global/app", "UpstreamPathTemplate": "/api/setting-management/settings/by-global/app",
"UpstreamHttpMethod": [ "GET" ], "UpstreamHttpMethod": [
"GET"
],
"LoadBalancerOptions": { "LoadBalancerOptions": {
"Type": "RoundRobin" "Type": "RoundRobin"
}, },
@ -191,7 +237,7 @@
"EnableRateLimiting": true, "EnableRateLimiting": true,
"Period": "1s", "Period": "1s",
"PeriodTimespan": 1, "PeriodTimespan": 1,
"Limit": 5 "Limit": 100
}, },
"QoSOptions": { "QoSOptions": {
"ExceptionsAllowedBeforeBreaking": 10, "ExceptionsAllowedBeforeBreaking": 10,
@ -203,7 +249,6 @@
}, },
"Key": "setting-global" "Key": "setting-global"
}, },
// ΢
{ {
"DownstreamPathTemplate": "/api/setting-management/wechat/by-current-tenant", "DownstreamPathTemplate": "/api/setting-management/wechat/by-current-tenant",
"DownstreamScheme": "http", "DownstreamScheme": "http",
@ -214,7 +259,9 @@
} }
], ],
"UpstreamPathTemplate": "/api/setting-management/wechat/by-current-tenant", "UpstreamPathTemplate": "/api/setting-management/wechat/by-current-tenant",
"UpstreamHttpMethod": [ "GET" ], "UpstreamHttpMethod": [
"GET"
],
"LoadBalancerOptions": { "LoadBalancerOptions": {
"Type": "RoundRobin" "Type": "RoundRobin"
}, },
@ -223,7 +270,7 @@
"EnableRateLimiting": true, "EnableRateLimiting": true,
"Period": "1s", "Period": "1s",
"PeriodTimespan": 1, "PeriodTimespan": 1,
"Limit": 5 "Limit": 100
}, },
"QoSOptions": { "QoSOptions": {
"ExceptionsAllowedBeforeBreaking": 10, "ExceptionsAllowedBeforeBreaking": 10,
@ -235,7 +282,6 @@
}, },
"Key": "wechat-setting-current-tenant" "Key": "wechat-setting-current-tenant"
}, },
// ΢ȫ
{ {
"DownstreamPathTemplate": "/api/setting-management/wechat/by-global", "DownstreamPathTemplate": "/api/setting-management/wechat/by-global",
"DownstreamScheme": "http", "DownstreamScheme": "http",
@ -246,7 +292,9 @@
} }
], ],
"UpstreamPathTemplate": "/api/setting-management/wechat/by-global", "UpstreamPathTemplate": "/api/setting-management/wechat/by-global",
"UpstreamHttpMethod": [ "GET" ], "UpstreamHttpMethod": [
"GET"
],
"LoadBalancerOptions": { "LoadBalancerOptions": {
"Type": "RoundRobin" "Type": "RoundRobin"
}, },
@ -255,7 +303,7 @@
"EnableRateLimiting": true, "EnableRateLimiting": true,
"Period": "1s", "Period": "1s",
"PeriodTimespan": 1, "PeriodTimespan": 1,
"Limit": 5 "Limit": 100
}, },
"QoSOptions": { "QoSOptions": {
"ExceptionsAllowedBeforeBreaking": 10, "ExceptionsAllowedBeforeBreaking": 10,
@ -267,7 +315,72 @@
}, },
"Key": "wechat-setting-global" "Key": "wechat-setting-global"
}, },
// {
"DownstreamPathTemplate": "/api/setting-management/tencent-cloud/by-current-tenant",
"DownstreamScheme": "http",
"DownstreamHostAndPorts": [
{
"Host": "127.0.0.1",
"Port": 30010
}
],
"UpstreamPathTemplate": "/api/setting-management/tencent-cloud/by-current-tenant",
"UpstreamHttpMethod": [
"GET"
],
"LoadBalancerOptions": {
"Type": "RoundRobin"
},
"RateLimitOptions": {
"ClientWhitelist": [],
"EnableRateLimiting": true,
"Period": "1s",
"PeriodTimespan": 1,
"Limit": 100
},
"QoSOptions": {
"ExceptionsAllowedBeforeBreaking": 10,
"DurationOfBreak": 1000,
"TimeoutValue": 10000
},
"HttpHandlerOptions": {
"UseTracing": true
},
"Key": "tencent-cloud-setting-current-tenant"
},
{
"DownstreamPathTemplate": "/api/setting-management/tencent-cloud/by-global",
"DownstreamScheme": "http",
"DownstreamHostAndPorts": [
{
"Host": "127.0.0.1",
"Port": 30010
}
],
"UpstreamPathTemplate": "/api/setting-management/tencent-cloud/by-global",
"UpstreamHttpMethod": [
"GET"
],
"LoadBalancerOptions": {
"Type": "RoundRobin"
},
"RateLimitOptions": {
"ClientWhitelist": [],
"EnableRateLimiting": true,
"Period": "1s",
"PeriodTimespan": 1,
"Limit": 100
},
"QoSOptions": {
"ExceptionsAllowedBeforeBreaking": 10,
"DurationOfBreak": 1000,
"TimeoutValue": 10000
},
"HttpHandlerOptions": {
"UseTracing": true
},
"Key": "tencent-cloud-setting-global"
},
{ {
"DownstreamPathTemplate": "/api/setting-management/aliyun/by-current-tenant", "DownstreamPathTemplate": "/api/setting-management/aliyun/by-current-tenant",
"DownstreamScheme": "http", "DownstreamScheme": "http",
@ -278,7 +391,9 @@
} }
], ],
"UpstreamPathTemplate": "/api/setting-management/aliyun/by-current-tenant", "UpstreamPathTemplate": "/api/setting-management/aliyun/by-current-tenant",
"UpstreamHttpMethod": [ "GET" ], "UpstreamHttpMethod": [
"GET"
],
"LoadBalancerOptions": { "LoadBalancerOptions": {
"Type": "RoundRobin" "Type": "RoundRobin"
}, },
@ -287,7 +402,7 @@
"EnableRateLimiting": true, "EnableRateLimiting": true,
"Period": "1s", "Period": "1s",
"PeriodTimespan": 1, "PeriodTimespan": 1,
"Limit": 5 "Limit": 100
}, },
"QoSOptions": { "QoSOptions": {
"ExceptionsAllowedBeforeBreaking": 10, "ExceptionsAllowedBeforeBreaking": 10,
@ -299,7 +414,6 @@
}, },
"Key": "aliyun-setting-current-tenant" "Key": "aliyun-setting-current-tenant"
}, },
// ȫ
{ {
"DownstreamPathTemplate": "/api/setting-management/aliyun/by-global", "DownstreamPathTemplate": "/api/setting-management/aliyun/by-global",
"DownstreamScheme": "http", "DownstreamScheme": "http",
@ -310,7 +424,9 @@
} }
], ],
"UpstreamPathTemplate": "/api/setting-management/aliyun/by-global", "UpstreamPathTemplate": "/api/setting-management/aliyun/by-global",
"UpstreamHttpMethod": [ "GET" ], "UpstreamHttpMethod": [
"GET"
],
"LoadBalancerOptions": { "LoadBalancerOptions": {
"Type": "RoundRobin" "Type": "RoundRobin"
}, },
@ -319,7 +435,7 @@
"EnableRateLimiting": true, "EnableRateLimiting": true,
"Period": "1s", "Period": "1s",
"PeriodTimespan": 1, "PeriodTimespan": 1,
"Limit": 5 "Limit": 100
}, },
"QoSOptions": { "QoSOptions": {
"ExceptionsAllowedBeforeBreaking": 10, "ExceptionsAllowedBeforeBreaking": 10,
@ -331,7 +447,102 @@
}, },
"Key": "aliyun-setting-global" "Key": "aliyun-setting-global"
}, },
// ù {
"DownstreamPathTemplate": "/api/setting-management/settings/change-global",
"DownstreamScheme": "http",
"DownstreamHostAndPorts": [
{
"Host": "127.0.0.1",
"Port": 30010
}
],
"UpstreamPathTemplate": "/api/setting-management/settings/change-global",
"UpstreamHttpMethod": [
"PUT"
],
"LoadBalancerOptions": {
"Type": "RoundRobin"
},
"RateLimitOptions": {
"ClientWhitelist": [],
"EnableRateLimiting": true,
"Period": "1s",
"PeriodTimespan": 1,
"Limit": 100
},
"QoSOptions": {
"ExceptionsAllowedBeforeBreaking": 10,
"DurationOfBreak": 1000,
"TimeoutValue": 10000
},
"HttpHandlerOptions": {
"UseTracing": true
}
},
{
"DownstreamPathTemplate": "/api/setting-management/settings/change-current-tenant",
"DownstreamScheme": "http",
"DownstreamHostAndPorts": [
{
"Host": "127.0.0.1",
"Port": 30010
}
],
"UpstreamPathTemplate": "/api/setting-management/settings/change-current-tenant",
"UpstreamHttpMethod": [
"PUT"
],
"LoadBalancerOptions": {
"Type": "RoundRobin"
},
"RateLimitOptions": {
"ClientWhitelist": [],
"EnableRateLimiting": true,
"Period": "1s",
"PeriodTimespan": 1,
"Limit": 100
},
"QoSOptions": {
"ExceptionsAllowedBeforeBreaking": 10,
"DurationOfBreak": 1000,
"TimeoutValue": 10000
},
"HttpHandlerOptions": {
"UseTracing": true
}
},
{
"DownstreamPathTemplate": "/api/setting-management/settings/change-current-user",
"DownstreamScheme": "http",
"DownstreamHostAndPorts": [
{
"Host": "127.0.0.1",
"Port": 30010
}
],
"UpstreamPathTemplate": "/api/setting-management/settings/change-current-user",
"UpstreamHttpMethod": [
"PUT"
],
"LoadBalancerOptions": {
"Type": "RoundRobin"
},
"RateLimitOptions": {
"ClientWhitelist": [],
"EnableRateLimiting": true,
"Period": "1s",
"PeriodTimespan": 1,
"Limit": 100
},
"QoSOptions": {
"ExceptionsAllowedBeforeBreaking": 10,
"DurationOfBreak": 1000,
"TimeoutValue": 10000
},
"HttpHandlerOptions": {
"UseTracing": true
}
},
{ {
"DownstreamPathTemplate": "/api/setting-management/{everything}", "DownstreamPathTemplate": "/api/setting-management/{everything}",
"DownstreamScheme": "http", "DownstreamScheme": "http",
@ -342,7 +553,12 @@
} }
], ],
"UpstreamPathTemplate": "/api/setting-management/{everything}", "UpstreamPathTemplate": "/api/setting-management/{everything}",
"UpstreamHttpMethod": [ "GET", "POST", "PUT", "DELETE" ], "UpstreamHttpMethod": [
"GET",
"POST",
"PUT",
"DELETE"
],
"LoadBalancerOptions": { "LoadBalancerOptions": {
"Type": "RoundRobin" "Type": "RoundRobin"
}, },
@ -362,7 +578,6 @@
"UseTracing": true "UseTracing": true
} }
}, },
// Թ
{ {
"DownstreamPathTemplate": "/api/feature-management/{everything}", "DownstreamPathTemplate": "/api/feature-management/{everything}",
"DownstreamScheme": "http", "DownstreamScheme": "http",
@ -373,7 +588,12 @@
} }
], ],
"UpstreamPathTemplate": "/api/feature-management/{everything}", "UpstreamPathTemplate": "/api/feature-management/{everything}",
"UpstreamHttpMethod": [ "GET", "POST", "PUT", "DELETE" ], "UpstreamHttpMethod": [
"GET",
"POST",
"PUT",
"DELETE"
],
"LoadBalancerOptions": { "LoadBalancerOptions": {
"Type": "RoundRobin" "Type": "RoundRobin"
}, },
@ -382,7 +602,42 @@
"EnableRateLimiting": true, "EnableRateLimiting": true,
"Period": "1s", "Period": "1s",
"PeriodTimespan": 1, "PeriodTimespan": 1,
"Limit": 5 "Limit": 100
},
"QoSOptions": {
"ExceptionsAllowedBeforeBreaking": 10,
"DurationOfBreak": 1000,
"TimeoutValue": 10000
},
"HttpHandlerOptions": {
"UseTracing": true
}
},
{
"DownstreamPathTemplate": "/api/saas/{everything}",
"DownstreamScheme": "http",
"DownstreamHostAndPorts": [
{
"Host": "127.0.0.1",
"Port": 30010
}
],
"UpstreamPathTemplate": "/api/saas/{everything}",
"UpstreamHttpMethod": [
"GET",
"POST",
"PUT",
"DELETE"
],
"LoadBalancerOptions": {
"Type": "RoundRobin"
},
"RateLimitOptions": {
"ClientWhitelist": [],
"EnableRateLimiting": true,
"Period": "1s",
"PeriodTimespan": 1,
"Limit": 100
}, },
"QoSOptions": { "QoSOptions": {
"ExceptionsAllowedBeforeBreaking": 10, "ExceptionsAllowedBeforeBreaking": 10,
@ -393,7 +648,6 @@
"UseTracing": true "UseTracing": true
} }
}, },
// ־
{ {
"DownstreamPathTemplate": "/api/auditing/{everything}", "DownstreamPathTemplate": "/api/auditing/{everything}",
"DownstreamScheme": "http", "DownstreamScheme": "http",
@ -404,7 +658,12 @@
} }
], ],
"UpstreamPathTemplate": "/api/auditing/{everything}", "UpstreamPathTemplate": "/api/auditing/{everything}",
"UpstreamHttpMethod": [ "GET", "POST", "PUT", "DELETE" ], "UpstreamHttpMethod": [
"GET",
"POST",
"PUT",
"DELETE"
],
"LoadBalancerOptions": { "LoadBalancerOptions": {
"Type": "RoundRobin" "Type": "RoundRobin"
}, },
@ -413,7 +672,97 @@
"EnableRateLimiting": true, "EnableRateLimiting": true,
"Period": "1s", "Period": "1s",
"PeriodTimespan": 1, "PeriodTimespan": 1,
"Limit": 5 "Limit": 100
},
"QoSOptions": {
"ExceptionsAllowedBeforeBreaking": 10,
"DurationOfBreak": 1000,
"TimeoutValue": 10000
},
"HttpHandlerOptions": {
"UseTracing": true
}
},
{
"DownstreamPathTemplate": "/api/text-templating/{everything}",
"DownstreamScheme": "http",
"DownstreamHostAndPorts": [
{
"Host": "127.0.0.1",
"Port": 30010
}
],
"UpstreamPathTemplate": "/api/text-templating/{everything}",
"UpstreamHttpMethod": [
"GET",
"POST",
"PUT",
"DELETE"
],
"LoadBalancerOptions": {
"Type": "RoundRobin"
},
"RateLimitOptions": {},
"QoSOptions": {
"ExceptionsAllowedBeforeBreaking": 10,
"DurationOfBreak": 1000,
"TimeoutValue": 30000
},
"HttpHandlerOptions": {
"UseTracing": true
}
},
{
"DownstreamPathTemplate": "/api/caching-management/{everything}",
"DownstreamScheme": "http",
"DownstreamHostAndPorts": [
{
"Host": "127.0.0.1",
"Port": 30010
}
],
"UpstreamPathTemplate": "/api/caching-management/{everything}",
"UpstreamHttpMethod": [
"GET",
"POST",
"PUT",
"DELETE"
],
"LoadBalancerOptions": {
"Type": "RoundRobin"
},
"RateLimitOptions": {},
"QoSOptions": {
"ExceptionsAllowedBeforeBreaking": 10,
"DurationOfBreak": 1000,
"TimeoutValue": 30000
},
"HttpHandlerOptions": {
"UseTracing": true
}
},
{
"DownstreamPathTemplate": "/api/abp/localization/{everything}",
"DownstreamScheme": "http",
"DownstreamHostAndPorts": [
{
"Host": "127.0.0.1",
"Port": 30010
}
],
"UpstreamPathTemplate": "/api/abp/localization/{everything}",
"UpstreamHttpMethod": [
"GET"
],
"LoadBalancerOptions": {
"Type": "RoundRobin"
},
"RateLimitOptions": {
"ClientWhitelist": [],
"EnableRateLimiting": true,
"Period": "1s",
"PeriodTimespan": 1,
"Limit": 100
}, },
"QoSOptions": { "QoSOptions": {
"ExceptionsAllowedBeforeBreaking": 10, "ExceptionsAllowedBeforeBreaking": 10,
@ -424,7 +773,6 @@
"UseTracing": true "UseTracing": true
} }
}, },
// API ĵ
{ {
"DownstreamPathTemplate": "/swagger/v1/swagger.json", "DownstreamPathTemplate": "/swagger/v1/swagger.json",
"DownstreamScheme": "http", "DownstreamScheme": "http",
@ -435,7 +783,9 @@
} }
], ],
"UpstreamPathTemplate": "/admin/v1/swagger.json", "UpstreamPathTemplate": "/admin/v1/swagger.json",
"UpstreamHttpMethod": [ "GET" ], "UpstreamHttpMethod": [
"GET"
],
"LoadBalancerOptions": { "LoadBalancerOptions": {
"Type": "RoundRobin" "Type": "RoundRobin"
}, },
@ -444,7 +794,7 @@
"EnableRateLimiting": true, "EnableRateLimiting": true,
"Period": "1s", "Period": "1s",
"PeriodTimespan": 1, "PeriodTimespan": 1,
"Limit": 5 "Limit": 100
}, },
"QoSOptions": { "QoSOptions": {
"ExceptionsAllowedBeforeBreaking": 10, "ExceptionsAllowedBeforeBreaking": 10,

0
gateways/internal/LINGYUN.MicroService.Internal.ApiGateway/src/LINGYUN.MicroService.Internal.ApiGateway/ocelot.global.json → gateways/internal/LINGYUN.MicroService.Internal.ApiGateway/src/LINGYUN.MicroService.Internal.ApiGateway/OcelotConfig/ocelot.global.json

107
gateways/internal/LINGYUN.MicroService.Internal.ApiGateway/src/LINGYUN.MicroService.Internal.ApiGateway/ocelot.idsadmin.json → gateways/internal/LINGYUN.MicroService.Internal.ApiGateway/src/LINGYUN.MicroService.Internal.ApiGateway/OcelotConfig/ocelot.idsadmin.json

@ -1,6 +1,6 @@
{ {
"Routes": [ "Routes": [
// //
{ {
"DownstreamPathTemplate": "/api/abp/application-configuration", "DownstreamPathTemplate": "/api/abp/application-configuration",
"DownstreamScheme": "http", "DownstreamScheme": "http",
@ -11,7 +11,9 @@
} }
], ],
"UpstreamPathTemplate": "/api/abp/ids-admin/application-configuration", "UpstreamPathTemplate": "/api/abp/ids-admin/application-configuration",
"UpstreamHttpMethod": [ "GET" ], "UpstreamHttpMethod": [
"GET"
],
"LoadBalancerOptions": { "LoadBalancerOptions": {
"Type": "RoundRobin" "Type": "RoundRobin"
}, },
@ -26,7 +28,7 @@
}, },
"Key": "ids-admin-configuration" "Key": "ids-admin-configuration"
}, },
// API // API
{ {
"DownstreamPathTemplate": "/api/abp/api-definition", "DownstreamPathTemplate": "/api/abp/api-definition",
"DownstreamScheme": "http", "DownstreamScheme": "http",
@ -37,7 +39,9 @@
} }
], ],
"UpstreamPathTemplate": "/api/abp/ids-admin/api-definition", "UpstreamPathTemplate": "/api/abp/ids-admin/api-definition",
"UpstreamHttpMethod": [ "GET" ], "UpstreamHttpMethod": [
"GET"
],
"LoadBalancerOptions": { "LoadBalancerOptions": {
"Type": "RoundRobin" "Type": "RoundRobin"
}, },
@ -52,7 +56,7 @@
}, },
"Key": "ids-admin-api-definition" "Key": "ids-admin-api-definition"
}, },
// //
{ {
"DownstreamPathTemplate": "/api/identity/{everything}", "DownstreamPathTemplate": "/api/identity/{everything}",
"DownstreamScheme": "http", "DownstreamScheme": "http",
@ -63,7 +67,12 @@
} }
], ],
"UpstreamPathTemplate": "/api/identity/{everything}", "UpstreamPathTemplate": "/api/identity/{everything}",
"UpstreamHttpMethod": [ "GET", "POST", "PUT", "DELETE" ], "UpstreamHttpMethod": [
"GET",
"POST",
"PUT",
"DELETE"
],
"LoadBalancerOptions": { "LoadBalancerOptions": {
"Type": "RoundRobin" "Type": "RoundRobin"
}, },
@ -72,7 +81,7 @@
"EnableRateLimiting": true, "EnableRateLimiting": true,
"Period": "1s", "Period": "1s",
"PeriodTimespan": 1, "PeriodTimespan": 1,
"Limit": 5 "Limit": 100
}, },
"QoSOptions": { "QoSOptions": {
"ExceptionsAllowedBeforeBreaking": 10, "ExceptionsAllowedBeforeBreaking": 10,
@ -83,7 +92,7 @@
"UseTracing": true "UseTracing": true
} }
}, },
// //
{ {
"DownstreamPathTemplate": "/api/identity-server/{everything}", "DownstreamPathTemplate": "/api/identity-server/{everything}",
"DownstreamScheme": "http", "DownstreamScheme": "http",
@ -94,7 +103,12 @@
} }
], ],
"UpstreamPathTemplate": "/api/identity-server/{everything}", "UpstreamPathTemplate": "/api/identity-server/{everything}",
"UpstreamHttpMethod": [ "GET", "POST", "PUT", "DELETE" ], "UpstreamHttpMethod": [
"GET",
"POST",
"PUT",
"DELETE"
],
"LoadBalancerOptions": { "LoadBalancerOptions": {
"Type": "RoundRobin" "Type": "RoundRobin"
}, },
@ -103,7 +117,7 @@
"EnableRateLimiting": true, "EnableRateLimiting": true,
"Period": "1s", "Period": "1s",
"PeriodTimespan": 1, "PeriodTimespan": 1,
"Limit": 5 "Limit": 100
}, },
"QoSOptions": { "QoSOptions": {
"ExceptionsAllowedBeforeBreaking": 10, "ExceptionsAllowedBeforeBreaking": 10,
@ -114,7 +128,7 @@
"UseTracing": true "UseTracing": true
} }
}, },
// //
{ {
"DownstreamPathTemplate": "/api/account/{everything}", "DownstreamPathTemplate": "/api/account/{everything}",
"DownstreamScheme": "http", "DownstreamScheme": "http",
@ -125,7 +139,12 @@
} }
], ],
"UpstreamPathTemplate": "/api/account/{everything}", "UpstreamPathTemplate": "/api/account/{everything}",
"UpstreamHttpMethod": [ "GET", "POST", "PUT", "DELETE" ], "UpstreamHttpMethod": [
"GET",
"POST",
"PUT",
"DELETE"
],
"LoadBalancerOptions": { "LoadBalancerOptions": {
"Type": "RoundRobin" "Type": "RoundRobin"
}, },
@ -134,8 +153,62 @@
"EnableRateLimiting": true, "EnableRateLimiting": true,
"Period": "1s", "Period": "1s",
"PeriodTimespan": 1, "PeriodTimespan": 1,
"Limit": 5 "Limit": 100
},
"QoSOptions": {
"ExceptionsAllowedBeforeBreaking": 10,
"DurationOfBreak": 1000,
"TimeoutValue": 10000
},
"HttpHandlerOptions": {
"UseTracing": true
}
},
//
{
"DownstreamPathTemplate": "/.well-known/openid-configuration",
"DownstreamScheme": "http",
"DownstreamHostAndPorts": [
{
"Host": "127.0.0.1",
"Port": 44385
}
],
"UpstreamPathTemplate": "/.well-known/openid-configuration",
"UpstreamHttpMethod": [
"GET"
],
"LoadBalancerOptions": {
"Type": "RoundRobin"
},
"RateLimitOptions": {},
"QoSOptions": {
"ExceptionsAllowedBeforeBreaking": 10,
"DurationOfBreak": 1000,
"TimeoutValue": 10000
},
"HttpHandlerOptions": {
"UseTracing": true
}
},
{
"DownstreamPathTemplate": "/connect/{everything}",
"DownstreamScheme": "http",
"DownstreamHostAndPorts": [
{
"Host": "127.0.0.1",
"Port": 44385
}
],
"UpstreamPathTemplate": "/connect/{everything}",
"UpstreamHttpMethod": [
"GET",
"POST"
],
"LoadBalancerOptions": {
"Type": "RoundRobin"
}, },
"RateLimitOptions": {},
"QoSOptions": { "QoSOptions": {
"ExceptionsAllowedBeforeBreaking": 10, "ExceptionsAllowedBeforeBreaking": 10,
"DurationOfBreak": 1000, "DurationOfBreak": 1000,
@ -145,7 +218,7 @@
"UseTracing": true "UseTracing": true
} }
}, },
// API // API
{ {
"DownstreamPathTemplate": "/swagger/v1/swagger.json", "DownstreamPathTemplate": "/swagger/v1/swagger.json",
"DownstreamScheme": "http", "DownstreamScheme": "http",
@ -156,7 +229,9 @@
} }
], ],
"UpstreamPathTemplate": "/ids-admin/v1/swagger.json", "UpstreamPathTemplate": "/ids-admin/v1/swagger.json",
"UpstreamHttpMethod": [ "GET" ], "UpstreamHttpMethod": [
"GET"
],
"LoadBalancerOptions": { "LoadBalancerOptions": {
"Type": "RoundRobin" "Type": "RoundRobin"
}, },
@ -165,7 +240,7 @@
"EnableRateLimiting": true, "EnableRateLimiting": true,
"Period": "1s", "Period": "1s",
"PeriodTimespan": 1, "PeriodTimespan": 1,
"Limit": 5 "Limit": 100
}, },
"QoSOptions": { "QoSOptions": {
"ExceptionsAllowedBeforeBreaking": 10, "ExceptionsAllowedBeforeBreaking": 10,

31
gateways/internal/LINGYUN.MicroService.Internal.ApiGateway/src/LINGYUN.MicroService.Internal.ApiGateway/ocelot.localization.json → gateways/internal/LINGYUN.MicroService.Internal.ApiGateway/src/LINGYUN.MicroService.Internal.ApiGateway/OcelotConfig/ocelot.localization.json

@ -1,6 +1,6 @@
{ {
"Routes": [ "Routes": [
// //
{ {
"DownstreamPathTemplate": "/api/abp/application-configuration", "DownstreamPathTemplate": "/api/abp/application-configuration",
"DownstreamScheme": "http", "DownstreamScheme": "http",
@ -11,7 +11,9 @@
} }
], ],
"UpstreamPathTemplate": "/api/abp/localization/application-configuration", "UpstreamPathTemplate": "/api/abp/localization/application-configuration",
"UpstreamHttpMethod": [ "GET" ], "UpstreamHttpMethod": [
"GET"
],
"LoadBalancerOptions": { "LoadBalancerOptions": {
"Type": "RoundRobin" "Type": "RoundRobin"
}, },
@ -26,7 +28,7 @@
}, },
"Key": "localization-configuration" "Key": "localization-configuration"
}, },
// API // API
{ {
"DownstreamPathTemplate": "/api/abp/api-definition", "DownstreamPathTemplate": "/api/abp/api-definition",
"DownstreamScheme": "http", "DownstreamScheme": "http",
@ -37,7 +39,9 @@
} }
], ],
"UpstreamPathTemplate": "/api/abp/localization/api-definition", "UpstreamPathTemplate": "/api/abp/localization/api-definition",
"UpstreamHttpMethod": [ "GET" ], "UpstreamHttpMethod": [
"GET"
],
"LoadBalancerOptions": { "LoadBalancerOptions": {
"Type": "RoundRobin" "Type": "RoundRobin"
}, },
@ -52,7 +56,7 @@
}, },
"Key": "localization-api-definition" "Key": "localization-api-definition"
}, },
// //
{ {
"DownstreamPathTemplate": "/api/localization/{everything}", "DownstreamPathTemplate": "/api/localization/{everything}",
"DownstreamScheme": "http", "DownstreamScheme": "http",
@ -63,7 +67,12 @@
} }
], ],
"UpstreamPathTemplate": "/api/localization/{everything}", "UpstreamPathTemplate": "/api/localization/{everything}",
"UpstreamHttpMethod": [ "GET", "POST", "PUT", "DELETE" ], "UpstreamHttpMethod": [
"GET",
"POST",
"PUT",
"DELETE"
],
"LoadBalancerOptions": { "LoadBalancerOptions": {
"Type": "RoundRobin" "Type": "RoundRobin"
}, },
@ -72,7 +81,7 @@
"EnableRateLimiting": true, "EnableRateLimiting": true,
"Period": "1s", "Period": "1s",
"PeriodTimespan": 1, "PeriodTimespan": 1,
"Limit": 5 "Limit": 100
}, },
"QoSOptions": { "QoSOptions": {
"ExceptionsAllowedBeforeBreaking": 10, "ExceptionsAllowedBeforeBreaking": 10,
@ -83,7 +92,7 @@
"UseTracing": true "UseTracing": true
} }
}, },
// API // API
{ {
"DownstreamPathTemplate": "/swagger/v1/swagger.json", "DownstreamPathTemplate": "/swagger/v1/swagger.json",
"DownstreamScheme": "http", "DownstreamScheme": "http",
@ -94,7 +103,9 @@
} }
], ],
"UpstreamPathTemplate": "/localization/v1/swagger.json", "UpstreamPathTemplate": "/localization/v1/swagger.json",
"UpstreamHttpMethod": [ "GET" ], "UpstreamHttpMethod": [
"GET"
],
"LoadBalancerOptions": { "LoadBalancerOptions": {
"Type": "RoundRobin" "Type": "RoundRobin"
}, },
@ -103,7 +114,7 @@
"EnableRateLimiting": true, "EnableRateLimiting": true,
"Period": "1s", "Period": "1s",
"PeriodTimespan": 1, "PeriodTimespan": 1,
"Limit": 5 "Limit": 100
}, },
"QoSOptions": { "QoSOptions": {
"ExceptionsAllowedBeforeBreaking": 10, "ExceptionsAllowedBeforeBreaking": 10,

226
gateways/internal/LINGYUN.MicroService.Internal.ApiGateway/src/LINGYUN.MicroService.Internal.ApiGateway/ocelot.messages.json → gateways/internal/LINGYUN.MicroService.Internal.ApiGateway/src/LINGYUN.MicroService.Internal.ApiGateway/OcelotConfig/ocelot.messages.json

@ -1,6 +1,6 @@
{ {
"Routes": [ "Routes": [
// ܶ˵ //
{ {
"DownstreamPathTemplate": "/api/abp/application-configuration", "DownstreamPathTemplate": "/api/abp/application-configuration",
"DownstreamScheme": "http", "DownstreamScheme": "http",
@ -11,7 +11,9 @@
} }
], ],
"UpstreamPathTemplate": "/api/abp/messages/application-configuration", "UpstreamPathTemplate": "/api/abp/messages/application-configuration",
"UpstreamHttpMethod": [ "GET" ], "UpstreamHttpMethod": [
"GET"
],
"LoadBalancerOptions": { "LoadBalancerOptions": {
"Type": "RoundRobin" "Type": "RoundRobin"
}, },
@ -26,7 +28,7 @@
}, },
"Key": "messages-configuration" "Key": "messages-configuration"
}, },
// ̬ܶAPI˵ // API
{ {
"DownstreamPathTemplate": "/api/abp/api-definition", "DownstreamPathTemplate": "/api/abp/api-definition",
"DownstreamScheme": "http", "DownstreamScheme": "http",
@ -37,7 +39,9 @@
} }
], ],
"UpstreamPathTemplate": "/api/abp/messages/api-definition", "UpstreamPathTemplate": "/api/abp/messages/api-definition",
"UpstreamHttpMethod": [ "GET" ], "UpstreamHttpMethod": [
"GET"
],
"LoadBalancerOptions": { "LoadBalancerOptions": {
"Type": "RoundRobin" "Type": "RoundRobin"
}, },
@ -52,7 +56,7 @@
}, },
"Key": "messages-api-definition" "Key": "messages-api-definition"
}, },
// ʱͨѶ //
{ {
"DownstreamPathTemplate": "/api/im/{everything}", "DownstreamPathTemplate": "/api/im/{everything}",
"DownstreamScheme": "http", "DownstreamScheme": "http",
@ -63,67 +67,6 @@
} }
], ],
"UpstreamPathTemplate": "/api/im/{everything}", "UpstreamPathTemplate": "/api/im/{everything}",
"UpstreamHttpMethod": [ "GET", "POST", "PUT", "DELETE" ],
"LoadBalancerOptions": {
"Type": "RoundRobin"
},
"RateLimitOptions": {
"ClientWhitelist": [],
"EnableRateLimiting": true,
"Period": "1s",
"PeriodTimespan": 1,
"Limit": 5
},
"QoSOptions": {
"ExceptionsAllowedBeforeBreaking": 10,
"DurationOfBreak": 1000,
"TimeoutValue": 10000
},
"HttpHandlerOptions": {
"UseTracing": true
}
},
// Hangfire DZ
{
"DownstreamPathTemplate": "/hangfire/{everything}",
"DownstreamScheme": "http",
"DownstreamHostAndPorts": [
{
"Host": "127.0.0.1",
"Port": 30020
}
],
"UpstreamPathTemplate": "/hangfire/{everything}",
"UpstreamHttpMethod": [ "GET" ],
"LoadBalancerOptions": {
"Type": "RoundRobin"
},
"RateLimitOptions": {
"ClientWhitelist": [],
"EnableRateLimiting": true,
"Period": "1s",
"PeriodTimespan": 1,
"Limit": 5
},
"QoSOptions": {
"ExceptionsAllowedBeforeBreaking": 10,
"DurationOfBreak": 1000,
"TimeoutValue": 10000
},
"HttpHandlerOptions": {
"UseTracing": true
}
},
{
"DownstreamPathTemplate": "/api/my-subscribes",
"DownstreamScheme": "http",
"DownstreamHostAndPorts": [
{
"Host": "127.0.0.1",
"Port": 30020
}
],
"UpstreamPathTemplate": "/api/my-subscribes",
"UpstreamHttpMethod": [ "UpstreamHttpMethod": [
"GET", "GET",
"POST", "POST",
@ -138,39 +81,7 @@
"EnableRateLimiting": true, "EnableRateLimiting": true,
"Period": "1s", "Period": "1s",
"PeriodTimespan": 1, "PeriodTimespan": 1,
"Limit": 5 "Limit": 100
},
"QoSOptions": {
"ExceptionsAllowedBeforeBreaking": 10,
"DurationOfBreak": 1000,
"TimeoutValue": 10000
},
"HttpHandlerOptions": {
"UseTracing": true
},
"Priority": 99
},
// û
{
"DownstreamPathTemplate": "/api/my-subscribes/{everything}",
"DownstreamScheme": "http",
"DownstreamHostAndPorts": [
{
"Host": "127.0.0.1",
"Port": 30020
}
],
"UpstreamPathTemplate": "/api/my-subscribes/{everything}",
"UpstreamHttpMethod": [ "GET", "POST", "PUT", "DELETE" ],
"LoadBalancerOptions": {
"Type": "RoundRobin"
},
"RateLimitOptions": {
"ClientWhitelist": [],
"EnableRateLimiting": true,
"Period": "1s",
"PeriodTimespan": 1,
"Limit": 5
}, },
"QoSOptions": { "QoSOptions": {
"ExceptionsAllowedBeforeBreaking": 10, "ExceptionsAllowedBeforeBreaking": 10,
@ -181,42 +92,9 @@
"UseTracing": true "UseTracing": true
} }
}, },
// ûб // Hangfire
{ {
"DownstreamPathTemplate": "/api/my-subscribes/all", "DownstreamPathTemplate": "/hangfire/{everything}",
"DownstreamScheme": "http",
"DownstreamHostAndPorts": [
{
"Host": "127.0.0.1",
"Port": 30020
}
],
"UpstreamPathTemplate": "/api/my-subscribes/all",
"UpstreamHttpMethod": [ "GET" ],
"LoadBalancerOptions": {
"Type": "RoundRobin"
},
"RateLimitOptions": {
"ClientWhitelist": [],
"EnableRateLimiting": true,
"Period": "1s",
"PeriodTimespan": 1,
"Limit": 5
},
"QoSOptions": {
"ExceptionsAllowedBeforeBreaking": 10,
"DurationOfBreak": 1000,
"TimeoutValue": 10000
},
"HttpHandlerOptions": {
"UseTracing": true
},
"Priority": 99,
"Key": "my-subscribes"
},
// û֪ͨ
{
"DownstreamPathTemplate": "/api/notifications/my-notifilers/assignables",
"DownstreamScheme": "http", "DownstreamScheme": "http",
"DownstreamHostAndPorts": [ "DownstreamHostAndPorts": [
{ {
@ -224,41 +102,10 @@
"Port": 30020 "Port": 30020
} }
], ],
"UpstreamPathTemplate": "/api/notifications/my-notifilers/assignables", "UpstreamPathTemplate": "/hangfire/{everything}",
"UpstreamHttpMethod": [ "GET" ], "UpstreamHttpMethod": [
"LoadBalancerOptions": { "GET"
"Type": "RoundRobin"
},
"RateLimitOptions": {
"ClientWhitelist": [],
"EnableRateLimiting": true,
"Period": "1s",
"PeriodTimespan": 1,
"Limit": 5
},
"QoSOptions": {
"ExceptionsAllowedBeforeBreaking": 10,
"DurationOfBreak": 1000,
"TimeoutValue": 10000
},
"HttpHandlerOptions": {
"UseTracing": true
},
"Priority": 99,
"Key": "assignables-notifilers"
},
// û֪ͨ
{
"DownstreamPathTemplate": "/api/notifications/my-notifilers",
"DownstreamScheme": "http",
"DownstreamHostAndPorts": [
{
"Host": "127.0.0.1",
"Port": 30020
}
], ],
"UpstreamPathTemplate": "/api/notifications/my-notifilers",
"UpstreamHttpMethod": [ "GET" ],
"LoadBalancerOptions": { "LoadBalancerOptions": {
"Type": "RoundRobin" "Type": "RoundRobin"
}, },
@ -267,7 +114,7 @@
"EnableRateLimiting": true, "EnableRateLimiting": true,
"Period": "1s", "Period": "1s",
"PeriodTimespan": 1, "PeriodTimespan": 1,
"Limit": 5 "Limit": 100
}, },
"QoSOptions": { "QoSOptions": {
"ExceptionsAllowedBeforeBreaking": 10, "ExceptionsAllowedBeforeBreaking": 10,
@ -278,8 +125,9 @@
"UseTracing": true "UseTracing": true
} }
}, },
//
{ {
"DownstreamPathTemplate": "/api/notifications/my-notifilers/{id}", "DownstreamPathTemplate": "/api/notifications/{everything}",
"DownstreamScheme": "http", "DownstreamScheme": "http",
"DownstreamHostAndPorts": [ "DownstreamHostAndPorts": [
{ {
@ -287,7 +135,7 @@
"Port": 30020 "Port": 30020
} }
], ],
"UpstreamPathTemplate": "/api/notifications/my-notifilers/{id}", "UpstreamPathTemplate": "/api/notifications/{everything}",
"UpstreamHttpMethod": [ "UpstreamHttpMethod": [
"GET", "GET",
"POST", "POST",
@ -302,7 +150,7 @@
"EnableRateLimiting": true, "EnableRateLimiting": true,
"Period": "1s", "Period": "1s",
"PeriodTimespan": 1, "PeriodTimespan": 1,
"Limit": 5 "Limit": 100
}, },
"QoSOptions": { "QoSOptions": {
"ExceptionsAllowedBeforeBreaking": 10, "ExceptionsAllowedBeforeBreaking": 10,
@ -313,7 +161,7 @@
"UseTracing": true "UseTracing": true
} }
}, },
// API ĵ // Api
{ {
"DownstreamPathTemplate": "/swagger/v1/swagger.json", "DownstreamPathTemplate": "/swagger/v1/swagger.json",
"DownstreamScheme": "http", "DownstreamScheme": "http",
@ -324,7 +172,9 @@
} }
], ],
"UpstreamPathTemplate": "/messages/v1/swagger.json", "UpstreamPathTemplate": "/messages/v1/swagger.json",
"UpstreamHttpMethod": [ "GET" ], "UpstreamHttpMethod": [
"GET"
],
"LoadBalancerOptions": { "LoadBalancerOptions": {
"Type": "RoundRobin" "Type": "RoundRobin"
}, },
@ -333,7 +183,7 @@
"EnableRateLimiting": true, "EnableRateLimiting": true,
"Period": "1s", "Period": "1s",
"PeriodTimespan": 1, "PeriodTimespan": 1,
"Limit": 5 "Limit": 100
}, },
"QoSOptions": { "QoSOptions": {
"ExceptionsAllowedBeforeBreaking": 10, "ExceptionsAllowedBeforeBreaking": 10,
@ -344,7 +194,7 @@
"UseTracing": true "UseTracing": true
} }
}, },
// // signalr
{ {
"DownstreamPathTemplate": "/signalr-hubs/messages", "DownstreamPathTemplate": "/signalr-hubs/messages",
"DownstreamScheme": "ws", "DownstreamScheme": "ws",
@ -355,7 +205,13 @@
} }
], ],
"UpstreamPathTemplate": "/signalr-hubs/messages", "UpstreamPathTemplate": "/signalr-hubs/messages",
"UpstreamHttpMethod": [ "GET", "POST", "PUT", "DELETE", "OPTIONS" ], "UpstreamHttpMethod": [
"GET",
"POST",
"PUT",
"DELETE",
"OPTIONS"
],
"LoadBalancerOptions": { "LoadBalancerOptions": {
"Type": "RoundRobin" "Type": "RoundRobin"
}, },
@ -380,7 +236,13 @@
} }
], ],
"UpstreamPathTemplate": "/signalr-hubs/notifications", "UpstreamPathTemplate": "/signalr-hubs/notifications",
"UpstreamHttpMethod": [ "GET", "POST", "PUT", "DELETE", "OPTIONS" ], "UpstreamHttpMethod": [
"GET",
"POST",
"PUT",
"DELETE",
"OPTIONS"
],
"LoadBalancerOptions": { "LoadBalancerOptions": {
"Type": "RoundRobin" "Type": "RoundRobin"
}, },
@ -405,7 +267,13 @@
} }
], ],
"UpstreamPathTemplate": "/signalr-hubs/{everything}", "UpstreamPathTemplate": "/signalr-hubs/{everything}",
"UpstreamHttpMethod": [ "GET", "POST", "PUT", "DELETE", "OPTIONS" ], "UpstreamHttpMethod": [
"GET",
"POST",
"PUT",
"DELETE",
"OPTIONS"
],
"LoadBalancerOptions": { "LoadBalancerOptions": {
"Type": "RoundRobin" "Type": "RoundRobin"
}, },

99
gateways/internal/LINGYUN.MicroService.Internal.ApiGateway/src/LINGYUN.MicroService.Internal.ApiGateway/ocelot.platform.json → gateways/internal/LINGYUN.MicroService.Internal.ApiGateway/src/LINGYUN.MicroService.Internal.ApiGateway/OcelotConfig/ocelot.platform.json

@ -1,6 +1,6 @@
{ {
"Routes": [ "Routes": [
// ܶ˵ //
{ {
"DownstreamPathTemplate": "/api/abp/application-configuration", "DownstreamPathTemplate": "/api/abp/application-configuration",
"DownstreamScheme": "http", "DownstreamScheme": "http",
@ -11,7 +11,9 @@
} }
], ],
"UpstreamPathTemplate": "/api/abp/platform/application-configuration", "UpstreamPathTemplate": "/api/abp/platform/application-configuration",
"UpstreamHttpMethod": [ "GET" ], "UpstreamHttpMethod": [
"GET"
],
"LoadBalancerOptions": { "LoadBalancerOptions": {
"Type": "RoundRobin" "Type": "RoundRobin"
}, },
@ -26,7 +28,7 @@
}, },
"Key": "platform-configuration" "Key": "platform-configuration"
}, },
// ̬ܶAPI˵ // API
{ {
"DownstreamPathTemplate": "/api/abp/api-definition", "DownstreamPathTemplate": "/api/abp/api-definition",
"DownstreamScheme": "http", "DownstreamScheme": "http",
@ -37,7 +39,9 @@
} }
], ],
"UpstreamPathTemplate": "/api/abp/platform/api-definition", "UpstreamPathTemplate": "/api/abp/platform/api-definition",
"UpstreamHttpMethod": [ "GET" ], "UpstreamHttpMethod": [
"GET"
],
"LoadBalancerOptions": { "LoadBalancerOptions": {
"Type": "RoundRobin" "Type": "RoundRobin"
}, },
@ -52,7 +56,7 @@
}, },
"Key": "platform-api-definition" "Key": "platform-api-definition"
}, },
// // oss
{ {
"DownstreamPathTemplate": "/api/oss-management/{everything}", "DownstreamPathTemplate": "/api/oss-management/{everything}",
"DownstreamScheme": "http", "DownstreamScheme": "http",
@ -63,7 +67,12 @@
} }
], ],
"UpstreamPathTemplate": "/api/oss-management/{everything}", "UpstreamPathTemplate": "/api/oss-management/{everything}",
"UpstreamHttpMethod": [ "GET", "POST", "PUT", "DELETE" ], "UpstreamHttpMethod": [
"GET",
"POST",
"PUT",
"DELETE"
],
"LoadBalancerOptions": { "LoadBalancerOptions": {
"Type": "RoundRobin" "Type": "RoundRobin"
}, },
@ -72,7 +81,7 @@
"EnableRateLimiting": true, "EnableRateLimiting": true,
"Period": "1s", "Period": "1s",
"PeriodTimespan": 1, "PeriodTimespan": 1,
"Limit": 5 "Limit": 100
}, },
"QoSOptions": { "QoSOptions": {
"ExceptionsAllowedBeforeBreaking": 10, "ExceptionsAllowedBeforeBreaking": 10,
@ -83,7 +92,7 @@
"UseTracing": true "UseTracing": true
} }
}, },
// ƽ̨ //
{ {
"DownstreamPathTemplate": "/api/platform/{everything}", "DownstreamPathTemplate": "/api/platform/{everything}",
"DownstreamScheme": "http", "DownstreamScheme": "http",
@ -94,38 +103,12 @@
} }
], ],
"UpstreamPathTemplate": "/api/platform/{everything}", "UpstreamPathTemplate": "/api/platform/{everything}",
"UpstreamHttpMethod": [ "GET", "POST", "PUT", "DELETE" ], "UpstreamHttpMethod": [
"LoadBalancerOptions": { "GET",
"Type": "RoundRobin" "POST",
}, "PUT",
"RateLimitOptions": { "DELETE"
"ClientWhitelist": [],
"EnableRateLimiting": true,
"Period": "1s",
"PeriodTimespan": 1,
"Limit": 5
},
"QoSOptions": {
"ExceptionsAllowedBeforeBreaking": 10,
"DurationOfBreak": 1000,
"TimeoutValue": 10000
},
"HttpHandlerOptions": {
"UseTracing": true
}
},
// ļ
{
"DownstreamPathTemplate": "/api/files/{everything}",
"DownstreamScheme": "http",
"DownstreamHostAndPorts": [
{
"Host": "127.0.0.1",
"Port": 30025
}
], ],
"UpstreamPathTemplate": "/api/files/{everything}",
"UpstreamHttpMethod": [ "GET", "POST", "PUT", "DELETE" ],
"LoadBalancerOptions": { "LoadBalancerOptions": {
"Type": "RoundRobin" "Type": "RoundRobin"
}, },
@ -134,7 +117,7 @@
"EnableRateLimiting": true, "EnableRateLimiting": true,
"Period": "1s", "Period": "1s",
"PeriodTimespan": 1, "PeriodTimespan": 1,
"Limit": 5 "Limit": 100
}, },
"QoSOptions": { "QoSOptions": {
"ExceptionsAllowedBeforeBreaking": 10, "ExceptionsAllowedBeforeBreaking": 10,
@ -145,6 +128,7 @@
"UseTracing": true "UseTracing": true
} }
}, },
//
{ {
"DownstreamPathTemplate": "/api/files/{everything}", "DownstreamPathTemplate": "/api/files/{everything}",
"DownstreamScheme": "http", "DownstreamScheme": "http",
@ -154,7 +138,7 @@
"Port": 30025 "Port": 30025
} }
], ],
"UpstreamPathTemplate": "/api/api/files/{everything}", "UpstreamPathTemplate": "/api/files/{everything}",
"UpstreamHttpMethod": [ "UpstreamHttpMethod": [
"GET", "GET",
"POST", "POST",
@ -169,7 +153,7 @@
"EnableRateLimiting": true, "EnableRateLimiting": true,
"Period": "1s", "Period": "1s",
"PeriodTimespan": 1, "PeriodTimespan": 1,
"Limit": 5 "Limit": 100
}, },
"QoSOptions": { "QoSOptions": {
"ExceptionsAllowedBeforeBreaking": 10, "ExceptionsAllowedBeforeBreaking": 10,
@ -181,15 +165,15 @@
} }
}, },
{ {
"DownstreamPathTemplate": "/api/task-management/{everything}", "DownstreamPathTemplate": "/api/files/{everything}",
"DownstreamScheme": "http", "DownstreamScheme": "http",
"DownstreamHostAndPorts": [ "DownstreamHostAndPorts": [
{ {
"Host": "127.0.0.1", "Host": "127.0.0.1",
"Port": 30040 "Port": 30025
} }
], ],
"UpstreamPathTemplate": "/api/task-management/{everything}", "UpstreamPathTemplate": "/api/api/files/{everything}",
"UpstreamHttpMethod": [ "UpstreamHttpMethod": [
"GET", "GET",
"POST", "POST",
@ -204,7 +188,7 @@
"EnableRateLimiting": true, "EnableRateLimiting": true,
"Period": "1s", "Period": "1s",
"PeriodTimespan": 1, "PeriodTimespan": 1,
"Limit": 5 "Limit": 100
}, },
"QoSOptions": { "QoSOptions": {
"ExceptionsAllowedBeforeBreaking": 10, "ExceptionsAllowedBeforeBreaking": 10,
@ -215,7 +199,7 @@
"UseTracing": true "UseTracing": true
} }
}, },
// // oss
{ {
"DownstreamPathTemplate": "/api/setting-management/oss-management/by-current-tenant", "DownstreamPathTemplate": "/api/setting-management/oss-management/by-current-tenant",
"DownstreamScheme": "http", "DownstreamScheme": "http",
@ -226,7 +210,9 @@
} }
], ],
"UpstreamPathTemplate": "/api/setting-management/oss-management/by-current-tenant", "UpstreamPathTemplate": "/api/setting-management/oss-management/by-current-tenant",
"UpstreamHttpMethod": [ "GET" ], "UpstreamHttpMethod": [
"GET"
],
"LoadBalancerOptions": { "LoadBalancerOptions": {
"Type": "RoundRobin" "Type": "RoundRobin"
}, },
@ -235,7 +221,7 @@
"EnableRateLimiting": true, "EnableRateLimiting": true,
"Period": "1s", "Period": "1s",
"PeriodTimespan": 1, "PeriodTimespan": 1,
"Limit": 5 "Limit": 100
}, },
"QoSOptions": { "QoSOptions": {
"ExceptionsAllowedBeforeBreaking": 10, "ExceptionsAllowedBeforeBreaking": 10,
@ -247,7 +233,6 @@
}, },
"Key": "oss-management-setting-current-tenant" "Key": "oss-management-setting-current-tenant"
}, },
// ȫ
{ {
"DownstreamPathTemplate": "/api/setting-management/oss-management/by-global", "DownstreamPathTemplate": "/api/setting-management/oss-management/by-global",
"DownstreamScheme": "http", "DownstreamScheme": "http",
@ -258,7 +243,9 @@
} }
], ],
"UpstreamPathTemplate": "/api/setting-management/oss-management/by-global", "UpstreamPathTemplate": "/api/setting-management/oss-management/by-global",
"UpstreamHttpMethod": [ "GET" ], "UpstreamHttpMethod": [
"GET"
],
"LoadBalancerOptions": { "LoadBalancerOptions": {
"Type": "RoundRobin" "Type": "RoundRobin"
}, },
@ -267,7 +254,7 @@
"EnableRateLimiting": true, "EnableRateLimiting": true,
"Period": "1s", "Period": "1s",
"PeriodTimespan": 1, "PeriodTimespan": 1,
"Limit": 5 "Limit": 100
}, },
"QoSOptions": { "QoSOptions": {
"ExceptionsAllowedBeforeBreaking": 10, "ExceptionsAllowedBeforeBreaking": 10,
@ -279,7 +266,7 @@
}, },
"Key": "oss-management-setting-global" "Key": "oss-management-setting-global"
}, },
// API ĵ // Api
{ {
"DownstreamPathTemplate": "/swagger/v1/swagger.json", "DownstreamPathTemplate": "/swagger/v1/swagger.json",
"DownstreamScheme": "http", "DownstreamScheme": "http",
@ -290,7 +277,9 @@
} }
], ],
"UpstreamPathTemplate": "/platform/v1/swagger.json", "UpstreamPathTemplate": "/platform/v1/swagger.json",
"UpstreamHttpMethod": [ "GET" ], "UpstreamHttpMethod": [
"GET"
],
"LoadBalancerOptions": { "LoadBalancerOptions": {
"Type": "RoundRobin" "Type": "RoundRobin"
}, },
@ -299,7 +288,7 @@
"EnableRateLimiting": true, "EnableRateLimiting": true,
"Period": "1s", "Period": "1s",
"PeriodTimespan": 1, "PeriodTimespan": 1,
"Limit": 5 "Limit": 100
}, },
"QoSOptions": { "QoSOptions": {
"ExceptionsAllowedBeforeBreaking": 10, "ExceptionsAllowedBeforeBreaking": 10,

23
gateways/internal/LINGYUN.MicroService.Internal.ApiGateway/src/LINGYUN.MicroService.Internal.ApiGateway/ocelot.task.json → gateways/internal/LINGYUN.MicroService.Internal.ApiGateway/src/LINGYUN.MicroService.Internal.ApiGateway/OcelotConfig/ocelot.task.json

@ -1,6 +1,6 @@
{ {
"Routes": [ "Routes": [
// //
{ {
"DownstreamPathTemplate": "/api/abp/application-configuration", "DownstreamPathTemplate": "/api/abp/application-configuration",
"DownstreamScheme": "http", "DownstreamScheme": "http",
@ -11,7 +11,9 @@
} }
], ],
"UpstreamPathTemplate": "/api/abp/task/application-configuration", "UpstreamPathTemplate": "/api/abp/task/application-configuration",
"UpstreamHttpMethod": [ "GET" ], "UpstreamHttpMethod": [
"GET"
],
"LoadBalancerOptions": { "LoadBalancerOptions": {
"Type": "RoundRobin" "Type": "RoundRobin"
}, },
@ -26,7 +28,7 @@
}, },
"Key": "task-configuration" "Key": "task-configuration"
}, },
// API // API
{ {
"DownstreamPathTemplate": "/api/abp/api-definition", "DownstreamPathTemplate": "/api/abp/api-definition",
"DownstreamScheme": "http", "DownstreamScheme": "http",
@ -37,7 +39,9 @@
} }
], ],
"UpstreamPathTemplate": "/api/abp/task/api-definition", "UpstreamPathTemplate": "/api/abp/task/api-definition",
"UpstreamHttpMethod": [ "GET" ], "UpstreamHttpMethod": [
"GET"
],
"LoadBalancerOptions": { "LoadBalancerOptions": {
"Type": "RoundRobin" "Type": "RoundRobin"
}, },
@ -52,7 +56,7 @@
}, },
"Key": "task-api-definition" "Key": "task-api-definition"
}, },
// //
{ {
"DownstreamPathTemplate": "/api/task-management/{everything}", "DownstreamPathTemplate": "/api/task-management/{everything}",
"DownstreamScheme": "http", "DownstreamScheme": "http",
@ -63,7 +67,12 @@
} }
], ],
"UpstreamPathTemplate": "/api/task-management/{everything}", "UpstreamPathTemplate": "/api/task-management/{everything}",
"UpstreamHttpMethod": [ "GET", "POST", "PUT", "DELETE" ], "UpstreamHttpMethod": [
"GET",
"POST",
"PUT",
"DELETE"
],
"LoadBalancerOptions": { "LoadBalancerOptions": {
"Type": "RoundRobin" "Type": "RoundRobin"
}, },
@ -72,7 +81,7 @@
"EnableRateLimiting": true, "EnableRateLimiting": true,
"Period": "1s", "Period": "1s",
"PeriodTimespan": 1, "PeriodTimespan": 1,
"Limit": 5 "Limit": 100
}, },
"QoSOptions": { "QoSOptions": {
"ExceptionsAllowedBeforeBreaking": 10, "ExceptionsAllowedBeforeBreaking": 10,

23
gateways/internal/LINGYUN.MicroService.Internal.ApiGateway/src/LINGYUN.MicroService.Internal.ApiGateway/ocelot.webhook.json → gateways/internal/LINGYUN.MicroService.Internal.ApiGateway/src/LINGYUN.MicroService.Internal.ApiGateway/OcelotConfig/ocelot.webhook.json

@ -1,5 +1,6 @@
{ {
"Routes": [ "Routes": [
// API
{ {
"DownstreamPathTemplate": "/api/abp/api-definition", "DownstreamPathTemplate": "/api/abp/api-definition",
"DownstreamScheme": "http", "DownstreamScheme": "http",
@ -10,7 +11,9 @@
} }
], ],
"UpstreamPathTemplate": "/api/abp/webhook/api-definition", "UpstreamPathTemplate": "/api/abp/webhook/api-definition",
"UpstreamHttpMethod": [ "GET" ], "UpstreamHttpMethod": [
"GET"
],
"LoadBalancerOptions": { "LoadBalancerOptions": {
"Type": "RoundRobin" "Type": "RoundRobin"
}, },
@ -25,6 +28,7 @@
}, },
"Key": "webhook-api-definition" "Key": "webhook-api-definition"
}, },
// webhooks
{ {
"DownstreamPathTemplate": "/api/webhooks/{everything}", "DownstreamPathTemplate": "/api/webhooks/{everything}",
"DownstreamScheme": "http", "DownstreamScheme": "http",
@ -35,21 +39,20 @@
} }
], ],
"UpstreamPathTemplate": "/api/webhooks/{everything}", "UpstreamPathTemplate": "/api/webhooks/{everything}",
"UpstreamHttpMethod": [ "GET", "POST", "PUT", "DELETE" ], "UpstreamHttpMethod": [
"GET",
"POST",
"PUT",
"DELETE"
],
"LoadBalancerOptions": { "LoadBalancerOptions": {
"Type": "RoundRobin" "Type": "RoundRobin"
}, },
"RateLimitOptions": { "RateLimitOptions": {},
"ClientWhitelist": [],
"EnableRateLimiting": true,
"Period": "1s",
"PeriodTimespan": 1,
"Limit": 5
},
"QoSOptions": { "QoSOptions": {
"ExceptionsAllowedBeforeBreaking": 10, "ExceptionsAllowedBeforeBreaking": 10,
"DurationOfBreak": 1000, "DurationOfBreak": 1000,
"TimeoutValue": 10000 "TimeoutValue": 30000
}, },
"HttpHandlerOptions": { "HttpHandlerOptions": {
"UseTracing": true "UseTracing": true

13
gateways/internal/LINGYUN.MicroService.Internal.ApiGateway/src/LINGYUN.MicroService.Internal.ApiGateway/Program.cs

@ -3,6 +3,7 @@ using Microsoft.AspNetCore.Hosting;
using Microsoft.Extensions.Configuration; using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Hosting; using Microsoft.Extensions.Hosting;
using Ocelot.DependencyInjection;
using Serilog; using Serilog;
using System; using System;
using System.IO; using System.IO;
@ -25,11 +26,13 @@ public class Program
.UseAutofac() .UseAutofac()
.ConfigureAppConfiguration((context, config) => .ConfigureAppConfiguration((context, config) =>
{ {
// 加入 ocelot配置文件 //// 加入 ocelot配置文件
config.AddJsonFile( //config.AddJsonFile(
$"ocelot.{context.HostingEnvironment.EnvironmentName ?? "Development"}.json", //$"ocelot.{context.HostingEnvironment.EnvironmentName ?? "Development"}.json",
optional: true, //optional: true,
reloadOnChange: true); //reloadOnChange: true);
config.AddAutoOcelotConfig("OcelotConfig", builder.Environment);
var configuration = config.Build(); var configuration = config.Build();
if (configuration.GetSection("AgileConfig").Exists()) if (configuration.GetSection("AgileConfig").Exists())

1895
gateways/internal/LINGYUN.MicroService.Internal.ApiGateway/src/LINGYUN.MicroService.Internal.ApiGateway/ocelot.Development.json

File diff suppressed because it is too large

4347
gateways/internal/LINGYUN.MicroService.Internal.ApiGateway/src/LINGYUN.MicroService.Internal.ApiGateway/ocelot.json

File diff suppressed because it is too large

2
starter/70.start-internal-gateway.bat

@ -1,4 +1,4 @@
@echo off @echo off
cls cls
cd ..\aspnet-core\ cd ..\aspnet-core\
.\start-internal-gateway.bat .\start-internal-gateway.bat --watchrun
Loading…
Cancel
Save