Lamp: Incident commands

This commands allows you to create, update and delete incident using Lamp command line

Create Incident command

Lamp createIncident command is used to create incidents in OpsGenie. createIncident command takes the following parameters:

Mandatory Parameters

Parameter

message

Incident text limited to 130 characters

Optional Parameters

Parameter

--description

Incident text in long form. Unlike the message field, not limited to 130 characters.

--type

Type of responders which need to be added to the incident . Values : user , team`

--responder

Responder identifiers in the same order as type.

--tags

A comma separated list of labels attached to the incident.

--detailKeys

Details are stored in Key/Value pair. List of comma separated keys in Details

--detailValues

List of comma separated corresponding values to the keys specified in detailKeys

--priority

The priority of alert. Values: P1, P2, P3, P4, P5 default is P3

--note

Additional incident note

--serviceId

Service Id of associated service

--statusPageEntityTitle

Title of Status Entity Page

--statusPageEntityDescription

Description of Status Entity page

Sample Usage:

With mandatory parameters:

opsgenie-lamp createIncident --message "Incident 3"

With optional parameters:

opsgenie-lamp createIncident --message "Incident 3" --description "This is a test Incident" --type "team" --responder "Team 2" --tags "service" --detailKeys "key1,key2" --detailValues "value5,value6" --priority "P3" --note "This is a note 2" --serviceId "test" --statusPageEntityTitle "Title1" --statusPageEntityDescription "Desc1"

Get Incident command

Lamp getIncident command is used to get an incident from OpsGenie with unique identifier . getIncident command takes the following parameters:

Mandatory Parameters

Parameter

--identifier

Id of the Incident whose information we want to get

--identifierType

Type of identifier used to identify incident tiny, id default is id

With mandatory parameters:

./opsgenie-lamp getIncident --identifier "3" --identifierType "tiny"

Get Incident List command

Lamp getIncidentList command fetches list of all incidents in OpsGenie. getIncidentList command takes the following parameters:

Mandatory Parameters

Parameter

query

Query to fetch incidents required. Example:- status: open

Optional Parameters

Parameter

--limit

Page size. Default is 20. Max value for this parameter is 100.

--sortField

createdAt, tinyId, message, status, isSeen, owner default is createdAt

--offset

Start index of the result set (to apply pagination). Minimum value (and also default value) is 0

--order

asc/desc, default: desc

Sample Usage:

With mandatory parameters:

opsgenie-lamp getIncidentList --query "status: open"

With optional parameters:

./opsgenie-lamp getIncidentList --limit "1" --sortField "createdAt" --offset "0" --order "desc"  --query "status: open"

Add Note to Incident command

Lamp addNoteToIncident command is used to add a note incident from OpsGenie with unique identifier . addNoteToIncident command takes the following parameters:

Mandatory Parameters

Parameter

--identifier

Id of the Incident to which note needs to be added

--identifierType

Type of identifier used to identify incident tiny, id default is id

--note

Note which needs to be added

With mandatory parameters:

./opsgenie-lamp addNoteToIncident --identifier "3" --identifierType "tiny" --note "Test Note will be added right now"

Add Incident Tags command

Lamp addIncidentTags command add tags to incidents in OpsGenie. addIncidentTags command takes the following parameters:

Mandatory Parameters

Parameter

--identifier

Id of the Incident to which tags needs to be added

--identifierType

Type of identifier used to identify incident tiny, id default is id

--tags

A comma separated list of labels that needs to added to the incident.

Optional Parameters

Parameter

--note

Note which needs to be added

Sample Usage:

With mandatory parameters:

./opsgenie-lamp addIncidentTags --identifier "3" --identifierType "tiny" --tags "rocking"

With optional parameters:

./opsgenie-lamp addIncidentTags --identifier "3" --identifierType "tiny" --note "Adding tags"  --tags "downtime,failing"

Remove Incident Tags command

Lamp removeIncidentTags command remove tags from incidents in OpsGenie. removeIncidentTags command takes the following parameters:

Mandatory Parameters

Parameter

--identifier

Id of the Incident to which tags needs to be removed

--identifierType

Type of identifier used to identify incident tiny, id default is id

--tags

A comma separated list of labels that needs toremoved to the incident.

Optional Parameters

Parameter

--note

Note which needs to be added

Sample Usage:

With mandatory parameters:

./opsgenie-lamp removeIncidentTags --identifier "3" --identifierType "tiny" --tags "rocking"

With optional parameters:

./opsgenie-lamp removeIncidentTags --identifier "3" --identifierType "tiny" --note "Removing tags"  --tags "downtime,failing"

Add Incident Details command

Lamp addIncidentDetails command add details to incidents in OpsGenie. addIncidentDetails command takes the following parameters:

Mandatory Parameters

Parameter

--identifier

Id of the Incident to which details needs to be added

--identifierType

Type of identifier used to identify incident tiny, id default is id

--detailKeys

Details are stored in Key/Value pair. List of comma separated keys in Details

--detailValues

List of comma separated corresponding values to the keys specified in detailKeys

Optional Parameters

Parameter

--note

Note which needs to be added

Sample Usage:

With mandatory parameters:

./opsgenie-lamp addIncidentDetails --identifier "3" --identifierType "tiny"  --detailKeys "key5,key6" --detailValues "value9,value10"

With optional parameters:

./opsgenie-lamp addIncidentDetails --identifier "3" --identifierType "tiny" --note "Adding Details"  --detailKeys "key5,key6" --detailValues "value9,value10"

Remove Incident Details command

Lamp removeIncidentDetails command remove details from incidents in OpsGenie. removeIncidentDetails command takes the following parameters:

Mandatory Parameters

Parameter

--identifier

Id of the Incident to which details needs to be removed

--identifierType

Type of identifier used to identify incident tiny, id default is id

--tags

Details are stored in Key/Value pair. List of comma separated keys in Details which needs to removed.

Optional Parameters

Parameter

--note

Note which needs to be added

Sample Usage:

With mandatory parameters:

./opsgenie-lamp removeIncidentDetails --identifier "3" --identifierType "tiny" --keys "key5"

With optional parameters:

./opsgenie-lamp removeIncidentDetails --identifier "3" --identifierType "tiny" --note "Adding Details"  --keys "key5"

Update Priority command

Lamp updateIncidentPriority command is used to update priority of an incident in OpsGenie with unique identifier . updateIncidentPriority command takes the following parameters:

Mandatory Parameters

Parameter

--identifier

Id of the Incident whose priority we want to update

--identifierType

Type of identifier used to identify incident tiny, id default is id

--priority

The priority of alert. Values: P1, P2, P3, P4, P5 default is P3

With mandatory parameters:

./opsgenie-lamp updateIncidentPriority --identifier "3" --identifierType "tiny" --priority "P4"

Update Incident Message command

Lamp updateIncidentMessage command is used to update message of an incident in OpsGenie with unique identifier . updateIncidentMessage command takes the following parameters:

Mandatory Parameters

Parameter

--identifier

Id of the Incident whose message we want to update

--identifierType

Type of identifier used to identify incident tiny, id default is id

--message

Incident text limited to 130 characters

With mandatory parameters:

./opsgenie-lamp updateIncidentMessage --identifier "3" --identifierType "tiny" --message "updated Incident 3"

Update Incident Description command

Lamp updateIncidentDescription command is used to update description of an incident in OpsGenie with unique identifier . getIncident command takes the following parameters:

Mandatory Parameters

Parameter

--identifier

Id of the Incident whose description needs to be updated

--identifierType

Type of identifier used to identify incident tiny, id default is id

--description

Incident text in long form. Unlike the message field, not limited to 130 characters.

With mandatory parameters:

./opsgenie-lamp updateIncidentDescription --identifier "3" --identifierType "tiny"  --description "Updated Description"

Close Incident command

Lamp closeIncident command is used to close incident from OpsGenie with unique identifier . closeIncident command takes the following parameters:

Mandatory Parameters

Parameter

--identifier

Id of the Incident to which needs to be closed

--identifierType

Type of identifier used to identify incident tiny, id default is id

--note

Note which needs to be added

With mandatory parameters:

./opsgenie-lamp closeIncident --identifier "3" --identifierType "tiny" --note "Clsoing incident"

Delete Incident command

Lamp deleteIncident command is used to delete an incident from OpsGenie with unique identifier . deleteIncident command takes the following parameters:

Mandatory Parameters

Parameter

--identifier

Id of the Incident which needs to be deleted

--identifierType

Type of identifier used to identify incident tiny, id default is id

With mandatory parameters:

./opsgenie-lamp deleteIncident --identifier "3" --identifierType "tiny"

Add Incident Responders command

Lamp addIncidentResponders command adds responders to an incident in OpsGenie. addIncidentResponders command takes the following parameters:

Mandatory Parameters

Parameter

--identifier

Id of the Incident to which responders needs to be added

--identifierType

Type of identifier used to identify incident tiny, id default is id

--type

Type of responders which need to be added to the incident . Values : user , team`

--responder

A comma separated list of labels attached to the incident.

Optional Parameters

Parameter

--note

Note which needs to be added

Sample Usage:

With mandatory parameters:

./opsgenie-lamp addIncidentResponders --identifier "3" --identifierType "tiny" --type "team" --responder "Team 2"

With optional parameters:

./opsgenie-lamp addIncidentResponders --identifier "3" --identifierType "tiny" --note "Adding Team 2 as Responder" --type "team" --responder "Team 2"