尽管[HttpPost]
public void Post([FromForm] Model value)
{
var apiUrl = value.ApiUrl; // http://api.com/start/1
var interval = value.Interval;
RecurringJob.AddOrUpdate(value.ApiName, () => RunInBackground(apiUrl), Cron.MinuteInterval(value.Interval));
var api = JobStorage.Current.GetMonitoringApi();
}
[DisableConcurrentExecutionWithParametersAttribute(timeoutInSeconds: 10 * 60)]
[AutomaticRetry(Attempts = 0)]
public async Task<bool> RunInBackground(string Url)
{
using (HttpClient httpClient = new HttpClient())
{
var response = await httpClient.GetAsync(Url);
httpClient.DefaultRequestHeaders.Accept.Clear();
httpClient.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json"));
var responseFromApi = await response.Content.ReadAsStringAsync();
return true;
}
}
不在list of supported gremlin steps for Cosmos DB上(以及其他一些),但似乎受到支持。给定一个带有人的示例图,它是一个类似
choose
返回一个json数组g.V().hasLabel('person').choose(values('name'))
.option('josh', constant('it's Josh!'))
。添加更多选项也可以,例如
['Josh!']
但是似乎不起作用的是使用g.V().hasLabel('person').choose(values('name'))
.option('josh', constant('it's Josh!'))
.option('marco', constant('it's marco!'))
/ Pick.none
来指定默认情况,如gremlin docs for choose
中所述,例如
none
有人知道如何在Cosmos DB中指定默认大小写吗?我已经尝试过任何包含g.V().hasLabel('person').choose(values('name'))
.option('josh', constant('it's Josh!'))
.option('marco', constant('it's marco!'))
.option(none, constant('it's somebody else!'))
和/或Pick
的排列,例如none
,Pick.none
,Pick().none()
,none
,...