-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add initial pipelines and mod files (#1)
Co-authored-by: RahulLah19 <[email protected]>
- Loading branch information
1 parent
eb86257
commit da4dc05
Showing
23 changed files
with
836 additions
and
133 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,7 +12,4 @@ | |
.DS_Store | ||
|
||
# Flowpipe variable files | ||
*.pvars | ||
|
||
# Flowpipe mod dependencies | ||
.flowpipe | ||
*.pvars |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,7 @@ | ||
# Common descriptions | ||
locals { | ||
repository_owner = split("/", var.repository_full_name)[0] | ||
repository_name = split("/", var.repository_full_name)[1] | ||
} | ||
api_key_param_description = "The API token to authenticate to the PagerDuty APIs." | ||
email_param_description = "The email address of a valid user associated with the account making the request." | ||
incident_id_param_description = "The ID of the incident." | ||
user_id_param_description = "The ID of the user." | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,14 @@ | ||
mod "pageduty" { | ||
title = "PageDuty" | ||
description = "Run pipelines and triggers that interact with PageDuty." | ||
color = "#191717" | ||
mod "pagerduty" { | ||
title = "PagerDuty" | ||
description = "Run pipelines and triggers that interact with PagerDuty." | ||
color = "#06AC38" | ||
documentation = file("./docs/index.md") | ||
icon = "/images/flowpipe/mods/turbot/github.svg" | ||
categories = ["pageduty"] | ||
icon = "/images/flowpipe/mods/turbot/pagerduty.svg" | ||
categories = ["pagerduty", "library"] | ||
|
||
opengraph { | ||
title = "PageDuty" | ||
description = "Run pipelines and triggers that interact with PageDuty." | ||
image = "/images/flowpipe/mods/turbot/github-social-graphic.png" | ||
title = "PagerDuty" | ||
description = "Run pipelines and triggers that interact with PagerDuty." | ||
image = "/images/flowpipe/mods/turbot/pagerduty-social-graphic.png" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,100 @@ | ||
pipeline "create_incident" { | ||
title = "Create Incident" | ||
description = "Create an incident." | ||
|
||
param "body" { | ||
type = object({ | ||
type = string | ||
details = string | ||
}) | ||
description = "Additional incident details." | ||
optional = true | ||
} | ||
|
||
param "conference_bridge" { | ||
type = object({ | ||
conference_number = string | ||
conference_url = string | ||
}) | ||
description = "Central channel for collaboration." | ||
optional = true | ||
} | ||
|
||
param "escalation_policy" { | ||
type = object({ | ||
id = string | ||
type = string | ||
}) | ||
description = "The escalation policy for the incident." | ||
optional = true | ||
} | ||
|
||
param "from" { | ||
type = string | ||
description = local.email_param_description | ||
} | ||
|
||
param "incident_key" { | ||
type = string | ||
description = "A string which identifies the incident. Sending subsequent requests referencing the same service and with the same incident_key will result in those requests being rejected if an open incident matches that incident_key." | ||
optional = true | ||
} | ||
|
||
param "priority" { | ||
type = object({ | ||
id = string | ||
type = string | ||
}) | ||
description = "The priority of the incident." | ||
optional = true | ||
} | ||
|
||
param "service" { | ||
type = object({ | ||
id = string | ||
type = string | ||
}) | ||
description = "The service detail for the incident." | ||
} | ||
|
||
param "api_key" { | ||
type = string | ||
description = local.api_key_param_description | ||
default = var.api_key | ||
} | ||
|
||
param "title" { | ||
type = string | ||
description = "A succinct description of the nature, symptoms, cause, or effect of the incident." | ||
} | ||
|
||
param "type" { | ||
type = string | ||
description = "The type of the incident." | ||
} | ||
|
||
param "urgency" { | ||
type = string | ||
description = "The urgency of the incident." | ||
optional = true | ||
} | ||
|
||
step "http" "create_incident" { | ||
method = "POST" | ||
url = "https://api.pagerduty.com/incidents" | ||
request_headers = { | ||
Content-Type = "application/json" | ||
Authorization = "Token token=${param.api_key}" | ||
From = "${param.from}" | ||
} | ||
request_body = jsonencode({ | ||
incident = { | ||
for name, value in param : name => value if value != null | ||
} | ||
}) | ||
} | ||
|
||
output "incident" { | ||
value = step.http.create_incident.response_body | ||
} | ||
} |
Oops, something went wrong.