Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Example of the Consul(ConsulAgent) configuration file.

{
"datacenter": "od-torpedo",
"data_dir": "C:\\ConsulAgent\\Data",
"log_level": "INFO",
"node_name": "Consul1",
"server": true,
"bind_addr": "127.0.0.1",
"advertise_addr": "127.0.0.1",
"services": [
"id": "OpelVehicleConfiguration1",
"name": "OpelVehicleConfigurationApi",
"tags": [
"primary"
],
"address": "127.0.0.1",
"port": 50400,
"checks": [
{
"id": "OpelVehicleConfiguration1_Check",
"name": "Check OpelVehicleConfiguration API on port 50400",
"http": "http://127.0.0.1:50400/OpelVehicleConfigurationApi/Health",
"tls_skip_verify": false,
"method": "GET",
"header": {
"Content-Type": [
"application/json"
]
},
"interval": "1s",
"timeout": "10s",
"failures_before_critical": 3
}
]
},
{
"id": "OpelVehicleConfiguration2",
"name": "OpelVehicleConfigurationApi",
"tags": [
"delayed",
"secondary"
],
"address": "127.0.0.1",
"port": 50401,
"checks": [
{
"id": "OpelVehicleConfiguration2_Check",
"name": "Check OpelVehicleConfiguration 2 API on port 50401",
"http": "http://127.0.0.1:50401/OpelVehicleConfigurationApi/Health",
"tls_skip_verify": false,
"method": "GET",
"header": {
"Content-Type": [
"application/json"
]
},
"interval": "1s",
"timeout": "10s",
"failures_before_critical": 3
}
]
}
],
"dns_config": {
"allow_stale": false,
"service_ttl": {
"*": "0s"
},
"node_ttl": "0s"
}
}

Ocelot configuration file example:

{
"ReRoutes": [
{
"DownstreamPathTemplate": "/api/{version}/{everything}",
"DownstreamScheme": "http",
"DownstreamHostAndPorts": [
{
"Host": "catalog-api",
"Port": 80
}
],
"UpstreamPathTemplate": "/api/{version}/c/{everything}",
"UpstreamHttpMethod": [ "POST", "PUT", "GET" ]
},
{
"DownstreamPathTemplate": "/api/{version}/{everything}",
"DownstreamScheme": "http",
"DownstreamHostAndPorts": [
{
"Host": "basket-api",
"Port": 80
}
],
"UpstreamPathTemplate": "/api/{version}/b/{everything}",
"UpstreamHttpMethod": [ "POST", "PUT", "GET" ],
"AuthenticationOptions": {
"AuthenticationProviderKey": "IdentityApiKey",
"AllowedScopes": []
}
}

...

This is a simple configuration guide for ODIS.