VM properties from API

Hi,

I need access to VM properties (VM tab in* /hosts/FQDN*) in foreman 1.2.1

Properties like NIC, DISK UUID…

With /hosts/FQDN?format=json i get:

{
host: {
compute_resource_id: 104,
organization_id: 2,
serial: null,
location_id: 1,
managed: true,
uuid: "8369e94e-4a60-2889-0d34-535687d7b066",
architecture_id: 1,
domain_id: 1,
last_compile: null,
last_report: null,
model_id: null,
root_pass: "xxxxxxxxxxxx",
source_file_id: null,
hostgroup_id: 18,
updated_at: "2013-10-29T12:07:30Z",
comment: "",
operatingsystem_id: 22,
build: false,
certname: "test_loct.foo.es",
environment: {
environment: {
name: "xisrcal",
id: 151
}
},
image_file: "",
image_id: null,
ptable_id: 13,
puppet_proxy_id: 7,
puppet_status: 0,
disk: "",
installed_at: "2013-10-29T09:47:17Z",
subnet_id: 4,
created_at: "2013-10-29T08:43:30Z",
enabled: true,
name: "test_loct.tems.foo.es",
owner_id: 6,
owner_type: "User",
interfaces: [ ],
environment_id: 151,
medium_id: 21,
puppet_ca_proxy_id: 7,
use_image: null,
id: 10248,
ip: "10.240.5.167",
last_freshcheck: null,
mac: "52:54:00:a7:24:bf",
host_parameters: [ ]
}
}

··· * * How i can access to VM properties from API? (Before facter)

Thanks.

> Hi,
>
> I need access to VM properties (VM tab in* /hosts/FQDN*) in foreman 1.2.1
>
> Properties like NIC, DISK UUID…
>
> With /hosts/FQDN?format=json i get:
>

try
/compute_resource/ID/vms/UUID

where ID == host[compute_resource_id] and UUID = host[uuid]
Ohad

··· On Wed, Oct 30, 2013 at 4:58 PM, Israel Calvete wrote:

{
host: {
compute_resource_id: 104,
organization_id: 2,
serial: null,
location_id: 1,
managed: true,
uuid: “8369e94e-4a60-2889-0d34-535687d7b066”,
architecture_id: 1,
domain_id: 1,
last_compile: null,
last_report: null,
model_id: null,
root_pass: “xxxxxxxxxxxx”,
source_file_id: null,
hostgroup_id: 18,
updated_at: “2013-10-29T12:07:30Z”,
comment: “”,
operatingsystem_id: 22,
build: false,
certname: “test_loct.foo.es”,
environment: {
environment: {
name: “xisrcal”,
id: 151
}
},
image_file: “”,
image_id: null,
ptable_id: 13,
puppet_proxy_id: 7,
puppet_status: 0,
disk: “”,
installed_at: “2013-10-29T09:47:17Z”,
subnet_id: 4,
created_at: “2013-10-29T08:43:30Z”,
enabled: true,
name: “test_loct.tems.foo.es”,
owner_id: 6,
owner_type: “User”,
interfaces: [ ],
environment_id: 151,
medium_id: 21,
puppet_ca_proxy_id: 7,
use_image: null,
id: 10248,
ip: “10.240.5.167”,
last_freshcheck: null,
mac: “52:54:00:a7:24:bf”,
host_parameters: [ ]
}
}
*
*
How i can access to VM properties from API? (Before facter)

Thanks.


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/groups/opt_out.

This works. Thanks.

But i'm ussing Active Resources and:

This works

/compute_resources/104/vms.json

This not works

/compute_resources/104/vms/8369e94e-4a60-2889-0d34-535687d7b066.json (
with ?format=json works)

Is a bug?

Thanks another time.

··· On Wednesday, October 30, 2013 4:33:50 PM UTC+1, ohad wrote: > > > > On Wed, Oct 30, 2013 at 4:58 PM, Israel Calvete <ical...@gmail.com > > wrote: > >> Hi, >> >> I need access to VM properties (VM tab in* /hosts/FQDN*) in foreman 1.2.1 >> >> Properties like NIC, DISK UUID.... >> >> With */hosts/FQDN?format=json* i get: >> > > try > /compute_resource/ID/vms/UUID > > where ID == host[compute_resource_id] and UUID = host[uuid] > Ohad > >> >> *{* >> *host: {* >> *compute_resource_id: 104,* >> *organization_id: 2,* >> *serial: null,* >> *location_id: 1,* >> *managed: true,* >> *uuid: "8369e94e-4a60-2889-0d34-535687d7b066",* >> *architecture_id: 1,* >> *domain_id: 1,* >> *last_compile: null,* >> *last_report: null,* >> *model_id: null,* >> *root_pass: "xxxxxxxxxxxx",* >> *source_file_id: null,* >> *hostgroup_id: 18,* >> *updated_at: "2013-10-29T12:07:30Z",* >> *comment: "",* >> *operatingsystem_id: 22,* >> *build: false,* >> *certname: "test_loct.foo.es",* >> *environment: {* >> *environment: {* >> *name: "xisrcal",* >> *id: 151* >> *}* >> *},* >> *image_file: "",* >> *image_id: null,* >> *ptable_id: 13,* >> *puppet_proxy_id: 7,* >> *puppet_status: 0,* >> *disk: "",* >> *installed_at: "2013-10-29T09:47:17Z",* >> *subnet_id: 4,* >> *created_at: "2013-10-29T08:43:30Z",* >> *enabled: true,* >> *name: "test_loct.tems.foo.es",* >> *owner_id: 6,* >> *owner_type: "User",* >> *interfaces: [ ],* >> *environment_id: 151,* >> *medium_id: 21,* >> *puppet_ca_proxy_id: 7,* >> *use_image: null,* >> *id: 10248,* >> *ip: "10.240.5.167",* >> *last_freshcheck: null,* >> *mac: "52:54:00:a7:24:bf",* >> *host_parameters: [ ]* >> *}* >> *}* >> * >> * >> How i can access to VM properties from API? (Before facter) >> >> Thanks. >> >> -- >> 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-user...@googlegroups.com . >> To post to this group, send email to forema...@googlegroups.com >> . >> Visit this group at http://groups.google.com/group/foreman-users. >> For more options, visit https://groups.google.com/groups/opt_out. >> > >