Ad Widget

Collapse

how to get count of Templates assign to host via API

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • natalia
    Senior Member
    • Apr 2013
    • 159

    #1

    how to get count of Templates assign to host via API

    Hi,

    I want to get list (via API) of all hosts assign only to 2 Templates

    I try to using :

    $json = {
    jsonrpc=> '2.0',
    method => 'host.get',
    params =>
    {
    output => ['selectParentTemplates'],
    #selectParentTemplates => ['selectParentTemplates'], #,'name'],
    filter => {
    host => "$host_name",
    },
    countOutput => true,
    },
    id => 2,
    auth => "$authID",
    };
    $response = $client->call($url, $json);

    but got error :
    "Bareword "true" not allowed while "strict subs" in use "

    Can't find any example.

    Please help

    Thanks
Working...