예제 #1
0
        private async Task <HttpResponseMessage> StateDiagram(HttpRequestMessage request, string service, CancellationToken cancellationToken)
        {
            IServiceInstance serviceInstance = _serviceResolver.GetInstanceByName(service);
            var d = await _stateDiagram.GetDiagram(serviceInstance);

            var msg = new HttpResponseMessage(HttpStatusCode.OK);

            if (string.IsNullOrWhiteSpace(d.contentType))
            {
                msg.Content = new StringContent(d.diagram, Encoding.UTF8);
            }
            else
            {
                msg.Content = new StringContent(d.diagram, Encoding.UTF8, d.contentType);
            }
            return(msg);
        }
예제 #2
0
        public Task <HttpResponseMessage> Errors(
            [HttpTrigger(AuthorizationLevel.Anonymous, "post", Route = "errors/{*service}")]
            HttpRequestMessage request,
            string service,
            CancellationToken cancellationToken)
        {
            var dict = new Dictionary <string, string> {
                ["Service"] = service
            };
            var serviceInstance = _serviceResolver.GetInstanceByName(service);



            return(Task.FromResult(new HttpResponseMessage(HttpStatusCode.OK)));
        }