diff --git a/Cronhub Scheduler Demo.mp4 b/Cronhub Scheduler Demo.mp4 new file mode 100644 index 0000000..0e8f3d0 Binary files /dev/null and b/Cronhub Scheduler Demo.mp4 differ diff --git a/docs/.vuepress/config.js b/docs/.vuepress/config.js index fb143e2..20e7417 100644 --- a/docs/.vuepress/config.js +++ b/docs/.vuepress/config.js @@ -52,7 +52,7 @@ function genSidebarConfig(title) { collapsable: false, children: [ "", - "getting-started", + // "getting-started", "how-to-ping", "sending-data-to-cronhub", "monitor-states", diff --git a/docs/.vuepress/dist/404.html b/docs/.vuepress/dist/404.html index 8141c28..2966f0a 100644 --- a/docs/.vuepress/dist/404.html +++ b/docs/.vuepress/dist/404.html @@ -8,13 +8,13 @@ - + -

404

That's a Four-Oh-Four.
+ - + diff --git a/docs/.vuepress/dist/assets/js/10.c2942ac7.js b/docs/.vuepress/dist/assets/js/10.c2942ac7.js deleted file mode 100644 index 7dca7b2..0000000 --- a/docs/.vuepress/dist/assets/js/10.c2942ac7.js +++ /dev/null @@ -1 +0,0 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[10],{168:function(t,e,o){t.exports=o.p+"assets/img/pd-integration-step-4.3cf12b9e.png"},169:function(t,e,o){t.exports=o.p+"assets/img/pd-integration-step-3.45c534ad.png"},170:function(t,e,o){t.exports=o.p+"assets/img/pd-integration-step-2.c85e983c.png"},171:function(t,e,o){t.exports=o.p+"assets/img/pd-integration-step-1.6dd9244c.png"},172:function(t,e,o){t.exports=o.p+"assets/img/slack-integration-step-2.47a4a361.png"},173:function(t,e,o){t.exports=o.p+"assets/img/slack-integration-step-1.84ff8d8f.png"},214:function(t,e,o){"use strict";o.r(e);var n=o(28),r=Object(n.a)({},function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("ContentSlotsDistributor",{attrs:{"slot-key":t.$parent.slotKey}},[n("h1",{attrs:{id:"integrations"}},[n("a",{staticClass:"header-anchor",attrs:{href:"#integrations"}},[t._v("#")]),t._v(" Integrations")]),t._v(" "),n("p",[t._v("Cronhub has built-in and third-party tool integrations that play nicely with your monitors. You can think of integrations as notification channels that you can use in your monitors to alert you when an event occurs on Cronhub. Currently, we support Slack, SMS and Webhooks integrations but more integrations will be added in the future. If you're thinking to build a new integration for Cronhub you can "),n("a",{attrs:{href:"mailto:tigran@cronhub.io"}},[t._v("reach out to me")]),t._v(".")]),t._v(" "),n("h2",{attrs:{id:"slack"}},[n("a",{staticClass:"header-anchor",attrs:{href:"#slack"}},[t._v("#")]),t._v(" Slack")]),t._v(" "),n("p",[t._v("Adding a Slack integration is a straightforward process. In order to integrate Slack with your Cronhub account, you should follow these steps")]),t._v(" "),n("ol",[n("li",[n("p",[t._v('Go to the "Settings" page and click on "Slack" link under the "Integrations" section on the left-sidebar.')])]),t._v(" "),n("li",[n("p",[t._v('When you\'re on the Slack integration page you will see "Add to Slack" button (see the screenshot below). Click on it.')])])]),t._v(" "),n("p",[n("img",{attrs:{src:o(173),alt:"Add to Slack"}})]),t._v(" "),n("ol",{attrs:{start:"3"}},[n("li",[t._v('"Add to Slack" button will redirect you to the slack auth page where you can choose the channel you want to get Cronhub alerts to (see the screenshot below).\n'),n("img",{attrs:{src:o(172),alt:"Slack auth page"}})])]),t._v(" "),n("p",[t._v('After choosing the channel "Authorize" it and you will go back to Cronhub. Now you can see all your connected channels in the list. You can add as many channels as you like.')]),t._v(" "),n("h2",{attrs:{id:"pagerduty"}},[n("a",{staticClass:"header-anchor",attrs:{href:"#pagerduty"}},[t._v("#")]),t._v(" PagerDuty")]),t._v(" "),n("p",[t._v("Adding a PagerDuty integration is a multi step process. In order to integrate Pagerduty with your Cronhub account, you should follow these steps")]),t._v(" "),n("ol",[n("li",[n("p",[t._v("Go to the "),n("a",{attrs:{href:"https://cronhub.io/settings/integrations/pagerduty",target:"_blank",rel:"noopener noreferrer"}},[t._v("PagerDuty"),n("OutboundLink")],1),t._v(" page under your settings.")])]),t._v(" "),n("li",[n("p",[t._v('When you\'re on the PagerDuty integration page you will see "Alert with PagerDuty" green button (see the screenshot below). Click on the button.')])])]),t._v(" "),n("p",[n("img",{attrs:{src:o(171),alt:"Alert with PagerDuty"}})]),t._v(" "),n("ol",{attrs:{start:"3"}},[n("li",[t._v('When you click on "Alert with PagerDuty" it will take you to the PagerDuty login screen. You should provide your credentials and click '),n("strong",[t._v("Authorize integration")]),t._v(" to allow Cronhub to integrate with PagerDuty.")])]),t._v(" "),n("p",[n("img",{attrs:{src:o(170),alt:"Authorize integration with Cronhub"}})]),t._v(" "),n("ol",{attrs:{start:"4"}},[n("li",[t._v("After authorizing with your credentials you will see a new screen to configure the Cronhub integration. You can either hook up Cronhub to an existing PagerDuty service, or create a new service. Click "),n("strong",[t._v("Finish integration")]),t._v(" to save your settings and redirect back to Cronhub.")])]),t._v(" "),n("p",[n("img",{attrs:{src:o(169),alt:"Configure the Cronhub Integration"}})]),t._v(" "),n("ol",{attrs:{start:"4"}},[n("li",[t._v("Now when you're back to Cronhub you should see all your PagerDuty service integrations.")])]),t._v(" "),n("p",[n("img",{attrs:{src:o(168),alt:"PagerDuty Cronhub Integration"}})]),t._v(" "),n("ol",{attrs:{start:"5"}},[n("li",[t._v("Cronhub can trigger an incident on PagerDuty when monitors fail and also mark them as resolved when the monitors recover.")])]),t._v(" "),n("p",[t._v("If you want to change your PagerDuty integration then you should remove it first and then go over the above steps again.")])])},[],!1,null,null,null);e.default=r.exports}}]); \ No newline at end of file diff --git a/docs/.vuepress/dist/assets/js/13.15b23470.js b/docs/.vuepress/dist/assets/js/10.d6f7128f.js similarity index 94% rename from docs/.vuepress/dist/assets/js/13.15b23470.js rename to docs/.vuepress/dist/assets/js/10.d6f7128f.js index 816e3be..231642c 100644 --- a/docs/.vuepress/dist/assets/js/13.15b23470.js +++ b/docs/.vuepress/dist/assets/js/10.d6f7128f.js @@ -1 +1 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[13],{210:function(t,e,o){"use strict";o.r(e);var r=o(28),a=Object(r.a)({},function(){var t=this,e=t.$createElement,o=t._self._c||e;return o("ContentSlotsDistributor",{attrs:{"slot-key":t.$parent.slotKey}},[o("h1",{attrs:{id:"getting-started"}},[o("a",{staticClass:"header-anchor",attrs:{href:"#getting-started"}},[t._v("#")]),t._v(" Getting Started")]),t._v(" "),o("h2",{attrs:{id:"your-first-monitor"}},[o("a",{staticClass:"header-anchor",attrs:{href:"#your-first-monitor"}},[t._v("#")]),t._v(" Your First Monitor")]),t._v(" "),o("p",[t._v("In this short video, I give you a quick introduction on how you can set up a cron job monitor on Cronhub. I use a local Ubuntu server where I create a new cron job and hook it up with a Cronhub monitor. It's a couple of step process which I explain in the video. Enjoy.")]),t._v(" "),o("iframe",{attrs:{width:"560",height:"315",src:"https://www.youtube.com/embed/Ets8vJYe1BI?ecver=1",frameborder:"0",allow:"autoplay; encrypted-media",allowfullscreen:""}})])},[],!1,null,null,null);e.default=a.exports}}]); \ No newline at end of file +(window.webpackJsonp=window.webpackJsonp||[]).push([[10],{214:function(t,e,o){"use strict";o.r(e);var r=o(28),a=Object(r.a)({},function(){var t=this,e=t.$createElement,o=t._self._c||e;return o("ContentSlotsDistributor",{attrs:{"slot-key":t.$parent.slotKey}},[o("h1",{attrs:{id:"getting-started"}},[o("a",{staticClass:"header-anchor",attrs:{href:"#getting-started"}},[t._v("#")]),t._v(" Getting Started")]),t._v(" "),o("h2",{attrs:{id:"your-first-monitor"}},[o("a",{staticClass:"header-anchor",attrs:{href:"#your-first-monitor"}},[t._v("#")]),t._v(" Your First Monitor")]),t._v(" "),o("p",[t._v("In this short video, I give you a quick introduction on how you can set up a cron job monitor on Cronhub. I use a local Ubuntu server where I create a new cron job and hook it up with a Cronhub monitor. It's a couple of step process which I explain in the video. Enjoy.")]),t._v(" "),o("iframe",{attrs:{width:"560",height:"315",src:"https://www.youtube.com/embed/Ets8vJYe1BI?ecver=1",frameborder:"0",allow:"autoplay; encrypted-media",allowfullscreen:""}})])},[],!1,null,null,null);e.default=a.exports}}]); \ No newline at end of file diff --git a/docs/.vuepress/dist/assets/js/12.cedd521a.js b/docs/.vuepress/dist/assets/js/12.cedd521a.js new file mode 100644 index 0000000..0672e90 --- /dev/null +++ b/docs/.vuepress/dist/assets/js/12.cedd521a.js @@ -0,0 +1 @@ +(window.webpackJsonp=window.webpackJsonp||[]).push([[12],{213:function(e,o,t){"use strict";t.r(o);var n=t(28),r=Object(n.a)({},function(){var e=this,o=e.$createElement,t=e._self._c||o;return t("ContentSlotsDistributor",{attrs:{"slot-key":e.$parent.slotKey}},[t("h1",{attrs:{id:"introduction"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#introduction"}},[e._v("#")]),e._v(" Introduction")]),e._v(" "),t("h2",{attrs:{id:"what-is-cronhub"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#what-is-cronhub"}},[e._v("#")]),e._v(" What is Cronhub?")]),e._v(" "),t("p",[t("strong",[e._v("Cronhub is a painless cron scheduler and monitoring service for developers who don't like working with complicated servers and cron jobs. No servers and ops required.")])]),e._v(" "),t("p",[e._v("We created Cronhub to make scheduling and monitoring of recurring tasks a lot easier. Use Cronhub to automate tasks and replace your cronjobs with our schedulers.")]),e._v(" "),t("p",[e._v("We offer two products that complement each other - Scheduler and Monitoring.")]),e._v(" "),t("p",[e._v("I have recorded a quick demo to show some of the features on Cronhub.")]),e._v(" "),t("iframe",{attrs:{src:"https://player.vimeo.com/video/420809493",width:"640",height:"480",frameborder:"0",allow:"autoplay; fullscreen",allowfullscreen:""}}),e._v(" "),t("h2",{attrs:{id:"what-is-scheduler"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#what-is-scheduler"}},[e._v("#")]),e._v(" What is Scheduler?")]),e._v(" "),t("p",[e._v("As the name implies, Scheduler is a scheduling tool. The schedule can be any time interval or cron expression. Within Scheduler, you define a schedule and a target URL. We send an HTTP request to your Target URL according to your schedule. We do not retry the request if your job fails, and we have a timeout of 3 seconds.")]),e._v(" "),t("p",[e._v("With Cronhub Scheduler, you can focus on your application, and we handle the scheduling part. Let's say you want to send a daily email to your users. You can work on creating the function that handles the email sending part, and we take care of the whole scheduling logic behind the scenes. You just need to tell us where your function lives and how often you want to run it.")]),e._v(" "),t("h2",{attrs:{id:"what-is-monitoring"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#what-is-monitoring"}},[e._v("#")]),e._v(" What is Monitoring?")]),e._v(" "),t("p",[e._v("Use Cronhub monitors to monitor your cron jobs (or any scheduled jobs). After integrating your job with Cronhub we send you alerts when:")]),e._v(" "),t("ol",[t("li",[e._v("Your job doesn't run on schedule (e.g. you have daily running job but it failed to run on time)")]),e._v(" "),t("li",[e._v("Your job runs longer than expected (e.g. your job should finish within a minute but it took an hour to finish)")])]),e._v(" "),t("p",[e._v("Cronhub supports E-mail, Slack, SMS, Webhook and PagerDuty notification channels.")]),e._v(" "),t("h3",{attrs:{id:"what-is-a-monitor"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#what-is-a-monitor"}},[e._v("#")]),e._v(" What is a monitor?")]),e._v(" "),t("p",[e._v("For each job, you need to create a monitor. The schedule of your cron and the created monitor should always match.\nFor instance, if you have a minutely running cron job on your server you should create a monitor and set the cron schedule to "),t("code",[e._v("* * * * *")]),e._v(". Or if you have a job that runs every hour you can create an hourly interval monitor.")]),e._v(" "),t("h3",{attrs:{id:"what-is-monitor-s-ping-url"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#what-is-monitor-s-ping-url"}},[e._v("#")]),e._v(" What is monitor's ping URL?")]),e._v(" "),t("p",[e._v("When you create a new monitor on Cronhub we generate a unique UUID for your monitor. The ping URL consists of the that UUID\nand the endpoint. For instance, if you only want to monitor the schedule of your cron job then your ping URL will look like this:")]),e._v(" "),t("div",{staticClass:"language-bash extra-class"},[t("pre",{pre:!0,attrs:{class:"language-bash"}},[t("code",[e._v(" https://cronhub.io/ping/1f5e3410-254c-11e8-b61d-55875966d031\n")])])]),t("p",[e._v("In this example the UUID is "),t("code",[e._v("1f5e3410-254c-11e8-b61d-55875966d031")]),e._v(" and the endpoint is "),t("code",[e._v("/ping")]),e._v(".")]),e._v(" "),t("p",[e._v("You will need to make HTTP requests from your job every time it runs. If you want to monitor the running time of the job as well you need to ping twice. At the start of your job and when the job is finished. After receiving the first ping, your monitor is successfully integrated. It will start monitoring your job and notify you if anything is off.")]),e._v(" "),t("h3",{attrs:{id:"how-does-alerting-work"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#how-does-alerting-work"}},[e._v("#")]),e._v(" How does alerting work?")]),e._v(" "),t("p",[e._v("If any of your jobs don't run on schedule or run longer than expected Cronhub will alert you. Currently, you can send alerts via Email, Slack, SMS, Webhook and PagerDuty.")])])},[],!1,null,null,null);o.default=r.exports}}]); \ No newline at end of file diff --git a/docs/.vuepress/dist/assets/js/12.64e358e4.js b/docs/.vuepress/dist/assets/js/13.55f71b73.js similarity index 99% rename from docs/.vuepress/dist/assets/js/12.64e358e4.js rename to docs/.vuepress/dist/assets/js/13.55f71b73.js index 2bd73d0..4219f7f 100644 --- a/docs/.vuepress/dist/assets/js/12.64e358e4.js +++ b/docs/.vuepress/dist/assets/js/13.55f71b73.js @@ -1 +1 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[12],{213:function(t,s,n){"use strict";n.r(s);var e=n(28),a=Object(e.a)({},function(){var t=this,s=t.$createElement,n=t._self._c||s;return n("ContentSlotsDistributor",{attrs:{"slot-key":t.$parent.slotKey}},[n("h1",{attrs:{id:"how-to-ping"}},[n("a",{staticClass:"header-anchor",attrs:{href:"#how-to-ping"}},[t._v("#")]),t._v(" How to Ping")]),t._v(" "),n("p",[t._v("The Ping API is an easy way to integrate your scheduled jobs with Cronhub monitors.")]),t._v(" "),n("p",[n("strong",[t._v("To integrate your job with a Cronhub monitor, you need to ping from your cron job every time it runs.")])]),t._v(" "),n("p",[t._v("The ping can be any HTTP request. If you only want to monitor the schedule of your job, then you need to ping only once after your job has successfully run. However, If you're going to monitor the schedule as well as the running time you need to ping twice, when your job starts and when your job finishes. This way Cronhub will be able to track the running time (or processing time) of your job and alert you if it takes longer than expected to finish.")]),t._v(" "),n("h2",{attrs:{id:"ping-api"}},[n("a",{staticClass:"header-anchor",attrs:{href:"#ping-api"}},[t._v("#")]),t._v(" Ping API")]),t._v(" "),n("table",[n("thead",[n("tr",[n("th",[t._v("Endpoint")]),t._v(" "),n("th",{staticStyle:{"text-align":"center"}},[t._v("Description")])])]),t._v(" "),n("tbody",[n("tr",[n("td",[n("code",[t._v("https://cronhub.io/ping/")])]),t._v(" "),n("td",{staticStyle:{"text-align":"center"}},[t._v("Use this endpoint if you only want to monitor the successful runs of your job on schedule.")])]),t._v(" "),n("tr",[n("td",[n("code",[t._v("https://cronhub.io/start/")])]),t._v(" "),n("td",{staticStyle:{"text-align":"center"}},[t._v("Use this endpoint to acknowledge the start of your job. Use this endpoint if you additionally want to monitor the running time of your job.")])]),t._v(" "),n("tr",[n("td",[n("code",[t._v("https://cronhub.io/finish/")])]),t._v(" "),n("td",{staticStyle:{"text-align":"center"}},[t._v("Use this endpoint to acknowledge the finish of your job. Use this endpoint if you additionally want to monitor the running time of your job.")])]),t._v(" "),n("tr",[n("td",[n("code",[t._v("https://cronhub.io/fail/")])]),t._v(" "),n("td",{staticStyle:{"text-align":"center"}},[t._v('Use this endpoint to acknowledge the failure of your job. After pinging this endpoint Cronhub will change the state of your monitor to "ALERT" and notify you or your team.')])])])]),t._v(" "),n("h2",{attrs:{id:"making-pings"}},[n("a",{staticClass:"header-anchor",attrs:{href:"#making-pings"}},[t._v("#")]),t._v(" Making pings")]),t._v(" "),n("p",[t._v("Below I have some handy examples that you can use for integration. I've started with "),n("code",[t._v("Crontab")]),t._v(" integration because most of the cron jobs on unix based systems are defined with this program.")]),t._v(" "),n("h2",{attrs:{id:"crontab"}},[n("a",{staticClass:"header-anchor",attrs:{href:"#crontab"}},[t._v("#")]),t._v(" Crontab")]),t._v(" "),n("p",[t._v("Crontab is a UNIX program that helps you to communicate with the cron deamon on a unix based system. The cron daemon is a long-running process that runs commands at specific dates and times. In order to tell cron daemon what commands it should run and when you need crontab entries.")]),t._v(" "),n("p",[t._v("On your UNIX system, you can run "),n("code",[t._v("crontab -l")]),t._v(" to display crontab and see if there are any scheduled tasks. Run "),n("code",[t._v("crontab -e")]),t._v(" to edit the crontab.")]),t._v(" "),n("p",[t._v("Below we have an example of a crontab entry that you can add to your system's crontab entry. Of course, you will have to replace the script name as well as the ping URL with your own script and the monitor URL.")]),t._v(" "),n("div",{staticClass:"language-bash extra-class"},[n("pre",{pre:!0,attrs:{class:"language-bash"}},[n("code",[t._v("* * * * * "),n("span",{pre:!0,attrs:{class:"token function"}},[t._v("curl")]),t._v(" -fsS --retry 3 https://cronhub.io/start/1f5e3410-254c-11e8-b61d-55875966d031"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v(" your_script.sh "),n("span",{pre:!0,attrs:{class:"token operator"}},[t._v("&&")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token function"}},[t._v("curl")]),t._v(" -fsS --retry 3 https://cronhub.io/finish/1f5e3410-254c-11e8-b61d-55875966d031\n")])])]),n("div",{staticClass:"custom-block tip"},[n("p",{staticClass:"custom-block-title"},[t._v("TIP")]),t._v(" "),n("p",[t._v("Please note the difference between "),n("code",[t._v(";")]),t._v(" and "),n("code",[t._v("&&")]),t._v(".")]),t._v(" "),n("p",[n("code",[t._v('echo "Hello" ; echo "world"')]),t._v(" means run "),n("code",[t._v('echo "world"')]),t._v(' no matter what the exit status of the previous command echo "Hello".')]),t._v(" "),n("p",[t._v("Whereas in case of echo "),n("code",[t._v('"Hello " && echo "world"')]),t._v(", "),n("code",[t._v('echo "world"')]),t._v(' will only run if the first command (echo "Hello") is a success (i.e. exit status 0).')])]),t._v(" "),n("h2",{attrs:{id:"php"}},[n("a",{staticClass:"header-anchor",attrs:{href:"#php"}},[t._v("#")]),t._v(" PHP")]),t._v(" "),n("div",{staticClass:"language-php extra-class"},[n("pre",{pre:!0,attrs:{class:"language-php"}},[n("code",[n("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// ping when your job starts")]),t._v("\n"),n("span",{pre:!0,attrs:{class:"token function"}},[t._v("file_get_contents")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),n("span",{pre:!0,attrs:{class:"token double-quoted-string string"}},[t._v('"https://cronhub.io/start/1f5e3410-254c-11e8-b61d-55875966d031"')]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n"),n("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// your code goes here...")]),t._v("\n\n"),n("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// ping when your job is finished")]),t._v("\n"),n("span",{pre:!0,attrs:{class:"token function"}},[t._v("file_get_contents")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),n("span",{pre:!0,attrs:{class:"token double-quoted-string string"}},[t._v('"https://cronhub.io/finish/1f5e3410-254c-11e8-b61d-55875966d031"')]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])]),n("h2",{attrs:{id:"bash"}},[n("a",{staticClass:"header-anchor",attrs:{href:"#bash"}},[t._v("#")]),t._v(" Bash")]),t._v(" "),n("div",{staticClass:"language-bash extra-class"},[n("pre",{pre:!0,attrs:{class:"language-bash"}},[n("code",[n("span",{pre:!0,attrs:{class:"token shebang important"}},[t._v("#!/bin/bash")]),t._v("\n\n"),n("span",{pre:!0,attrs:{class:"token comment"}},[t._v("# ping when your job starts")]),t._v("\n"),n("span",{pre:!0,attrs:{class:"token function"}},[t._v("curl")]),t._v(" -fsS --retry 3 https://cronhub.io/start/1f5e3410-254c-11e8-b61d-55875966d031\n\nyour_script.sh\n\n"),n("span",{pre:!0,attrs:{class:"token comment"}},[t._v("# ping when your job is finished")]),t._v("\n"),n("span",{pre:!0,attrs:{class:"token function"}},[t._v("curl")]),t._v(" -fsS --retry 3 https://cronhub.io/finish/1f5e3410-254c-11e8-b61d-55875966d031\n")])])]),n("h2",{attrs:{id:"python"}},[n("a",{staticClass:"header-anchor",attrs:{href:"#python"}},[t._v("#")]),t._v(" Python")]),t._v(" "),n("div",{staticClass:"language-python extra-class"},[n("pre",{pre:!0,attrs:{class:"language-python"}},[n("code",[n("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("import")]),t._v(" urllib2\n\n"),n("span",{pre:!0,attrs:{class:"token comment"}},[t._v("# ping when your job starts")]),t._v("\n"),n("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("try")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v("\n urllib2"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("urlopen"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),n("span",{pre:!0,attrs:{class:"token string"}},[t._v('"https://cronhub.io/start/1f5e3410-254c-11e8-b61d-55875966d031"')]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n"),n("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("except")]),t._v(" Exception"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v("\n "),n("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("pass")]),t._v("\n\n"),n("span",{pre:!0,attrs:{class:"token comment"}},[t._v("# your code goes here...")]),t._v("\n\n"),n("span",{pre:!0,attrs:{class:"token comment"}},[t._v("# ping when your job is finished")]),t._v("\n"),n("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("try")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v("\n urllib2"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("urlopen"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),n("span",{pre:!0,attrs:{class:"token string"}},[t._v('"https://cronhub.io/finish/1f5e3410-254c-11e8-b61d-55875966d031"')]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n"),n("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("except")]),t._v(" Exception"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v("\n "),n("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("pass")]),t._v("\n")])])]),n("h2",{attrs:{id:"node"}},[n("a",{staticClass:"header-anchor",attrs:{href:"#node"}},[t._v("#")]),t._v(" Node")]),t._v(" "),n("div",{staticClass:"language-js extra-class"},[n("pre",{pre:!0,attrs:{class:"language-js"}},[n("code",[n("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("var")]),t._v(" https "),n("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token function"}},[t._v("require")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),n("span",{pre:!0,attrs:{class:"token string"}},[t._v("'https'")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n"),n("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// ping when your job starts")]),t._v("\nhttps"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),n("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("get")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),n("span",{pre:!0,attrs:{class:"token string"}},[t._v('"https://cronhub.io/start/1f5e3410-254c-11e8-b61d-55875966d031"')]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n"),n("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// your code goes here...")]),t._v("\n\n"),n("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// ping when your job is finished")]),t._v("\nhttps"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),n("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("get")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),n("span",{pre:!0,attrs:{class:"token string"}},[t._v('"https://cronhub.io/finish/1f5e3410-254c-11e8-b61d-55875966d031"')]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])])])},[],!1,null,null,null);s.default=a.exports}}]); \ No newline at end of file +(window.webpackJsonp=window.webpackJsonp||[]).push([[13],{210:function(t,s,n){"use strict";n.r(s);var e=n(28),a=Object(e.a)({},function(){var t=this,s=t.$createElement,n=t._self._c||s;return n("ContentSlotsDistributor",{attrs:{"slot-key":t.$parent.slotKey}},[n("h1",{attrs:{id:"how-to-ping"}},[n("a",{staticClass:"header-anchor",attrs:{href:"#how-to-ping"}},[t._v("#")]),t._v(" How to Ping")]),t._v(" "),n("p",[t._v("The Ping API is an easy way to integrate your scheduled jobs with Cronhub monitors.")]),t._v(" "),n("p",[n("strong",[t._v("To integrate your job with a Cronhub monitor, you need to ping from your cron job every time it runs.")])]),t._v(" "),n("p",[t._v("The ping can be any HTTP request. If you only want to monitor the schedule of your job, then you need to ping only once after your job has successfully run. However, If you're going to monitor the schedule as well as the running time you need to ping twice, when your job starts and when your job finishes. This way Cronhub will be able to track the running time (or processing time) of your job and alert you if it takes longer than expected to finish.")]),t._v(" "),n("h2",{attrs:{id:"ping-api"}},[n("a",{staticClass:"header-anchor",attrs:{href:"#ping-api"}},[t._v("#")]),t._v(" Ping API")]),t._v(" "),n("table",[n("thead",[n("tr",[n("th",[t._v("Endpoint")]),t._v(" "),n("th",{staticStyle:{"text-align":"center"}},[t._v("Description")])])]),t._v(" "),n("tbody",[n("tr",[n("td",[n("code",[t._v("https://cronhub.io/ping/")])]),t._v(" "),n("td",{staticStyle:{"text-align":"center"}},[t._v("Use this endpoint if you only want to monitor the successful runs of your job on schedule.")])]),t._v(" "),n("tr",[n("td",[n("code",[t._v("https://cronhub.io/start/")])]),t._v(" "),n("td",{staticStyle:{"text-align":"center"}},[t._v("Use this endpoint to acknowledge the start of your job. Use this endpoint if you additionally want to monitor the running time of your job.")])]),t._v(" "),n("tr",[n("td",[n("code",[t._v("https://cronhub.io/finish/")])]),t._v(" "),n("td",{staticStyle:{"text-align":"center"}},[t._v("Use this endpoint to acknowledge the finish of your job. Use this endpoint if you additionally want to monitor the running time of your job.")])]),t._v(" "),n("tr",[n("td",[n("code",[t._v("https://cronhub.io/fail/")])]),t._v(" "),n("td",{staticStyle:{"text-align":"center"}},[t._v('Use this endpoint to acknowledge the failure of your job. After pinging this endpoint Cronhub will change the state of your monitor to "ALERT" and notify you or your team.')])])])]),t._v(" "),n("h2",{attrs:{id:"making-pings"}},[n("a",{staticClass:"header-anchor",attrs:{href:"#making-pings"}},[t._v("#")]),t._v(" Making pings")]),t._v(" "),n("p",[t._v("Below I have some handy examples that you can use for integration. I've started with "),n("code",[t._v("Crontab")]),t._v(" integration because most of the cron jobs on unix based systems are defined with this program.")]),t._v(" "),n("h2",{attrs:{id:"crontab"}},[n("a",{staticClass:"header-anchor",attrs:{href:"#crontab"}},[t._v("#")]),t._v(" Crontab")]),t._v(" "),n("p",[t._v("Crontab is a UNIX program that helps you to communicate with the cron deamon on a unix based system. The cron daemon is a long-running process that runs commands at specific dates and times. In order to tell cron daemon what commands it should run and when you need crontab entries.")]),t._v(" "),n("p",[t._v("On your UNIX system, you can run "),n("code",[t._v("crontab -l")]),t._v(" to display crontab and see if there are any scheduled tasks. Run "),n("code",[t._v("crontab -e")]),t._v(" to edit the crontab.")]),t._v(" "),n("p",[t._v("Below we have an example of a crontab entry that you can add to your system's crontab entry. Of course, you will have to replace the script name as well as the ping URL with your own script and the monitor URL.")]),t._v(" "),n("div",{staticClass:"language-bash extra-class"},[n("pre",{pre:!0,attrs:{class:"language-bash"}},[n("code",[t._v("* * * * * "),n("span",{pre:!0,attrs:{class:"token function"}},[t._v("curl")]),t._v(" -fsS --retry 3 https://cronhub.io/start/1f5e3410-254c-11e8-b61d-55875966d031"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v(" your_script.sh "),n("span",{pre:!0,attrs:{class:"token operator"}},[t._v("&&")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token function"}},[t._v("curl")]),t._v(" -fsS --retry 3 https://cronhub.io/finish/1f5e3410-254c-11e8-b61d-55875966d031\n")])])]),n("div",{staticClass:"custom-block tip"},[n("p",{staticClass:"custom-block-title"},[t._v("TIP")]),t._v(" "),n("p",[t._v("Please note the difference between "),n("code",[t._v(";")]),t._v(" and "),n("code",[t._v("&&")]),t._v(".")]),t._v(" "),n("p",[n("code",[t._v('echo "Hello" ; echo "world"')]),t._v(" means run "),n("code",[t._v('echo "world"')]),t._v(' no matter what the exit status of the previous command echo "Hello".')]),t._v(" "),n("p",[t._v("Whereas in case of echo "),n("code",[t._v('"Hello " && echo "world"')]),t._v(", "),n("code",[t._v('echo "world"')]),t._v(' will only run if the first command (echo "Hello") is a success (i.e. exit status 0).')])]),t._v(" "),n("h2",{attrs:{id:"php"}},[n("a",{staticClass:"header-anchor",attrs:{href:"#php"}},[t._v("#")]),t._v(" PHP")]),t._v(" "),n("div",{staticClass:"language-php extra-class"},[n("pre",{pre:!0,attrs:{class:"language-php"}},[n("code",[n("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// ping when your job starts")]),t._v("\n"),n("span",{pre:!0,attrs:{class:"token function"}},[t._v("file_get_contents")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),n("span",{pre:!0,attrs:{class:"token double-quoted-string string"}},[t._v('"https://cronhub.io/start/1f5e3410-254c-11e8-b61d-55875966d031"')]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n"),n("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// your code goes here...")]),t._v("\n\n"),n("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// ping when your job is finished")]),t._v("\n"),n("span",{pre:!0,attrs:{class:"token function"}},[t._v("file_get_contents")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),n("span",{pre:!0,attrs:{class:"token double-quoted-string string"}},[t._v('"https://cronhub.io/finish/1f5e3410-254c-11e8-b61d-55875966d031"')]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])]),n("h2",{attrs:{id:"bash"}},[n("a",{staticClass:"header-anchor",attrs:{href:"#bash"}},[t._v("#")]),t._v(" Bash")]),t._v(" "),n("div",{staticClass:"language-bash extra-class"},[n("pre",{pre:!0,attrs:{class:"language-bash"}},[n("code",[n("span",{pre:!0,attrs:{class:"token shebang important"}},[t._v("#!/bin/bash")]),t._v("\n\n"),n("span",{pre:!0,attrs:{class:"token comment"}},[t._v("# ping when your job starts")]),t._v("\n"),n("span",{pre:!0,attrs:{class:"token function"}},[t._v("curl")]),t._v(" -fsS --retry 3 https://cronhub.io/start/1f5e3410-254c-11e8-b61d-55875966d031\n\nyour_script.sh\n\n"),n("span",{pre:!0,attrs:{class:"token comment"}},[t._v("# ping when your job is finished")]),t._v("\n"),n("span",{pre:!0,attrs:{class:"token function"}},[t._v("curl")]),t._v(" -fsS --retry 3 https://cronhub.io/finish/1f5e3410-254c-11e8-b61d-55875966d031\n")])])]),n("h2",{attrs:{id:"python"}},[n("a",{staticClass:"header-anchor",attrs:{href:"#python"}},[t._v("#")]),t._v(" Python")]),t._v(" "),n("div",{staticClass:"language-python extra-class"},[n("pre",{pre:!0,attrs:{class:"language-python"}},[n("code",[n("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("import")]),t._v(" urllib2\n\n"),n("span",{pre:!0,attrs:{class:"token comment"}},[t._v("# ping when your job starts")]),t._v("\n"),n("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("try")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v("\n urllib2"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("urlopen"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),n("span",{pre:!0,attrs:{class:"token string"}},[t._v('"https://cronhub.io/start/1f5e3410-254c-11e8-b61d-55875966d031"')]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n"),n("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("except")]),t._v(" Exception"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v("\n "),n("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("pass")]),t._v("\n\n"),n("span",{pre:!0,attrs:{class:"token comment"}},[t._v("# your code goes here...")]),t._v("\n\n"),n("span",{pre:!0,attrs:{class:"token comment"}},[t._v("# ping when your job is finished")]),t._v("\n"),n("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("try")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v("\n urllib2"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("urlopen"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),n("span",{pre:!0,attrs:{class:"token string"}},[t._v('"https://cronhub.io/finish/1f5e3410-254c-11e8-b61d-55875966d031"')]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n"),n("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("except")]),t._v(" Exception"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v("\n "),n("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("pass")]),t._v("\n")])])]),n("h2",{attrs:{id:"node"}},[n("a",{staticClass:"header-anchor",attrs:{href:"#node"}},[t._v("#")]),t._v(" Node")]),t._v(" "),n("div",{staticClass:"language-js extra-class"},[n("pre",{pre:!0,attrs:{class:"language-js"}},[n("code",[n("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("var")]),t._v(" https "),n("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token function"}},[t._v("require")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),n("span",{pre:!0,attrs:{class:"token string"}},[t._v("'https'")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n"),n("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// ping when your job starts")]),t._v("\nhttps"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),n("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("get")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),n("span",{pre:!0,attrs:{class:"token string"}},[t._v('"https://cronhub.io/start/1f5e3410-254c-11e8-b61d-55875966d031"')]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n"),n("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// your code goes here...")]),t._v("\n\n"),n("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// ping when your job is finished")]),t._v("\nhttps"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),n("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("get")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),n("span",{pre:!0,attrs:{class:"token string"}},[t._v('"https://cronhub.io/finish/1f5e3410-254c-11e8-b61d-55875966d031"')]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])])])},[],!1,null,null,null);s.default=a.exports}}]); \ No newline at end of file diff --git a/docs/.vuepress/dist/assets/js/5.31a5abb6.js b/docs/.vuepress/dist/assets/js/5.31a5abb6.js deleted file mode 100644 index 44f37b3..0000000 --- a/docs/.vuepress/dist/assets/js/5.31a5abb6.js +++ /dev/null @@ -1 +0,0 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[5],{219:function(t,s,a){"use strict";a.r(s);var e=a(28),n=Object(e.a)({},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("ContentSlotsDistributor",{attrs:{"slot-key":t.$parent.slotKey}},[a("h1",{attrs:{id:"public-api"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#public-api"}},[t._v("#")]),t._v(" Public API")]),t._v(" "),a("p",[t._v("Cronhub Public API is a REST API that supports basic CRUD operations on top of Cronhub monitors. Our API uses HTTP response codes to indicate any API errors. All API responses are JSON objects.")]),t._v(" "),a("p",[t._v("If you have any ideas or suggestions about the API "),a("a",{attrs:{href:"https://github.com/cronhub-app/backlog/issues",target:"_blank",rel:"noopener noreferrer"}},[t._v("let us know on Github"),a("OutboundLink")],1),t._v(".")]),t._v(" "),a("p",[t._v("We reserve the right to rate-limit any access key if we feel you're not using the api fairly.")]),t._v(" "),a("p"),a("div",{staticClass:"table-of-contents"},[a("ul",[a("li",[a("a",{attrs:{href:"#authentication"}},[t._v("Authentication")])]),a("li",[a("a",{attrs:{href:"#api-endpoints"}},[t._v("API Endpoints")]),a("ul",[a("li",[a("a",{attrs:{href:"#list-all-monitors"}},[t._v("List all monitors")])]),a("li",[a("a",{attrs:{href:"#get-an-existing-monitor"}},[t._v("Get an existing monitor")])]),a("li",[a("a",{attrs:{href:"#create-a-new-monitor"}},[t._v("Create a new monitor")])]),a("li",[a("a",{attrs:{href:"#update-an-existing-monitor"}},[t._v("Update an existing monitor")])]),a("li",[a("a",{attrs:{href:"#delete-a-monitor"}},[t._v("Delete a monitor")])]),a("li",[a("a",{attrs:{href:"#pause-a-monitor"}},[t._v("Pause a monitor")])])])])])]),a("p"),t._v(" "),a("h2",{attrs:{id:"authentication"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#authentication"}},[t._v("#")]),t._v(" Authentication")]),t._v(" "),a("p",[t._v("All API requests must be authenticated by the API key that Cronhub provides. When you "),a("a",{attrs:{href:"https://cronhub.io/register",target:"_blank",rel:"noopener noreferrer"}},[t._v("create a new Cronhub account"),a("OutboundLink")],1),t._v(' you will get an API key. You can find it on the "Settings" page of the site. Here is an example how it may look '),a("code",[t._v("ch_5b73b46baf0c00.55022502")]),t._v(".")]),t._v(" "),a("p",[a("strong",[t._v("You can authenticate your requests by sending the API key in your HTTP request header. The name of the header should be "),a("code",[t._v("X-Api-Key")]),t._v(" and the value should be your key.")])]),t._v(" "),a("h2",{attrs:{id:"api-endpoints"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#api-endpoints"}},[t._v("#")]),t._v(" API Endpoints")]),t._v(" "),a("h3",{attrs:{id:"list-all-monitors"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#list-all-monitors"}},[t._v("#")]),t._v(" List all monitors")]),t._v(" "),a("p",[a("code",[t._v("GET https://cronhub.io/api/v1/monitors")]),t._v(" Get the list of all your existing monitors.")]),t._v(" "),a("p",[t._v("Example Request")]),t._v(" "),a("div",{staticClass:"language-bash extra-class"},[a("pre",{pre:!0,attrs:{class:"language-bash"}},[a("code",[a("span",{pre:!0,attrs:{class:"token function"}},[t._v("curl")]),t._v(" --header "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"X-Api-Key: api-key"')]),t._v(" https://cronhub.io/api/v1/monitors\n")])])]),a("p",[t._v("Example Response")]),t._v(" "),a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"success"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("true")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"response"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"name"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Daily database backup"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"code"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"cbe02bb0-9e72-11e8-ba9d-2bd49279e066"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"schedule"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"0 0 * * *"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"grace_period"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("2")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"timezone"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"UTC"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"status"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"up"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"last_ping"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"2018-08-12T21:01:08+00:00"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"running_time"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"running_time_unit"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"minutes"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"created_at"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"2018-08-21T21:00:51+00:00"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"name"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"My Daily Cron Monitor"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"code"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"b5e5e820-9945-11e8-8dd4-23e5bbe40518"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"schedule"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"0 0 * * *"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"grace_period"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("20")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"timezone"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"UTC"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"status"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"up"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"last_ping"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"2018-08-12T21:01:08+00:00"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"running_time"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("2")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"running_time_unit"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"minutes"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"created_at"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"2018-08-21T21:00:51+00:00"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),a("h3",{attrs:{id:"get-an-existing-monitor"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#get-an-existing-monitor"}},[t._v("#")]),t._v(" Get an existing monitor")]),t._v(" "),a("p",[a("code",[t._v("GET https://cronhub.io/api/v1/monitors/")]),t._v(" Get an existing monitor by its uuid.")]),t._v(" "),a("div",{staticClass:"custom-block tip"},[a("p",{staticClass:"custom-block-title"},[t._v("TIP")]),t._v(" "),a("p",[a("code",[t._v("")]),t._v(' is the unique id that identifies your monitor. You can find it if you go to the monitor\'s\n"How to Integrate" page.')])]),t._v(" "),a("p",[t._v("Example Request")]),t._v(" "),a("div",{staticClass:"language-bash extra-class"},[a("pre",{pre:!0,attrs:{class:"language-bash"}},[a("code",[a("span",{pre:!0,attrs:{class:"token function"}},[t._v("curl")]),t._v(" --header "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"X-Api-Key: api-key"')]),t._v(" https://cronhub.io/api/v1/monitors/b531e120-a018-11e8-93de-5b0f21d9156d\n")])])]),a("p",[t._v("Example Response")]),t._v(" "),a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"success"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("true")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"response"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"name"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Cronhub minutely monitor"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"code"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"b531e120-a018-11e8-93de-5b0f21d9156d"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"schedule"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"* * * * *"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"grace_period"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("5")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"timezone"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"UTC"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"status"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"up"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"last_ping"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"2018-08-12T21:01:08+00:00"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"running_time"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token null"}},[t._v("null")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"running_time_unit"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token null"}},[t._v("null")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"created_at"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"2018-08-21T21:00:51+00:00"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),a("h3",{attrs:{id:"create-a-new-monitor"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#create-a-new-monitor"}},[t._v("#")]),t._v(" Create a new monitor")]),t._v(" "),a("p",[t._v("Create a new monitor with the given arguments.")]),t._v(" "),a("div",{staticClass:"language-bash extra-class"},[a("pre",{pre:!0,attrs:{class:"language-bash"}},[a("code",[a("span",{pre:!0,attrs:{class:"token function"}},[t._v("curl")]),t._v(" -X "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"POST"')]),t._v(" --header "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"X-Api-Key: api-key"')]),t._v(" \\\n -d name"),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v("'Cronhub monitor example'")]),t._v(" \\\n -d schedule"),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v("'* * * * *'")]),t._v(" \\\n -d grace_period"),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v("1 \\\n -d timezone"),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v("UTC \\\n https://cronhub.io/api/v1/monitors\n")])])]),a("table",[a("thead",[a("tr",[a("th",[t._v("Argument")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("Description")]),t._v(" "),a("th",{staticStyle:{"text-align":"right"}})])]),t._v(" "),a("tbody",[a("tr",[a("td",[a("code",[t._v("name")])]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("The name of the monitor you want to create")]),t._v(" "),a("td",{staticStyle:{"text-align":"right"}},[t._v("Required")])]),t._v(" "),a("tr",[a("td",[a("code",[t._v("schedule")])]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("The cron schedule (e.g. 0 0 * * *)")]),t._v(" "),a("td",{staticStyle:{"text-align":"right"}},[t._v("Required")])]),t._v(" "),a("tr",[a("td",[a("code",[t._v("timezone")])]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("Your server timezone (e.g. UTC)")]),t._v(" "),a("td",{staticStyle:{"text-align":"right"}},[t._v("Required")])]),t._v(" "),a("tr",[a("td",[a("code",[t._v("grace_period")])]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("Grace period by minutes. The value should be between 1 and 60.")]),t._v(" "),a("td",{staticStyle:{"text-align":"right"}},[t._v("Required")])]),t._v(" "),a("tr",[a("td",[a("code",[t._v("running_time")])]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("The running time threshold. The value should be an integer.")]),t._v(" "),a("td",{staticStyle:{"text-align":"right"}},[t._v("Optional")])]),t._v(" "),a("tr",[a("td",[a("code",[t._v("running_time_unit")])]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("The running time unit. The value should be any of the following time units: "),a("code",[t._v("seconds")]),t._v(", "),a("code",[t._v("minutes")]),t._v(", "),a("code",[t._v("hours")]),t._v(", "),a("code",[t._v("days")]),t._v(", "),a("code",[t._v("weeks")])]),t._v(" "),a("td",{staticStyle:{"text-align":"right"}},[t._v("Required only if "),a("code",[t._v("running_time")]),t._v(" is present.")])])])]),t._v(" "),a("div",{staticClass:"custom-block warning"},[a("p",{staticClass:"custom-block-title"},[t._v("WARNING")]),t._v(" "),a("p",[t._v("By default we will set "),a("code",[t._v("E-mail")]),t._v(" as the only notification channel for your monitor. You can always change it on Cronhub.")])]),t._v(" "),a("p",[t._v("Example Request")]),t._v(" "),a("div",{staticClass:"language-bash extra-class"},[a("pre",{pre:!0,attrs:{class:"language-bash"}},[a("code",[a("span",{pre:!0,attrs:{class:"token function"}},[t._v("curl")]),t._v(" -X "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"POST"')]),t._v(" --header "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"X-Api-Key: ch_5b67f0d9ee835"')]),t._v(" -d name"),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v("'Cronhub monitor example'")]),t._v(" -d schedule"),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v("'* * * * *'")]),t._v(" -d grace_period"),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v("1 -d timezone"),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v("'UTC'")]),t._v(" https://cronhub.io/api/v1/monitors\n")])])]),a("p",[t._v("Example Response")]),t._v(" "),a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"success"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("true")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"response"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"name"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Cronhub monitor example"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"code"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"24b70a00-9fef-11e8-aec8-258e1cb2dfaa"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"schedule"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"* * * * *"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"grace_period"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"timezone"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"UTC"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"status"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token null"}},[t._v("null")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"running_time"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token null"}},[t._v("null")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"running_time_unit"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token null"}},[t._v("null")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"created_at"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"2018-08-21T21:00:51+00:00"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),a("h3",{attrs:{id:"update-an-existing-monitor"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#update-an-existing-monitor"}},[t._v("#")]),t._v(" Update an existing monitor")]),t._v(" "),a("div",{staticClass:"language-bash extra-class"},[a("pre",{pre:!0,attrs:{class:"language-bash"}},[a("code",[a("span",{pre:!0,attrs:{class:"token function"}},[t._v("curl")]),t._v(" -X "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"PUT"')]),t._v(" --header "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"X-Api-Key: api-key"')]),t._v(" \\\n -d name"),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v("'Daily Email Report'")]),t._v(" \\\n -d schedule"),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v("'0 0 * * *'")]),t._v(" \\\n -d grace_period"),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v("20 \\\n -d timezone"),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v("UTC \\\n https://cronhub.io/api/v1/monitors/ff722460-a026-11e8-b4f1-f5e50b7346a6\n")])])]),a("table",[a("thead",[a("tr",[a("th",[t._v("Argument")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("Description")]),t._v(" "),a("th",{staticStyle:{"text-align":"right"}})])]),t._v(" "),a("tbody",[a("tr",[a("td",[a("code",[t._v("name")])]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("The name of the monitor you want to create")]),t._v(" "),a("td",{staticStyle:{"text-align":"right"}},[t._v("Required")])]),t._v(" "),a("tr",[a("td",[a("code",[t._v("schedule")])]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("The cron schedule (e.g. 0 0 * * *)")]),t._v(" "),a("td",{staticStyle:{"text-align":"right"}},[t._v("Required")])]),t._v(" "),a("tr",[a("td",[a("code",[t._v("timezone")])]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("Your server timezone (e.g. UTC)")]),t._v(" "),a("td",{staticStyle:{"text-align":"right"}},[t._v("Required")])]),t._v(" "),a("tr",[a("td",[a("code",[t._v("grace_period")])]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("Grace period by minutes. The value should be between 1 and 60.")]),t._v(" "),a("td",{staticStyle:{"text-align":"right"}},[t._v("Required")])]),t._v(" "),a("tr",[a("td",[a("code",[t._v("running_time")])]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("The running time threshold. The value should be an integer.")]),t._v(" "),a("td",{staticStyle:{"text-align":"right"}},[t._v("Optional")])]),t._v(" "),a("tr",[a("td",[a("code",[t._v("running_time_unit")])]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("The running time unit. The value should be any of the following time units: "),a("code",[t._v("seconds")]),t._v(", "),a("code",[t._v("minutes")]),t._v(", "),a("code",[t._v("hours")]),t._v(", "),a("code",[t._v("days")]),t._v(", "),a("code",[t._v("weeks")])]),t._v(" "),a("td",{staticStyle:{"text-align":"right"}},[t._v("Required only if "),a("code",[t._v("running_time")]),t._v(" is present.")])])])]),t._v(" "),a("p",[t._v("Example Request")]),t._v(" "),a("div",{staticClass:"language-bash extra-class"},[a("pre",{pre:!0,attrs:{class:"language-bash"}},[a("code",[t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("curl")]),t._v(" -X "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"PUT"')]),t._v(" --header "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"X-Api-Key: ch_5b67f0d9ee835"')]),t._v(" -d name"),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v("'Daily Email Report'")]),t._v(" -d schedule"),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v("'0 0 * * *'")]),t._v(" -d grace_period"),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v("20 -d timezone"),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v("UTC https://cronhub.io/api/v1/monitors/ff722460-a026-11e8-b4f1-f5e50b7346a6\n")])])]),a("p",[t._v("Example Response")]),t._v(" "),a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"success"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("true")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"response"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"name"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Daily Email Report"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"code"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"ff722460-a026-11e8-b4f1-f5e50b7346a6"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"schedule"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"0 0 * * *"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"grace_period"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("20")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"timezone"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"UTC"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"status"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"new"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"running_time"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token null"}},[t._v("null")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"running_time_unit"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token null"}},[t._v("null")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"created_at"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"2018-08-21T21:00:51+00:00"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),a("h3",{attrs:{id:"delete-a-monitor"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#delete-a-monitor"}},[t._v("#")]),t._v(" Delete a monitor")]),t._v(" "),a("p",[a("code",[t._v("DELETE https://cronhub.io/api/v1/monitors/")]),t._v(" Delete an existing monitor.")]),t._v(" "),a("p",[t._v("Example request")]),t._v(" "),a("div",{staticClass:"language-bash extra-class"},[a("pre",{pre:!0,attrs:{class:"language-bash"}},[a("code",[a("span",{pre:!0,attrs:{class:"token function"}},[t._v("curl")]),t._v(" -X "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"DELETE"')]),t._v(" --header "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"X-Api-Key: api-key"')]),t._v(" https://cronhub.io/api/v1/monitors/4aa80130-995a-11e8-b107-1992dc48b7c2\n")])])]),a("p",[t._v("Example response")]),t._v(" "),a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"success"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("true")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"response"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),a("h3",{attrs:{id:"pause-a-monitor"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#pause-a-monitor"}},[t._v("#")]),t._v(" Pause a monitor")]),t._v(" "),a("p",[a("code",[t._v("PUT https://cronhub.io/api/v1/monitors//pause")]),t._v(" Pause an existing monitor.")]),t._v(" "),a("p",[t._v("Example request")]),t._v(" "),a("div",{staticClass:"language-bash extra-class"},[a("pre",{pre:!0,attrs:{class:"language-bash"}},[a("code",[a("span",{pre:!0,attrs:{class:"token function"}},[t._v("curl")]),t._v(" -X "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"PUT"')]),t._v(" --header "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"X-Api-Key: api-key"')]),t._v(" https://cronhub.io/api/v1/monitors/b5e5e820-9945-11e8-8dd4-23e5bbe40518/pause\n")])])]),a("p",[t._v("Example response")]),t._v(" "),a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"success"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("true")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"response"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"name"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"My Daily Cron Monitor"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"code"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"b5e5e820-9945-11e8-8dd4-23e5bbe40518"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"schedule"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"0 0 * * *"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"timezone"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"UTC"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"status"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"paused"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"last_ping"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"2018-08-12T21:01:08+00:00"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"running_time"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("2")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"running_time_unit"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"minutes"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"created_at"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"2018-08-21T21:00:51+00:00"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])])},[],!1,null,null,null);s.default=n.exports}}]); \ No newline at end of file diff --git a/docs/.vuepress/dist/assets/js/5.3fedee2d.js b/docs/.vuepress/dist/assets/js/5.3fedee2d.js new file mode 100644 index 0000000..1ed6f5b --- /dev/null +++ b/docs/.vuepress/dist/assets/js/5.3fedee2d.js @@ -0,0 +1 @@ +(window.webpackJsonp=window.webpackJsonp||[]).push([[5],{219:function(t,s,a){"use strict";a.r(s);var e=a(28),r=Object(e.a)({},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("ContentSlotsDistributor",{attrs:{"slot-key":t.$parent.slotKey}},[a("h1",{attrs:{id:"public-api"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#public-api"}},[t._v("#")]),t._v(" Public API")]),t._v(" "),a("p",[t._v("Cronhub Public API is a REST like API that supports basic CRUD operations on top of Cronhub resources. Our API uses HTTP response codes to indicate any API errors. All API responses are JSON objects.")]),t._v(" "),a("p",[t._v("If you have any ideas or suggestions about the API "),a("a",{attrs:{href:"https://github.com/cronhub-app/backlog/issues",target:"_blank",rel:"noopener noreferrer"}},[t._v("let us know on Github"),a("OutboundLink")],1),t._v(".")]),t._v(" "),a("p",[t._v("We reserve the right to rate-limit any access key if we feel you're not using the API fairly.")]),t._v(" "),a("p"),a("div",{staticClass:"table-of-contents"},[a("ul",[a("li",[a("a",{attrs:{href:"#authentication"}},[t._v("Authentication")])]),a("li",[a("a",{attrs:{href:"#tada-scheduler-api-endpoints"}},[t._v("🎉 Scheduler API Endpoints")]),a("ul",[a("li",[a("a",{attrs:{href:"#list-all-schedulers"}},[t._v("List all schedulers")])]),a("li",[a("a",{attrs:{href:"#get-an-existing-scheduler"}},[t._v("Get an existing scheduler")])]),a("li",[a("a",{attrs:{href:"#create-a-new-scheduler"}},[t._v("Create a new scheduler")])]),a("li",[a("a",{attrs:{href:"#update-an-existing-scheduler"}},[t._v("Update an existing scheduler")])]),a("li",[a("a",{attrs:{href:"#delete-a-scheduler"}},[t._v("Delete a scheduler")])]),a("li",[a("a",{attrs:{href:"#pause-a-scheduler"}},[t._v("Pause a scheduler")])]),a("li",[a("a",{attrs:{href:"#resume-a-scheduler"}},[t._v("Resume a scheduler")])])])]),a("li",[a("a",{attrs:{href:"#monitor-api-endpoints"}},[t._v("Monitor API Endpoints")]),a("ul",[a("li",[a("a",{attrs:{href:"#list-all-monitors"}},[t._v("List all monitors")])]),a("li",[a("a",{attrs:{href:"#get-an-existing-monitor"}},[t._v("Get an existing monitor")])]),a("li",[a("a",{attrs:{href:"#create-a-new-monitor"}},[t._v("Create a new monitor")])]),a("li",[a("a",{attrs:{href:"#update-an-existing-monitor"}},[t._v("Update an existing monitor")])]),a("li",[a("a",{attrs:{href:"#delete-a-monitor"}},[t._v("Delete a monitor")])]),a("li",[a("a",{attrs:{href:"#pause-a-monitor"}},[t._v("Pause a monitor")])])])])])]),a("p"),t._v(" "),a("h2",{attrs:{id:"authentication"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#authentication"}},[t._v("#")]),t._v(" Authentication")]),t._v(" "),a("p",[t._v("All API requests must be authenticated by the API key that Cronhub provides. When you "),a("a",{attrs:{href:"https://cronhub.io/register",target:"_blank",rel:"noopener noreferrer"}},[t._v("create a new Cronhub account"),a("OutboundLink")],1),t._v(' you will get an API key. You can find it on the "Settings" page of the site. Here is an example how it may look '),a("code",[t._v("ch_5b73b46baf0c00.55022502")]),t._v(".")]),t._v(" "),a("p",[a("strong",[t._v("You can authenticate your requests by sending the API key in your HTTP request header. The name of the header should be "),a("code",[t._v("X-Api-Key")]),t._v(" and the value should be your key.")])]),t._v(" "),a("p",[t._v("You need an active billing plan on Cronhub to work with Cronhub resources.")]),t._v(" "),a("h2",{attrs:{id:"scheduler-api-endpoints"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#scheduler-api-endpoints"}},[t._v("#")]),t._v(" 🎉 Scheduler API Endpoints")]),t._v(" "),a("h3",{attrs:{id:"list-all-schedulers"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#list-all-schedulers"}},[t._v("#")]),t._v(" List all schedulers")]),t._v(" "),a("p",[a("code",[t._v("GET https://cronhub.io/api/v1/schedulers")]),t._v(" Get the list of all your existing schedulers.")]),t._v(" "),a("p",[t._v("Example Request")]),t._v(" "),a("div",{staticClass:"language-bash extra-class"},[a("pre",{pre:!0,attrs:{class:"language-bash"}},[a("code",[a("span",{pre:!0,attrs:{class:"token function"}},[t._v("curl")]),t._v(" --header "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"X-Api-Key: api-key"')]),t._v(" https://cronhub.io/api/v1/schedulers\n")])])]),a("p",[t._v("Example Response")]),t._v(" "),a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"schedulers"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"id"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"name"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"my scheduler"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"description"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token null"}},[t._v("null")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"interval_schedule_value"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token null"}},[t._v("null")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"interval_schedule_rate"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token null"}},[t._v("null")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"type"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"cron"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"schedule"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"0 0 * * *"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"timezone"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"UTC"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"status"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"paused"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"url"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"https://example.com"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"http_body"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"http_method"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"get"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"created_at"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1589647300")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"updated_at"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1589647361")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"id"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"name"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"backup database"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"description"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token null"}},[t._v("null")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"interval_schedule_value"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("12")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"interval_schedule_rate"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"hours"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"type"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"interval"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"schedule"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token null"}},[t._v("null")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"timezone"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"UTC"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"status"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"active"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"url"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"https://myapiendpoint.com/run_backup"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"http_body"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"http_method"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"get"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"created_at"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1589631880")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"updated_at"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1589631880")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),a("h3",{attrs:{id:"get-an-existing-scheduler"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#get-an-existing-scheduler"}},[t._v("#")]),t._v(" Get an existing scheduler")]),t._v(" "),a("p",[a("code",[t._v("GET https://cronhub.test/api/v1/schedulers/")]),t._v(" Get an existing scheduler by its unique id.")]),t._v(" "),a("div",{staticClass:"custom-block tip"},[a("p",{staticClass:"custom-block-title"},[t._v("TIP")]),t._v(" "),a("p",[a("code",[t._v("")]),t._v(" is the unique id that identifies your scheduler. You can find it if you go to the scheduler's page. It's the number you see in the browser's URL address bar.")])]),t._v(" "),a("p",[t._v("Example Request")]),t._v(" "),a("div",{staticClass:"language-bash extra-class"},[a("pre",{pre:!0,attrs:{class:"language-bash"}},[a("code",[a("span",{pre:!0,attrs:{class:"token function"}},[t._v("curl")]),t._v(" --header "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"X-Api-Key: api-key"')]),t._v(" https://cronhub.io/api/v1/schedulers/1\n")])])]),a("p",[t._v("Example Response")]),t._v(" "),a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"scheduler"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"id"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"name"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"run lambda function"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"description"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token null"}},[t._v("null")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"interval_schedule_value"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("12")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"interval_schedule_rate"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"hours"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"type"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"interval"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"schedule"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token null"}},[t._v("null")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"timezone"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"UTC"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"status"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"paused"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"url"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"https://www.netlify.com/api/run_amazing_function"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"http_body"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"http_method"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"get"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"created_at"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1589827724")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"updated_at"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1589828386")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),a("h3",{attrs:{id:"create-a-new-scheduler"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#create-a-new-scheduler"}},[t._v("#")]),t._v(" Create a new scheduler")]),t._v(" "),a("p",[a("code",[t._v("POST https://cronhub.io/api/v1/schedulers/create")])]),t._v(" "),a("p",[t._v("Create a new scheduler with the given arguments.")]),t._v(" "),a("table",[a("thead",[a("tr",[a("th",[t._v("Argument")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("Description")]),t._v(" "),a("th",{staticStyle:{"text-align":"right"}},[t._v("Is required")])])]),t._v(" "),a("tbody",[a("tr",[a("td",[a("code",[t._v("name")])]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("The name of your scheduler.")]),t._v(" "),a("td",{staticStyle:{"text-align":"right"}},[t._v("yes")])]),t._v(" "),a("tr",[a("td",[a("code",[t._v("type")])]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("The type of your scheduler. Must be "),a("code",[t._v("cron")]),t._v(" or "),a("code",[t._v("interval")]),t._v(".")]),t._v(" "),a("td",{staticStyle:{"text-align":"right"}},[t._v("yes")])]),t._v(" "),a("tr",[a("td",[a("code",[t._v("url")])]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("The HTTP target URL. Must be a valid URL.")]),t._v(" "),a("td",{staticStyle:{"text-align":"right"}},[t._v("yes")])]),t._v(" "),a("tr",[a("td",[a("code",[t._v("http_method")])]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("The HTTP method")]),t._v(" "),a("td",{staticStyle:{"text-align":"right"}},[t._v("yes")])]),t._v(" "),a("tr",[a("td",[a("code",[t._v("http_body")])]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("The HTTP body when the "),a("code",[t._v("http_method")]),t._v(" is "),a("code",[t._v("POST")]),t._v(" or "),a("code",[t._v("PUT")])]),t._v(" "),a("td",{staticStyle:{"text-align":"right"}},[t._v("no")])]),t._v(" "),a("tr",[a("td",[a("code",[t._v("schedule")])]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("The cron expression schedule (e.g. "),a("code",[t._v("0 0 * * *")]),t._v(")")]),t._v(" "),a("td",{staticStyle:{"text-align":"right"}},[t._v("yes, if "),a("code",[t._v("type")]),t._v(" is `cron")])]),t._v(" "),a("tr",[a("td",[a("code",[t._v("interval_value")])]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("The interval value. Must be a positive integer.")]),t._v(" "),a("td",{staticStyle:{"text-align":"right"}},[t._v("yes, if "),a("code",[t._v("type")]),t._v(" is "),a("code",[t._v("interval")])])]),t._v(" "),a("tr",[a("td",[a("code",[t._v("interval_rate")])]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("The interval rate. Must be "),a("code",[t._v("minutes")]),t._v(", "),a("code",[t._v("hours")]),t._v(" or "),a("code",[t._v("days")]),t._v(" only.")]),t._v(" "),a("td",{staticStyle:{"text-align":"right"}},[t._v("yes, if "),a("code",[t._v("type")]),t._v(" is "),a("code",[t._v("interval")])])]),t._v(" "),a("tr",[a("td",[a("code",[t._v("timezone")])]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v('Should be "UTC" for now')]),t._v(" "),a("td",{staticStyle:{"text-align":"right"}},[t._v("yes, if "),a("code",[t._v("type")]),t._v(" is "),a("code",[t._v("cron")])])])])]),t._v(" "),a("p",[t._v("Example request:")]),t._v(" "),a("div",{staticClass:"language-bash extra-class"},[a("pre",{pre:!0,attrs:{class:"language-bash"}},[a("code",[a("span",{pre:!0,attrs:{class:"token function"}},[t._v("curl")]),t._v(" -X "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"POST"')]),t._v(" --header "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"X-Api-Key: api-key"')]),t._v(" \\\n -d name"),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v("'scheduler example'")]),t._v(" \\\n -d type"),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v("'cron'")]),t._v(" \\\n -d url"),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v("'https://example-api.com/run_job'")]),t._v(" \\\n -d http_method"),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v("'get'")]),t._v(" \\\n -d schedule"),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v("'* * * * *'")]),t._v(" \\\n -d timezone"),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v("'UTC'")]),t._v(" \\\n https://cronhub.io/api/v1/schedulers/create\n")])])]),a("p",[t._v("Example response:")]),t._v(" "),a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"created"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"id"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"name"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"scheduler example\'"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"description"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token null"}},[t._v("null")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"interval_schedule_value"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token null"}},[t._v("null")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"interval_schedule_rate"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token null"}},[t._v("null")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"type"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"cron"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"schedule"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"* * * * *"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"timezone"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"UTC"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"status"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"active"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"url"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"https://example-api.com/run_job"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"http_body"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"http_method"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"get"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"created_at"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1589829544")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"updated_at"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1589829544")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),a("h3",{attrs:{id:"update-an-existing-scheduler"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#update-an-existing-scheduler"}},[t._v("#")]),t._v(" Update an existing scheduler")]),t._v(" "),a("p",[a("code",[t._v("PUT https://cronhub.io/api/v1/schedulers/")])]),t._v(" "),a("div",{staticClass:"custom-block tip"},[a("p",{staticClass:"custom-block-title"},[t._v("TIP")]),t._v(" "),a("p",[a("code",[t._v("")]),t._v(" is the unique id that identifies your scheduler. You can find it if you go to the scheduler's page. It's the number you see in the browser's URL address bar.")])]),t._v(" "),a("p",[t._v("Update the scheduler with the given arguments.")]),t._v(" "),a("table",[a("thead",[a("tr",[a("th",[t._v("Argument")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("Description")]),t._v(" "),a("th",{staticStyle:{"text-align":"right"}},[t._v("Is required")])])]),t._v(" "),a("tbody",[a("tr",[a("td",[a("code",[t._v("name")])]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("The name of your scheduler.")]),t._v(" "),a("td",{staticStyle:{"text-align":"right"}},[t._v("yes")])]),t._v(" "),a("tr",[a("td",[a("code",[t._v("type")])]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("The type of your scheduler. Must be "),a("code",[t._v("cron")]),t._v(" or "),a("code",[t._v("interval")]),t._v(".")]),t._v(" "),a("td",{staticStyle:{"text-align":"right"}},[t._v("yes")])]),t._v(" "),a("tr",[a("td",[a("code",[t._v("url")])]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("The HTTP target URL. Must be a valid URL.")]),t._v(" "),a("td",{staticStyle:{"text-align":"right"}},[t._v("yes")])]),t._v(" "),a("tr",[a("td",[a("code",[t._v("http_method")])]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("The HTTP method")]),t._v(" "),a("td",{staticStyle:{"text-align":"right"}},[t._v("yes")])]),t._v(" "),a("tr",[a("td",[a("code",[t._v("http_body")])]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("The HTTP body when the "),a("code",[t._v("http_method")]),t._v(" is "),a("code",[t._v("POST")]),t._v(" or "),a("code",[t._v("PUT")])]),t._v(" "),a("td",{staticStyle:{"text-align":"right"}},[t._v("no")])]),t._v(" "),a("tr",[a("td",[a("code",[t._v("schedule")])]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("The cron expression schedule (e.g. "),a("code",[t._v("0 0 * * *")]),t._v(")")]),t._v(" "),a("td",{staticStyle:{"text-align":"right"}},[t._v("yes, if "),a("code",[t._v("type")]),t._v(" is `cron")])]),t._v(" "),a("tr",[a("td",[a("code",[t._v("interval_value")])]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("The interval value. Must be a positive integer.")]),t._v(" "),a("td",{staticStyle:{"text-align":"right"}},[t._v("yes, if "),a("code",[t._v("type")]),t._v(" is "),a("code",[t._v("interval")])])]),t._v(" "),a("tr",[a("td",[a("code",[t._v("interval_rate")])]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("The interval rate. Must be "),a("code",[t._v("minutes")]),t._v(", "),a("code",[t._v("hours")]),t._v(" or "),a("code",[t._v("days")]),t._v(" only.")]),t._v(" "),a("td",{staticStyle:{"text-align":"right"}},[t._v("yes, if "),a("code",[t._v("type")]),t._v(" is "),a("code",[t._v("interval")])])]),t._v(" "),a("tr",[a("td",[a("code",[t._v("timezone")])]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v('Should be "UTC" for now')]),t._v(" "),a("td",{staticStyle:{"text-align":"right"}},[t._v("yes, if "),a("code",[t._v("type")]),t._v(" is "),a("code",[t._v("cron")])])])])]),t._v(" "),a("p",[t._v("Example request:")]),t._v(" "),a("div",{staticClass:"language-bash extra-class"},[a("pre",{pre:!0,attrs:{class:"language-bash"}},[a("code",[a("span",{pre:!0,attrs:{class:"token function"}},[t._v("curl")]),t._v(" -X "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"PUT"')]),t._v(" --header "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"X-Api-Key: api-key"')]),t._v(" \\\n -d name"),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v("'scheduler example changed'")]),t._v(" \\\n -d type"),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v("'cron'")]),t._v(" \\\n -d url"),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v("'https://example-api.com/run_job'")]),t._v(" \\\n -d http_method"),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v("'get'")]),t._v(" \\\n -d schedule"),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v("'0 0 * * *'")]),t._v(" \\\n -d timezone"),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v("'UTC'")]),t._v(" \\\n https://cronhub.io/api/v1/schedulers/1\n")])])]),a("p",[t._v("Example response:")]),t._v(" "),a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"updated"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"id"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"name"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"scheduler example changed\'"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"description"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token null"}},[t._v("null")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"interval_schedule_value"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token null"}},[t._v("null")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"interval_schedule_rate"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token null"}},[t._v("null")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"type"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"cron"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"schedule"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"0 0 * * *"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"timezone"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"UTC"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"status"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"active"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"url"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"https://example-api.com/run_job"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"http_body"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"http_method"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"get"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"created_at"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1589829544")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"updated_at"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1589829544")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),a("h3",{attrs:{id:"delete-a-scheduler"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#delete-a-scheduler"}},[t._v("#")]),t._v(" Delete a scheduler")]),t._v(" "),a("p",[a("code",[t._v("DELETE https://cronhub.io/api/v1/schedulers/")]),t._v(" Delete the scheduler with the given id.")]),t._v(" "),a("p",[t._v("Example request:")]),t._v(" "),a("div",{staticClass:"language-bash extra-class"},[a("pre",{pre:!0,attrs:{class:"language-bash"}},[a("code",[a("span",{pre:!0,attrs:{class:"token function"}},[t._v("curl")]),t._v(" -X "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"DELETE"')]),t._v(" --header "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"X-Api-Key: api-key"')]),t._v(" https://cronhub.io/api/v1/schedulers/1\n")])])]),a("p",[t._v("Example response:")]),t._v(" "),a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"deleted"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("true")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),a("h3",{attrs:{id:"pause-a-scheduler"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#pause-a-scheduler"}},[t._v("#")]),t._v(" Pause a scheduler")]),t._v(" "),a("p",[a("code",[t._v("PUT https://cronhub.io/api/v1/schedulers//pause")])]),t._v(" "),a("p",[t._v("Pause the scheduler with the given id. Sets the "),a("code",[t._v("status")]),t._v(" field to "),a("code",[t._v("paused")]),t._v(".")]),t._v(" "),a("p",[t._v("Example request:")]),t._v(" "),a("div",{staticClass:"language-bash extra-class"},[a("pre",{pre:!0,attrs:{class:"language-bash"}},[a("code",[a("span",{pre:!0,attrs:{class:"token function"}},[t._v("curl")]),t._v(" -X "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"PUT"')]),t._v(" --header "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"X-Api-Key: api-key"')]),t._v(" https://cronhub.io/api/v1/schedulers/1/pause\n")])])]),a("p",[t._v("Example response:")]),t._v(" "),a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"paused"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"id"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"name"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"my scheduler"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"description"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token null"}},[t._v("null")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"interval_schedule_value"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token null"}},[t._v("null")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"interval_schedule_rate"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token null"}},[t._v("null")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"type"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"cron"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"schedule"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"0 0 * * *"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"timezone"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"UTC"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"status"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"paused"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"url"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"https://exampleurl.com"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"http_body"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"http_method"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"get"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"created_at"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1589647300")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"updated_at"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1589829046")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),a("h3",{attrs:{id:"resume-a-scheduler"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#resume-a-scheduler"}},[t._v("#")]),t._v(" Resume a scheduler")]),t._v(" "),a("p",[a("code",[t._v("PUT https://cronhub.io/api/v1/schedulers//resume")])]),t._v(" "),a("p",[t._v("Resume the scheduler with the given id. Sets the "),a("code",[t._v("status")]),t._v(" field to "),a("code",[t._v("active")]),t._v(".")]),t._v(" "),a("p",[t._v("Example request:")]),t._v(" "),a("div",{staticClass:"language-bash extra-class"},[a("pre",{pre:!0,attrs:{class:"language-bash"}},[a("code",[a("span",{pre:!0,attrs:{class:"token function"}},[t._v("curl")]),t._v(" -X "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"PUT"')]),t._v(" --header "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"X-Api-Key: api-key"')]),t._v(" https://cronhub.io/api/v1/schedulers/1/resume\n")])])]),a("p",[t._v("Example response:")]),t._v(" "),a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"resumed"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"id"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"name"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"my scheduler"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"description"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token null"}},[t._v("null")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"interval_schedule_value"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token null"}},[t._v("null")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"interval_schedule_rate"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token null"}},[t._v("null")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"type"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"cron"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"schedule"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"0 0 * * *"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"timezone"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"UTC"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"status"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"active"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"url"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"https://exampleurl.com"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"http_body"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"http_method"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"get"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"created_at"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1589647300")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"updated_at"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1589829046")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),a("h2",{attrs:{id:"monitor-api-endpoints"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#monitor-api-endpoints"}},[t._v("#")]),t._v(" Monitor API Endpoints")]),t._v(" "),a("h3",{attrs:{id:"list-all-monitors"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#list-all-monitors"}},[t._v("#")]),t._v(" List all monitors")]),t._v(" "),a("p",[a("code",[t._v("GET https://cronhub.io/api/v1/monitors")]),t._v(" Get the list of all your existing monitors.")]),t._v(" "),a("p",[t._v("Example Request")]),t._v(" "),a("div",{staticClass:"language-bash extra-class"},[a("pre",{pre:!0,attrs:{class:"language-bash"}},[a("code",[a("span",{pre:!0,attrs:{class:"token function"}},[t._v("curl")]),t._v(" --header "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"X-Api-Key: api-key"')]),t._v(" https://cronhub.io/api/v1/monitors\n")])])]),a("p",[t._v("Example Response")]),t._v(" "),a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"success"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("true")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"response"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"name"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Daily database backup"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"code"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"cbe02bb0-9e72-11e8-ba9d-2bd49279e066"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"schedule"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"0 0 * * *"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"grace_period"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("2")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"timezone"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"UTC"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"status"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"up"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"last_ping"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"2018-08-12T21:01:08+00:00"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"running_time"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"running_time_unit"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"minutes"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"created_at"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"2018-08-21T21:00:51+00:00"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"name"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"My Daily Cron Monitor"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"code"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"b5e5e820-9945-11e8-8dd4-23e5bbe40518"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"schedule"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"0 0 * * *"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"grace_period"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("20")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"timezone"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"UTC"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"status"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"up"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"last_ping"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"2018-08-12T21:01:08+00:00"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"running_time"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("2")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"running_time_unit"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"minutes"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"created_at"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"2018-08-21T21:00:51+00:00"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),a("h3",{attrs:{id:"get-an-existing-monitor"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#get-an-existing-monitor"}},[t._v("#")]),t._v(" Get an existing monitor")]),t._v(" "),a("p",[a("code",[t._v("GET https://cronhub.io/api/v1/monitors/")]),t._v(" Get an existing monitor by its uuid.")]),t._v(" "),a("div",{staticClass:"custom-block tip"},[a("p",{staticClass:"custom-block-title"},[t._v("TIP")]),t._v(" "),a("p",[a("code",[t._v("")]),t._v(' is the unique id that identifies your monitor. You can find it if you go to the monitor\'s\n"How to Integrate" page.')])]),t._v(" "),a("p",[t._v("Example Request")]),t._v(" "),a("div",{staticClass:"language-bash extra-class"},[a("pre",{pre:!0,attrs:{class:"language-bash"}},[a("code",[a("span",{pre:!0,attrs:{class:"token function"}},[t._v("curl")]),t._v(" --header "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"X-Api-Key: api-key"')]),t._v(" https://cronhub.io/api/v1/monitors/b531e120-a018-11e8-93de-5b0f21d9156d\n")])])]),a("p",[t._v("Example Response")]),t._v(" "),a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"success"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("true")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"response"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"name"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Cronhub minutely monitor"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"code"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"b531e120-a018-11e8-93de-5b0f21d9156d"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"schedule"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"* * * * *"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"grace_period"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("5")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"timezone"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"UTC"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"status"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"up"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"last_ping"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"2018-08-12T21:01:08+00:00"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"running_time"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token null"}},[t._v("null")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"running_time_unit"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token null"}},[t._v("null")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"created_at"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"2018-08-21T21:00:51+00:00"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),a("h3",{attrs:{id:"create-a-new-monitor"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#create-a-new-monitor"}},[t._v("#")]),t._v(" Create a new monitor")]),t._v(" "),a("p",[t._v("Create a new monitor with the given arguments.")]),t._v(" "),a("div",{staticClass:"language-bash extra-class"},[a("pre",{pre:!0,attrs:{class:"language-bash"}},[a("code",[a("span",{pre:!0,attrs:{class:"token function"}},[t._v("curl")]),t._v(" -X "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"POST"')]),t._v(" --header "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"X-Api-Key: api-key"')]),t._v(" \\\n -d name"),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v("'Cronhub monitor example'")]),t._v(" \\\n -d schedule"),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v("'* * * * *'")]),t._v(" \\\n -d grace_period"),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v("1 \\\n -d timezone"),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v("UTC \\\n https://cronhub.io/api/v1/monitors\n")])])]),a("table",[a("thead",[a("tr",[a("th",[t._v("Argument")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("Description")]),t._v(" "),a("th",{staticStyle:{"text-align":"right"}})])]),t._v(" "),a("tbody",[a("tr",[a("td",[a("code",[t._v("name")])]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("The name of the monitor you want to create")]),t._v(" "),a("td",{staticStyle:{"text-align":"right"}},[t._v("Required")])]),t._v(" "),a("tr",[a("td",[a("code",[t._v("schedule")])]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("The cron schedule (e.g. 0 0 * * *)")]),t._v(" "),a("td",{staticStyle:{"text-align":"right"}},[t._v("Required")])]),t._v(" "),a("tr",[a("td",[a("code",[t._v("timezone")])]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("Your server timezone (e.g. UTC)")]),t._v(" "),a("td",{staticStyle:{"text-align":"right"}},[t._v("Required")])]),t._v(" "),a("tr",[a("td",[a("code",[t._v("grace_period")])]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("Grace period by minutes. The value should be between 1 and 60.")]),t._v(" "),a("td",{staticStyle:{"text-align":"right"}},[t._v("Required")])]),t._v(" "),a("tr",[a("td",[a("code",[t._v("running_time")])]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("The running time threshold. The value should be an integer.")]),t._v(" "),a("td",{staticStyle:{"text-align":"right"}},[t._v("Optional")])]),t._v(" "),a("tr",[a("td",[a("code",[t._v("running_time_unit")])]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("The running time unit. The value should be any of the following time units: "),a("code",[t._v("seconds")]),t._v(", "),a("code",[t._v("minutes")]),t._v(", "),a("code",[t._v("hours")]),t._v(", "),a("code",[t._v("days")]),t._v(", "),a("code",[t._v("weeks")])]),t._v(" "),a("td",{staticStyle:{"text-align":"right"}},[t._v("Required only if "),a("code",[t._v("running_time")]),t._v(" is present.")])])])]),t._v(" "),a("div",{staticClass:"custom-block warning"},[a("p",{staticClass:"custom-block-title"},[t._v("WARNING")]),t._v(" "),a("p",[t._v("By default we will set "),a("code",[t._v("E-mail")]),t._v(" as the only notification channel for your monitor. You can always change it on Cronhub.")])]),t._v(" "),a("p",[t._v("Example Request")]),t._v(" "),a("div",{staticClass:"language-bash extra-class"},[a("pre",{pre:!0,attrs:{class:"language-bash"}},[a("code",[a("span",{pre:!0,attrs:{class:"token function"}},[t._v("curl")]),t._v(" -X "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"POST"')]),t._v(" --header "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"X-Api-Key: ch_5b67f0d9ee835"')]),t._v(" -d name"),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v("'Cronhub monitor example'")]),t._v(" -d schedule"),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v("'* * * * *'")]),t._v(" -d grace_period"),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v("1 -d timezone"),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v("'UTC'")]),t._v(" https://cronhub.io/api/v1/monitors\n")])])]),a("p",[t._v("Example Response")]),t._v(" "),a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"success"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("true")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"response"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"name"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Cronhub monitor example"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"code"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"24b70a00-9fef-11e8-aec8-258e1cb2dfaa"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"schedule"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"* * * * *"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"grace_period"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"timezone"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"UTC"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"status"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token null"}},[t._v("null")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"running_time"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token null"}},[t._v("null")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"running_time_unit"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token null"}},[t._v("null")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"created_at"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"2018-08-21T21:00:51+00:00"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),a("h3",{attrs:{id:"update-an-existing-monitor"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#update-an-existing-monitor"}},[t._v("#")]),t._v(" Update an existing monitor")]),t._v(" "),a("div",{staticClass:"language-bash extra-class"},[a("pre",{pre:!0,attrs:{class:"language-bash"}},[a("code",[a("span",{pre:!0,attrs:{class:"token function"}},[t._v("curl")]),t._v(" -X "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"PUT"')]),t._v(" --header "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"X-Api-Key: api-key"')]),t._v(" \\\n -d name"),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v("'Daily Email Report'")]),t._v(" \\\n -d schedule"),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v("'0 0 * * *'")]),t._v(" \\\n -d grace_period"),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v("20 \\\n -d timezone"),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v("UTC \\\n https://cronhub.io/api/v1/monitors/ff722460-a026-11e8-b4f1-f5e50b7346a6\n")])])]),a("table",[a("thead",[a("tr",[a("th",[t._v("Argument")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("Description")]),t._v(" "),a("th",{staticStyle:{"text-align":"right"}})])]),t._v(" "),a("tbody",[a("tr",[a("td",[a("code",[t._v("name")])]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("The name of the monitor you want to create")]),t._v(" "),a("td",{staticStyle:{"text-align":"right"}},[t._v("Required")])]),t._v(" "),a("tr",[a("td",[a("code",[t._v("schedule")])]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("The cron schedule (e.g. 0 0 * * *)")]),t._v(" "),a("td",{staticStyle:{"text-align":"right"}},[t._v("Required")])]),t._v(" "),a("tr",[a("td",[a("code",[t._v("timezone")])]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("Your server timezone (e.g. UTC)")]),t._v(" "),a("td",{staticStyle:{"text-align":"right"}},[t._v("Required")])]),t._v(" "),a("tr",[a("td",[a("code",[t._v("grace_period")])]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("Grace period by minutes. The value should be between 1 and 60.")]),t._v(" "),a("td",{staticStyle:{"text-align":"right"}},[t._v("Required")])]),t._v(" "),a("tr",[a("td",[a("code",[t._v("running_time")])]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("The running time threshold. The value should be an integer.")]),t._v(" "),a("td",{staticStyle:{"text-align":"right"}},[t._v("Optional")])]),t._v(" "),a("tr",[a("td",[a("code",[t._v("running_time_unit")])]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("The running time unit. The value should be any of the following time units: "),a("code",[t._v("seconds")]),t._v(", "),a("code",[t._v("minutes")]),t._v(", "),a("code",[t._v("hours")]),t._v(", "),a("code",[t._v("days")]),t._v(", "),a("code",[t._v("weeks")])]),t._v(" "),a("td",{staticStyle:{"text-align":"right"}},[t._v("Required only if "),a("code",[t._v("running_time")]),t._v(" is present.")])])])]),t._v(" "),a("p",[t._v("Example Request")]),t._v(" "),a("div",{staticClass:"language-bash extra-class"},[a("pre",{pre:!0,attrs:{class:"language-bash"}},[a("code",[t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("curl")]),t._v(" -X "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"PUT"')]),t._v(" --header "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"X-Api-Key: ch_5b67f0d9ee835"')]),t._v(" -d name"),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v("'Daily Email Report'")]),t._v(" -d schedule"),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v("'0 0 * * *'")]),t._v(" -d grace_period"),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v("20 -d timezone"),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v("UTC https://cronhub.io/api/v1/monitors/ff722460-a026-11e8-b4f1-f5e50b7346a6\n")])])]),a("p",[t._v("Example Response")]),t._v(" "),a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"success"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("true")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"response"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"name"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Daily Email Report"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"code"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"ff722460-a026-11e8-b4f1-f5e50b7346a6"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"schedule"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"0 0 * * *"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"grace_period"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("20")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"timezone"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"UTC"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"status"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"new"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"running_time"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token null"}},[t._v("null")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"running_time_unit"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token null"}},[t._v("null")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"created_at"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"2018-08-21T21:00:51+00:00"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),a("h3",{attrs:{id:"delete-a-monitor"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#delete-a-monitor"}},[t._v("#")]),t._v(" Delete a monitor")]),t._v(" "),a("p",[a("code",[t._v("DELETE https://cronhub.io/api/v1/monitors/")]),t._v(" Delete an existing monitor.")]),t._v(" "),a("p",[t._v("Example request")]),t._v(" "),a("div",{staticClass:"language-bash extra-class"},[a("pre",{pre:!0,attrs:{class:"language-bash"}},[a("code",[a("span",{pre:!0,attrs:{class:"token function"}},[t._v("curl")]),t._v(" -X "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"DELETE"')]),t._v(" --header "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"X-Api-Key: api-key"')]),t._v(" https://cronhub.io/api/v1/monitors/4aa80130-995a-11e8-b107-1992dc48b7c2\n")])])]),a("p",[t._v("Example response")]),t._v(" "),a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"success"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("true")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"response"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),a("h3",{attrs:{id:"pause-a-monitor"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#pause-a-monitor"}},[t._v("#")]),t._v(" Pause a monitor")]),t._v(" "),a("p",[a("code",[t._v("PUT https://cronhub.io/api/v1/monitors//pause")]),t._v(" Pause an existing monitor.")]),t._v(" "),a("p",[t._v("Example request")]),t._v(" "),a("div",{staticClass:"language-bash extra-class"},[a("pre",{pre:!0,attrs:{class:"language-bash"}},[a("code",[a("span",{pre:!0,attrs:{class:"token function"}},[t._v("curl")]),t._v(" -X "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"PUT"')]),t._v(" --header "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"X-Api-Key: api-key"')]),t._v(" https://cronhub.io/api/v1/monitors/b5e5e820-9945-11e8-8dd4-23e5bbe40518/pause\n")])])]),a("p",[t._v("Example response")]),t._v(" "),a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"success"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("true")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"response"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"name"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"My Daily Cron Monitor"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"code"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"b5e5e820-9945-11e8-8dd4-23e5bbe40518"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"schedule"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"0 0 * * *"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"timezone"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"UTC"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"status"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"paused"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"last_ping"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"2018-08-12T21:01:08+00:00"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"running_time"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("2")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"running_time_unit"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"minutes"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"created_at"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"2018-08-21T21:00:51+00:00"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])])},[],!1,null,null,null);s.default=r.exports}}]); \ No newline at end of file diff --git a/docs/.vuepress/dist/assets/js/9.c9acf2f1.js b/docs/.vuepress/dist/assets/js/6.805ab219.js similarity index 94% rename from docs/.vuepress/dist/assets/js/9.c9acf2f1.js rename to docs/.vuepress/dist/assets/js/6.805ab219.js index f3b1985..2911877 100644 --- a/docs/.vuepress/dist/assets/js/9.c9acf2f1.js +++ b/docs/.vuepress/dist/assets/js/6.805ab219.js @@ -1 +1 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[9],{167:function(t,e,a){t.exports=a.p+"assets/img/ping-payload.106bd75c.png"},216:function(t,e,a){"use strict";a.r(e);var s=a(28),o=Object(s.a)({},function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("ContentSlotsDistributor",{attrs:{"slot-key":t.$parent.slotKey}},[s("h1",{attrs:{id:"sending-data"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#sending-data"}},[t._v("#")]),t._v(" Sending Data")]),t._v(" "),s("p",[t._v("Often your cron job outputs some data or logs, and you need to see it. Of course, ssh-ing to your server and echo-ing the output file every single time takes a lot of time. To solve this problem, you can now send your cron job output to Cronhub when you ping your monitor.")]),t._v(" "),s("p",[t._v("If you ping your Cronhub monitor with a GET request, then you can use URL param to pass a simple string.")]),t._v(" "),s("div",{staticClass:"language- extra-class"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[t._v("https://cronhub.io/ping/94160de0-83f8-11ea-8723-d3afea01e5aa?payload=processing_jobs,30\n")])])]),s("p",[t._v("Please note that for GET requests, the URL param must be "),s("code",[t._v("payload.")])]),t._v(" "),s("p",[t._v("If you need to send a JSON payload, then you can use a POST request for that. Attach your payload as a POST data, and we will store it on our end. Something like this will work.")]),t._v(" "),s("div",{staticClass:"language-sh extra-class"},[s("pre",{pre:!0,attrs:{class:"language-sh"}},[s("code",[s("span",{pre:!0,attrs:{class:"token function"}},[t._v("curl")]),t._v(" -d "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('\'{"processed_jobs":"1000", "failed_jobs":"10"}\'')]),t._v(" \\\nhttps://cronhub.io/ping/654be180-83f8-11ea-8aa6-1f735e295b19\n\n")])])]),s("p",[t._v('After the ping, we will display the payload on your monitor overview page under "Past pings" sections as follows.')]),t._v(" "),s("p",[s("img",{attrs:{src:a(167),alt:"Ping Payload"}})]),t._v(" "),s("p",[t._v("The limit of the data you can send is 1000 characters.")])])},[],!1,null,null,null);e.default=o.exports}}]); \ No newline at end of file +(window.webpackJsonp=window.webpackJsonp||[]).push([[6],{167:function(t,e,a){t.exports=a.p+"assets/img/ping-payload.106bd75c.png"},218:function(t,e,a){"use strict";a.r(e);var s=a(28),o=Object(s.a)({},function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("ContentSlotsDistributor",{attrs:{"slot-key":t.$parent.slotKey}},[s("h1",{attrs:{id:"sending-data"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#sending-data"}},[t._v("#")]),t._v(" Sending Data")]),t._v(" "),s("p",[t._v("Often your cron job outputs some data or logs, and you need to see it. Of course, ssh-ing to your server and echo-ing the output file every single time takes a lot of time. To solve this problem, you can now send your cron job output to Cronhub when you ping your monitor.")]),t._v(" "),s("p",[t._v("If you ping your Cronhub monitor with a GET request, then you can use URL param to pass a simple string.")]),t._v(" "),s("div",{staticClass:"language- extra-class"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[t._v("https://cronhub.io/ping/94160de0-83f8-11ea-8723-d3afea01e5aa?payload=processing_jobs,30\n")])])]),s("p",[t._v("Please note that for GET requests, the URL param must be "),s("code",[t._v("payload.")])]),t._v(" "),s("p",[t._v("If you need to send a JSON payload, then you can use a POST request for that. Attach your payload as a POST data, and we will store it on our end. Something like this will work.")]),t._v(" "),s("div",{staticClass:"language-sh extra-class"},[s("pre",{pre:!0,attrs:{class:"language-sh"}},[s("code",[s("span",{pre:!0,attrs:{class:"token function"}},[t._v("curl")]),t._v(" -d "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('\'{"processed_jobs":"1000", "failed_jobs":"10"}\'')]),t._v(" \\\nhttps://cronhub.io/ping/654be180-83f8-11ea-8aa6-1f735e295b19\n\n")])])]),s("p",[t._v('After the ping, we will display the payload on your monitor overview page under "Past pings" sections as follows.')]),t._v(" "),s("p",[s("img",{attrs:{src:a(167),alt:"Ping Payload"}})]),t._v(" "),s("p",[t._v("The limit of the data you can send is 1000 characters.")])])},[],!1,null,null,null);e.default=o.exports}}]); \ No newline at end of file diff --git a/docs/.vuepress/dist/assets/js/8.c52dfac2.js b/docs/.vuepress/dist/assets/js/7.248bdb79.js similarity index 95% rename from docs/.vuepress/dist/assets/js/8.c52dfac2.js rename to docs/.vuepress/dist/assets/js/7.248bdb79.js index bca4592..518a41a 100644 --- a/docs/.vuepress/dist/assets/js/8.c52dfac2.js +++ b/docs/.vuepress/dist/assets/js/7.248bdb79.js @@ -1 +1 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[8],{212:function(e,t,r){"use strict";r.r(t);var n=r(28),o=Object(n.a)({},function(){var e=this,t=e.$createElement,r=e._self._c||t;return r("ContentSlotsDistributor",{attrs:{"slot-key":e.$parent.slotKey}},[r("h1",{attrs:{id:"community"}},[r("a",{staticClass:"header-anchor",attrs:{href:"#community"}},[e._v("#")]),e._v(" Community")]),e._v(" "),r("p",[e._v("This section showcases all the packages, apps or different tools that were created by the community for Cronhub users.")]),e._v(" "),r("ul",[r("li",[r("p",[r("a",{attrs:{href:"https://github.com/yschimke/okurl",target:"_blank",rel:"noopener noreferrer"}},[e._v("Cronhub CLI powered by okurl"),r("OutboundLink")],1),e._v(" created by "),r("a",{attrs:{href:"https://twitter.com/yschimke",target:"_blank",rel:"noopener noreferrer"}},[e._v("Yuri Schimke"),r("OutboundLink")],1)])]),e._v(" "),r("li",[r("p",[r("a",{attrs:{href:"https://jfenn.me/projects/cronhub-monitor",target:"_blank",rel:"noopener noreferrer"}},[e._v("A native Cronhub notification client for Android"),r("OutboundLink")],1),e._v(" created by "),r("a",{attrs:{href:"https://jfenn.me/",target:"_blank",rel:"noopener noreferrer"}},[e._v("James Fenn"),r("OutboundLink")],1)])])])])},[],!1,null,null,null);t.default=o.exports}}]); \ No newline at end of file +(window.webpackJsonp=window.webpackJsonp||[]).push([[7],{217:function(e,t,r){"use strict";r.r(t);var n=r(28),o=Object(n.a)({},function(){var e=this,t=e.$createElement,r=e._self._c||t;return r("ContentSlotsDistributor",{attrs:{"slot-key":e.$parent.slotKey}},[r("h1",{attrs:{id:"community"}},[r("a",{staticClass:"header-anchor",attrs:{href:"#community"}},[e._v("#")]),e._v(" Community")]),e._v(" "),r("p",[e._v("This section showcases all the packages, apps or different tools that were created by the community for Cronhub users.")]),e._v(" "),r("ul",[r("li",[r("p",[r("a",{attrs:{href:"https://github.com/yschimke/okurl",target:"_blank",rel:"noopener noreferrer"}},[e._v("Cronhub CLI powered by okurl"),r("OutboundLink")],1),e._v(" created by "),r("a",{attrs:{href:"https://twitter.com/yschimke",target:"_blank",rel:"noopener noreferrer"}},[e._v("Yuri Schimke"),r("OutboundLink")],1)])]),e._v(" "),r("li",[r("p",[r("a",{attrs:{href:"https://jfenn.me/projects/cronhub-monitor",target:"_blank",rel:"noopener noreferrer"}},[e._v("A native Cronhub notification client for Android"),r("OutboundLink")],1),e._v(" created by "),r("a",{attrs:{href:"https://jfenn.me/",target:"_blank",rel:"noopener noreferrer"}},[e._v("James Fenn"),r("OutboundLink")],1)])])])])},[],!1,null,null,null);t.default=o.exports}}]); \ No newline at end of file diff --git a/docs/.vuepress/dist/assets/js/7.7d2167de.js b/docs/.vuepress/dist/assets/js/7.7d2167de.js deleted file mode 100644 index c6781e6..0000000 --- a/docs/.vuepress/dist/assets/js/7.7d2167de.js +++ /dev/null @@ -1 +0,0 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[7],{217:function(o,t,e){"use strict";e.r(t);var n=e(28),r=Object(n.a)({},function(){var o=this,t=o.$createElement,e=o._self._c||t;return e("ContentSlotsDistributor",{attrs:{"slot-key":o.$parent.slotKey}},[e("h1",{attrs:{id:"introduction"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#introduction"}},[o._v("#")]),o._v(" Introduction")]),o._v(" "),e("h2",{attrs:{id:"what-is-cronhub"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#what-is-cronhub"}},[o._v("#")]),o._v(" What is Cronhub?")]),o._v(" "),e("p",[o._v("Cronhub is a tool to easily monitor your cron jobs (or any scheduled jobs). You can keep track of all your cron jobs in one place. After integrating your job with Cronhub we send you alerts when:")]),o._v(" "),e("ol",[e("li",[o._v("Your job doesn't run on schedule (e.g. you have daily running job but it failed to run on time)")]),o._v(" "),e("li",[o._v("Your job runs longer than expected (e.g. your job should finish within a minute but it took an hour to finish)")])]),o._v(" "),e("p",[o._v("Cronhub supports E-mail, Slack, SMS, Webhook and PagerDuty notification channels.")]),o._v(" "),e("h2",{attrs:{id:"what-is-a-monitor"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#what-is-a-monitor"}},[o._v("#")]),o._v(" What is a monitor?")]),o._v(" "),e("p",[o._v("For each job, you need to create a monitor. The schedule of your cron and the created monitor should always match.\nFor instance, if you have a minutely running cron job on your server you should create a monitor and set the cron schedule to "),e("code",[o._v("* * * * *")]),o._v(". Or if you have a job that runs every hour you can create an hourly interval monitor.")]),o._v(" "),e("h2",{attrs:{id:"what-is-monitor-s-ping-url"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#what-is-monitor-s-ping-url"}},[o._v("#")]),o._v(" What is monitor's ping URL?")]),o._v(" "),e("p",[o._v("When you create a new monitor on Cronhub we generate a unique UUID for your monitor. The ping URL consists of the that UUID\nand the endpoint. For instance, if you only want to monitor the schedule of your cron job then your ping URL will look like this:")]),o._v(" "),e("div",{staticClass:"language-bash extra-class"},[e("pre",{pre:!0,attrs:{class:"language-bash"}},[e("code",[o._v(" https://cronhub.io/ping/1f5e3410-254c-11e8-b61d-55875966d031\n")])])]),e("p",[o._v("In this example the UUID is "),e("code",[o._v("1f5e3410-254c-11e8-b61d-55875966d031")]),o._v(" and the endpoint is "),e("code",[o._v("/ping")]),o._v(".")]),o._v(" "),e("p",[o._v("You will need to make HTTP requests from your job every time it runs. If you want to monitor the running time of the job as well you need to ping twice. At the start of your job and when the job is finished. After receiving the first ping, your monitor is successfully integrated. It will start monitoring your job and notify you if anything is off.")]),o._v(" "),e("h2",{attrs:{id:"how-does-alerting-work"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#how-does-alerting-work"}},[o._v("#")]),o._v(" How does alerting work?")]),o._v(" "),e("p",[o._v("If any of your jobs don't run on schedule or run longer than expected Cronhub will alert you. Currently, you can send alerts via Email, Slack, SMS, Webhook and PagerDuty.")])])},[],!1,null,null,null);t.default=r.exports}}]); \ No newline at end of file diff --git a/docs/.vuepress/dist/assets/js/6.8396e65d.js b/docs/.vuepress/dist/assets/js/8.255d5828.js similarity index 97% rename from docs/.vuepress/dist/assets/js/6.8396e65d.js rename to docs/.vuepress/dist/assets/js/8.255d5828.js index 09c82c8..171686f 100644 --- a/docs/.vuepress/dist/assets/js/6.8396e65d.js +++ b/docs/.vuepress/dist/assets/js/8.255d5828.js @@ -1 +1 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[6],{218:function(e,t,o){"use strict";o.r(t);var n=o(28),r=Object(n.a)({},function(){var e=this,t=e.$createElement,o=e._self._c||t;return o("ContentSlotsDistributor",{attrs:{"slot-key":e.$parent.slotKey}},[o("h1",{attrs:{id:"monitor-states-alerts"}},[o("a",{staticClass:"header-anchor",attrs:{href:"#monitor-states-alerts"}},[e._v("#")]),e._v(" Monitor States & Alerts")]),e._v(" "),o("h2",{attrs:{id:"what-does-each-monitor-state-mean"}},[o("a",{staticClass:"header-anchor",attrs:{href:"#what-does-each-monitor-state-mean"}},[e._v("#")]),e._v(" What does each monitor state mean?")]),e._v(" "),o("ul",[o("li",[o("p",[o("code",[e._v("NEW")]),e._v(": Monitor is created but it hasn't received any pings yet.")])]),e._v(" "),o("li",[o("p",[o("code",[e._v("RUNNING")]),e._v(": Monitor received a "),o("code",[e._v("start")]),e._v(" ping and it's currently running.")])]),e._v(" "),o("li",[o("p",[o("code",[e._v("UP")]),e._v(": Monitor is running on schedule and the last ping hasn't exceeded cron scheduled time + grace period.")])]),e._v(" "),o("li",[o("p",[o("code",[e._v("ALERT")]),e._v(": Monitor is not running according to the cron schedule or the last ran took longer than expected.")])]),e._v(" "),o("li",[o("p",[o("code",[e._v("PAUSED")]),e._v(": Monitor is paused. Monitor will stay paused unless it's manually resumed. It can still receive pings but it will ignore them.")])])]),e._v(" "),o("h2",{attrs:{id:"when-does-cronhub-alert-you"}},[o("a",{staticClass:"header-anchor",attrs:{href:"#when-does-cronhub-alert-you"}},[e._v("#")]),e._v(" When does Cronhub alert you?")]),e._v(" "),o("ol",[o("li",[o("p",[e._v("We send an alert when your monitor receives the first ping. The state of the monitor goes from "),o("code",[e._v("NEW")]),e._v(" to "),o("code",[e._v("OK")]),e._v(" or "),o("code",[e._v("RUNNING")]),e._v(" depending on the type of the ping. This means that your monitor is set to monitor your cron job according to the cron job schedule and defined running time.")])]),e._v(" "),o("li",[o("p",[e._v("We send an alert when your monitor goes to the "),o("code",[e._v("ALERT")]),e._v(" state. This happens when the monitor doesn't recieve a ping on schedule or it runs longer than it supposed to. You can manually trigger alert by hitting "),o("code",[e._v("/fail")]),e._v(" endpoint.")])]),e._v(" "),o("li",[o("p",[e._v("When your monitor recovers. When your monitor recovers the new state is "),o("code",[e._v("OK")]),e._v(".")])])])])},[],!1,null,null,null);t.default=r.exports}}]); \ No newline at end of file +(window.webpackJsonp=window.webpackJsonp||[]).push([[8],{212:function(e,t,o){"use strict";o.r(t);var n=o(28),r=Object(n.a)({},function(){var e=this,t=e.$createElement,o=e._self._c||t;return o("ContentSlotsDistributor",{attrs:{"slot-key":e.$parent.slotKey}},[o("h1",{attrs:{id:"monitor-states-alerts"}},[o("a",{staticClass:"header-anchor",attrs:{href:"#monitor-states-alerts"}},[e._v("#")]),e._v(" Monitor States & Alerts")]),e._v(" "),o("h2",{attrs:{id:"what-does-each-monitor-state-mean"}},[o("a",{staticClass:"header-anchor",attrs:{href:"#what-does-each-monitor-state-mean"}},[e._v("#")]),e._v(" What does each monitor state mean?")]),e._v(" "),o("ul",[o("li",[o("p",[o("code",[e._v("NEW")]),e._v(": Monitor is created but it hasn't received any pings yet.")])]),e._v(" "),o("li",[o("p",[o("code",[e._v("RUNNING")]),e._v(": Monitor received a "),o("code",[e._v("start")]),e._v(" ping and it's currently running.")])]),e._v(" "),o("li",[o("p",[o("code",[e._v("UP")]),e._v(": Monitor is running on schedule and the last ping hasn't exceeded cron scheduled time + grace period.")])]),e._v(" "),o("li",[o("p",[o("code",[e._v("ALERT")]),e._v(": Monitor is not running according to the cron schedule or the last ran took longer than expected.")])]),e._v(" "),o("li",[o("p",[o("code",[e._v("PAUSED")]),e._v(": Monitor is paused. Monitor will stay paused unless it's manually resumed. It can still receive pings but it will ignore them.")])])]),e._v(" "),o("h2",{attrs:{id:"when-does-cronhub-alert-you"}},[o("a",{staticClass:"header-anchor",attrs:{href:"#when-does-cronhub-alert-you"}},[e._v("#")]),e._v(" When does Cronhub alert you?")]),e._v(" "),o("ol",[o("li",[o("p",[e._v("We send an alert when your monitor receives the first ping. The state of the monitor goes from "),o("code",[e._v("NEW")]),e._v(" to "),o("code",[e._v("OK")]),e._v(" or "),o("code",[e._v("RUNNING")]),e._v(" depending on the type of the ping. This means that your monitor is set to monitor your cron job according to the cron job schedule and defined running time.")])]),e._v(" "),o("li",[o("p",[e._v("We send an alert when your monitor goes to the "),o("code",[e._v("ALERT")]),e._v(" state. This happens when the monitor doesn't recieve a ping on schedule or it runs longer than it supposed to. You can manually trigger alert by hitting "),o("code",[e._v("/fail")]),e._v(" endpoint.")])]),e._v(" "),o("li",[o("p",[e._v("When your monitor recovers. When your monitor recovers the new state is "),o("code",[e._v("OK")]),e._v(".")])])])])},[],!1,null,null,null);t.default=r.exports}}]); \ No newline at end of file diff --git a/docs/.vuepress/dist/assets/js/9.73f4b77a.js b/docs/.vuepress/dist/assets/js/9.73f4b77a.js new file mode 100644 index 0000000..cebfc76 --- /dev/null +++ b/docs/.vuepress/dist/assets/js/9.73f4b77a.js @@ -0,0 +1 @@ +(window.webpackJsonp=window.webpackJsonp||[]).push([[9],{168:function(t,e,o){t.exports=o.p+"assets/img/pd-integration-step-4.3cf12b9e.png"},169:function(t,e,o){t.exports=o.p+"assets/img/pd-integration-step-3.45c534ad.png"},170:function(t,e,o){t.exports=o.p+"assets/img/pd-integration-step-2.c85e983c.png"},171:function(t,e,o){t.exports=o.p+"assets/img/pd-integration-step-1.6dd9244c.png"},172:function(t,e,o){t.exports=o.p+"assets/img/slack-integration-step-2.47a4a361.png"},173:function(t,e,o){t.exports=o.p+"assets/img/slack-integration-step-1.84ff8d8f.png"},216:function(t,e,o){"use strict";o.r(e);var n=o(28),r=Object(n.a)({},function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("ContentSlotsDistributor",{attrs:{"slot-key":t.$parent.slotKey}},[n("h1",{attrs:{id:"integrations"}},[n("a",{staticClass:"header-anchor",attrs:{href:"#integrations"}},[t._v("#")]),t._v(" Integrations")]),t._v(" "),n("p",[t._v("Cronhub has built-in and third-party tool integrations that play nicely with your monitors. You can think of integrations as notification channels that you can use in your monitors to alert you when an event occurs on Cronhub. Currently, we support Slack, SMS and Webhooks integrations but more integrations will be added in the future. If you're thinking to build a new integration for Cronhub you can "),n("a",{attrs:{href:"mailto:tigran@cronhub.io"}},[t._v("reach out to me")]),t._v(".")]),t._v(" "),n("h2",{attrs:{id:"slack"}},[n("a",{staticClass:"header-anchor",attrs:{href:"#slack"}},[t._v("#")]),t._v(" Slack")]),t._v(" "),n("p",[t._v("Adding a Slack integration is a straightforward process. In order to integrate Slack with your Cronhub account, you should follow these steps")]),t._v(" "),n("ol",[n("li",[n("p",[t._v('Go to the "Settings" page and click on "Slack" link under the "Integrations" section on the left-sidebar.')])]),t._v(" "),n("li",[n("p",[t._v('When you\'re on the Slack integration page you will see "Add to Slack" button (see the screenshot below). Click on it.')])])]),t._v(" "),n("p",[n("img",{attrs:{src:o(173),alt:"Add to Slack"}})]),t._v(" "),n("ol",{attrs:{start:"3"}},[n("li",[t._v('"Add to Slack" button will redirect you to the slack auth page where you can choose the channel you want to get Cronhub alerts to (see the screenshot below).\n'),n("img",{attrs:{src:o(172),alt:"Slack auth page"}})])]),t._v(" "),n("p",[t._v('After choosing the channel "Authorize" it and you will go back to Cronhub. Now you can see all your connected channels in the list. You can add as many channels as you like.')]),t._v(" "),n("h2",{attrs:{id:"pagerduty"}},[n("a",{staticClass:"header-anchor",attrs:{href:"#pagerduty"}},[t._v("#")]),t._v(" PagerDuty")]),t._v(" "),n("p",[t._v("Adding a PagerDuty integration is a multi step process. In order to integrate Pagerduty with your Cronhub account, you should follow these steps")]),t._v(" "),n("ol",[n("li",[n("p",[t._v("Go to the "),n("a",{attrs:{href:"https://cronhub.io/settings/integrations/pagerduty",target:"_blank",rel:"noopener noreferrer"}},[t._v("PagerDuty"),n("OutboundLink")],1),t._v(" page under your settings.")])]),t._v(" "),n("li",[n("p",[t._v('When you\'re on the PagerDuty integration page you will see "Alert with PagerDuty" green button (see the screenshot below). Click on the button.')])])]),t._v(" "),n("p",[n("img",{attrs:{src:o(171),alt:"Alert with PagerDuty"}})]),t._v(" "),n("ol",{attrs:{start:"3"}},[n("li",[t._v('When you click on "Alert with PagerDuty" it will take you to the PagerDuty login screen. You should provide your credentials and click '),n("strong",[t._v("Authorize integration")]),t._v(" to allow Cronhub to integrate with PagerDuty.")])]),t._v(" "),n("p",[n("img",{attrs:{src:o(170),alt:"Authorize integration with Cronhub"}})]),t._v(" "),n("ol",{attrs:{start:"4"}},[n("li",[t._v("After authorizing with your credentials you will see a new screen to configure the Cronhub integration. You can either hook up Cronhub to an existing PagerDuty service, or create a new service. Click "),n("strong",[t._v("Finish integration")]),t._v(" to save your settings and redirect back to Cronhub.")])]),t._v(" "),n("p",[n("img",{attrs:{src:o(169),alt:"Configure the Cronhub Integration"}})]),t._v(" "),n("ol",{attrs:{start:"4"}},[n("li",[t._v("Now when you're back to Cronhub you should see all your PagerDuty service integrations.")])]),t._v(" "),n("p",[n("img",{attrs:{src:o(168),alt:"PagerDuty Cronhub Integration"}})]),t._v(" "),n("ol",{attrs:{start:"5"}},[n("li",[t._v("Cronhub can trigger an incident on PagerDuty when monitors fail and also mark them as resolved when the monitors recover.")])]),t._v(" "),n("p",[t._v("If you want to change your PagerDuty integration then you should remove it first and then go over the above steps again.")])])},[],!1,null,null,null);e.default=r.exports}}]); \ No newline at end of file diff --git a/docs/.vuepress/dist/assets/js/app.f57648bb.js b/docs/.vuepress/dist/assets/js/app.f7330bb8.js similarity index 83% rename from docs/.vuepress/dist/assets/js/app.f57648bb.js rename to docs/.vuepress/dist/assets/js/app.f7330bb8.js index a8f5359..a64ffbe 100644 --- a/docs/.vuepress/dist/assets/js/app.f57648bb.js +++ b/docs/.vuepress/dist/assets/js/app.f7330bb8.js @@ -1,13 +1,13 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[0],[]]);!function(t){function e(e){for(var r,a,s=e[0],u=e[1],c=e[2],l=0,p=[];l0?o(r(t),9007199254740991):0}},function(t,e,n){var r=n(16);t.exports=function(t){return Object(r(t))}},function(t,e,n){var r=n(54),o=n(10),i=n(138);r||o(Object.prototype,"toString",i,{unsafe:!0})},function(t,e){t.exports=function(t){if(void 0==t)throw TypeError("Can't call method on "+t);return t}},function(t,e,n){"use strict";var r=n(0),o=n(18).filter,i=n(44),a=n(11),s=i("filter"),u=a("filter");r({target:"Array",proto:!0,forced:!s||!u},{filter:function(t){return o(this,t,arguments.length>1?arguments[1]:void 0)}})},function(t,e,n){var r=n(56),o=n(46),i=n(14),a=n(13),s=n(110),u=[].push,c=function(t){var e=1==t,n=2==t,c=3==t,f=4==t,l=6==t,p=5==t||l;return function(d,h,v,y){for(var m,g,b=i(d),_=o(b),w=r(h,v,3),x=a(_.length),S=0,O=y||s,C=e?O(d,x):n?O(d,0):void 0;x>S;S++)if((p||S in _)&&(g=w(m=_[S],S,b),t))if(e)C[S]=g;else if(g)switch(t){case 3:return!0;case 5:return m;case 6:return S;case 2:u.call(C,m)}else if(f)return!1;return l?-1:c||f?f:C}};t.exports={forEach:c(0),map:c(1),filter:c(2),some:c(3),every:c(4),find:c(5),findIndex:c(6)}},function(t,e,n){var r,o,i,a=n(140),s=n(3),u=n(4),c=n(9),f=n(5),l=n(35),p=n(23),d=s.WeakMap;if(a){var h=new d,v=h.get,y=h.has,m=h.set;r=function(t,e){return m.call(h,t,e),e},o=function(t){return v.call(h,t)||{}},i=function(t){return y.call(h,t)}}else{var g=l("state");p[g]=!0,r=function(t,e){return c(t,g,e),e},o=function(t){return f(t,g)?t[g]:{}},i=function(t){return f(t,g)}}t.exports={set:r,get:o,has:i,enforce:function(t){return i(t)?o(t):r(t,{})},getterFor:function(t){return function(e){var n;if(!u(e)||(n=o(e)).type!==t)throw TypeError("Incompatible receiver, "+t+" required");return n}}}},function(t,e){t.exports={}},function(t,e,n){var r,o=n(8),i=n(136),a=n(57),s=n(23),u=n(135),c=n(93),f=n(35)("IE_PROTO"),l=function(){},p=function(t){return" + diff --git a/docs/.vuepress/dist/cronhub-cli.html b/docs/.vuepress/dist/cronhub-cli.html index 21fa58d..dd29067 100644 --- a/docs/.vuepress/dist/cronhub-cli.html +++ b/docs/.vuepress/dist/cronhub-cli.html @@ -8,7 +8,7 @@ - + @@ -24,7 +24,7 @@ cronhub.io
Contribute on Github -

# Cronhub CLI

Use Cronhub command-line tool to manage your monitors on Cronhub. Using the CLI, you can list all your monitors, get a specific monitor and easily make pings to your Cronhub monitors.

Very soon, we plan to make the CLI the easiest way to integrate your system cron jobs with Cronhub monitors and keep them in sync. It means less manual work and more automation. Cool eh?

Usage: cronhub [OPTIONS] COMMAND [ARGS]...
+        

# Cronhub CLI

Use Cronhub command-line tool to manage your monitors on Cronhub. Using the CLI, you can list all your monitors, get a specific monitor and easily make pings to your Cronhub monitors.

Very soon, we plan to make the CLI the easiest way to integrate your system cron jobs with Cronhub monitors and keep them in sync. It means less manual work and more automation. Cool eh?

Usage: cronhub [OPTIONS] COMMAND [ARGS]...
 
   A CLI interface that works with Cronhub.
 
@@ -54,6 +54,6 @@
       
       →
     

- + diff --git a/docs/.vuepress/dist/favicon-16x16.png b/docs/.vuepress/dist/favicon-16x16.png index fa5e77b..266dcb5 100644 Binary files a/docs/.vuepress/dist/favicon-16x16.png and b/docs/.vuepress/dist/favicon-16x16.png differ diff --git a/docs/.vuepress/dist/favicon-32x32.png b/docs/.vuepress/dist/favicon-32x32.png index 880db95..ad9bcb4 100644 Binary files a/docs/.vuepress/dist/favicon-32x32.png and b/docs/.vuepress/dist/favicon-32x32.png differ diff --git a/docs/.vuepress/dist/favicon.ico b/docs/.vuepress/dist/favicon.ico index 793f268..f9c030d 100644 Binary files a/docs/.vuepress/dist/favicon.ico and b/docs/.vuepress/dist/favicon.ico differ diff --git a/docs/.vuepress/dist/getting-started.html b/docs/.vuepress/dist/getting-started.html index 278cc97..d626009 100644 --- a/docs/.vuepress/dist/getting-started.html +++ b/docs/.vuepress/dist/getting-started.html @@ -8,7 +8,7 @@ - + @@ -24,15 +24,7 @@ cronhub.io
Contribute on Github -

# Getting Started

# Your First Monitor

In this short video, I give you a quick introduction on how you can set up a cron job monitor on Cronhub. I use a local Ubuntu server where I create a new cron job and hook it up with a Cronhub monitor. It's a couple of step process which I explain in the video. Enjoy.

- +

# Getting Started

# Your First Monitor

In this short video, I give you a quick introduction on how you can set up a cron job monitor on Cronhub. I use a local Ubuntu server where I create a new cron job and hook it up with a Cronhub monitor. It's a couple of step process which I explain in the video. Enjoy.

+ diff --git a/docs/.vuepress/dist/how-to-ping.html b/docs/.vuepress/dist/how-to-ping.html index 2581169..4f10e01 100644 --- a/docs/.vuepress/dist/how-to-ping.html +++ b/docs/.vuepress/dist/how-to-ping.html @@ -8,7 +8,7 @@ - + @@ -24,7 +24,7 @@ cronhub.io Contribute on Github -

# How to Ping

The Ping API is an easy way to integrate your scheduled jobs with Cronhub monitors.

To integrate your job with a Cronhub monitor, you need to ping from your cron job every time it runs.

The ping can be any HTTP request. If you only want to monitor the schedule of your job, then you need to ping only once after your job has successfully run. However, If you're going to monitor the schedule as well as the running time you need to ping twice, when your job starts and when your job finishes. This way Cronhub will be able to track the running time (or processing time) of your job and alert you if it takes longer than expected to finish.

# Ping API

Endpoint Description
https://cronhub.io/ping/<monitor-uuid> Use this endpoint if you only want to monitor the successful runs of your job on schedule.
https://cronhub.io/start/<monitor-uuid> Use this endpoint to acknowledge the start of your job. Use this endpoint if you additionally want to monitor the running time of your job.
https://cronhub.io/finish/<monitor-uuid> Use this endpoint to acknowledge the finish of your job. Use this endpoint if you additionally want to monitor the running time of your job.
https://cronhub.io/fail/<monitor-uuid> Use this endpoint to acknowledge the failure of your job. After pinging this endpoint Cronhub will change the state of your monitor to "ALERT" and notify you or your team.

# Making pings

Below I have some handy examples that you can use for integration. I've started with Crontab integration because most of the cron jobs on unix based systems are defined with this program.

# Crontab

Crontab is a UNIX program that helps you to communicate with the cron deamon on a unix based system. The cron daemon is a long-running process that runs commands at specific dates and times. In order to tell cron daemon what commands it should run and when you need crontab entries.

On your UNIX system, you can run crontab -l to display crontab and see if there are any scheduled tasks. Run crontab -e to edit the crontab.

Below we have an example of a crontab entry that you can add to your system's crontab entry. Of course, you will have to replace the script name as well as the ping URL with your own script and the monitor URL.

* * * * * curl -fsS --retry 3 https://cronhub.io/start/1f5e3410-254c-11e8-b61d-55875966d031; your_script.sh && curl -fsS --retry 3 https://cronhub.io/finish/1f5e3410-254c-11e8-b61d-55875966d031
+        

# How to Ping

The Ping API is an easy way to integrate your scheduled jobs with Cronhub monitors.

To integrate your job with a Cronhub monitor, you need to ping from your cron job every time it runs.

The ping can be any HTTP request. If you only want to monitor the schedule of your job, then you need to ping only once after your job has successfully run. However, If you're going to monitor the schedule as well as the running time you need to ping twice, when your job starts and when your job finishes. This way Cronhub will be able to track the running time (or processing time) of your job and alert you if it takes longer than expected to finish.

# Ping API

Endpoint Description
https://cronhub.io/ping/<monitor-uuid> Use this endpoint if you only want to monitor the successful runs of your job on schedule.
https://cronhub.io/start/<monitor-uuid> Use this endpoint to acknowledge the start of your job. Use this endpoint if you additionally want to monitor the running time of your job.
https://cronhub.io/finish/<monitor-uuid> Use this endpoint to acknowledge the finish of your job. Use this endpoint if you additionally want to monitor the running time of your job.
https://cronhub.io/fail/<monitor-uuid> Use this endpoint to acknowledge the failure of your job. After pinging this endpoint Cronhub will change the state of your monitor to "ALERT" and notify you or your team.

# Making pings

Below I have some handy examples that you can use for integration. I've started with Crontab integration because most of the cron jobs on unix based systems are defined with this program.

# Crontab

Crontab is a UNIX program that helps you to communicate with the cron deamon on a unix based system. The cron daemon is a long-running process that runs commands at specific dates and times. In order to tell cron daemon what commands it should run and when you need crontab entries.

On your UNIX system, you can run crontab -l to display crontab and see if there are any scheduled tasks. Run crontab -e to edit the crontab.

Below we have an example of a crontab entry that you can add to your system's crontab entry. Of course, you will have to replace the script name as well as the ping URL with your own script and the monitor URL.

* * * * * curl -fsS --retry 3 https://cronhub.io/start/1f5e3410-254c-11e8-b61d-55875966d031; your_script.sh && curl -fsS --retry 3 https://cronhub.io/finish/1f5e3410-254c-11e8-b61d-55875966d031
 

TIP

Please note the difference between ; and &&.

echo "Hello" ; echo "world" means run echo "world" no matter what the exit status of the previous command echo "Hello".

Whereas in case of echo "Hello " && echo "world", echo "world" will only run if the first command (echo "Hello") is a success (i.e. exit status 0).

# PHP

// ping when your job starts
 file_get_contents("https://cronhub.io/start/1f5e3410-254c-11e8-b61d-55875966d031");
 
@@ -67,13 +67,13 @@
 https.get("https://cronhub.io/finish/1f5e3410-254c-11e8-b61d-55875966d031");
 
- + diff --git a/docs/.vuepress/dist/index.html b/docs/.vuepress/dist/index.html index e5f8f7e..e9e88bd 100644 --- a/docs/.vuepress/dist/index.html +++ b/docs/.vuepress/dist/index.html @@ -8,7 +8,7 @@ - + @@ -24,14 +24,14 @@ cronhub.io Contribute on Github -

# Introduction

# What is Cronhub?

Cronhub is a tool to easily monitor your cron jobs (or any scheduled jobs). You can keep track of all your cron jobs in one place. After integrating your job with Cronhub we send you alerts when:

  1. Your job doesn't run on schedule (e.g. you have daily running job but it failed to run on time)
  2. Your job runs longer than expected (e.g. your job should finish within a minute but it took an hour to finish)

Cronhub supports E-mail, Slack, SMS, Webhook and PagerDuty notification channels.

# What is a monitor?

For each job, you need to create a monitor. The schedule of your cron and the created monitor should always match. -For instance, if you have a minutely running cron job on your server you should create a monitor and set the cron schedule to * * * * *. Or if you have a job that runs every hour you can create an hourly interval monitor.

# What is monitor's ping URL?

When you create a new monitor on Cronhub we generate a unique UUID for your monitor. The ping URL consists of the that UUID +

# Introduction

# What is Cronhub?

Cronhub is a painless cron scheduler and monitoring service for developers who don't like working with complicated servers and cron jobs. No servers and ops required.

We created Cronhub to make scheduling and monitoring of recurring tasks a lot easier. Use Cronhub to automate tasks and replace your cronjobs with our schedulers.

We offer two products that complement each other - Scheduler and Monitoring.

I have recorded a quick demo to show some of the features on Cronhub.

# What is Scheduler?

As the name implies, Scheduler is a scheduling tool. The schedule can be any time interval or cron expression. Within Scheduler, you define a schedule and a target URL. We send an HTTP request to your Target URL according to your schedule. We do not retry the request if your job fails, and we have a timeout of 3 seconds.

With Cronhub Scheduler, you can focus on your application, and we handle the scheduling part. Let's say you want to send a daily email to your users. You can work on creating the function that handles the email sending part, and we take care of the whole scheduling logic behind the scenes. You just need to tell us where your function lives and how often you want to run it.

# What is Monitoring?

Use Cronhub monitors to monitor your cron jobs (or any scheduled jobs). After integrating your job with Cronhub we send you alerts when:

  1. Your job doesn't run on schedule (e.g. you have daily running job but it failed to run on time)
  2. Your job runs longer than expected (e.g. your job should finish within a minute but it took an hour to finish)

Cronhub supports E-mail, Slack, SMS, Webhook and PagerDuty notification channels.

# What is a monitor?

For each job, you need to create a monitor. The schedule of your cron and the created monitor should always match. +For instance, if you have a minutely running cron job on your server you should create a monitor and set the cron schedule to * * * * *. Or if you have a job that runs every hour you can create an hourly interval monitor.

# What is monitor's ping URL?

When you create a new monitor on Cronhub we generate a unique UUID for your monitor. The ping URL consists of the that UUID and the endpoint. For instance, if you only want to monitor the schedule of your cron job then your ping URL will look like this:

 https://cronhub.io/ping/1f5e3410-254c-11e8-b61d-55875966d031
-

In this example the UUID is 1f5e3410-254c-11e8-b61d-55875966d031 and the endpoint is /ping.

You will need to make HTTP requests from your job every time it runs. If you want to monitor the running time of the job as well you need to ping twice. At the start of your job and when the job is finished. After receiving the first ping, your monitor is successfully integrated. It will start monitoring your job and notify you if anything is off.

# How does alerting work?

If any of your jobs don't run on schedule or run longer than expected Cronhub will alert you. Currently, you can send alerts via Email, Slack, SMS, Webhook and PagerDuty.

In this example the UUID is 1f5e3410-254c-11e8-b61d-55875966d031 and the endpoint is /ping.

You will need to make HTTP requests from your job every time it runs. If you want to monitor the running time of the job as well you need to ping twice. At the start of your job and when the job is finished. After receiving the first ping, your monitor is successfully integrated. It will start monitoring your job and notify you if anything is off.

# How does alerting work?

If any of your jobs don't run on schedule or run longer than expected Cronhub will alert you. Currently, you can send alerts via Email, Slack, SMS, Webhook and PagerDuty.

- + diff --git a/docs/.vuepress/dist/integrations.html b/docs/.vuepress/dist/integrations.html index b8ea64a..303c833 100644 --- a/docs/.vuepress/dist/integrations.html +++ b/docs/.vuepress/dist/integrations.html @@ -8,7 +8,7 @@ - + @@ -24,7 +24,7 @@ cronhub.io Contribute on Github -

# Integrations

Cronhub has built-in and third-party tool integrations that play nicely with your monitors. You can think of integrations as notification channels that you can use in your monitors to alert you when an event occurs on Cronhub. Currently, we support Slack, SMS and Webhooks integrations but more integrations will be added in the future. If you're thinking to build a new integration for Cronhub you can reach out to me.

# Slack

Adding a Slack integration is a straightforward process. In order to integrate Slack with your Cronhub account, you should follow these steps

  1. Go to the "Settings" page and click on "Slack" link under the "Integrations" section on the left-sidebar.

  2. When you're on the Slack integration page you will see "Add to Slack" button (see the screenshot below). Click on it.

Add to Slack

  1. "Add to Slack" button will redirect you to the slack auth page where you can choose the channel you want to get Cronhub alerts to (see the screenshot below). +

    # Integrations

    Cronhub has built-in and third-party tool integrations that play nicely with your monitors. You can think of integrations as notification channels that you can use in your monitors to alert you when an event occurs on Cronhub. Currently, we support Slack, SMS and Webhooks integrations but more integrations will be added in the future. If you're thinking to build a new integration for Cronhub you can reach out to me.

    # Slack

    Adding a Slack integration is a straightforward process. In order to integrate Slack with your Cronhub account, you should follow these steps

    1. Go to the "Settings" page and click on "Slack" link under the "Integrations" section on the left-sidebar.

    2. When you're on the Slack integration page you will see "Add to Slack" button (see the screenshot below). Click on it.

    Add to Slack

    1. "Add to Slack" button will redirect you to the slack auth page where you can choose the channel you want to get Cronhub alerts to (see the screenshot below). Slack auth page

    After choosing the channel "Authorize" it and you will go back to Cronhub. Now you can see all your connected channels in the list. You can add as many channels as you like.

    # PagerDuty

    Adding a PagerDuty integration is a multi step process. In order to integrate Pagerduty with your Cronhub account, you should follow these steps

    1. Go to the PagerDuty page under your settings.

    2. When you're on the PagerDuty integration page you will see "Alert with PagerDuty" green button (see the screenshot below). Click on the button.

    Alert with PagerDuty

    1. When you click on "Alert with PagerDuty" it will take you to the PagerDuty login screen. You should provide your credentials and click Authorize integration to allow Cronhub to integrate with PagerDuty.

    Authorize integration with Cronhub

    1. After authorizing with your credentials you will see a new screen to configure the Cronhub integration. You can either hook up Cronhub to an existing PagerDuty service, or create a new service. Click Finish integration to save your settings and redirect back to Cronhub.

    Configure the Cronhub Integration

    1. Now when you're back to Cronhub you should see all your PagerDuty service integrations.

    PagerDuty Cronhub Integration

    1. Cronhub can trigger an incident on PagerDuty when monitors fail and also mark them as resolved when the monitors recover.

    If you want to change your PagerDuty integration then you should remove it first and then go over the above steps again.

- + diff --git a/docs/.vuepress/dist/monitor-states.html b/docs/.vuepress/dist/monitor-states.html index 2cb6acd..1f6dbdc 100644 --- a/docs/.vuepress/dist/monitor-states.html +++ b/docs/.vuepress/dist/monitor-states.html @@ -8,7 +8,7 @@ - + @@ -24,7 +24,7 @@ cronhub.io Contribute on Github -

# Monitor States & Alerts

# What does each monitor state mean?

  • NEW: Monitor is created but it hasn't received any pings yet.

  • RUNNING: Monitor received a start ping and it's currently running.

  • UP: Monitor is running on schedule and the last ping hasn't exceeded cron scheduled time + grace period.

  • ALERT: Monitor is not running according to the cron schedule or the last ran took longer than expected.

  • PAUSED: Monitor is paused. Monitor will stay paused unless it's manually resumed. It can still receive pings but it will ignore them.

# When does Cronhub alert you?

  1. We send an alert when your monitor receives the first ping. The state of the monitor goes from NEW to OK or RUNNING depending on the type of the ping. This means that your monitor is set to monitor your cron job according to the cron job schedule and defined running time.

  2. We send an alert when your monitor goes to the ALERT state. This happens when the monitor doesn't recieve a ping on schedule or it runs longer than it supposed to. You can manually trigger alert by hitting /fail endpoint.

  3. When your monitor recovers. When your monitor recovers the new state is OK.

- + diff --git a/docs/.vuepress/dist/public-api.html b/docs/.vuepress/dist/public-api.html index dfe884a..3b227c8 100644 --- a/docs/.vuepress/dist/public-api.html +++ b/docs/.vuepress/dist/public-api.html @@ -8,7 +8,7 @@ - + @@ -24,7 +24,155 @@ cronhub.io Contribute on Github -

# Public API

Cronhub Public API is a REST API that supports basic CRUD operations on top of Cronhub monitors. Our API uses HTTP response codes to indicate any API errors. All API responses are JSON objects.

If you have any ideas or suggestions about the API let us know on Github.

We reserve the right to rate-limit any access key if we feel you're not using the api fairly.

# Authentication

All API requests must be authenticated by the API key that Cronhub provides. When you create a new Cronhub account you will get an API key. You can find it on the "Settings" page of the site. Here is an example how it may look ch_5b73b46baf0c00.55022502.

You can authenticate your requests by sending the API key in your HTTP request header. The name of the header should be X-Api-Key and the value should be your key.

# API Endpoints

# List all monitors

GET https://cronhub.io/api/v1/monitors Get the list of all your existing monitors.

Example Request

curl --header "X-Api-Key: api-key" https://cronhub.io/api/v1/monitors
+        

# Public API

Cronhub Public API is a REST like API that supports basic CRUD operations on top of Cronhub resources. Our API uses HTTP response codes to indicate any API errors. All API responses are JSON objects.

If you have any ideas or suggestions about the API let us know on Github.

We reserve the right to rate-limit any access key if we feel you're not using the API fairly.

# Authentication

All API requests must be authenticated by the API key that Cronhub provides. When you create a new Cronhub account you will get an API key. You can find it on the "Settings" page of the site. Here is an example how it may look ch_5b73b46baf0c00.55022502.

You can authenticate your requests by sending the API key in your HTTP request header. The name of the header should be X-Api-Key and the value should be your key.

You need an active billing plan on Cronhub to work with Cronhub resources.

# 🎉 Scheduler API Endpoints

# List all schedulers

GET https://cronhub.io/api/v1/schedulers Get the list of all your existing schedulers.

Example Request

curl --header "X-Api-Key: api-key" https://cronhub.io/api/v1/schedulers
+

Example Response

{
+    "schedulers": [
+        {
+            "id": 1,
+            "name": "my scheduler",
+            "description": null,
+            "interval_schedule_value": null,
+            "interval_schedule_rate": null,
+            "type": "cron",
+            "schedule": "0 0 * * *",
+            "timezone": "UTC",
+            "status": "paused",
+            "url": "https://example.com",
+            "http_body": [],
+            "http_method": "get",
+            "created_at": 1589647300,
+            "updated_at": 1589647361
+        },
+        {
+            "id": 1,
+            "name": "backup database",
+            "description": null,
+            "interval_schedule_value": 12,
+            "interval_schedule_rate": "hours",
+            "type": "interval",
+            "schedule": null,
+            "timezone": "UTC",
+            "status": "active",
+            "url": "https://myapiendpoint.com/run_backup",
+            "http_body": [],
+            "http_method": "get",
+            "created_at": 1589631880,
+            "updated_at": 1589631880
+        },
+    ]
+}
+

# Get an existing scheduler

GET https://cronhub.test/api/v1/schedulers/<scheduler-id> Get an existing scheduler by its unique id.

TIP

<scheduler-id> is the unique id that identifies your scheduler. You can find it if you go to the scheduler's page. It's the number you see in the browser's URL address bar.

Example Request

curl --header "X-Api-Key: api-key" https://cronhub.io/api/v1/schedulers/1
+

Example Response

{
+    "scheduler": {
+        "id": 1,
+        "name": "run lambda function",
+        "description": null,
+        "interval_schedule_value": 12,
+        "interval_schedule_rate": "hours",
+        "type": "interval",
+        "schedule": null,
+        "timezone": "UTC",
+        "status": "paused",
+        "url": "https://www.netlify.com/api/run_amazing_function",
+        "http_body": [],
+        "http_method": "get",
+        "created_at": 1589827724,
+        "updated_at": 1589828386
+    }
+}
+

# Create a new scheduler

POST https://cronhub.io/api/v1/schedulers/create

Create a new scheduler with the given arguments.

Argument Description Is required
name The name of your scheduler. yes
type The type of your scheduler. Must be cron or interval. yes
url The HTTP target URL. Must be a valid URL. yes
http_method The HTTP method yes
http_body The HTTP body when the http_method is POST or PUT no
schedule The cron expression schedule (e.g. 0 0 * * *) yes, if type is `cron
interval_value The interval value. Must be a positive integer. yes, if type is interval
interval_rate The interval rate. Must be minutes, hours or days only. yes, if type is interval
timezone Should be "UTC" for now yes, if type is cron

Example request:

curl -X "POST" --header "X-Api-Key: api-key" \
+  -d name='scheduler example' \
+  -d type='cron' \
+  -d url='https://example-api.com/run_job' \
+  -d http_method='get' \
+  -d schedule='* * * * *' \
+  -d timezone='UTC' \
+  https://cronhub.io/api/v1/schedulers/create
+

Example response:

{
+    "created": {
+        "id": 1,
+        "name": "scheduler example'",
+        "description": null,
+        "interval_schedule_value": null,
+        "interval_schedule_rate": null,
+        "type": "cron",
+        "schedule": "* * * * *",
+        "timezone": "UTC",
+        "status": "active",
+        "url": "https://example-api.com/run_job",
+        "http_body": [],
+        "http_method": "get",
+        "created_at": 1589829544,
+        "updated_at": 1589829544
+    }
+}
+

# Update an existing scheduler

PUT https://cronhub.io/api/v1/schedulers/<scheduler-id>

TIP

<scheduler-id> is the unique id that identifies your scheduler. You can find it if you go to the scheduler's page. It's the number you see in the browser's URL address bar.

Update the scheduler with the given arguments.

Argument Description Is required
name The name of your scheduler. yes
type The type of your scheduler. Must be cron or interval. yes
url The HTTP target URL. Must be a valid URL. yes
http_method The HTTP method yes
http_body The HTTP body when the http_method is POST or PUT no
schedule The cron expression schedule (e.g. 0 0 * * *) yes, if type is `cron
interval_value The interval value. Must be a positive integer. yes, if type is interval
interval_rate The interval rate. Must be minutes, hours or days only. yes, if type is interval
timezone Should be "UTC" for now yes, if type is cron

Example request:

curl -X "PUT" --header "X-Api-Key: api-key" \
+  -d name='scheduler example changed' \
+  -d type='cron' \
+  -d url='https://example-api.com/run_job' \
+  -d http_method='get' \
+  -d schedule='0 0 * * *' \
+  -d timezone='UTC' \
+  https://cronhub.io/api/v1/schedulers/1
+

Example response:

{
+    "updated": {
+        "id": 1,
+        "name": "scheduler example changed'",
+        "description": null,
+        "interval_schedule_value": null,
+        "interval_schedule_rate": null,
+        "type": "cron",
+        "schedule": "0 0 * * *",
+        "timezone": "UTC",
+        "status": "active",
+        "url": "https://example-api.com/run_job",
+        "http_body": [],
+        "http_method": "get",
+        "created_at": 1589829544,
+        "updated_at": 1589829544
+    }
+}
+

# Delete a scheduler

DELETE https://cronhub.io/api/v1/schedulers/<scheduler-id> Delete the scheduler with the given id.

Example request:

curl -X "DELETE" --header "X-Api-Key: api-key" https://cronhub.io/api/v1/schedulers/1
+

Example response:

{"deleted":true}
+

# Pause a scheduler

PUT https://cronhub.io/api/v1/schedulers/<scheduler-id>/pause

Pause the scheduler with the given id. Sets the status field to paused.

Example request:

curl -X "PUT" --header "X-Api-Key: api-key" https://cronhub.io/api/v1/schedulers/1/pause
+

Example response:

{
+    "paused": {
+        "id": 1,
+        "name": "my scheduler",
+        "description": null,
+        "interval_schedule_value": null,
+        "interval_schedule_rate": null,
+        "type": "cron",
+        "schedule": "0 0 * * *",
+        "timezone": "UTC",
+        "status": "paused",
+        "url": "https://exampleurl.com",
+        "http_body": [],
+        "http_method": "get",
+        "created_at": 1589647300,
+        "updated_at": 1589829046
+    }
+}
+

# Resume a scheduler

PUT https://cronhub.io/api/v1/schedulers/<scheduler-id>/resume

Resume the scheduler with the given id. Sets the status field to active.

Example request:

curl -X "PUT" --header "X-Api-Key: api-key" https://cronhub.io/api/v1/schedulers/1/resume
+

Example response:

{
+    "resumed": {
+        "id": 1,
+        "name": "my scheduler",
+        "description": null,
+        "interval_schedule_value": null,
+        "interval_schedule_rate": null,
+        "type": "cron",
+        "schedule": "0 0 * * *",
+        "timezone": "UTC",
+        "status": "active",
+        "url": "https://exampleurl.com",
+        "http_body": [],
+        "http_method": "get",
+        "created_at": 1589647300,
+        "updated_at": 1589829046
+    }
+}
+

# Monitor API Endpoints

# List all monitors

GET https://cronhub.io/api/v1/monitors Get the list of all your existing monitors.

Example Request

curl --header "X-Api-Key: api-key" https://cronhub.io/api/v1/monitors
 

Example Response

{
   "success": true,
   "response": [
@@ -130,7 +278,7 @@
     "created_at": "2018-08-21T21:00:51+00:00",
   }
 }
-
- + diff --git a/docs/.vuepress/dist/sending-data-to-cronhub.html b/docs/.vuepress/dist/sending-data-to-cronhub.html index 32f660d..12517d9 100644 --- a/docs/.vuepress/dist/sending-data-to-cronhub.html +++ b/docs/.vuepress/dist/sending-data-to-cronhub.html @@ -8,7 +8,7 @@ - + @@ -24,11 +24,11 @@ cronhub.io Contribute on Github -

# Sending Data

Often your cron job outputs some data or logs, and you need to see it. Of course, ssh-ing to your server and echo-ing the output file every single time takes a lot of time. To solve this problem, you can now send your cron job output to Cronhub when you ping your monitor.

If you ping your Cronhub monitor with a GET request, then you can use URL param to pass a simple string.

https://cronhub.io/ping/94160de0-83f8-11ea-8723-d3afea01e5aa?payload=processing_jobs,30
+        

# Sending Data

Often your cron job outputs some data or logs, and you need to see it. Of course, ssh-ing to your server and echo-ing the output file every single time takes a lot of time. To solve this problem, you can now send your cron job output to Cronhub when you ping your monitor.

If you ping your Cronhub monitor with a GET request, then you can use URL param to pass a simple string.

https://cronhub.io/ping/94160de0-83f8-11ea-8723-d3afea01e5aa?payload=processing_jobs,30
 

Please note that for GET requests, the URL param must be payload.

If you need to send a JSON payload, then you can use a POST request for that. Attach your payload as a POST data, and we will store it on our end. Something like this will work.

curl -d '{"processed_jobs":"1000", "failed_jobs":"10"}' \
 https://cronhub.io/ping/654be180-83f8-11ea-8aa6-1f735e295b19
 
-

After the ping, we will display the payload on your monitor overview page under "Past pings" sections as follows.

Ping Payload

The limit of the data you can send is 1000 characters.

After the ping, we will display the payload on your monitor overview page under "Past pings" sections as follows.

Ping Payload

The limit of the data you can send is 1000 characters.

- + diff --git a/docs/.vuepress/public/favicon-16x16.png b/docs/.vuepress/public/favicon-16x16.png index fa5e77b..266dcb5 100644 Binary files a/docs/.vuepress/public/favicon-16x16.png and b/docs/.vuepress/public/favicon-16x16.png differ diff --git a/docs/.vuepress/public/favicon-32x32.png b/docs/.vuepress/public/favicon-32x32.png index 880db95..ad9bcb4 100644 Binary files a/docs/.vuepress/public/favicon-32x32.png and b/docs/.vuepress/public/favicon-32x32.png differ diff --git a/docs/.vuepress/public/favicon.ico b/docs/.vuepress/public/favicon.ico index 793f268..f9c030d 100644 Binary files a/docs/.vuepress/public/favicon.ico and b/docs/.vuepress/public/favicon.ico differ diff --git a/docs/README.md b/docs/README.md index b6fe3da..64d6f26 100755 --- a/docs/README.md +++ b/docs/README.md @@ -1,19 +1,36 @@ # Introduction ## What is Cronhub? -Cronhub is a tool to easily monitor your cron jobs (or any scheduled jobs). You can keep track of all your cron jobs in one place. After integrating your job with Cronhub we send you alerts when: +**Cronhub is a painless cron scheduler and monitoring service for developers who don't like working with complicated servers and cron jobs. No servers and ops required.** + +We created Cronhub to make scheduling and monitoring of recurring tasks a lot easier. Use Cronhub to automate tasks and replace your cronjobs with our schedulers. + +We offer two products that complement each other - Scheduler and Monitoring. + +I have recorded a quick demo to show some of the features on Cronhub. + + + +## What is Scheduler? +As the name implies, Scheduler is a scheduling tool. The schedule can be any time interval or cron expression. Within Scheduler, you define a schedule and a target URL. We send an HTTP request to your Target URL according to your schedule. We do not retry the request if your job fails, and we have a timeout of 3 seconds. + + +With Cronhub Scheduler, you can focus on your application, and we handle the scheduling part. Let's say you want to send a daily email to your users. You can work on creating the function that handles the email sending part, and we take care of the whole scheduling logic behind the scenes. You just need to tell us where your function lives and how often you want to run it. + + +## What is Monitoring? +Use Cronhub monitors to monitor your cron jobs (or any scheduled jobs). After integrating your job with Cronhub we send you alerts when: 1. Your job doesn't run on schedule (e.g. you have daily running job but it failed to run on time) 2. Your job runs longer than expected (e.g. your job should finish within a minute but it took an hour to finish) Cronhub supports E-mail, Slack, SMS, Webhook and PagerDuty notification channels. -## What is a monitor? - +### What is a monitor? For each job, you need to create a monitor. The schedule of your cron and the created monitor should always match. For instance, if you have a minutely running cron job on your server you should create a monitor and set the cron schedule to `* * * * *`. Or if you have a job that runs every hour you can create an hourly interval monitor. -## What is monitor's ping URL? +### What is monitor's ping URL? When you create a new monitor on Cronhub we generate a unique UUID for your monitor. The ping URL consists of the that UUID and the endpoint. For instance, if you only want to monitor the schedule of your cron job then your ping URL will look like this: @@ -24,5 +41,5 @@ In this example the UUID is `1f5e3410-254c-11e8-b61d-55875966d031` and the endpo You will need to make HTTP requests from your job every time it runs. If you want to monitor the running time of the job as well you need to ping twice. At the start of your job and when the job is finished. After receiving the first ping, your monitor is successfully integrated. It will start monitoring your job and notify you if anything is off. -## How does alerting work? +### How does alerting work? If any of your jobs don't run on schedule or run longer than expected Cronhub will alert you. Currently, you can send alerts via Email, Slack, SMS, Webhook and PagerDuty. diff --git a/docs/public-api.md b/docs/public-api.md index 2987b45..3784238 100644 --- a/docs/public-api.md +++ b/docs/public-api.md @@ -1,10 +1,10 @@ # Public API -Cronhub Public API is a REST API that supports basic CRUD operations on top of Cronhub monitors. Our API uses HTTP response codes to indicate any API errors. All API responses are JSON objects. +Cronhub Public API is a REST like API that supports basic CRUD operations on top of Cronhub resources. Our API uses HTTP response codes to indicate any API errors. All API responses are JSON objects. If you have any ideas or suggestions about the API [let us know on Github](https://github.com/cronhub-app/backlog/issues). -We reserve the right to rate-limit any access key if we feel you're not using the api fairly. +We reserve the right to rate-limit any access key if we feel you're not using the API fairly. [[toc]] @@ -14,7 +14,286 @@ All API requests must be authenticated by the API key that Cronhub provides. Whe **You can authenticate your requests by sending the API key in your HTTP request header. The name of the header should be `X-Api-Key` and the value should be your key.** -## API Endpoints +You need an active billing plan on Cronhub to work with Cronhub resources. + +## :tada: Scheduler API Endpoints +### List all schedulers +`GET https://cronhub.io/api/v1/schedulers` Get the list of all your existing schedulers. + +Example Request + +```bash +curl --header "X-Api-Key: api-key" https://cronhub.io/api/v1/schedulers +``` + +Example Response + +```json +{ + "schedulers": [ + { + "id": 1, + "name": "my scheduler", + "description": null, + "interval_schedule_value": null, + "interval_schedule_rate": null, + "type": "cron", + "schedule": "0 0 * * *", + "timezone": "UTC", + "status": "paused", + "url": "https://example.com", + "http_body": [], + "http_method": "get", + "created_at": 1589647300, + "updated_at": 1589647361 + }, + { + "id": 1, + "name": "backup database", + "description": null, + "interval_schedule_value": 12, + "interval_schedule_rate": "hours", + "type": "interval", + "schedule": null, + "timezone": "UTC", + "status": "active", + "url": "https://myapiendpoint.com/run_backup", + "http_body": [], + "http_method": "get", + "created_at": 1589631880, + "updated_at": 1589631880 + }, + ] +} +``` + +### Get an existing scheduler +`GET https://cronhub.test/api/v1/schedulers/` Get an existing scheduler by its unique id. + +::: tip +`` is the unique id that identifies your scheduler. You can find it if you go to the scheduler's page. It's the number you see in the browser's URL address bar. +::: + +Example Request + +```bash +curl --header "X-Api-Key: api-key" https://cronhub.io/api/v1/schedulers/1 +``` + +Example Response + +```json +{ + "scheduler": { + "id": 1, + "name": "run lambda function", + "description": null, + "interval_schedule_value": 12, + "interval_schedule_rate": "hours", + "type": "interval", + "schedule": null, + "timezone": "UTC", + "status": "paused", + "url": "https://www.netlify.com/api/run_amazing_function", + "http_body": [], + "http_method": "get", + "created_at": 1589827724, + "updated_at": 1589828386 + } +} +``` + +### Create a new scheduler + +`POST https://cronhub.io/api/v1/schedulers/create` + +Create a new scheduler with the given arguments. + +| Argument | Description | Is required | +| ------------- |:-------------:| -----:| +| `name` | The name of your scheduler. | yes | +| `type` | The type of your scheduler. Must be `cron` or `interval`. | yes | +| `url` | The HTTP target URL. Must be a valid URL. | yes | +| `http_method` | The HTTP method | yes | +| `http_body` | The HTTP body when the `http_method` is `POST` or `PUT` | no | +| `schedule` | The cron expression schedule (e.g. `0 0 * * *`) | yes, if `type` is `cron | +| `interval_value` | The interval value. Must be a positive integer. | yes, if `type` is `interval` | +| `interval_rate` | The interval rate. Must be `minutes`, `hours` or `days` only. | yes, if `type` is `interval` | +| `timezone` | Should be "UTC" for now | yes, if `type` is `cron` | + +Example request: +```bash +curl -X "POST" --header "X-Api-Key: api-key" \ + -d name='scheduler example' \ + -d type='cron' \ + -d url='https://example-api.com/run_job' \ + -d http_method='get' \ + -d schedule='* * * * *' \ + -d timezone='UTC' \ + https://cronhub.io/api/v1/schedulers/create +``` + +Example response: +```json +{ + "created": { + "id": 1, + "name": "scheduler example'", + "description": null, + "interval_schedule_value": null, + "interval_schedule_rate": null, + "type": "cron", + "schedule": "* * * * *", + "timezone": "UTC", + "status": "active", + "url": "https://example-api.com/run_job", + "http_body": [], + "http_method": "get", + "created_at": 1589829544, + "updated_at": 1589829544 + } +} +``` + +### Update an existing scheduler +`PUT https://cronhub.io/api/v1/schedulers/` + + +::: tip +`` is the unique id that identifies your scheduler. You can find it if you go to the scheduler's page. It's the number you see in the browser's URL address bar. +::: + +Update the scheduler with the given arguments. + +| Argument | Description | Is required | +| ------------- |:-------------:| -----:| +| `name` | The name of your scheduler. | yes | +| `type` | The type of your scheduler. Must be `cron` or `interval`. | yes | +| `url` | The HTTP target URL. Must be a valid URL. | yes | +| `http_method` | The HTTP method | yes | +| `http_body` | The HTTP body when the `http_method` is `POST` or `PUT` | no | +| `schedule` | The cron expression schedule (e.g. `0 0 * * *`) | yes, if `type` is `cron | +| `interval_value` | The interval value. Must be a positive integer. | yes, if `type` is `interval` | +| `interval_rate` | The interval rate. Must be `minutes`, `hours` or `days` only. | yes, if `type` is `interval` | +| `timezone` | Should be "UTC" for now | yes, if `type` is `cron` | + + +Example request: +```bash +curl -X "PUT" --header "X-Api-Key: api-key" \ + -d name='scheduler example changed' \ + -d type='cron' \ + -d url='https://example-api.com/run_job' \ + -d http_method='get' \ + -d schedule='0 0 * * *' \ + -d timezone='UTC' \ + https://cronhub.io/api/v1/schedulers/1 +``` + +Example response: +```json +{ + "updated": { + "id": 1, + "name": "scheduler example changed'", + "description": null, + "interval_schedule_value": null, + "interval_schedule_rate": null, + "type": "cron", + "schedule": "0 0 * * *", + "timezone": "UTC", + "status": "active", + "url": "https://example-api.com/run_job", + "http_body": [], + "http_method": "get", + "created_at": 1589829544, + "updated_at": 1589829544 + } +} +``` + +### Delete a scheduler +`DELETE https://cronhub.io/api/v1/schedulers/` Delete the scheduler with the given id. + + +Example request: +```bash +curl -X "DELETE" --header "X-Api-Key: api-key" https://cronhub.io/api/v1/schedulers/1 +``` + +Example response: +```json +{"deleted":true} +``` + +### Pause a scheduler +`PUT https://cronhub.io/api/v1/schedulers//pause` + +Pause the scheduler with the given id. Sets the `status` field to `paused`. + + +Example request: +```bash +curl -X "PUT" --header "X-Api-Key: api-key" https://cronhub.io/api/v1/schedulers/1/pause +``` + +Example response: +```json +{ + "paused": { + "id": 1, + "name": "my scheduler", + "description": null, + "interval_schedule_value": null, + "interval_schedule_rate": null, + "type": "cron", + "schedule": "0 0 * * *", + "timezone": "UTC", + "status": "paused", + "url": "https://exampleurl.com", + "http_body": [], + "http_method": "get", + "created_at": 1589647300, + "updated_at": 1589829046 + } +} +``` + +### Resume a scheduler +`PUT https://cronhub.io/api/v1/schedulers//resume` + +Resume the scheduler with the given id. Sets the `status` field to `active`. + + +Example request: +```bash +curl -X "PUT" --header "X-Api-Key: api-key" https://cronhub.io/api/v1/schedulers/1/resume +``` + +Example response: +```json +{ + "resumed": { + "id": 1, + "name": "my scheduler", + "description": null, + "interval_schedule_value": null, + "interval_schedule_rate": null, + "type": "cron", + "schedule": "0 0 * * *", + "timezone": "UTC", + "status": "active", + "url": "https://exampleurl.com", + "http_body": [], + "http_method": "get", + "created_at": 1589647300, + "updated_at": 1589829046 + } +} +``` + +## Monitor API Endpoints + ### List all monitors @@ -235,3 +514,4 @@ Example response } } ``` +