Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[dev.icinga.com #9080] Add commands (actions) for the API #2910

Closed
icinga-migration opened this issue Apr 17, 2015 · 19 comments
Closed

[dev.icinga.com #9080] Add commands (actions) for the API #2910

icinga-migration opened this issue Apr 17, 2015 · 19 comments

Comments

@icinga-migration
Copy link
Member

@icinga-migration icinga-migration commented Apr 17, 2015

This issue has been migrated from Redmine: https://dev.icinga.com/issues/9080

Created by gbeutner on 2015-04-17 12:27:09 +00:00

Assignee: jflach
Status: Resolved (closed on 2015-10-27 17:44:27 +00:00)
Target Version: 2.4.0
Last Update: 2015-11-12 15:34:37 +00:00 (in Redmine)

Backport?: No
Include in Changelog: 1

  • Similar to external commands
  • Support for filters ("acknowledge all hosts which match filter expression X")
  • Canned filters for commonly used commands ("acknowledge all services on host X") – these aren't technically necessary because the user could use filters to achieve the same effect; however, they make the API easier to use for novice users
  • Ability to evaluate arbitrary script expressions
    • In sandbox mode for read-only users

Attachments

Changesets

2015-07-30 15:50:17 +00:00 by jflach 9b6ebbc

Implement basic actions framework

refs #9080

2015-07-31 15:18:49 +00:00 by jflach 60f86d0

Implement /v1/actions/process-check-result

Requires error handling.

refs #9080

2015-08-20 09:21:56 +00:00 by jflach ccb386e

Implement external commands as api actions

refs #9080

2015-08-20 12:45:36 +00:00 by jflach ad01b82

Experimental actions without types

refs #9080

2015-08-21 10:48:32 +00:00 by jflach afd6af3

Implement external commands as api actions

refs #9080

2015-08-21 10:48:32 +00:00 by jflach c5fe46a

Experimental actions without types

refs #9080

2015-08-21 10:49:51 +00:00 by mfriedrich 981ed59

API: Return comment/downtime ids, refactor code

refs #9080

2015-08-24 06:01:33 +00:00 by (unknown) 380b127

Clean up the API action code a bit

refs #9080

2015-08-25 13:14:10 +00:00 by jflach 49682ca

Implement all actions except modified attributes

refs #9080 #9979

2015-08-26 11:53:17 +00:00 by jflach 01ced15

Implement all actions except modified attributes

refs #9080 #9979

2015-10-22 09:33:26 +00:00 by jflach be320b2

Update API actions

fixes #10180
refs #9080

2015-10-26 16:03:23 +00:00 by jflach 0efab37

Update API documentation

refs #9080

2015-10-27 13:15:07 +00:00 by jflach 2fc042e

Update API actions and documentation

refs #9080 #9105

2015-10-27 17:42:32 +00:00 by mfriedrich 1223007

Review and update documentation

fixes #9080
refs #9105

2015-11-01 15:33:43 +00:00 by mfriedrich 439dad5

API actions: Check if removal of comments and downtimes was succesful

refs #9080

Subtasks:

Relations:

@icinga-migration
Copy link
Member Author

@icinga-migration icinga-migration commented Apr 17, 2015

Updated by mfriedrich on 2015-04-17 15:56:24 +00:00

  • Relates set to 8754
@icinga-migration
Copy link
Member Author

@icinga-migration icinga-migration commented Apr 17, 2015

Updated by mfriedrich on 2015-04-17 15:57:18 +00:00

  • Relates set to 8663
@icinga-migration
Copy link
Member Author

@icinga-migration icinga-migration commented Apr 29, 2015

Updated by mfriedrich on 2015-04-29 16:18:33 +00:00

  • Relates set to 8671
@icinga-migration
Copy link
Member Author

@icinga-migration icinga-migration commented Apr 29, 2015

Updated by mfriedrich on 2015-04-29 16:21:49 +00:00

  • Relates set to 8636
@icinga-migration
Copy link
Member Author

@icinga-migration icinga-migration commented May 19, 2015

Updated by mfriedrich on 2015-05-19 08:20:37 +00:00

  • Blocked set to 9077
@icinga-migration
Copy link
Member Author

@icinga-migration icinga-migration commented Jun 30, 2015

Updated by mfriedrich on 2015-06-30 15:09:49 +00:00

  • Subject changed from Add commands for the API to Add commands (actions) for the API
@icinga-migration
Copy link
Member Author

@icinga-migration icinga-migration commented Jul 30, 2015

Updated by mfriedrich on 2015-07-30 17:04:13 +00:00

  • Status changed from New to Assigned
  • Assigned to set to jflach
@icinga-migration
Copy link
Member Author

@icinga-migration icinga-migration commented Aug 4, 2015

Updated by jflach on 2015-08-04 10:26:21 +00:00

Planed actions:

  • Process check result
  • Disable/Enable active/passive checks
  • Schedule checks
  • Add/Remove Acknowledgements
  • Enable/Disable flap detection
  • Add/Delete (all) comments
  • Enable/Disable downtime
  • Set/Remove downtime
  • Enable/Disable notifications
  • Send/Receive notifications
  • Delay notifications
  • Change check interval
  • Change max check attempts ... (general change attribute ?)
  • Shutdown/Restart Icinga2
  • Process file

TODO:

  • Actions without objects to work on
  • Find a way to make actions work on groups
@icinga-migration
Copy link
Member Author

@icinga-migration icinga-migration commented Aug 5, 2015

Updated by jflach on 2015-08-05 15:42:32 +00:00

TODOS:

  • Modified attributes?
  • How to handle groups?
  • Global actions
  • Shutdown and restart can't return
  • New icinga2 object (Users, Notifications, ...)
  • Comments and Downtimes by name instead of ID
@icinga-migration
Copy link
Member Author

@icinga-migration icinga-migration commented Oct 17, 2015

Updated by mfriedrich on 2015-10-17 01:41:28 +00:00

The naming for global actions is still not good. "notification delivery" sounds as wrong as "performance_data_collection". Probably we should still use "enable-global-notifications" and allow to set the parameter "enable" to whether "true" or "false" and just process that value internally. Users commonly see that "enable_*" attribute all over the other Icinga objects too (e.g. "enable_active_checks" or "enable_perfdata").

@icinga-migration
Copy link
Member Author

@icinga-migration icinga-migration commented Oct 17, 2015

Updated by mfriedrich on 2015-10-17 16:44:13 +00:00

Another idea - why not entirely drop the global actions? We've recently removed global constants and added them as object attributes to the Icingaapplicakion object.

In order to modify these object attributes, one could just POST an update to /v1/objects/icingaapplications/app ... imho that's the more logical way given that all other objects are updated in the same way.

This should be mentioned in the documentation of course, and will certainly help removing that complex table still existing - we should add chapters for specific action types anyways before closing this issue too.

@icinga-migration
Copy link
Member Author

@icinga-migration icinga-migration commented Oct 22, 2015

Updated by mfriedrich on 2015-10-22 08:14:07 +00:00

  • Assigned to changed from jflach to mfriedrich
@icinga-migration
Copy link
Member Author

@icinga-migration icinga-migration commented Oct 22, 2015

Updated by mfriedrich on 2015-10-22 09:29:31 +00:00

Documentation Review:

  • Chapters require an html anchor similar to the rest. Furthermore their name should be more telling. See the example below.
###  Process Check Result Action
  • The example is wrong. POST request and attributes are missing.
    $ curl -u root:icinga -k -s 'https://localhost:5665/v1/actions/process-check-result?filter=service.name=="ping6"'
  • Action attributes must be put inside a table, similar to the rest of the documentation.
    • Add required, optional and their type in the description.
    • Remove that complex example with types and parenthesis
    /v1/actions/process-check-result?exit_status=int&(plugin_output=string)&(performance_data[]=string)&\
        (check_command[]=string)&(check_source=string)&(execution_end=time_t)&(execution_start=time_t)&\
        (schedule_end=time_t)&(schedule_start=time_t)
  • The action descriptions should be shorter, less text. Do not explain why an attribute is required, but focus on additional details.
  • Comment and Downtime actions require the 'downtime_id' but not the legacy_id in our interface. We discussed that a while ago and made that decision.
@icinga-migration
Copy link
Member Author

@icinga-migration icinga-migration commented Oct 22, 2015

Updated by mfriedrich on 2015-10-22 09:37:22 +00:00

  • Assigned to changed from mfriedrich to jflach
@icinga-migration
Copy link
Member Author

@icinga-migration icinga-migration commented Oct 26, 2015

Updated by jflach on 2015-10-26 15:00:09 +00:00

  • File added 0001-Update-API-documentation.patch

Comment and Downtime actions require the 'downtime_id' but not the legacy_id in our interface. We discussed that a while ago and made that decision.

I know the downtimes comments are being redone to ConfigObjects, but I have no insight in development process. I will change it in code and documentation once the change is definite.

I attached a patch with my changes.

Edit: nvm that, I broke the tables

@icinga-migration
Copy link
Member Author

@icinga-migration icinga-migration commented Oct 26, 2015

Updated by jflach on 2015-10-26 16:06:24 +00:00

Changes have been pushed.
TODO:

  • Some parameter descriptions need work (process-check-result)
  • Additional examples?
@icinga-migration
Copy link
Member Author

@icinga-migration icinga-migration commented Oct 27, 2015

Updated by mfriedrich on 2015-10-27 17:42:22 +00:00

I've reviewed the latest doc updates and added my changes. Will close this ticket, the other documentation stuff needs to be done with the global doc issue.

@icinga-migration
Copy link
Member Author

@icinga-migration icinga-migration commented Oct 27, 2015

Updated by mfriedrich on 2015-10-27 17:44:27 +00:00

  • Status changed from Assigned to Resolved

Applied in changeset 1223007.

@icinga-migration
Copy link
Member Author

@icinga-migration icinga-migration commented Nov 12, 2015

Updated by mfriedrich on 2015-11-12 15:34:37 +00:00

  • Backport? changed from TBD to No
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
1 participant
You can’t perform that action at this time.