Lamp: Command Line
Lamp is a Go based command line utility to interact with Opsgenie service. It provides capabilities to create and close alerts, attach files, etc..
Lamp is used to integrate any management tool that can execute a shell script with Opsgenie. Lamp interacts with the Opsgenie service through the RESTful Web API.
Lamp has a built in contextual help system for obtaining information on available commands, and available options for their use. If you invoke lamp with the --help option, you will see the available list of commands. If you invoke lamp with the --help option with a specific command, you will see the options for that command.
For ease of use apiKey should be set in conf file that lamp will use, for some flexible use cases --apiKey parameter can also be used when executing lamp commands.
To migrate your Java based Lamp to Go Based Lamp you can refer to Migration Guide
Installation
Prerequisites:
- Opsgenie account: If you don't already have one create an Opsgenie account
- If you're downloading from source, Opsgenie Lamp requires Go version 1.12 or above. Golang can be downloaded from here. One should make sure the GOPATH and GOROOT variables are set accordingly.
OpsGenie Lamp is a Go-based command line utility and can be obtained in two ways:
Downloading with go get
- Lamp can be installed via the command:
go get github.com/opsgenie/opsgenie-lamp/...
The
go get
command will produce an executable named "opsgenie-lamp", hence you should use "opsgenie-lamp" instead of "lamp" like following:
opsgenie-lamp createAlert --message "host down"
Downloading Lamp Zip
- Download Lamp Zip
- Download the Lamp version based on your operating system.
- For Mac use opsgenie-lamp_X.X_darwin_amd64.zip
*Internet Requirement : By default Lamp requires internet connection to reach Opsgenie.
If Lamp host server does not have internet connection you can configure Lamp Proxy settings, see below.
Configuration
Application Configuration
Lamp is able to use configuration files in different locations. There are several ways to do it, and methods have an order:
- If you want to use a configuration file located in a custom location, you can define it in your commands.If Lamp command contains
--config
parameter, it uses the given file as configuration.
opsgenie-lamp createAlert --message "host down" --config /opt/conf/myConfigurationFile.conf
- If there is no
--config
parameter defined, Lamp looks for an Environment variable: LAMP_CONF_PATH. If this environment variable is set, lamp uses the given file as configuration. - If none of the methods given above works, Lamp uses the default {{USER_HOME}}/.config/lamp.conf file as configuration
You can reach the sample configuration here. The following are the common configuration settings for Lamp:
Lamp Configuration Settings
Setting | Description | Mandatory | Default Value |
---|---|---|---|
apiKey | API key used for authenticating API requests. API key can be obtained by adding an API Integration. * Optionally --apiKey parameter can also be set when executing lamp commands, in this case the apiKey in the configuration file will not be used. | No | - |
apiUrl | The URL for the Opsgenie API. If you are in the EU instance, you'll want to set this to api.eu.opsgenie.com For the sandbox, you'll use api.sandbox.opsgenie.com | No | api.opsgenie.com |
user | Default owner of the execution. If user is not specified for Lamp action this value will be used. | No | |
requestTimeout | Total timeout value of the request executed across Opsgenie server. Unit: second | No | 30 Sec |
logPath | This would enable logging to a file. Path where log files will be created. | No |
Lamp Proxy Configuration Settings
In order to use Lamp on systems that are behind firewalls do not have direct access to the Internet, you need to configure Lamp proxy settings to interact with Opsgenie web services API, create alerts, etc.
Setting | Description | Mandatory | Default Value |
---|---|---|---|
proxyHost | Proxy host | Yes | - |
proxyPort | Proxy port | No | - |
proxyUsername | Proxy authentication username | No | - |
proxyPassword | Proxy authentication password | No | - |
proxyProtocol | Proxy connection protocol. It may be one of http depending on your proxy servers. | No | https |
Create Alert Command
Lamp createAlert command is used to create alerts in OpsGenie. createAlert command takes the following parameters:
Mandatory Parameters
Parameter | |
---|---|
--message | Alert text limited to 130 characters |
Optional Parameters
Parameter | |
---|---|
--alias | A user defined identifier for the alert and there can be only one alert with open status with the same alias. Provides ability to assign a known id and later use this id to perform additional actions such as log, close, attach for the same alert. |
--actions | A comma separated list of actions that can be executed. Custom actions can be defined to enable users to execute actions for each alert. All action executions will be posted to Outgoing Integrations like Webhook, OEC, Slack, HipChat etc |
--source | Field to specify source of alert. By default, it will be assigned to IP address of incoming request |
--tags | A comma separated list of labels attached to the alert. |
--description | Alert text in long form. Unlike the message field, not limited to 130 characters. |
-D | Additional alert properties. The syntax is -D = |
--entity | The entity the alert is related to. |
--priority | The priority of alert. Values: P1 , P2 , P3 , P4 , P5 default is P3 |
--user | Owner of execution |
--note | Additional alert note |
--teams | A comma separated list of teams for setting responders |
--users | A comma separated list of users for setting responders |
--escalations | A comma separated list of escalations for setting responders |
--schedules | A comma separated list of schedules for setting responders |
--apiKey | API key used for authenticating API requests * If not given the api key in the conf file will be used Optional API key is valid for all Lamp commands |
--configFile | Location of a custom configuration file |
-v | Execute commands in verbose mode. |
Sample Usage:
With mandatory parameters:
opsgenie-lamp createAlert --message "appserver1 down"
With optional parameters:
opsgenie-lamp createAlert --message "appserver1 down --description "appserver1 is not responding to requests and reported as down by the monitoring tools" --tags "operations, servers" --actions "stop, restart" -D severity=critical
With optional apiKey parameter :
opsgenie-lamp createAlert --apiKey ab5454992-fabb2-4ba2-ad44f-1af65ds8b5c079 --message "appserver1 down"
With optional config and verbose parameter:
opsgenie-lamp createAlert -v --message "appserver1 down" --config "/opt/conf/myConfigurationFile.conf"
Close Alert Command
Lamp closeAlert command is close open alerts in OpsGenie. closeAlert command takes the following parameters:
Mandatory Parameters
Parameter | |
---|---|
--id | Id value of the alert that will be closed. Id, tiny Id or alias must be provided. |
--identifier | Identifier type of the given id with '--id' flag, can be 'id', 'tiny' or 'alias'. |
Optional Parameters
Parameter | |
---|---|
--user | Owner of execution |
--note | Additional alert note |
--source | Source of action |
Sample Usage:
opsgenie-lamp closeAlert --id 44d2e383-df30-49e1-820e-65e8e6e6387f
opsgenie-lamp closeAlert --apiKey ab5454992-fabb2-4ba2-ad44f-1af65ds8b5c079 --alias appserver3Down
Delete Alert Command
Lamp deleteAlert command is delete alerts in Opsgenie. deleteAlert command takes the following parameters:
Mandatory Parameters
Parameter | |
---|---|
--id | Id value of the alert that will be closed. Id, tiny Id or alias must be provided. |
--identifier | Identifier type of the given id with '--id' flag, can be 'id', 'tiny' or 'alias'. Default value is id. |
Optional Parameters
Parameter | |
---|---|
--user | Owner of execution |
--source | Source of action |
Sample Usage:
opsgenie-lamp deleteAlert --id 44d2e383-df30-49e1-820e-65e8e6e6387f
Get Alert Command
Lamp getAlert command is used to get alerts details from OpsGenie. getAlert command takes the following parameters:
Mandatory Parameters
Parameter | |
---|---|
--id | Id value of the alert that will be closed. Id, tiny Id or alias must be provided. |
--identifier | Identifier type of the given id with '--id' flag, can be 'id', 'tiny' or 'alias'. Default value is id. |
Optional Parameters
Parameter | |
---|---|
--output-format | Retrieved alert can be printed as JSON or YAML format. Default value is json |
--pretty | Boolean flag to print retrieved alert as pretty json |
Sample Usage:
opsgenie-lamp getAlert --id 44d2e383-df30-49e1-820e-65e8e6e6387f
opsgenie-lamp getAlert --alias appserver3Down
opsgenie-lamp getAlert --id 44d2e383-df30-49e1-820e-65e8e6e6387f --output-format yaml
opsgenie-lamp getAlert --id 44d2e383-df30-49e1-820e-65e8e6e6387f --pretty
List Alerts Command
Lamp listAlerts command is used to list alerts details from Opsgenie. listAlerts command takes the following parameters:
Optional Parameters
Parameter | Description |
---|---|
--query | Search query to apply while filtering the alerts. More on Search queries for alerts |
--limit | Page size. Default is 20. Max value for this parameter is 100. |
--sortBy | createdAt, updatedAt, 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 |
--searchIdentifier | Identifier of the saved search query to apply while filtering the alerts |
--searchIdentifierType | Identifier type of the value at searchIdentifier, which can be id or name. Default value is id. If searchIdentifier is not provided, this value is ignored. |
--output-format | Retrieved alerts can be printed as JSON and YAML format. Default value is json. |
--pretty | Boolean flag to print retrieved alert as pretty json. |
Sample Usage:
opsgenie-lamp listAlerts
opsgenie-lamp listAlerts --query "status: open AND teams = 'devops'"
opsgenie-lamp listAlerts --query "tag: (graylog AND dynamodb)" --output-format yaml
opsgenie-lamp listAlerts --limit 5 --pretty
Count Alerts Command
Lamp countAlerts command is used to count the number of alerts at Opsgenie. countAlerts command takes the following parameters:
Optional Parameters
Parameter | |
---|---|
--query | Search query to apply while filtering the alerts. More on Search queries for alerts |
--limit | Page size. Default is 20. Max value for this parameter is 100. |
Sample Usage:
opsgenie-lamp countAlerts --query "status: open"
opsgenie-lamp countAlerts --query "teams = 'devops'"
opsgenie-lamp countAlerts --query "tag: (graylog AND dynamodb)" --output-format yaml
List Alert Logs Command
Lamp listAlertLogs command is used to list alert logs from Opsgenie. listAlertLogs command takes the following parameters:
Mandatory Parameters
Parameter | |
---|---|
--id | Id value of the alert that will be closed. Id, tiny Id or alias must be provided. |
--identifier | Identifier type of the given id with '--id' flag, can be 'id', 'tiny' or 'alias'. Default value is id. |
Optional Parameters
Parameter | |
---|---|
--limit | Page size. Default is 20. Max value for this parameter is 100 |
--offset | starting value of the offset property |
--order | asc/desc, default: desc |
--direction | Page direction to apply for the given offset. Possible values are next and prev. Default value is next. |
-output-format | Retrieved alerts can be printed as JSON and YAML format. Default value is json |
--pretty | Boolean flag to print retrieved alert as pretty json |
Sample usage:
opsgenie-lamp listAlertLogs --id 37d2c2b0-a64f-4dbe-b592-df06e34e7683
opsgenie-lamp listAlertLogs --id 37d2c2b0-a64f-4dbe-b592-df06e34e7683 --limit 5 --pretty
opsgenie-lamp listAlertLogs --id 37d2c2b0-a64f-4dbe-b592-df06e34e7683 --order asc
List Alert Notes Command
Lamp listAlertNotes command is used to list alert notes from Opsgenie. listAlertNotes command takes the following parameters:
Mandatory Parameters
Parameter | |
---|---|
--id | Id value of the alert that will be closed. Id, tiny Id or alias must be provided. |
--identifier | Identifier type of the given id with '--id' flag, can be 'id', 'tiny' or 'alias'. Default value is id. |
Optional Parameters
Parameter | |
---|---|
--limit | Page size. Default is 20. Max value for this parameter is 100. |
--order | asc/desc, default: desc |
--offset | Starting value of the offset property. |
--direction | Page direction to apply for the given offset. Possible values are next and prev. Default value is next |
--output-format | Retrieved alerts can be printed as JSON and YAML format. Default value is json. |
--pretty | Boolean flag to print retrieved alert as pretty json. |
Sample Usage:
opsgenie-lamp listAlertNotes --id 37d2c2b0-a64f-4dbe-b592-df06e34e7683
opsgenie-lamp listAlertNotes --id 37d2c2b0-a64f-4dbe-b592-df06e34e7683 --limit 5 --pretty
opsgenie-lamp listAlertNotes --id 37d2c2b0-a64f-4dbe-b592-df06e34e7683 --order asc
Acknowledge Command
Lamp acknowledge command is used to acknowledge alerts in Opsgenie. acknowledge command takes the following parameters:
Mandatory Parameters
Parameter | |
---|---|
--id | Id value of the alert that will be closed. Id, tiny Id or alias must be provided. |
--identifier | Identifier type of the given id with '--id' flag, can be 'id', 'tiny' or 'alias'. Default value is id. |
Optional Parameters
Parameter | |
---|---|
--user | Owner of execution |
--note | Additional alert note |
--source | Source of action |
Sample Usage:
opsgenie-lamp acknowledge --id 44d2e383-df30-49e1-820e-65e8e6e6387f
opsgenie-lamp acknowledge --apiKey ab5454992-fabb2-4ba2-ad44f-1af65ds8b5c079 --alias appserver3Down
Unacknowledge Command
Lamp unacknowledge command is used to unacknowledge alerts in Opsgenie. unacknowledge command takes the following parameters:
Mandatory Parameters
Parameter | |
---|---|
--id | Id value of the alert that will be closed. Id, tiny Id or alias must be provided. |
--identifier | Identifier type of the given id with '--id' flag, can be 'id', 'tiny' or 'alias'. Default value is id. |
Optional Parameters
Parameter | |
---|---|
--user | Owner of execution |
--note | Additional alert note |
--source | Source of action |
Sample Usage:
opsgenie-lamp unacknowledge --id 44d2e383-df30-49e1-820e-65e8e6e6387f
opsgenie-lamp unacknowledge --apiKey ab5454992-fabb2-4ba2-ad44f-1af65ds8b5c079 --alias appserver3Down
Snooze Command
Lamp snooze command is used to snooze alert at Opsgenie. snooze command takes the following parameters:
Mandatory Parameters
Parameter | |
---|---|
--id | Id value of the alert that will be closed. Id, tiny Id or alias must be provided. |
--identifier | Identifier type of the given id with '--id' flag, can be 'id', 'tiny' or 'alias'. Default value is id. |
--endDate | The date in ISO8601 format snooze will end. (e.g. 2017-06-13T16:54:42Z) |
Optional Parameters
Parameter | |
---|---|
--user | Owner of execution |
--note | Additional alert note |
--source | Source of action |
Sample Usage:
opsgenie-lamp snooze --id 44d2e383-df30-49e1-820e-65e8e6e6387f --endDate "2017-06-13T16:54:42Z"
Assign Command
Lamp assign command is used to assign the ownership of alerts in Opsgenie. assign command takes the following parameters:
Mandatory Parameters
Parameter | |
---|---|
--id | Id value of the alert that will be closed. Id, tiny Id or alias must be provided. |
--identifier | Identifier type of the given id with '--id' flag, can be 'id', 'tiny' or 'alias'. Default value is id. |
--owner | The users who will be the owner of the alert after the execution. |
Optional Parameters
Parameter | |
---|---|
--user | Owner of execution |
--note | Additional alert note |
--source | Source of action |
Sample Usage:
opsgenie-lamp assign --id 44d2e383-df30-49e1-820e-65e8e6e6387f --owner [email protected]
opsgenie-lamp assign --apiKey ab5454992-fabb2-4ba2-ad44f-1af65ds8b5c079 --alias appserver3Down --owner [email protected]
Add Team Command
Lamp addTeam command is used to add new teams to alerts in Opsgenie. addRecipient command takes the following parameters:
Mandatory Parameters
Parameter | |
---|---|
--id | Id value of the alert that will be closed. Id, tiny Id or alias must be provided. |
--identifier | Identifier type of the given id with '--id' flag, can be 'id', 'tiny' or 'alias'. Default value is id. |
--team | The team that will be added to the alert. |
Optional Parameters
Parameter | |
---|---|
--user | Owner of execution |
--note | Additional alert note |
--source | Source of action |
Sample Usage:
opsgenie-lamp addTeam --id 44d2e383-df30-49e1-820e-65e8e6e6387f --team operations
opsgenie-lamp addTeam --apiKey ab5454992-fabb2-4ba2-ad44f-1af65ds8b5c079 --alias appserver3Down --team operations
Add Responder Command
Lamp addResponder command is used to add new responders to alerts in Opsgenie. addResponder command takes the following parameters:
Mandatory Parameters
Parameter | |
---|---|
--id | Id value of the alert that will be closed. Id, tiny Id or alias must be provided. |
--identifier | Identifier type of the given id with '--id' flag, can be 'id', 'tiny' or 'alias'. Default value is id. |
--responder | The responder that will be added to the alert. |
--type | The responder type that which is provided at responder which can be team, user, escalation or schedule. |
Optional Parameters
Parameter | |
---|---|
--user | Owner of execution |
--note | Additional alert note |
--source | Source of action |
Sample Usage:
opsgenie-lamp addResponder --id 44d2e383-df30-49e1-820e-65e8e6e6387f --recipient [email protected] --type user
opsgenie-lamp addRecipient --apiKey ab5454992-fabb2-4ba2-ad44f-1af65ds8b5c079 --alias appserver3Down --recipient [email protected] --type user
Add Note Command
Lamp addNote command is used to add notes to alerts in Opsgenie. addNote command takes the following parameters:
Mandatory Parameters
Parameter | |
---|---|
--id | Id value of the alert that will be closed. Id, tiny Id or alias must be provided. |
--identifier | Identifier type of the given id with '--id' flag, can be 'id', 'tiny' or 'alias'. Default value is id. |
--note | Note text |
Optional Parameters
Parameter | |
---|---|
--user | Owner of execution |
--source | Source of action |
Sample Usage:
opsgenie-lamp addNote --id 44d2e383-df30-49e1-820e-65e8e6e6387f --note "I'll work on this"
opsgenie-lamp addNote --apiKey ab5454992-fabb2-4ba2-ad44f-1af65ds8b5c079 --alias appserver3Down --note "I'll work on this"
Add Tags Command
Lamp addTags command is used to add tags to alerts in Opsgenie. addTags command takes the following parameters:
Mandatory Parameters
Parameter | |
---|---|
--id | Id value of the alert that will be closed. Id, tiny Id or alias must be provided. |
--identifier | Identifier type of the given id with '--id' flag, can be 'id', 'tiny' or 'alias'. Default value is id. |
--tags | A comma separated list of labels attached to the alert. |
Optional Parameters
Parameter | |
---|---|
--user | Owner of execution |
--source | Source of action |
--note | Additional alert note |
Sample Usage:
opsgenie-lamp addTags --id 44d2e383-df30-49e1-820e-65e8e6e6387f --tags "tag1, tag2"
opsgenie-lamp addTags --apiKey ab5454992-fabb2-4ba2-ad44f-1af65ds8b5c079 --alias appserver3Down --tags "tag1, tag2"
Remove Tags Command
Lamp removeTags command is used to remove tags from alerts in Opsgenie. removeTags command takes the following parameters:
Mandatory Parameters
Parameter | |
---|---|
--id | Id value of the alert that will be closed. Id, tiny Id or alias must be provided. |
--identifier | Identifier type of the given id with '--id' flag, can be 'id', 'tiny' or 'alias'. Default value is id. |
--tags | A comma separated list of labels attached to the alert. |
Optional Parameters
Parameter | |
---|---|
--user | Owner of execution |
--source | Source of action |
--note | Additional alert note |
Sample Usage
opsgenie-lamp removeTags --id 44d2e383-df30-49e1-820e-65e8e6e6387f --tags "tag1, tag2"
opsgenie-lamp removeTags --apiKey ab5454992-fabb2-4ba2-ad44f-1af65ds8b5c079 --alias appserver3Down --tags "tag1, tag2"
Add Details Command
Lamp addDetails command is used to add details to alerts in Opsgenie. addDetails command takes the following parameters:
Mandatory Parameters
Parameter | |
---|---|
--id | Id value of the alert that will be closed. Id, tiny Id or alias must be provided. |
--identifier | Identifier type of the given id with '--id' flag, can be 'id', 'tiny' or 'alias'. Default value is id. |
-D | Additional alert properties. The syntax is -D = |
Optional Parameters
Parameter | |
---|---|
--user | Owner of execution |
--source | Source of action |
--note | Additional alert note |
Sample Usage:
opsgenie-lamp addDetails --id 44d2e383-df30-49e1-820e-65e8e6e6387f -D severity=critical
Remove Details Command
Lamp removeDetails command is used to remove details from alerts in Opsgenie. removeDetails command takes the following parameters:
Mandatory Parameters
Parameter | |
---|---|
--id | Id value of the alert that will be closed. Id, tiny Id or alias must be provided. |
--identifier | Identifier type of the given id with '--id' flag, can be 'id', 'tiny' or 'alias'. Default value is id. |
--keys | A comma separated list of detail keys attached to the alert. |
Optional Parameters
Parameter | |
---|---|
--user | Owner of execution |
--source | Source of action |
--note | Additional alert note |
Usage:
opsgenie-lamp removeDetails --id 44d2e383-df30-49e1-820e-65e8e6e6387f --keys severity
Execute Alert Action Command
Lamp executeAction command is used to execute custom actions on alerts in Opsgenie. executeAction command takes the following parameters:
Mandatory Parameters
Parameter | |
---|---|
--id | Id value of the alert that will be closed. Id, tiny Id or alias must be provided. |
--identifier | Identifier type of the given id with '--id' flag, can be 'id', 'tiny' or 'alias'. Default value is id. |
--action | Action to execute |
Optional Parameters
Parameter | |
---|---|
--user | Owner of execution |
--note | Additional alert note |
--source | Source of action |
Sample Usage:
opsgenie-lamp executeAction --id 44d2e383-df30-49e1-820e-65e8e6e6387f --action restartEntity
opsgenie-lamp executeAction --apiKey ab5454992-fabb2-4ba2-ad44f-1af65ds8b5c079 --alias appserver3Down --action restartEntity
Attach File Command
Lamp attachFile command is used to attach file to alerts in Opsgenie. attachFile command takes the following parameters:
Mandatory Parameters:
Parameter | Description |
---|---|
--id | Id value of the alert that will be closed. Id, tiny Id or alias must be provided. |
--identifier | Identifier type of the given id with '--id' flag, can be 'id', 'tiny' or 'alias'. Default value is id. |
--filePath | Absolute or relative path to the file |
--fileName | File name |
--indexFile | Name of html file which will be shown when attachment clicked on UI. If it is not specified, following rules will be applied by order to determine index file name 1. if it is not a zip file, it will be assigned to attachment file name 2. If it is a zip file, it will be assigned to 1. HTML file whose name equals attachment file name 2. index.htm or index.html file 3. the first HTML file found in the ZIP 4. If no HTML file exists, it will be assigned to attachment zip file name and zip file will be downloaded from Opsgenie web site directly when clicked on attachment. |
Optional Parameters
Parameter | |
---|---|
--user | Default owner of the execution. If user is not specified, the system becomes owner of the execution. |
Sample Usage:
opsgenie-lamp attachFile --tinyId 5 --attachment ~/Desktop/attachment.jpg --user [email protected]
opsgenie-lamp attachFile --tinyId 5 --attachment ~/Desktop/attachment.jpg --user [email protected] --apiKey 123
Sample Response
Result : Attachment [attachment.jpg] successfully added to alert [c8daa4c3-951d-40ee-9711-bd332040c207].
Get Attachment File Command
Lamp getAttachment command is used to get a download url for file that was attached to an alert in Opsgenie. getAttachment command takes the following parameters:
Mandatory Parameters:
Parameter | Description |
---|---|
--id | Id value of the alert that will be closed. Id, tiny Id or alias must be provided. |
--identifier | Identifier type of the given id with '--id' flag, can be 'id', 'tiny' or 'alias'. Default value is id. |
--attachmentId | Identifier of the alert attachment |
**Sample Usage
opsgenie-lamp getAttachment --tinyId 5 --attachmentId 1503330358392000143 --apiKey 123
Sample Response
Download Link:
{download link here}
Download Attachment File Command
Lamp downloadAttachment command is used to download attachment file that was attached to an alert to the specified path. downloadAttachment command takes the following parameters:
Mandatory Parameters:
Parameter | Description |
---|---|
--id | Id value of the alert that will be closed. Id, tiny Id or alias must be provided. |
--identifier | Identifier type of the given id with '--id' flag, can be 'id', 'tiny' or 'alias'. Default value is id. |
--attachmentId | Identifier of the alert attachment |
--destinationPath | Path that file will be downloaded to |
Sample Usage
opsgenie-lamp downloadAttachment --tinyId 5 --attachmentId 1503330358392000143 --apiKey 123 --destinationPath ~/Desktop/newfolder
List Alert Attachments Command
Lamp listAttachments command is used to list meta informations of attachments that were attached to an alert in Opsgenie. listAttachments command takes the following parameters:
Mandatory Parameters:
Parameter | Description |
---|---|
--id | Id value of the alert that will be closed. Id, tiny Id or alias must be provided. |
--identifier | Identifier type of the given id with '--id' flag, can be 'id', 'tiny' or 'alias'. Default value is id. |
Sample Usage
opsgenie-lamp listAttachments --tinyId 5 --apiKey 123
Sample Response
[
{
"name": "wl2.jpg",
"id": 1503330358392000300
},
{
"name": "wl2.jpg",
"id": 1503388343129020000
},
{
"name": "wl2.jpg",
"id": 1503389457245022000
},
{
"name": "wl2.jpg",
"id": 1503389932719013600
},
{
"name": "wl2.jpg",
"id": 1503390131492009700
}
]
Delete Attachment Command
Lamp deleteAttachment command is used to delete an attachment file that was attached to an alert in Opsgenie. deleteAttachment command takes the following parameters:
Mandatory Parameters:
Parameter | Description |
---|---|
--id | Id value of the alert that will be closed. Id, tiny Id or alias must be provided. |
--identifier | Identifier type of the given id with '--id' flag, can be 'id', 'tiny' or 'alias'. Default value is id. |
--attachmentId | Identifier of the attachment |
Sample Usage
opsgenie-lamp deleteAttachment --tinyId 5 --apiKey 123 --attachmentId 1503330358392000143
Sample Response
RequestID: 46d41737-5e29-4e99-a12b-0958bb467e26
Result: Deleted
Escalate To Next Command
Lamp escalateToNext command is used to immediately process the next available rule in the specified escalation in Opsgenie. escalateToNext command takes the following parameters:
Mandatory Parameters
Parameter | Description |
---|---|
--id | Id value of the alert that will be closed. Id, tiny Id or alias must be provided. |
--identifier | Identifier type of the given id with '--id' flag, can be 'id', 'tiny' or 'alias'. Default value is id. |
--escalationId | Id of the escalation that will be escalated to the next level. |
--escalationName | Name of the escalation that will be escalated to the next level. |
Optional Parameters
Parameter | Description |
---|---|
--user | Owner of execution |
--source | Source of action |
--note | Additional alert note |
Sample Usage:
opsgenie-lamp escalateToNext --id 44d2e383-df30-49e1-820e-65e8e6e6387f --escalationName escalation_name
Create Schedule Command
Lamp createSchedule command is used to add a new schedule in
Opsgenie.
Mandatory Parameters:
Parameter | Description |
---|---|
--name | Name of the schedule to be created. |
Optional Parameters:
Parameter | Description |
---|---|
--description | Description of the schedule to be created |
--tz | Timezone for the schedule |
--team | Name of the team under which the schedule should be created |
--enabled | Enable the created schedule |
Sample Usage:
opsgenie-lamp createSchedule --name 'test-schedule'
opsgenie-lamp createSchedule --name "test-schedule-1" --description "test schedule created by lamp" --tz "Asia/Kolkata" --team "Foo Bar" --enabled
Get Schedule Command
Lamp getSchedule command is used to retrieve a schedule from Opsgenie.
Mandatory Parameters:
Parameter | Description |
---|---|
--id | ID of the schedule |
--identifierType | Identifier type of the specified schedule id, which can be id, name. Default value = id |
Optional Parameters:
Parameter | Description |
---|---|
--output-format | Prints the output in json or yaml formats (default: "json") |
--pretty | For more readable JSON output |
Sample Usage:
opsgenie-lamp getSchedule --id '8971e253-4a38-4ea0-a7be-160ca61b1c03'
opsgenie-lamp getSchedule --id 'test-schedule' --identifierType name
List Schedules Command
Lamp listSchedules command is used to list all the schedules in Opsgenie.
Optional Parameters:
Parameter | Description |
---|---|
--expand | Get more detailed response by expanding it |
--output-format | Prints the output in json or yaml formats (default: "json") |
--pretty | For more readable JSON output |
opsgenie-lamp listSchedules
opsgenie-lamp listSchedules --output-format yaml
Update Schedule Command
Mandatory Parameters:
Parameter | Description |
---|---|
--id | ID of the schedule |
--identifierType | Identifier type of the specified schedule id, which can be id, name. Default value = id |
--name | Name of the schedule |
Optional Parameters:
Parameter | Description |
---|---|
--description | Description of the schedule to be created |
--tz | Timezone for the schedule |
--team | Name of the team under which the schedule is |
--enabled | Enable the schedule |
Sample Usage:
opsgenie-lamp updateSchedule --id 8971e253-4a38-4ea0-a7be-160ca61b1c03 --description "updated test schedule description" --enabled --name 'updated-schedule-name'
Delete Schedule Command
Lamp deleteSchedule command is used to delete a schedule from Opsgenie.
Mandatory Parameters:
Parameter | Description |
---|---|
--id | ID of the schedule |
--identifierType | Identifier type of the specified schedule id, which can be id, name. Default value = id |
opsgenie-lamp deleteSchedule --id "7b55172e-b7a1-4c64-9060-1ecfa50e4e5a"
Get Schedule Timeline Command
Lamp getScheduleTimeline command is used to retrieve the timeline of the given schedule that includes time and on-call recipient details.
Mandatory Parameters:
Parameter | Description |
---|---|
--id | ID of the schedule |
--identifierType | Identifier type of the specified schedule id, which can be id, name. Default value = id |
Optional Parameters:
Parameter | Description |
---|---|
--interval | Length of time as integer in intervalUnits |
--intervalUnit | Unit of the time to retrieve the timeline. Possible values: days, weeks and months |
--expand | Get a detailed response. Possible values: base, forwarding, override |
--date | Time (in ISO8601) to return future date on-call participants. Default is no |
--output-format | Prints the output in json or yaml formats (default: "json") |
--pretty | For more readable JSON output |
opsgenie-lamp getScheduleTimeline --id 8971e253-4a38-4ea0-a7be-160ca61b1c03 --intervalUnit days --expand override --interval 1 --date 2021-07-22T03:54:55+00:00 --output-format yaml
resultmetadata:
requestid: ce7a5e2a-0d65-415f-b602-d12b7d52ddff
responsetime: 0.025
ratelimitstate: OK
ratelimitreason: ""
ratelimitperiod: ""
retrycount: 0
scheduleinfo:
id: 8971e253-4a38-4ea0-a7be-160ca61b1c03
name: test-schedule
enabled: true
description: ""
ownerteam:
id: ""
name: ""
startdate: 2021-07-22T03:54:55Z
enddate: 2021-07-23T03:54:55Z
finaltimeline:
rotations:
- id: d2df1964-fe62-4df8-94ea-040e2edcbf6d
name: Rota1
order: 1
periods:
- startdate: 2021-07-22T03:54:55Z
enddate: 2021-07-22T12:00:00Z
type: default
recipient:
type: user
name: [email protected]
id: ec9b1791-3bbb-4821-97fd-c09a62d0e55c
username: ""
- startdate: 2021-07-22T12:00:00Z
enddate: 2021-07-23T03:54:55Z
type: default
recipient:
type: user
name: [email protected]
id: 5599119a-230a-4d0d-83e8-4503796e9d46
username: ""
basetimeline:
rotations:
- id: d2df1964-fe62-4df8-94ea-040e2edcbf6d
name: Rota1
order: 1
periods:
- startdate: 2021-07-22T03:54:55Z
enddate: 2021-07-22T12:00:00Z
type: default
recipient:
type: user
name: [email protected]
id: ec9b1791-3bbb-4821-97fd-c09a62d0e55c
username: ""
- startdate: 2021-07-22T12:00:00Z
enddate: 2021-07-23T03:54:55Z
type: default
recipient:
type: user
name: [email protected]
id: 5599119a-230a-4d0d-83e8-4503796e9d46
username: ""
overridetimeline:
rotations: []
forwardingtimeline:
rotations: []
expandablefields: []
Create Schedule Rotation Command
Lamp createScheduleRotation command is used to add a rotation to a schedule on Opsgenie.
Mandatory Parameters:
Parameter | Description |
---|---|
--id | ID of the schedule |
--identifierType | Identifier type of the specified schedule id, which can be id, name. Default value = id |
--type | Type of rotation. Available values: daily, weekly and hourly |
--startDate | Schedule Start Date in ISO8601 format |
--participants | A comma separated list of participants. Example: user:, team:, none. |
Optional Parameters:
Parameter | Description |
---|---|
--endDate | Schedule End Date in ISO8601 format |
--length | Length of the rotation. Default: 1 |
opsgenie-lamp createScheduleRotation --id 8971e253-4a38-4ea0-a7be-160ca61b1c03 --type weekly --startDate 2020-07-27T03:54:55+00:00 --participants user:[email protected],team:"Test Users 1"
opsgenie-lamp createScheduleRotation --id 8971e253-4a38-4ea0-a7be-160ca61b1c03 --type daily --startDate 2020-07-27T03:54:55+00:00 --endDate 2020-08-03T03:54:55+00:00 --length 2 --participants user:[email protected],team:"Test Users 1"
Get Schedule Rotation Command
Lamp getScheduleRotation command is used to retrieve a rotation to a schedule from Opsgenie.
Mandatory Parameters:
Parameter | Description |
---|---|
--id | ID of the schedule |
--identifierType | Identifier type of the specified schedule id, which can be id, name. Default value = id |
--rotation-id | ID of the rotation |
Optional Parameters:
Parameter | Description |
---|---|
--output-format | Prints the output in json or yaml formats (default: "json") |
--pretty | For more readable JSON output |
opsgenie-lamp getScheduleRotation --id 8971e253-4a38-4ea0-a7be-160ca61b1c03 --rotation-id bdba6200-de94-474b-b5d6-6ac8b85e4d7e
opsgenie-lamp getScheduleRotation --id test-schedule --identifierType name --rotation-id bdba6200-de94-474b-b5d6-6ac8b85e4d7e --output-format yaml
resultmetadata:
requestid: fb016fe6-a56f-4545-8ab5-1113cb59a558
responsetime: 0.012
ratelimitstate: OK
ratelimitreason: ""
ratelimitperiod: ""
retrycount: 0
rotation:
id: bdba6200-de94-474b-b5d6-6ac8b85e4d7e
name: Rot2
startdate: 2020-07-27T04:00:55Z
enddate: 2020-08-03T04:00:55Z
type: daily
length: 2
participants:
- type: user
name: ""
id: 7b903be8-899e-4bcc-b638-a6fc20416423
username: [email protected]
- type: team
name: Test Users 1
id: 3926aa77-e394-40c3-b8b8-8bda1dace3d9
username: ""
timerestriction: null
info:
id: 8971e253-4a38-4ea0-a7be-160ca61b1c03
name: test-schedule
enabled: true
List Schedule Rotations Command
Lamp listScheduleRotations command is used to list all the rotations for a given schedule in Opsgenie.
Mandatory Parameters:
Parameter | Description |
---|---|
--id | ID of the schedule |
--identifierType | Identifier type of the specified schedule id, which can be id, name. Default value = id |
Optional Parameters:
Parameter | Description |
---|---|
--output-format | Prints the output in json or yaml formats (default: "json") |
--pretty | For more readable JSON output |
opsgenie-lamp listScheduleRotations --id 8971e253-4a38-4ea0-a7be-160ca61b1c03
Update Schedule Rotation Command
Mandatory Parameters:
Parameter | Description |
---|---|
--id | ID of the schedule |
--identifierType | Identifier type of the specified schedule id, which can be id, name. Default value = id |
--rotation-id | ID of the rotation |
Optional Parameters:
Paramter | Description |
---|---|
--name | Name of the rotation |
--startDate | Schedule Start Date inISO8601 format |
--endDate | Schedule End Date in ISO8601 format |
--type | Type of rotation. Available values: daily, weekly and hourly |
--participants | A comma separated list of participants. Example: user:, team:, none |
--length | Length of the rotation. Default: 1 |
opsgenie-lamp updateScheduleRotation --id 8971e253-4a38-4ea0-a7be-160ca61b1c03 --rotation-id bdba6200-de94-474b-b5d6-6ac8b85e4d7e --output-format yaml --name 'rotation-2'
opsgenie-lamp updateScheduleRotation --id 8971e253-4a38-4ea0-a7be-160ca61b1c03 --rotation-id bdba6200-de94-474b-b5d6-6ac8b85e4d7e --output-format yaml --endDate 2020-08-15T03:54:55+00:00 --length 3 --participants user:[email protected]
Delete Schedule Rotation Command
Lamp deleteScheduleRotation command is used to delete a rotation in an Opsgenie schedule.
Mandatory Parameters:
Parameter | Description |
---|---|
--id | ID of the schedule |
--identifierType | Identifier type of the specified schedule id, which can be id, name. Default value = id |
--rotation -id | ID of the rotation |
Sample Usage:
opsgenie-lamp deleteScheduleRotation --id 8971e253-4a38-4ea0-a7be-160ca61b1c03 --rotation-id bdba6200-de94-474b-b5d6-6ac8b85e4d7e
Create Schedule Override Command
Lamp createScheduleOverride command is used to create a schedule override for the specified user and schedule.
Mandatory Parameters:
Parameter | Description |
---|---|
--id | ID of the schedule |
--identifierType | Identifier type of the specified schedule id, which can be id, name. Default value = id |
--startDate | Schedule override Start Date in ISO8601 format |
--endDate | Schedule override End Date in ISO8601 format |
--responder | Responder type and name. Examples: user:, team:, escalation: |
--rotations | Comma separated list of rotation ids |
Optional Parameters:
Parmeter | Description |
---|---|
--alias | Alias of the schedule override |
Sample Usage:
opsgenie-lamp createScheduleOverride --id 8971e253-4a38-4ea0-a7be-160ca61b1c03 --startDate 2020-07-28T00:00:00+00:00 --endDate 2020-07-29T00:00:00+00:00 --responder user:[email protected] --rotations d2df1964-fe62-4df8-94ea-040e2edcbf6d,222c1326-3655-4b02-9412-7359fbba0ae8
Get Schedule Override Command
Lamp getScheduleOverride command is used to retrieve a specific schedule override from Opsgenie.
Mandatory Parameters:
Parameter | Description |
---|---|
--id | ID of the schedule |
--identifierType | Identifier type of the specified schedule id, which can be id, name. Default value = id |
--alias | Alias of the schedule override |
Optional Parameters:
Parameter | Identifier |
---|---|
--output-format | Prints the output in json or yaml formats (default: "json") |
--pretty | For more readable JSON output |
Sample Usage:
opsgenie-lamp getScheduleOverride --id 8971e253-4a38-4ea0-a7be-160ca61b1c03 --alias 3065798d-76da-4968-827b-4d316f35f436
List Schedule Override Command
Lamp listScheduleOverrides command is used to list all the schedule overrides for the specified schedule.
Mandatory Parameters:
Parameter | Description |
---|---|
--id | Identifier type of the specified schedule id, which can be id, name. Default value = id |
--identifierType | Identifier type of the specified schedule id, which can be id, name. Default value = id |
Optional Parameters:
Parameter | Description |
---|---|
--output-format | Prints the output in json or yaml formats (default: "json") |
--pretty | For more readable JSON output |
Sample Usage:
opsgenie-lamp listScheduleOverrides --id 8971e253-4a38-4ea0-a7be-160ca61b1c03 --output-format yaml
Update Schedule Override Command
Lamp updateScheduleOverride command is used to update details of a specific schedule override from Opsgenie.
Mandatory Parameters:
Parameter | Description |
---|---|
--id | ID of the schedule |
--identifierType | Identifier type of the specified schedule id, which can be id, name. Default value = id |
--alias | Alias of the schedule override |
Optional Parameters:
Parameter | Description |
---|---|
--startDate | Schedule override Start Date in ISO8601 format |
--endDate | Schedule override End Date in ISO8601 format |
--responder | Responder type and name. Examples: user:, team:, escalation: |
--rotations | Comma separated list of rotation ids |
Sample Usage:
opsgenie-lamp updateScheduleOverride --id 8971e253-4a38-4ea0-a7be-160ca61b1c03 --alias 3065798d-76da-4968-827b-4d316f35f436 --responder user:[email protected] --startDate 2020-07-26T00:00:00+00:00 --endDate 2020-07-28T00:00:00+00:00
Delete Schedule Override Command
Lamp deleteScheduleOverride command is used to delete a specific schedule override from Opsgenie.
Mandatory Parameters:
Parameter | Description |
---|---|
--id | ID of the schedule |
--identifierType | Identifier type of the specified schedule id, which can be id, name. Default value = id |
--alias | Alias of the schedule override |
Sample Usage:
opsgenie-lamp deleteScheduleOverride --id 8971e253-4a38-4ea0-a7be-160ca61b1c03 --alias 3065798d-76da-4968-827b-4d316f35f436
Enable Command
Lamp enable command is used to enable integrations and policies. enable command takes the following parameters.
Mandatory Parameters
Parameter | Description |
---|---|
--id | Id of the integration/policy that will be enabled. Either id or name must be provided |
--type | Type of the entity that will be enabled. It must be integration or policy. |
--policyType | Policy type should be one of alert or notification. |
--teamId | Team Id for policies which are created on a team. |
Sample Usage
opsgenie-lamp enable --id ab5454992-fabb2-4ba2-ad44f-1af65ds8b5c079 --type policy --teamId 0216a8a8-caa9-4ff3-9dc3-428d3c6c16aa --policyType alert
opsgenie-lamp enable --apiKey ab5454992-fabb2-4ba2-ad44f-1af65ds8b5c079 --id dc4488e2-58cc-4bae-ac37-32612fefb09b --type integration
Disable Command
Lamp disable command is used to disable integrations and policies. disable command takes the following parameters.
Mandatory Parameters
Parameter | Description |
---|---|
--id | Id of the integration/policy that will be disabled. Either id or name must be provided |
--type | Type of the entity that will be disabled. It must be integration or policy. |
--policyType | Policy type should be one of alert or notification. |
--teamId | Team Id for policies which are created on a team |
Sample Usage
opsgenie-lamp disable --id ab5454992-fabb2-4ba2-ad44f-1af65ds8b5c079 --type policy --teamId 0216a8a8-caa9-4ff3-9dc3-428d3c6c16aa --policyType alert
opsgenie-lamp disable --apiKey ab5454992-fabb2-4ba2-ad44f-1af65ds8b5c079 --id dc4488e2-58cc-4bae-ac37-32612fefb09b --type integration
Export Users Command
Lamp exportUsers command is used to export users to a csv file. exportUsers command takes the following parameters:
Optional Parameters
Parameter | Description |
---|---|
--destinationPath | Path that file will be downloaded to |
--query | Search query to apply while filtering the users. More on Search syntax for users |
Sample Usage
opsgenie-lamp exportUsers --destinationPath ~/Desktop/ --query "role:Owner"
opsgenie-lamp exportUsers --apiKey ab5454992-fabb2-4ba2-ad44f-1af65ds8b5c079
Download Logs Command
Lamp downloadLogs command is used to download Opsgenie logs in a time period. downloadLogs command takes the following parameters:
Parameter | Description |
---|---|
-start | Download log files starting from this date. which should be in format as: YYYY-MM-DD-HH-mm-ss, i.e. 2018-10-26-15-30-00 |
-end | Download log files until this date. which should be in format as: YYYY-MM-DD-HH-mm-ss, i.e. 2018-10-26-15-30-00 (Optional) if not exist it will be set as now. |
-path | Download path. (Optional) If not exist, Lamp will use the current directory. |
Sample usage
opsgenie-lamp downloadLogs -start "2018-10-24-07-30-00" -end "2018-10-31-11-53-51" -path "/tmp/opsgenie-logs" -v
Create Team Command
Lamp createTeam command is used to create a team in Opsgenie. You can choose to give a user to add to the team while creating and the user role. You can add more users using addMember command
Parameter | Description |
---|---|
-name | Team name. Cannot be empty or duplicate |
-desc | Team description, can be empty, can be updated. |
-userName | Email of the user whom you are adding to the team, optional if you are providing userId. |
-userId | UserId of the user, optional if you are providing userName. |
-role | Role name of the user. |
Sample usage
opsgenie-lamp createTeam -n "New team" -d description -userName [email protected] -role user
Update Team Command
Lamp updateTeam command can be used to update an existing team. Add members to the team using addMember command
Parameter | Description |
---|---|
-id | Team Id of the team being updated. Optional if you are providing name. |
-name | Team name of the team being updated. Optional if you are providing id. |
-desc | Team description. Provide if you want to update description. |
-userName | Email of the user whom you are adding to the team, optional if you are providing userId. |
-userId | UserId of the user, optional if you are providing userName. |
-role | Role name of the user. |
Sample usage
opsgenie-lamp updateTeam -v -id 123456 -d "description" -userName [email protected] -role admin
Get Team Command
Lamp getTeam command can be used to get team info using team Id or team name.
Parameter | Description |
---|---|
-id | Id of the team. Optional if you are providing team name. |
-name | Team name. Optional if you are providing id. |
Sample usage
opsgenie-lamp getTeam -name "my awesome team"
Delete Team Command
Lamp deleteTeam command is useful for deleting a team in Opsgenie.
Parameter | Description |
---|---|
-name | Team name to be deleted. |
-id | Team id to be deleted. |
Sample usage
opsgenie-lamp deleteTeam -id teamid
Add Member Command
Lamp addMember command is useful for adding a member with role to a team.
-teamName | Team name to add member to. Optional if providing teamId. |
-teamId | Team Id to add member to. Optional if providing teamName |
-userName | User email address. |
-userId | User Id, optional if you provide userName. |
-role | User role name. |
Sample usage
opsgenie-lamp addMember -name "my team name" -role user -userName [email protected]
List Teams Command
Lamp listTeams command lists all the teams in your Opsgenie account.
Sample usage
opsgenie-lamp listTeams
Remove Member Command
Lamp removeMember command can be used to remove a member from team using username or userId.
Parameter | Description |
---|---|
-teamName | Team name from which to remove member. |
-teamId | Team Id from which to remove member |
-userId | User id of the member. |
-userName | Username of the member. |
Sample usage
opsgenie-lamp removeMember -teamName "my team name" -userName [email protected]
Create Role Command
Lamp createRole command is helpful in creating user roles from command line.
Parameter | Description |
---|---|
-name | Team name for which to add role. |
-id | Team Id for which to add role. |
-roleName | Role name to be created. |
-rights | List of rights to be added for the role, comma separated. |
Sample usage
opsgenie-lamp createRole -name "my team name" -rights edit-routing-rules,edit-team-roles,manage-members -roleName role-1
List All Role Rights Command
Lamp listRoleRights command lists all the available role rights and their categories.
Sample usage
opsgenie-lamp listRoleRights
Get Role Command
Lamp getRole command is used to get details of a role by role name or role Id.
Parameter | Description |
---|---|
-teamName | Team name of which the role belongs to. |
-teamId | Team id of which the role belongs to. |
-roleName | Name of the role. |
-roleId | Id of the role, optional if role name provided. |
Sample usage
opsgenie-lamp getRole -name "my team name" -roleName role-1
Delete Role Command
Lamp deleteRole command is useful to delete an existing role from team.
-teamName | Team name of which the role belongs to. |
-teamId | Team id of which the role belongs to. |
-roleName | Name of the role. |
-roleId | Id of the role, optional if role name provided. |
Sample usage
opsgenie-lamp deleteRole -name "my team name" -roleName role-1
List Roles Command
Lamp listRoles command can be used to list roles from a team.
Parameter | Description |
---|---|
-name | Team name, optional if team id provided. |
-id | Team Id, optional if team name provided. |
Sample usage
opsgenie-lamp listRoles -name "my team name"
List Team Routing Rules Command
Lamp listRoutingRules command can be used to list team's routing rules.
Parameter | Description |
---|---|
-name | Team name to fetch routing rules for. |
-id | Team Id to fetch routing rules for. |
Sample usage
opsgenie-lamp listRoutingRules -name "my team"
Deleting Team Routing Rule Command
Lamp deleteRoutingRule command is used to deleting a routing rule by its Id.
Parameter | Description |
---|---|
-name | Team name to delete the routing rule from. |
-id | Team Id to delete the routing rule from. |
-ruleId | Routing Rule Id. |
Sample usage
opsgenie-lamp deleteRoutingRule -ruleId 6374203e -n "my team"
Get Routing Rule Command
Lamp getRoutingRule command is useful in getting information about the routing rule by id.
Parameter | Description |
---|---|
-teamName | Team name that the rule belongs to. |
-teamId | TeamId that the rule belongs to. |
-ruleId | Routing rule Id. |
Sample usage
opsgenie-lamp getRoutingRule -n "my team" -ruleId "ruleId"
List Team Logs Command
Lamp listTeamLogs command is useful for fetching team logs. The response is paginated, you can specify offsets , limit and the order of the logs to fetch.
Parameter | Description |
---|---|
-id | Team Id, optional if you provide team name. |
-name | Team name, optional if you provide team id. |
-offset | Offset for the logs, default is 0. |
-limit | Number of logs entries to fetch. |
-order | Order in which to fetch the logs asc or desc, default is desc. |
Sample usage
opsgenie-lamp listTeamLogs -n "my team" -limit 10 -order desc
Get On-Call Command
Lamp getOncall command is useful for getting the current on-call details at the given time for a schedule.
Parameters | Description |
---|---|
-id | Id of the on-call schedule. |
-name | Name of the on-call schedule. |
-flat | If the response should be flat, which does not included user details except for email. |
-atTime | Time at which to check, need to specify time in 2006-01-02T15:04:05+07:00 format, default is current time. |
Sample usage
opsgenie-lamp getOncall -name "Team A main" -atTime "2006-01-02T15:04:05+07:00" -flat
Get Next On-Call Command
Lamp getNextOncall ommand is useful for getting the next on-call details at the given time for a schedule.
Parameter | Description |
---|---|
-id | Id of the on-call schedule. |
-name | Name of the on-call schedule. |
-flat | If the response should be flat, which does not included user details except for email. |
-atTime | Time at which to check, need to specify time in 2006-01-02T15:04:05+07:00 format, default is current time. |
Sample usage
opsgenie-lamp getOncall -name "Team A main" -atTime "2006-01-02T15:04:05+07:00" -flat
Export User On-Calls Command
Lamps exportUserOncalls command is useful for exporting upcoming on-calls schedules for a given user in an ics file, which user can add to his/her calendar application. This will export the schedule for the next 3 months.
Parameter | Description |
---|---|
-userName | User email of the user for whom to export the schedules. |
-userId | User name of the user for whom to export the schedules. |
-exportTo | File path to save the file, default is current folder. |
Sample usage
./opsgenie-lamp exportUserOncalls -userName [email protected] -exportTo "/Users/username/Documents/"
Version Command
It prompts the current Lamp Version
Sample Usage
opsgenie-lamp --version
Source
The source code is available at GitHub.
Updated almost 2 years ago