Skip to content

Commit

Permalink
Merge pull request #6 from turbot/release/v1.0.0
Browse files Browse the repository at this point in the history
Release/v1.0.0
  • Loading branch information
misraved authored Oct 22, 2024
2 parents dbac110 + 3e83354 commit 9ce4152
Show file tree
Hide file tree
Showing 8 changed files with 51 additions and 30 deletions.
15 changes: 15 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,18 @@
## v1.0.0 (2024-10-22)

_Breaking changes_

- Flowpipe `v1.0.0` is now required. For a full list of CLI changes, please see the [Flowpipe v1.0.0 CHANGELOG](https://flowpipe.io/changelog/flowpipe-cli-v1-0-0).
- In Flowpipe configuration files (`.fpc`), `credential` and `credential_import` resources have been renamed to `connection` and `connection_import` respectively.
- Renamed all `cred` params to `conn` and updated their types from `string` to `conn`.

_Enhancements_

- Added `library` to the mod's categories.
- Updated the following pipeline tags:
- `type = "featured"` to `recommended = "true"`
- `type = "test"` to `folder = "Tests"`

## v0.1.0 [2023-12-14]

_What's new?_
Expand Down
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,25 +17,25 @@ brew tap turbot/tap
brew install flowpipe
```

### Credentials
### Connections

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

- `UPTIMEROBOT_API_KEY`

You can also create `credential` resources in configuration files:
You can also create `connection` resources in configuration files:

```sh
vi ~/.flowpipe/config/uptimerobot.fpc
```

```hcl
credential "uptimerobot" "my_uptimerobot" {
connection "uptimerobot" "my_uptimerobot" {
api_key = "u1123455-ecaf32fwer633fdf4f33dd3c445"
}
```

For more information on credentials in Flowpipe, please see [Managing Credentials](https://flowpipe.io/docs/run/credentials).
For more information on connections in Flowpipe, please see [Managing Connections](https://flowpipe.io/docs/run/connections).

### Usage

Expand Down Expand Up @@ -100,10 +100,10 @@ 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:
To use a specific `connection`, specify the `conn` pipeline argument:

```sh
flowpipe pipeline run create_monitor --arg cred=uptimerobot_profile --arg friendly_name="My New Monitor" --arg url="https://example.com" --arg type="1"
flowpipe pipeline run create_monitor --arg conn=connection.uptimerobot.my_uptimerobot --arg friendly_name="My New Monitor" --arg url="https://example.com" --arg type="1"
```

## Open Source & Contributing
Expand Down
2 changes: 1 addition & 1 deletion locals.fp
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,5 @@ locals {

# Common descriptions
locals {
cred_param_description = "Name for credentials to use. If not provided, the default credentials will be used."
conn_param_description = "Name of UptimeRobot connection to use. If not provided, the default UptimeRobot connection will be used."
}
8 changes: 7 additions & 1 deletion mod.fp
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,17 @@ mod "uptimerobot" {
color = "#3BD771"
documentation = file("./README.md")
icon = "/images/mods/turbot/uptimerobot.svg"
categories = ["monitoring"]
categories = ["library", "monitoring"]

opengraph {
title = "UptimeRobot Mod for Flowpipe"
description = "Run pipelines to supercharge your UptimeRobot workflows using Flowpipe."
image = "/images/mods/turbot/uptimerobot-social-graphic.png"
}

require {
flowpipe {
min_version = "1.0.0"
}
}
}
12 changes: 6 additions & 6 deletions pipelines/account/get_account.fp
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@ pipeline "get_account" {
description = "Get account details."

tags = {
type = "featured"
recommended = "true"
}

param "cred" {
type = string
description = local.cred_param_description
default = "default"
param "conn" {
type = connection.uptimerobot
description = local.conn_param_description
default = connection.uptimerobot.default
}

step "http" "get_account" {
Expand All @@ -21,7 +21,7 @@ pipeline "get_account" {
}

request_body = jsonencode({
api_key = credential.uptimerobot[param.cred].api_key
api_key = param.conn.api_key
format = "json"
})
}
Expand Down
12 changes: 6 additions & 6 deletions pipelines/monitor/create_monitor.fp
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@ pipeline "create_monitor" {
description = "Create new monitors of any type."

tags = {
type = "featured"
recommended = "true"
}

param "cred" {
type = string
description = local.cred_param_description
default = "default"
param "conn" {
type = connection.uptimerobot
description = local.conn_param_description
default = connection.uptimerobot.default
}

param "friendly_name" {
Expand Down Expand Up @@ -64,7 +64,7 @@ pipeline "create_monitor" {
for name, value in param : try(local.create_monitor_request_params[name], name) => value if contains(keys(local.create_monitor_request_params), name) && value != null
},
{
api_key = credential.uptimerobot[param.cred].api_key
api_key = param.conn.api_key
}
))
}
Expand Down
10 changes: 5 additions & 5 deletions pipelines/monitor/edit_monitor.fp
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ pipeline "edit_monitor" {
title = "Edit Monitor"
description = "Edit a monitor."

param "cred" {
type = string
description = local.cred_param_description
default = "default"
param "conn" {
type = connection.uptimerobot
description = local.conn_param_description
default = connection.uptimerobot.default
}

param "friendly_name" {
Expand All @@ -32,7 +32,7 @@ pipeline "edit_monitor" {
}

request_body = jsonencode({
api_key = credential.uptimerobot[param.cred].api_key
api_key = param.conn.api_key
friendly_name = param.friendly_name
id = param.monitor_id
url = param.url
Expand Down
10 changes: 5 additions & 5 deletions pipelines/monitor/list_monitors.fp
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ pipeline "list_monitors" {
title = "List Monitors"
description = "Lists all the monitors in a user's account."

param "cred" {
type = string
description = local.cred_param_description
default = "default"
param "conn" {
type = connection.uptimerobot
description = local.conn_param_description
default = connection.uptimerobot.default
}

# TODO: Add pagination support once https://github.com/turbot/flowpipe/issues/339 is resolved
Expand All @@ -19,7 +19,7 @@ pipeline "list_monitors" {
}

request_body = jsonencode({
api_key = credential.uptimerobot[param.cred].api_key
api_key = param.conn.api_key
format = "json"
logs = "1"
})
Expand Down

0 comments on commit 9ce4152

Please sign in to comment.