ps/Modules/Alkami.PowerShell.Common/Public/New-StatusIoIncident.ps1

58 lines
1.6 KiB
PowerShell
Raw Permalink Normal View History

2023-05-30 22:51:22 -07:00
Function New-StatusIoIncident {
<#
.SYNOPSIS
Sends an SNS message to create a new StatusPage.Io Incident.
.PARAMETER PageId
StatusIo Page Id. Alkami's account id.
.PARAMETER ComponentId
Specific Component to modify. Often a pod or lane.
.PARAMETER ComponentName
Human friendly Component name
.PARAMETER ComponentStatus
Component status to set
.PARAMETER IncidentName
Human friendly Incident Name
.PARAMETER IncidentStatus
Incident status to set.
.PARAMETER IncidentId
Incident Id of an existing incident to update. Ignored if it doesn't exist. If it's invalid, the message will
fire, but the lambda will fail. Check those logs if updates aren't occurring. Ignored if provided for a Create
incident.
#>
[CmdletBinding()]
param(
[Parameter(Mandatory = $true)]
[string]$PageId,
[Parameter(Mandatory = $true)]
[string]$ComponentId,
[Parameter(Mandatory = $true)]
[string]$ComponentName,
[Parameter(Mandatory = $true)]
[string]$ComponentStatus,
[Parameter(Mandatory = $true)]
[string]$IncidentName,
[Parameter(Mandatory = $true)]
[string]$IncidentStatus,
[Parameter(Mandatory = $false)]
[string]$IncidentId
)
$incident = @{
PageId = $pageId;
ComponentId = $ComponentId;
ComponentName = $ComponentName;
ComponentStatus = $ComponentStatus;
IncidentName = $IncidentName;
IncidentStatus = $IncidentStatus;
InciidentId = $IncidentId;
}
return $incident
}