Page 1 of 1

New API question

Posted: Wed Oct 07, 2015 8:07 am
by BanditBBS
Right now, for adding new hosts or services, is there any way to say "dont require fields" so I can supply a template so I don't get

Code: Select all

{
    "error": "Missing required variables",
    "missing": [
        "max_check_attempts",
        "check_period",
        "notification_interval",
        "notification_period",
        "contacts OR contact_groups"
    ]
}
I really want to use the API for something I am doing, but I have to be able to use templates and not require those fields as they are all supplied by templates.

EDIT: I guess I could write the host cfg to the import folder, use the API to run the import, then write the services file and do the import again as a work around, but using the curl commands would be awesome!

Re: New API question

Posted: Wed Oct 07, 2015 9:04 am
by jomann
That is actually a good point. I'll add something here for this because you can use the "use" attribute.

Edit: Added a parameter to pass called "force" so you can add &force=1 to skip the check.

Re: New API question

Posted: Wed Oct 07, 2015 9:12 am
by BanditBBS
jomann wrote:That is actually a good point. I'll add something here for this because you can use the "use" attribute.

Edit: Added a parameter to pass called "force" so you can add &force=1 to skip the check.
Also for the services as well since we can use a template there please :)

You can close this thread.

Re: New API question

Posted: Wed Oct 07, 2015 9:15 am
by jomann
It'll be in there for both of them this coming release (this week).