SetCronJob Client Library for Node.js
This module provides calls to the SetCronJob API for Nodejs. Setcronjob module provides you feature to set online schedulers for your application. This schedulers can call any api or task on on your server corresponding to different time settings. You can retriever your daily log with respective execution results and can enable and disable schedulers easily.
For more information on the API request and responses visit the SetCronJob API docs
Example
var setCronJob = ;var cronJob = 'xxxxxxxx'; //list cron for a tokencronJobcron;
Installation
npm install setcronjob //install locally
npm install -g setcronjob //install globally
npm install setcronjob --save //install locally and save to package json
Quick Start
You will need valid Setcronjob Token to work with this module, You can obtain token after signing up (https://www.setcronjob.com/)
Cron Job:
var setCronJob = ;var cronJob = 'xxxxxxxx';
//list cron for a tokencronJobcron;
//get one cron job informationvar params = id: 'xxxxxx';cronJobcron;
//Add cron jobvar params = month: 3 day: 25 hour: 18 minute: 0 url: 'https://test.com:9000/api/v1//execute' timezone: 'Asia/Kolkata' postData: '{"postId":"xyz"}' httpMethod: 'POST';cronJobcron;
//Edit cronvar params = id: 'xyz' month: 4 day: 26 hour: 19 minute: 20 url: 'https://daytest.com:9000/api/v1//execute' timezone: 'Asia/Kolkata' postData: '{"postId":"xyz"}' httpMethod: 'POST';cronJobcron;
//Enable cronvar params = id: 'xyz';cronJobcron;
//Disable cronvar params = id: 'xyz';cronJobcron;
//delete cronvar params = id: 'xyz';cronJobcron;
//run cronvar params = id: 'xyz';cronJobcron
//get logsvar params = id: 'xyz';cronJobcron;
Account job:
var setCronJob = ;var cronJob = 'xxxxxxxx';
//Edit accountvar params = timezone: 'Asia/kolkatta';cronJobaccount;
Group Job:
var setCronJob = ;var cronJob = 'xxxxxxxx';
//list groupcronJobgroup;
//Get groupvar params = id: 'xyz';cronJobgroup;
//Add groupvar params = name: 'test-group';cronJobgroup;
//Edit groupvar params = id: 'xyz' name: 'test-edit';cronJobgroup;
//Delete groupvar params = id: 'xyz';cronJobgroup;
//Vanish groupvar params = id: 'xyz';cronJobgroup;
//Emp†y groupvar params = id: 'xyz';cronJobgroup;
Server Job:
var setCronJob = ;var cronJob = 'xxxxxxxx';
//Get server timecronJobserver;
//get supported time zonescronJobserver;
//get user agentscronJobserveruserAgent { if err console else console };
//get server ipcronJobserver;
Tests
To run tests type npm test. To run tests with coverage type npm coverage.
Examples
Contributors
Originally authored by @princesoni1989
LICENSE
setcronjob is released under the ISC License Copyright (c) 2016 Prince Soni
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.