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

IcingaArguments: allow to manage functions through API #1416

Closed
wants to merge 1 commit into from
Closed

IcingaArguments: allow to manage functions through API #1416

wants to merge 1 commit into from

Conversation

capull0
Copy link

@capull0 capull0 commented Mar 1, 2018

We solved our bottom-up configuration via the director API and a python script.
With this patch it is also possible to handle functions through the API

Works for us, but don't know if it breaks something else.
I don't know the reason for:
$attrs['argument_value'] = '/* Unable to fetch function body through API */';

@mdetrano
Copy link
Contributor

Hello,

I am interested in this pull request and have tested it independently.

It think in the patch, around line 153, this line:

                     if (property_exists($value, 'body')) { 

should be

                    if (property_exists($value->value, 'body')) {

also,
in the same function (mungeCommandArgument) , if this is added to the $map variable:
'set_if_format' => 'set_if_format',
Then the set_if parameters that are specified with Icinga DSL will be imported correctly (otherwise this values is left as "string"...which it isn't).

Combining the changes in this pull request with the couple of fixes stated here, I can get the full cycle to work in the API... GET json data, then POST the same data to create a working command object just as it was originally.

This also helps greatly when using the "restore object" feature in Director's activity log to recover a deleted command (the DSL stuff is restored as well).

@Thomas-Gelf Thomas-Gelf added this to the 1.7.0 milestone Sep 20, 2019
@Thomas-Gelf
Copy link
Contributor

Thanks for this pull request, this should have been implemented with 6c00d17.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants