GlpigetObject » History » Version 5

yeti, 02/03/2011 06:28 PM

1 1 yeti
h1. [[En_devguide#Provided-Methods|Methods]] > glpi.getObject
2 2 yeti
3 2 yeti
!https://forge.indepnet.net/svn/webservices/authenticated.png! +@This method is only accessible by authenticated users@+
4 2 yeti
5 2 yeti
Retrieve information on a existing object if the authenticated user can view it.
6 2 yeti
7 2 yeti
*input* a hastable
8 2 yeti
9 3 yeti
* *help* option to get usage information *+OPTIONAL+*
10 3 yeti
* *itemtype* the object type *+MANDATORY+*
11 3 yeti
* *id* the ID of object *+MANDATORY+*
12 4 yeti
* *show_label* option to show the lang label for each return field *+OPTIONAL+*
13 4 yeti
* *show_name* option to show the dropdown name value for each ID field *+OPTIONAL+*
14 4 yeti
15 4 yeti
+*Other input hastable options*+ 
16 4 yeti
17 4 yeti
The following options are available depending on the type that was defines in the "itemtype" option bellow.
18 4 yeti
19 4 yeti
* *with_infocom* option to show infocom informations in the output result
20 4 yeti
* *with_networkport* option to show network ports in the output result
21 5 yeti
* *with_phone* option to show connected phones in the output result (only for Computer type)
22 5 yeti
* *with_printer* option to show connected printers in the output result (only for Computer type)
23 5 yeti
* *with_monitor* option to show connected monitors in the output result (only for Computer type)
24 5 yeti
* *with_peripheral* option to show connected peripherals in the output result (only for Computer type)
25 5 yeti
* *with_document* option to show documents in the output result
26 5 yeti
* *with_ticket* option to show tickets in the output result (only for Ticket type)
27 5 yeti
* *with_tickettask* option to show ticket tasks in the output result (only for Ticket type)
28 5 yeti
* *with_ticketfollowup* option to show ticket followups in the output result (only for Ticket type)
29 5 yeti
* *with_ticketvalidation* option to show ticket validations informations in the output result (only for Ticket type)
30 5 yeti
* *with_reservation* option to show reservations available in the output result
31 5 yeti
* *with_software* option to show installed softwares in the output result (only for Computer type)
32 5 yeti
* *with_contract* option to show attached contracts in the output result
33 4 yeti
34 2 yeti
35 2 yeti
*Default Call* example
36 2 yeti
<pre>
37 2 yeti
$ php testxmlrpc.php --session=0ptega61kobcnhkv0vokbercv1 --method=glpi.getObject --itemtype=Computer --id=501
38 2 yeti
+ Calling 'glpi.getObject' on http://localhost/glpi/plugins/webservices/xmlrpc.php?session=0ptega61kobcnhkv0vokbercv1
39 2 yeti
+ Response: Array
40 2 yeti
(
41 2 yeti
    [name] => computers 0-1
42 2 yeti
    [id] => 501
43 2 yeti
    [locations_id] => 21
44 2 yeti
    [computertypes_id] => 1
45 2 yeti
    [computermodels_id] => 1
46 2 yeti
    [states_id] => 5
47 2 yeti
    [operatingsystems_id] => 1
48 2 yeti
    [operatingsystemversions_id] => 2
49 2 yeti
    [operatingsystemservicepacks_id] => 4
50 2 yeti
    [autoupdatesystems_id] => 3
51 2 yeti
    [os_license_number] => os sn 0
52 2 yeti
    [os_licenseid] => os id 0
53 2 yeti
    [serial] => m233a56mu6i
54 2 yeti
    [otherserial] => vqcfci7a8si
55 2 yeti
    [notepad] => note computer 0
56 2 yeti
    [contact] => contact 0
57 2 yeti
    [contact_num] => num 0
58 2 yeti
    [users_id] => 748
59 2 yeti
    [groups_id] => 3
60 2 yeti
    [date_mod] => 2011-01-26 10:39:52
61 2 yeti
    [networks_id] => 5
62 2 yeti
    [domains_id] => 3
63 2 yeti
    [manufacturers_id] => 1
64 2 yeti
    [users_id_tech] => 579
65 2 yeti
    [entities_id] => 1
66 2 yeti
    [is_ocs_import] => 0
67 2 yeti
)</pre>