New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@qrvey/scheduler

Package Overview
Dependencies
Maintainers
0
Versions
19
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@qrvey/scheduler

Library to schedule the datasync cronjobs

  • 1.0.0
  • npm
  • Socket score

Version published
Weekly downloads
880
increased by167.48%
Maintainers
0
Weekly downloads
 
Created
Source

Qrvey queue message

This is a library to use AWS Eventbridge or k8s scheduler

Installation

npm install @qrvey/scheduler

Require environment variables

AWS_ACCOUNT_ID; //AWS AccountId to send SQS service
AWS_DEFAULT_REGION; //AWS Region for SQS service
PLATFORM_TYPE; //Platform type (possible value CONTAINER)

Usage

Sample usage

const { schedulerService } = require("@qrvey/scheduler");

(async () => {
    const scheduleParams = {
        cronJobName: "multicloud-testcron",
        scheduleExpression: "cron(*/1 * * * * *)",
        description:
            '{"userEmail":"email@useremail.com","datasetName":"DBName","appName":"AppName","readableCronExpr":"Every hour","owner":"ownerId","datasetId":"datasetId","userId":"userId","appId":"appId"}',
        targetParams: {
            Name: "demo_drScheduler_CJ_mra43sr0U",
            Input: {
                detail: {
                    appId: "appId",
                    userId: "userId",
                    owner: "owner",
                    datasetId: "datasetId",
                    cronSyncFrequency: "0 0/1 * * ? *",
                    version: 2.1,
                },
                source: "aws.events",
            },
        },
        tags: [
            {
                Key: "version",
                Value: "2.1",
            },
            {
                Key: "datasetId",
                Value: "datasetId",
            },
            {
                Key: "appId",
                Value: "appId",
            },
            {
                Key: "userId",
                Value: "userId",
            },
            {
                Key: "state",
                Value: "ENABLED",
            },
            {
                Key: "owner",
                Value: "userId",
            },
        ],
        targetResource: "arn:aws:lambda:{region}:{accountId}:function:{functionName}", //For ks8 scheduler the targetRosource will be the entire container url
        state: "DISABLED",
    };

    const schedulerClient = new schedulerService();
    const res = await schedulerClient.create(scheduleParams);
})();

FAQs

Package last updated on 19 Jun 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc