Hi,
If I want a specific item for a host, like mac or ip, shouldn't I be able
to query it like this:
curl -k -u id:pass -H 'Accept: version=2,application/json'
https://foremanserver/api/hosts/server1.domainname/mac
I see i'm able to query hostbased parameters like this: curl -k -u id:pass
-H 'Accept: version=2,application/json'
https://foremanserver/api/hosts/server1.domainname/parameters/param1 but
can't get just mac or ip…
>
> Hi,
>
> If I want a specific item for a host, like mac or ip, shouldn't I be able
> to query it like this:
>
> curl -k -u id:pass -H 'Accept: version=2,application/json'
> https://foremanserver/api/hosts/server1.domainname/mac
That is not a valid route, however you could query:
https://foremanserver/api/hosts/server1.domainname/
The response will contain a subfield called 'interfaces', with an array
of all interfaces in your host, and you can get the ips/macs from there.
Alternatively, if you just need the interfaces and don't care about any
other attributes, you can query:
https://foremanserver/api/hosts/server1.domainname/interfaces
>
> I see i'm able to query hostbased parameters like this: curl -k -u id:pass
> -H 'Accept: version=2,application/json'
> https://foremanserver/api/hosts/server1.domainname/parameters/param1 but
> can't get just mac or ip…
Hope this helped
···
On 07/14, Andrew Blatt wrote:
–
You received this message because you are subscribed to the Google Groups “Foreman users” group.
To unsubscribe from this group and stop receiving emails from it, send an email to foreman-users+unsubscribe@googlegroups.com.
To post to this group, send email to foreman-users@googlegroups.com.
Visit this group at http://groups.google.com/group/foreman-users.
For more options, visit https://groups.google.com/d/optout.
–
Daniel Lobato Garcia
@eLobatoss
blog.daniellobato.me
daniellobato.me
GPG: http://keys.gnupg.net/pks/lookup?op=get&search=0x7A92D6DD38D6DE30
Keybase: https://keybase.io/elobato