Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/UptimeRobot #1752

Closed
wants to merge 9 commits into from
Closed

Conversation

MedAliMarz
Copy link
Contributor

This PR include a node for UptimeRobot with support for:

  • Account: getAccountDetails:
  • Monitor: create reset getAll update delete
  • Alert Contact: create getAll update delete
  • Maintenance Window: create getAll update delete
  • Public Status Page: create getAll update delete
the next workflow can be used for reviewing the node functionalities
{
  "nodes": [
    {
      "parameters": {},
      "name": "Start",
      "type": "n8n-nodes-base.start",
      "typeVersion": 1,
      "position": [
        250,
        300
      ]
    },
    {
      "parameters": {},
      "name": "UptimeRobot",
      "type": "n8n-nodes-base.uptimeRobot",
      "typeVersion": 1,
      "position": [
        410,
        20
      ],
      "credentials": {
        "uptimeRobotApi": "Dali UptimeRobotApi creds"
      }
    },
    {
      "parameters": {
        "resource": "monitor",
        "operation": "create",
        "friendly_name": "=Monitor{{Date.now()}}",
        "type": 1,
        "url": "http://n8n.io"
      },
      "name": "UptimeRobot1",
      "type": "n8n-nodes-base.uptimeRobot",
      "typeVersion": 1,
      "position": [
        410,
        290
      ],
      "credentials": {
        "uptimeRobotApi": "Dali UptimeRobotApi creds"
      }
    },
    {
      "parameters": {
        "resource": "monitor",
        "operation": "reset",
        "id": "={{$node[\"UptimeRobot1\"].json[\"id\"]}}"
      },
      "name": "UptimeRobot2",
      "type": "n8n-nodes-base.uptimeRobot",
      "typeVersion": 1,
      "position": [
        580,
        290
      ],
      "credentials": {
        "uptimeRobotApi": "Dali UptimeRobotApi creds"
      }
    },
    {
      "parameters": {
        "resource": "monitor",
        "limit": 1,
        "filters": {}
      },
      "name": "UptimeRobot3",
      "type": "n8n-nodes-base.uptimeRobot",
      "typeVersion": 1,
      "position": [
        740,
        290
      ],
      "credentials": {
        "uptimeRobotApi": "Dali UptimeRobotApi creds"
      }
    },
    {
      "parameters": {
        "resource": "monitor",
        "operation": "update",
        "id": "={{$node[\"UptimeRobot1\"].json[\"id\"]}}",
        "updateFields": {
          "friendly_name": "UpdatedMonitor",
          "url": "http://community.n8n.io"
        }
      },
      "name": "UptimeRobot4",
      "type": "n8n-nodes-base.uptimeRobot",
      "typeVersion": 1,
      "position": [
        890,
        290
      ],
      "credentials": {
        "uptimeRobotApi": "Dali UptimeRobotApi creds"
      }
    },
    {
      "parameters": {
        "resource": "monitor",
        "limit": 1,
        "filters": {
          "monitors": "={{$node[\"UptimeRobot1\"].json[\"id\"]}}"
        }
      },
      "name": "UptimeRobot5",
      "type": "n8n-nodes-base.uptimeRobot",
      "typeVersion": 1,
      "position": [
        1050,
        290
      ],
      "credentials": {
        "uptimeRobotApi": "Dali UptimeRobotApi creds"
      }
    },
    {
      "parameters": {
        "resource": "monitor",
        "operation": "delete",
        "id": "={{$node[\"UptimeRobot1\"].json[\"id\"]}}"
      },
      "name": "UptimeRobot6",
      "type": "n8n-nodes-base.uptimeRobot",
      "typeVersion": 1,
      "position": [
        1220,
        290
      ],
      "credentials": {
        "uptimeRobotApi": "Dali UptimeRobotApi creds"
      }
    },
    {
      "parameters": {
        "resource": "alertContact",
        "operation": "create",
        "friendly_name": "=AlertContact{{Date.now()}}",
        "type": 2,
        "value": "=fakeemail{{Date.now().toString().substr(6)}}@test.com"
      },
      "name": "UptimeRobot7",
      "type": "n8n-nodes-base.uptimeRobot",
      "typeVersion": 1,
      "position": [
        410,
        450
      ],
      "credentials": {
        "uptimeRobotApi": "Dali UptimeRobotApi creds"
      }
    },
    {
      "parameters": {
        "resource": "alertContact",
        "limit": 1,
        "filters": {}
      },
      "name": "UptimeRobot8",
      "type": "n8n-nodes-base.uptimeRobot",
      "typeVersion": 1,
      "position": [
        560,
        450
      ],
      "credentials": {
        "uptimeRobotApi": "Dali UptimeRobotApi creds"
      }
    },
    {
      "parameters": {
        "resource": "alertContact",
        "operation": "update",
        "id": "={{$node[\"UptimeRobot7\"].json[\"id\"]}}",
        "updateFields": {
          "friendly_name": "UpdatedAlertContact"
        }
      },
      "name": "UptimeRobot9",
      "type": "n8n-nodes-base.uptimeRobot",
      "typeVersion": 1,
      "position": [
        700,
        450
      ],
      "credentials": {
        "uptimeRobotApi": "Dali UptimeRobotApi creds"
      }
    },
    {
      "parameters": {
        "resource": "alertContact",
        "operation": "delete",
        "id": "={{$node[\"UptimeRobot7\"].json[\"id\"]}}"
      },
      "name": "UptimeRobot10",
      "type": "n8n-nodes-base.uptimeRobot",
      "typeVersion": 1,
      "position": [
        850,
        450
      ],
      "credentials": {
        "uptimeRobotApi": "Dali UptimeRobotApi creds"
      }
    },
    {
      "parameters": {
        "resource": "mwindows",
        "operation": "create",
        "duration": 5,
        "friendly_name": "=Mwindow{{Date.now()}}",
        "start_time": "2021-05-20T22:00:00.000Z",
        "type": 2,
        "value": "20:30"
      },
      "name": "UptimeRobot11",
      "type": "n8n-nodes-base.uptimeRobot",
      "typeVersion": 1,
      "position": [
        410,
        600
      ],
      "credentials": {
        "uptimeRobotApi": "Dali UptimeRobotApi creds"
      }
    },
    {
      "parameters": {
        "resource": "mwindows",
        "limit": 1,
        "filters": {}
      },
      "name": "UptimeRobot12",
      "type": "n8n-nodes-base.uptimeRobot",
      "typeVersion": 1,
      "position": [
        550,
        600
      ],
      "credentials": {
        "uptimeRobotApi": "Dali UptimeRobotApi creds"
      }
    },
    {
      "parameters": {
        "resource": "mwindows",
        "operation": "update",
        "id": "={{$node[\"UptimeRobot11\"].json[\"id\"]}}",
        "duration": 4,
        "updateFields": {
          "type": 3,
          "value": "1-2"
        }
      },
      "name": "UptimeRobot13",
      "type": "n8n-nodes-base.uptimeRobot",
      "typeVersion": 1,
      "position": [
        700,
        600
      ],
      "credentials": {
        "uptimeRobotApi": "Dali UptimeRobotApi creds"
      }
    },
    {
      "parameters": {
        "resource": "mwindows",
        "limit": 1,
        "filters": {
          "mwindows": "={{$node[\"UptimeRobot11\"].json[\"id\"]}}"
        }
      },
      "name": "UptimeRobot14",
      "type": "n8n-nodes-base.uptimeRobot",
      "typeVersion": 1,
      "position": [
        850,
        600
      ],
      "credentials": {
        "uptimeRobotApi": "Dali UptimeRobotApi creds"
      }
    },
    {
      "parameters": {
        "resource": "mwindows",
        "operation": "delete",
        "id": "={{$node[\"UptimeRobot11\"].json[\"id\"]}}"
      },
      "name": "UptimeRobot15",
      "type": "n8n-nodes-base.uptimeRobot",
      "typeVersion": 1,
      "position": [
        1000,
        600
      ],
      "credentials": {
        "uptimeRobotApi": "Dali UptimeRobotApi creds"
      }
    },
    {
      "parameters": {
        "resource": "psp",
        "operation": "create",
        "friendly_name": "=Psp{{Date.now()}}",
        "monitors": "={{$node[\"UptimeRobot1\"].json[\"id\"]}}",
        "additionalFields": {}
      },
      "name": "UptimeRobot16",
      "type": "n8n-nodes-base.uptimeRobot",
      "typeVersion": 1,
      "position": [
        550,
        130
      ],
      "credentials": {
        "uptimeRobotApi": "Dali UptimeRobotApi creds"
      }
    },
    {
      "parameters": {
        "resource": "psp",
        "limit": 1,
        "filters": {
          "psps": "={{$node[\"UptimeRobot16\"].json[\"id\"]}}"
        }
      },
      "name": "UptimeRobot17",
      "type": "n8n-nodes-base.uptimeRobot",
      "typeVersion": 1,
      "position": [
        700,
        130
      ],
      "credentials": {
        "uptimeRobotApi": "Dali UptimeRobotApi creds"
      }
    },
    {
      "parameters": {
        "resource": "psp",
        "operation": "update",
        "id": "={{$node[\"UptimeRobot16\"].json[\"id\"]}}",
        "updateFields": {
          "friendly_name": "UpdatedPSP"
        }
      },
      "name": "UptimeRobot18",
      "type": "n8n-nodes-base.uptimeRobot",
      "typeVersion": 1,
      "position": [
        850,
        130
      ],
      "credentials": {
        "uptimeRobotApi": "Dali UptimeRobotApi creds"
      }
    },
    {
      "parameters": {
        "resource": "psp",
        "operation": "delete",
        "id": "={{$node[\"UptimeRobot16\"].json[\"id\"]}}"
      },
      "name": "UptimeRobot19",
      "type": "n8n-nodes-base.uptimeRobot",
      "typeVersion": 1,
      "position": [
        1000,
        130
      ],
      "credentials": {
        "uptimeRobotApi": "Dali UptimeRobotApi creds"
      }
    }
  ],
  "connections": {
    "Start": {
      "main": [
        [
          {
            "node": "UptimeRobot1",
            "type": "main",
            "index": 0
          },
          {
            "node": "UptimeRobot7",
            "type": "main",
            "index": 0
          },
          {
            "node": "UptimeRobot11",
            "type": "main",
            "index": 0
          },
          {
            "node": "UptimeRobot",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "UptimeRobot1": {
      "main": [
        [
          {
            "node": "UptimeRobot16",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "UptimeRobot2": {
      "main": [
        [
          {
            "node": "UptimeRobot3",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "UptimeRobot3": {
      "main": [
        [
          {
            "node": "UptimeRobot4",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "UptimeRobot4": {
      "main": [
        [
          {
            "node": "UptimeRobot5",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "UptimeRobot5": {
      "main": [
        [
          {
            "node": "UptimeRobot6",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "UptimeRobot7": {
      "main": [
        [
          {
            "node": "UptimeRobot8",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "UptimeRobot8": {
      "main": [
        [
          {
            "node": "UptimeRobot9",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "UptimeRobot9": {
      "main": [
        [
          {
            "node": "UptimeRobot10",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "UptimeRobot11": {
      "main": [
        [
          {
            "node": "UptimeRobot12",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "UptimeRobot12": {
      "main": [
        [
          {
            "node": "UptimeRobot13",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "UptimeRobot13": {
      "main": [
        [
          {
            "node": "UptimeRobot14",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "UptimeRobot14": {
      "main": [
        [
          {
            "node": "UptimeRobot15",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "UptimeRobot16": {
      "main": [
        [
          {
            "node": "UptimeRobot17",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "UptimeRobot17": {
      "main": [
        [
          {
            "node": "UptimeRobot18",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "UptimeRobot18": {
      "main": [
        [
          {
            "node": "UptimeRobot19",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "UptimeRobot19": {
      "main": [
        [
          {
            "node": "UptimeRobot2",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}

Copy link
Contributor

@ivov ivov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for taking this on 👍

Quick code review - node not yet tested.

packages/nodes-base/nodes/UptimeRobot/GenericFunctions.ts Outdated Show resolved Hide resolved
packages/nodes-base/nodes/UptimeRobot/GenericFunctions.ts Outdated Show resolved Hide resolved
packages/nodes-base/nodes/UptimeRobot/GenericFunctions.ts Outdated Show resolved Hide resolved
@ivov
Copy link
Contributor

ivov commented May 14, 2021

Node functionality tested - all operations working.

Minor details to add to the above:
HTTP(s)HTTP(S)
Web-HookWebhook
mwindowsmwindow

@RicardoE105 RicardoE105 mentioned this pull request May 26, 2021
@RicardoE105
Copy link
Contributor

Closing this in favor of #1830

@janober
Copy link
Member

janober commented May 30, 2021

Thanks a lot. Got merged with #1830

@janober
Copy link
Member

janober commented May 30, 2021

Got released with n8n@0.122.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants