我正在尝试从我的 Web Api 在谷歌云计划中创建工作。
我可以使用客户端库创建工作,但我相信它不会发布到 Google。
CloudSchedulerService cloudScheduler = new CloudSchedulerService();
IDictionary<string, string> header = new Dictionary<string, string>();
header.Add("Content-Type", "application/json");
header.Add("Authorization", "Bearer sk_test_XKokBfNWv6FIYuTMg5sLPjhJ");
HttpTarget httpTarget = new HttpTarget()
{
Body = "Check",
Headers = header,
HttpMethod = "POST",
Uri = "******"
};
Job job = new Job()
{
Description = "testing",
HttpTarget = httpTarget,
Name = "projects/******/locations/europe-west3/jobs/testjob4",
Schedule = "5 * * * *",
TimeZone = "Asia/Kuwait"
};
cloudScheduler.Projects.Locations.Jobs.Create(job, "projects/******/locations/europe-west3");