Skip to content

joshburkard/OpsGenie

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Module OpsGenie

Table of Contents

Description

This powershell module will interact with the OpsGenie API v2

more infos about the OpsGenie API is available at https://docs.opsgenie.com/docs

Global parameters

this parameters are accepted in all functions:

parameter mandatory type description
APIKey true string the APIKey
EU false switch use this switch parameter, if you need to connect to the EU-instance of OpsGenie
Proxy false string the URI of the proxy server, only if needed
ProxyCredential false PSCredential Credentials for the proxy server, only if needed

Prerequisites

to interact with the OpsGenie API, you need an OpsGenie Team and an API Key for the Team-integration

to create the API Key, open OpsGenie and follow this steps:

  • click on Teams on the main menu
  • select your Team, for which the alerts should be used
  • click Integrations
  • click Add integration
  • select the API integration and click Add
  • you will see the API Key in this form
  • make adjustments to the permissions and click to Safe Integration.

Note: you can create multiple API-integrations with different API-Keys and different permissions.

Examples

you can start with this simple examples. other examples are under each function description.

define the connection to OpsGenie

you can define a HashTable with the connection parameters

$OpsGenieConnection = @{
    APIKey          = 'only-an-example-key-8e57c630b7ef'
    EU              = $true
    Proxy           = 'http://proxy.server.com:8080'
    ProxyCredential = $PSCredentialObject
}

create a new alert

to create a new alert, use this command

# create an alias to identify the alert later
$alias = ( New-Guid ).Guid

# create the alert
New-OpsGenieAlert @OpsGenieConnection -Message 'this is a Test-Alert' -alias $alias -priority P5

you can add additional parameters if needed

acknowledge an alert

Invoke-OpsGenieAlertAction @OpsGenieConnection -alias $alias -action 'acknowledge'

close an alert

Close-OpsGenieAlert @OpsGenieConnection -alias $alias

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors