GithubHelp home page GithubHelp logo

turbot / flowpipe-mod-uptimerobot Goto Github PK

View Code? Open in Web Editor NEW
2.0 8.0 0.0 16 KB

UptimeRobot pipeline library for the Flowpipe cloud scripting engine. Automation and workflows to connect UptimeRobot to the people, systems and data that matters.

Home Page: https://hub.flowpipe.io/mods/turbot/uptimerobot

License: Apache License 2.0

HCL 100.00%
flowpipe flowpipe-mod automation cloud devops integrations low-code orchestration pipelines security

flowpipe-mod-uptimerobot's Introduction

UptimeRobot Mod for Flowpipe

UptimeRobot pipeline library for Flowpipe enabling seamless integration of UptimeRobot services into your workflows.

Documentation

Getting Started

Installation

Download and install Flowpipe (https://flowpipe.io/downloads). Or use Brew:

brew tap turbot/tap
brew install flowpipe

Credentials

By default, the following environment variables will be used for authentication:

  • UPTIMEROBOT_API_KEY

You can also create credential resources in configuration files:

vi ~/.flowpipe/config/uptimerobot.fpc
credential "uptimerobot" "my_uptimerobot" {
  api_key = "u1123455-ecaf32fwer633fdf4f33dd3c445"
}

For more information on credentials in Flowpipe, please see Managing Credentials.

Usage

Initialize a mod:

mkdir my_mod
cd my_mod
flowpipe mod init

Install the UptimeRobot mod as a dependency:

flowpipe mod install github.com/turbot/flowpipe-mod-uptimerobot

Use the dependency in a pipeline step:

vi my_pipeline.fp
pipeline "my_pipeline" {

  step "pipeline" "create_monitor" {
    pipeline = uptimerobot.pipeline.create_monitor
    args = {
      friendly_name = "My New Monitor"
      url           = "https://example.com"
      type          = "1"
    }
  }
}

Run the pipeline:

flowpipe pipeline run my_pipeline

Developing

Clone:

git clone https://github.com/turbot/flowpipe-mod-uptimerobot.git
cd flowpipe-mod-uptimerobot

List pipelines:

flowpipe pipeline list

Run a pipeline:

flowpipe pipeline run create_monitor --arg friendly_name="My New Monitor" --arg url="https://example.com" --arg type="1"

To use a specific credential, specify the cred pipeline argument:

flowpipe pipeline run create_monitor --arg cred=uptimerobot_profile --arg friendly_name="My New Monitor" --arg url="https://example.com" --arg type="1"

Open Source & Contributing

This repository is published under the Apache 2.0 license. Please see our code of conduct. We look forward to collaborating with you!

Flowpipe is a product produced from this open source software, exclusively by Turbot HQ, Inc. It is distributed under our commercial terms. Others are allowed to make their own distribution of the software, but cannot use any of the Turbot trademarks, cloud services, etc. You can learn more in our Open Source FAQ.

Get Involved

Join #flowpipe on Slack โ†’

Want to help but not sure where to start? Pick up one of the help wanted issues:

flowpipe-mod-uptimerobot's People

Contributors

karanpopat avatar priyanka-chatterjee-2000 avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

flowpipe-mod-uptimerobot's Issues

User experience: Give a better error message when API key is missing

Is your feature request related to a problem? Please describe.
Give a proper error message, when the API key is missing

CLI Version: Flowpipe v0.1.0

$ flowpipe pipeline run uptimerobot.pipeline.list_monitors
[flowpipe] Execution ID: exec_clujp7nljat7rfenbjv0
[list_monitors] Starting pipeline
[list_monitors.list_monitors] Starting http: POST https://api.uptimerobot.com/v2/getMonitors
[list_monitors.list_monitors] Complete: 200 667ms
[list_monitors] Internal Error: Error calculating output 'monitors': Internal Error: output: Unsupported attribute: This object does not have an attribute named "monitors".
(/Users/venu/turbie/turbot/flowpipe-mod-uptimerobot/pipelines/monitor/list_monitors.fp:30,56-65)
[list_monitors] Failed 678ms

Only after using a --verbose flag, we get to know

$ flowpipe pipeline run uptimerobot.pipeline.list_monitors --verbose
[flowpipe] Execution ID: exec_clujsrnljat7scnhik10
[list_monitors] Starting pipeline
[list_monitors.list_monitors] Starting http: POST https://api.uptimerobot.com/v2/getMonitors
[list_monitors.list_monitors] Arg method = POST
[list_monitors.list_monitors] Arg request_body = {"api_key":"","format":"json","logs":"1"}
[list_monitors.list_monitors] Arg request_headers = {
  "Cache-Control": "no-cache",
  "Content-Type": "application/json"
}
[list_monitors.list_monitors] Arg step_name = list_monitors
[list_monitors.list_monitors] Arg url = https://api.uptimerobot.com/v2/getMonitors
[list_monitors.list_monitors] Attr finished_at = 2023-12-16T06:06:38.617853Z
[list_monitors.list_monitors] Attr response_body = {
  "error": {
    "message": "api_key parameter is missing.",
    "parameter_name": "api_key",
    "type": "missing_parameter"
  },
  "stat": "fail"
}
[list_monitors.list_monitors] Attr response_headers = {
  "Alt-Svc": "h3=\":443\"; ma=86400",
  "Cf-Cache-Status": "DYNAMIC",
  "Cf-Ray": "8364bdd269ecf484-BOM",
  "Connection": "keep-alive",
  "Content-Security-Policy": "frame-ancestors 'self'",
  "Content-Type": "application/json; charset=utf-8",
  "Date": "Sat, 16 Dec 2023 06:06:38 GMT",
  "Etag": "W/\"79-ergfDZeyI1WuHJDomaLmz5TLbYo\"",
  "Nel": "{\"success_fraction\":0,\"report_to\":\"cf-nel\",\"max_age\":604800}",
  "Permissions-Policy": "geolocation=(),midi=(),sync-xhr=(),microphone=(),camera=(),magnetometer=(),gyroscope=(),fullscreen=(self),payment=()",
  "Referrer-Policy": "strict-origin-when-cross-origin",
  "Report-To": "{\"endpoints\":[{\"url\":\"https:\\/\\/a.nel.cloudflare.com\\/report\\/v3?s=VfJ8AhBN4%2F5ElW0T6SnaC%2F09%2F%2FlkL%2FKd8ODUUiFzw1iPMLN53r2j99rlTGvyh3NUDLpvfnVUoI1KccJix4iAwpPQ0N9MzhDaS35xjd5KjbPt28ynOZnSIJoEuuJp8993fETbq6FgfBw2Pk1MAXQH4jk%3D\"}],\"group\":\"cf-nel\",\"max_age\":604800}",
  "Server": "cloudflare",
  "Strict-Transport-Security": "max-age=31536000; preload",
  "Vary": "Accept-Encoding",
  "X-Content-Type-Options": "nosniff",
  "X-Frame-Options": "SAMEORIGIN",
  "X-Xss-Protection": "1; mode=block"
}
[list_monitors.list_monitors] Attr started_at = 2023-12-16T06:06:38.346992Z
[list_monitors.list_monitors] Attr status = 200 OK
[list_monitors.list_monitors] Attr status_code = 200
[list_monitors.list_monitors] Complete: 200 272ms
[list_monitors] Internal Error: Error calculating output 'monitors': Internal Error: output: Unsupported attribute: This object does not have an attribute named "monitors".
(/Users/venu/turbie/turbot/flowpipe-mod-uptimerobot/pipelines/monitor/list_monitors.fp:30,56-65)
[list_monitors] Failed 280ms

The status code is 200 even for a failed request. Similar to slack api.
Perhaps include this message in the pipeline error instead of Error calculating output 'monitors'

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.