GlpigetObject » History » Version 11

walid, 10/02/2011 12:24 PM

1 1 yeti
h1. [[En_devguide#Provided-Methods|Methods]] > glpi.getObject
2 2 yeti
3 11 walid
4 9 walid
| Version | Comments |
5 10 walid
| 1.2.0 | options added : with_softwareversion, with_softwarelicense |
6 9 walid
| 1.1.0 | Method added |
7 1 yeti
8 11 walid
!https://forge.indepnet.net/svn/webservices/authenticated.png! +@This method is only accessible by authenticated and super-admin users@+
9 2 yeti
10 11 walid
Retrieve information on a existing object if the authenticated user is a super-admin.
11 2 yeti
12 2 yeti
*input* a hastable
13 2 yeti
14 3 yeti
* *help* option to get usage information *+OPTIONAL+*
15 3 yeti
* *itemtype* the object type *+MANDATORY+*
16 7 yeti
_itemtype can take one of the following_ https://forge.indepnet.net/embedded/glpi/annotated.html
17 3 yeti
* *id* the ID of object *+MANDATORY+*
18 4 yeti
* *show_label* option to show the lang label for each return field *+OPTIONAL+*
19 4 yeti
* *show_name* option to show the dropdown name value for each ID field *+OPTIONAL+*
20 4 yeti
21 4 yeti
+*Other input hastable options*+ 
22 4 yeti
23 4 yeti
The following options are available depending on the type that was defines in the "itemtype" option bellow.
24 4 yeti
25 4 yeti
* *with_infocom* option to show infocom informations in the output result
26 4 yeti
* *with_networkport* option to show network ports in the output result
27 5 yeti
* *with_phone* option to show connected phones in the output result (only for Computer type)
28 5 yeti
* *with_printer* option to show connected printers in the output result (only for Computer type)
29 5 yeti
* *with_monitor* option to show connected monitors in the output result (only for Computer type)
30 5 yeti
* *with_peripheral* option to show connected peripherals in the output result (only for Computer type)
31 5 yeti
* *with_document* option to show documents in the output result
32 5 yeti
* *with_ticket* option to show tickets in the output result (only for Ticket type)
33 5 yeti
* *with_tickettask* option to show ticket tasks in the output result (only for Ticket type)
34 5 yeti
* *with_ticketfollowup* option to show ticket followups in the output result (only for Ticket type)
35 5 yeti
* *with_ticketvalidation* option to show ticket validations informations in the output result (only for Ticket type)
36 5 yeti
* *with_reservation* option to show reservations available in the output result
37 1 yeti
* *with_software* option to show installed softwares in the output result (only for Computer type)
38 10 walid
* *with_softwareversion* option to show version associated with a software (with-software parameter needed)
39 10 walid
* *with_softwarelicense* option to show licensed associated with a software (with-software parameter needed)
40 5 yeti
* *with_contract* option to show attached contracts in the output result
41 4 yeti
42 2 yeti
43 2 yeti
*Default Call* example
44 2 yeti
<pre>
45 2 yeti
$ php testxmlrpc.php --session=0ptega61kobcnhkv0vokbercv1 --method=glpi.getObject --itemtype=Computer --id=501
46 2 yeti
+ Calling 'glpi.getObject' on http://localhost/glpi/plugins/webservices/xmlrpc.php?session=0ptega61kobcnhkv0vokbercv1
47 2 yeti
+ Response: Array
48 2 yeti
(
49 2 yeti
    [name] => computers 0-1
50 2 yeti
    [id] => 501
51 2 yeti
    [locations_id] => 21
52 2 yeti
    [computertypes_id] => 1
53 2 yeti
    [computermodels_id] => 1
54 2 yeti
    [states_id] => 5
55 2 yeti
    [operatingsystems_id] => 1
56 2 yeti
    [operatingsystemversions_id] => 2
57 2 yeti
    [operatingsystemservicepacks_id] => 4
58 2 yeti
    [autoupdatesystems_id] => 3
59 2 yeti
    [os_license_number] => os sn 0
60 2 yeti
    [os_licenseid] => os id 0
61 2 yeti
    [serial] => m233a56mu6i
62 2 yeti
    [otherserial] => vqcfci7a8si
63 2 yeti
    [notepad] => note computer 0
64 2 yeti
    [contact] => contact 0
65 2 yeti
    [contact_num] => num 0
66 2 yeti
    [users_id] => 748
67 2 yeti
    [groups_id] => 3
68 2 yeti
    [date_mod] => 2011-01-26 10:39:52
69 2 yeti
    [networks_id] => 5
70 2 yeti
    [domains_id] => 3
71 2 yeti
    [manufacturers_id] => 1
72 2 yeti
    [users_id_tech] => 579
73 2 yeti
    [entities_id] => 1
74 2 yeti
    [is_ocs_import] => 0
75 2 yeti
)</pre>
76 6 yeti
77 6 yeti
*Same call with_infocom* example
78 6 yeti
<pre>
79 6 yeti
$ php testxmlrpc.php --session=0ptega61kobcnhkv0vokbercv1 --method=glpi.getObject --itemtype=Computer --id=501 --with_infocom
80 6 yeti
+ Calling 'glpi.getObject' on http://localhost//glpi_078_svn/plugins/webservices/xmlrpc.php?session=0ptega61kobcnhkv0vokbercv1
81 6 yeti
+ Response: Array
82 6 yeti
(
83 6 yeti
    [name] => computers 0-1
84 6 yeti
    [id] => 501
85 6 yeti
    [locations_id] => 21
86 6 yeti
    [computertypes_id] => 1
87 6 yeti
    [computermodels_id] => 1
88 6 yeti
    [states_id] => 5
89 6 yeti
    [operatingsystems_id] => 1
90 6 yeti
    [operatingsystemversions_id] => 2
91 6 yeti
    [operatingsystemservicepacks_id] => 4
92 6 yeti
    [autoupdatesystems_id] => 3
93 6 yeti
    [os_license_number] => os sn 0
94 6 yeti
    [os_licenseid] => os id 0
95 6 yeti
    [serial] => m233a56mu6i
96 6 yeti
    [otherserial] => vqcfci7a8si
97 6 yeti
    [notepad] => note computer 0
98 6 yeti
    [contact] => contact 0
99 6 yeti
    [contact_num] => num 0
100 6 yeti
    [users_id] => 748
101 6 yeti
    [groups_id] => 3
102 6 yeti
    [date_mod] => 2011-01-26 10:39:52
103 6 yeti
    [networks_id] => 5
104 6 yeti
    [domains_id] => 3
105 6 yeti
    [manufacturers_id] => 1
106 6 yeti
    [users_id_tech] => 579
107 6 yeti
    [entities_id] => 1
108 6 yeti
    [is_ocs_import] => 0
109 6 yeti
    [Infocom] => Array
110 6 yeti
        (
111 6 yeti
            [id] => 1126
112 6 yeti
            [buy_date] => 2006-07-16
113 6 yeti
            [use_date] => 2006-07-16
114 6 yeti
            [warranty_duration] => 36
115 6 yeti
            [warranty_info] => infowar comp 501
116 6 yeti
            [warranty_value] => 315.0000
117 6 yeti
            [suppliers_id] => 10
118 6 yeti
            [order_number] => commande comp 501
119 6 yeti
            [delivery_number] => BL comp 501
120 6 yeti
            [immo_number] => immo comp 501
121 6 yeti
            [value] => 3355.0000
122 6 yeti
            [sink_time] => 5
123 6 yeti
            [sink_type] => 1
124 6 yeti
            [comment] => comment comp 501
125 6 yeti
            [sink_coeff] => 5
126 6 yeti
            [bill] => facture comp 501
127 6 yeti
            [budgets_id] => 9
128 6 yeti
            [itemtype] => Computer
129 6 yeti
            [items_id] => 501
130 6 yeti
            [alert] => 0
131 6 yeti
            [entities_id] => 1
132 6 yeti
            [is_recursive] => 0
133 6 yeti
        )
134 6 yeti
135 6 yeti
)
136 6 yeti
</pre>