Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
64 changes: 64 additions & 0 deletions src/GitHub/public/Status/Get-GitHubScheduledMaintenance.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
function Get-GitHubScheduledMaintenance {
<#
.SYNOPSIS
Gets the status of GitHub scheduled maintenance

.DESCRIPTION
Scheduled maintenances are planned outages, upgrades, or general notices that you're working
on infrastructure and disruptions may occurr. A close sibling of Incidents, each usually goes
through a progression of statuses listed below, with an impact calculated from a blend of
component statuses (or an optional override).

Status: Scheduled, In Progress, Verifying, or Completed
Impact: None (black), Minor (yellow), Major (orange), or Critical (red)

.EXAMPLE
Get-GitHubScheduledMaintenance

Get a list of the 50 most recent scheduled maintenances.
This includes scheduled maintenances as described in the above two endpoints, as well as those in the Completed state.

.EXAMPLE
Get-GitHubScheduledMaintenance -Active

Get a list of any active maintenances.

.EXAMPLE
Get-GitHubScheduledMaintenance -Upcoming

Get a list of any upcoming maintenances.

.NOTES
https://www.githubstatus.com/api#scheduled-maintenances
#>
param(
# Get a list of any active maintenances.
# This endpoint will only return scheduled maintenances in the In Progress or Verifying state.
[Parameter()]
[switch] $Active,

# Get a list of any upcoming maintenances.
# This endpoint will only return scheduled maintenances still in the Scheduled state.
[Parameter()]
[switch] $Upcoming
)

if ($Active) {
$APIURI = 'https://www.githubstatus.com/api/v2/scheduled-maintenances/active.json'
$response = Invoke-RestMethod -Uri $APIURI -Method Get
$response.scheduled_maintenances
return
}

if ($Upcoming) {
$APIURI = 'https://www.githubstatus.com/api/v2/scheduled-maintenances/upcoming.json'
$response = Invoke-RestMethod -Uri $APIURI -Method Get
$response.scheduled_maintenances
return
}

$APIURI = 'https://www.githubstatus.com/api/v2/scheduled-maintenances.json'
$response = Invoke-RestMethod -Uri $APIURI -Method Get
$response.scheduled_maintenances

}
43 changes: 43 additions & 0 deletions src/GitHub/public/Status/Get-GitHubStatus.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
function Get-GitHubStatus {
<#
.SYNOPSIS
Gets the status of GitHub services

.DESCRIPTION
Get a summary of the status page, including a status indicator, component statuses, unresolved incidents, and any upcoming or in-progress scheduled maintenances.
Get the status rollup for the whole page. This endpoint includes an indicator - one of none, minor, major, or critical, as well as a human description of the blended component status. Examples of the blended status include "All Systems Operational", "Partial System Outage", and "Major Service Outage".

.EXAMPLE
Get-GitHubStatus

Gets the status of GitHub services

.EXAMPLE
Get-GitHubStatus -Summary

Gets a summary of the status page, including a status indicator, component statuses, unresolved incidents, and any upcoming or in-progress scheduled maintenances.

.NOTES
https://www.githubstatus.com/api#summary
https://www.githubstatus.com/api#status
#>
[OutputType([pscustomobject])]
[CmdletBinding()]
param(
# Gets a summary of the status page, including a status indicator, component statuses, unresolved incidents, and any upcoming or in-progress scheduled maintenances.
[Parameter()]
[switch] $Summary
)

if ($Summary) {
$APIURI = 'https://www.githubstatus.com/api/v2/summary.json'
$response = Invoke-RestMethod -Uri $APIURI -Method Get
$response
return
}

$APIURI = 'https://www.githubstatus.com/api/v2/status.json'
$response = Invoke-RestMethod -Uri $APIURI -Method Get
$response.status

}
24 changes: 24 additions & 0 deletions src/GitHub/public/Status/Get-GitHubStatusComponents.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
function Get-GitHubStatusComponents {
<#
.SYNOPSIS
Gets the status of GitHub components

.DESCRIPTION
Get the components for the page. Each component is listed along with its status - one of operational, degraded_performance, partial_outage, or major_outage.

.EXAMPLE
Get-GitHubStatusComponents

Gets the status of GitHub components

.NOTES
https://www.githubstatus.com/api#components
#>
[OutputType([pscustomobject[]])]
[CmdletBinding()]
param()

$APIURI = 'https://www.githubstatus.com/api/v2/components.json'
$response = Invoke-RestMethod -Uri $APIURI -Method Get
$response.components
}
46 changes: 46 additions & 0 deletions src/GitHub/public/Status/Get-GitHubStatusIncidents.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
function Get-GitHubStatusIncidents {
<#
.SYNOPSIS
Gets the status of GitHub incidents

.DESCRIPTION
Incidents are the cornerstone of any status page, being composed of many incident updates.
Each incident usually goes through a progression of statuses listed below, with an impact
calculated from a blend of component statuses (or an optional override).

Status: Investigating, Identified, Monitoring, Resolved, or Postmortem
Impact: None (black), Minor (yellow), Major (orange), or Critical (red)

.EXAMPLE
Get-GitHubStatusIncidents

Gets the status of GitHub incidents

.EXAMPLE
Get-GitHubStatusIncidents -Unresolved

Gets the status of GitHub incidents that are unresolved

.NOTES
https://www.githubstatus.com/api#incidents
#>
[OutputType([pscustomobject[]])]
[CmdletBinding()]
param(
# Gets the status of GitHub incidents that are unresolved
[Parameter()]
[switch] $Unresolved
)

if ($Unresolved) {
$APIURI = 'https://www.githubstatus.com/api/v2/incidents/unresolved.json'
$response = Invoke-RestMethod -Uri $APIURI -Method Get
$response.incidents
return
}

$APIURI = 'https://www.githubstatus.com/api/v2/incidents.json'
$response = Invoke-RestMethod -Uri $APIURI -Method Get
$response.incidents

}