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 #13311] template objects for API POST queries #4805

Closed
icinga-migration opened this issue Nov 24, 2016 · 2 comments
Closed
Labels
area/api REST API enhancement New feature or request

Comments

@icinga-migration
Copy link

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

Created by darmagan on 2016-11-24 13:22:07 +00:00

Assignee: (none)
Status: New
Target Version: (none)
Last Update: 2016-11-28 07:34:51 +00:00 (in Redmine)

Backport?: Not yet backported
Include in Changelog: 1

Hello,

the icinga2 API ignores existing template objects if you want to modify there attributes.
It would be nice if querys like

curl -k -s -u uname:pass -H 'Accept: application/json' -X POST 'https://icinga2host:5665/v1/objects/hosts/examplehost' -d '{templates [ "generic-host", "temp01", "temp02" ],attrs, vars.attr02

were possible.

Regards

@icinga-migration
Copy link
Author

Updated by rhillmann on 2016-11-25 10:38:29 +00:00

It would be nice to get the configured attributes of an template as well, just a list of templates is useless for me (with cascade option as well)

@icinga-migration
Copy link
Author

Updated by gbeutner on 2016-11-28 07:34:51 +00:00

@rhillmann: The problem with that is that templates don't have attributes, as far as Icinga is concerned they're unintelligible program code, here's an example that tries to visualize this issue:

template Host "tmpl" {
  if () {
    check_command = "x"
  } else {
    check_command = "y"
}

There's no way for Icinga to know what 'check_command' is until that piece of code is executed in the context of an object definition. In fact, that's a trivial example, really, it's entirely possible to dynamically set properties without Icinga even being able to tell which attribute you're changing (this[aname] = "...", where aname is a variable containing the attribute name).

I'm afraid there really is no way to tell which attributes a template modifies.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/api REST API enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants