Edit me

nOps Scheduler API Guide

What is nOps Scheduler?

nOps Scheduler automatically pauses unused cloud resources, such as EC2 instances, EBS volumes, and RDS instances. It works by creating tag-based schedules. For example, an organization might create a schedule that pauses all EC2 instances with the tag “dev” during off-peak hours. 

nOps Scheduler provides a RESTful API to create, manage and monitor schedules and resources.

Why use nOps Scheduler?

  • Cost optimization. Scheduling can save organizations a significant amount of money on Dev and QA costs, especially during off-peak hours.
  • Time savings. Lack of time and resources is a key blocker preventing engineers from reducing cloud spend — nOps Scheduler makes scheduling simpler and faster.
  • Automation. Our AI is constantly learning your usage patterns for greater savings.

Summary of steps

In order to implement grouped schedules using the nOps API:

  1. Authenticate to the nOps API
  2. List created nOps Scheduler
  3. Create a grouped schedule
  4. (Optional) Create an EventBridge
  5. Get the status of the grouped schedule

Complete instructions

1. Authentication

The first step is to authenticate to the nOps API. Here are the steps to create a signed request (a key pair used to verify your signature).

  • Configure an API key in nOps through the nOps app.
  • (Optional) Create a public/private key pair. Configure nOps with the public key to validate the signature.
  • Compose your request.

This article provides more detailed information on the API authentication process.

2. Getting nOps Schedules

Once you are authenticated, you can onboard resources to nOps Scheduler with this request:

GET https://app.nops.io/svc/notifications/scheduler/nops_scheduler?api_key=<insert_api_key>

This request requires the following parameters:

  • PI <insert_api_key>: Your nOps API key

For example, the following request would give nOps Scheduler resource recommendations: **

3. Scheduler Recommendations

Once you have added resources to nOps Scheduler, you can use the following features:

  • Utilization Based Recommendation
  • Workload Based Recommendation
  • Storage Recommendation

The following request lists your Utilization Based Recommendation

GET https://app.nops.io/svc/k8s_cost/scheduler_groups?page_number=1&page_size=20&sort_by=savings&sort_type=desc

The following request lists your Workload Based Recommendation

GET https://app.nops.io/svc/k8s_cost/workload_scheduler_groups?page_number=1&page_size=20&sort_by=savings&sort_type=desc

The following request lists your Storage Recommendations

GET https://app.nops.io/svc/k8s_cost/nops_essentials?page_number=1&page_size=20&sort_by=savings&sort_type=desc

4. (Optional) Create an EventBridge

An EventBridge is a notification that is triggered when a schedule is activated or deactivated. An EventBridge is created specific to an AWS account. Each AWS account must have an nOps Scheduler EventBridge configured. Any further schedules created in the account will use the same EventBridge. 

Before creating a new EventBridge, check if there is an EventBridge for the AWS account that is already configured. 

GET https://app.nops.io/svc/notifications/eventbridge

If the EventBridge integration does not exist, you should create a new EventBridge from the following steps:

In the Create New EventBridge page:

  • Create a name for the EventBridge.
  • Select the AWS account to deploy the EventBridge into. In the AWS accounts list, you will only see the accounts that you onboard into nOps.
  • Select the region to deploy the EventBridge into.
  • Click Create.

This article provides more information on using EventBridge with nOps Scheduler. 

5. Creating a Schedule:

To create a schedule, use the following endpoint. 


    POST https://app.nops.io/svc/notifications/scheduler/nops_scheduler
    Body: (Format: JSON)
    {"name":"test","project":<project_id>,"account_number":"<aws_account_id>","scheduled_by_tag_value":"38fdb370-32c9-11ee-92fc-0fc75763a04d","eventbridge_configuration":'<eventbridge id>',"hours_down":1,"resources":[],"actions":[{"action":"start","action_type":"selected_day_of_week","day":"mon","day_of_week":["mon"],"hour":0,"minute":0,"position":0},{"action":"stop","action_type":"selected_day_of_week","day":"sun","day_of_week":["sun"],"hour":23,"minute":0,"position":167,"action_details":{}}]}

Getting started with the nOps developer API
The Scheduler Slackbot "How To" Guide
Back to top       Home
Tags: developer