Xcapclient
Version 4 (Adrian Georgescu, 10/26/2008 02:06 pm)
1 | 1 | Adrian Georgescu | == xcapclient == |
---|---|---|---|
2 | 1 | Adrian Georgescu | |
3 | 1 | Adrian Georgescu | To use this script you must to have a valid [wiki:configuration_file configuration file]. |
4 | 1 | Adrian Georgescu | |
5 | 1 | Adrian Georgescu | |
6 | 1 | Adrian Georgescu | === Description === |
7 | 1 | Adrian Georgescu | |
8 | 2 | Adrian Georgescu | This client is part of python-xcaplib package provided by [http://openxcap.org OpenXCAP] server. If you have installed bash_completion.d/xcapclient you can use TAB completion to browse through the content of the XCAP server documents/nodes/atributes. For more information read the documentation that comes with the package. |
9 | 1 | Adrian Georgescu | |
10 | 1 | Adrian Georgescu | {{{ |
11 | 1 | Adrian Georgescu | adigeo@ag-imac3:~$xcapclient -h |
12 | 1 | Adrian Georgescu | |
13 | 1 | Adrian Georgescu | xcapclient: Client for managing full or partial XML documents on XCAP servers (RFC 4825) |
14 | 1 | Adrian Georgescu | xcapclient [OPTIONS] --app AUID ACTION [NODE-SELECTOR] |
15 | 1 | Adrian Georgescu | |
16 | 1 | Adrian Georgescu | ACTION is an operation to perform: get, replace, insert, put or delete. |
17 | 1 | Adrian Georgescu | Presence of NODE-SELECTOR indicates that action is to be performed on an |
18 | 1 | Adrian Georgescu | element or an attribute. |
19 | 1 | Adrian Georgescu | |
20 | 1 | Adrian Georgescu | Options: |
21 | 1 | Adrian Georgescu | -h, --help show this help message and exit |
22 | 1 | Adrian Georgescu | -a NAME, --account-name=NAME |
23 | 1 | Adrian Georgescu | the account name from which to read account settings. |
24 | 1 | Adrian Georgescu | Corresponds to section Account_NAME in the |
25 | 1 | Adrian Georgescu | configuration file. If not supplied, the section |
26 | 1 | Adrian Georgescu | [Account] will be read. |
27 | 1 | Adrian Georgescu | --show-config show options from the configuration file; use |
28 | 1 | Adrian Georgescu | together with --account-name |
29 | 1 | Adrian Georgescu | --xcap-root=XCAP_ROOT XCAP root, e.g. https://xcap.example.com/xcap-root |
30 | 1 | Adrian Georgescu | --sip-address=SIP_ADDRESS |
31 | 1 | Adrian Georgescu | SIP address of the user in the form username@domain |
32 | 1 | Adrian Georgescu | -p PASSWORD, --password=PASSWORD |
33 | 1 | Adrian Georgescu | password to use if authentication is required. If not |
34 | 1 | Adrian Georgescu | supplied will be asked interactively |
35 | 1 | Adrian Georgescu | --app=AUID Application Unique ID. There's no default value; |
36 | 1 | Adrian Georgescu | however, it may be guessed from NODE-SELECTOR or from |
37 | 1 | Adrian Georgescu | the input file. Known apps: watchers, pidf- |
38 | 1 | Adrian Georgescu | manipulation, rls-services, resource-lists, xcap- |
39 | 1 | Adrian Georgescu | caps, pres-rules, test-app |
40 | 1 | Adrian Georgescu | --filename=FILENAME |
41 | 1 | Adrian Georgescu | -c CONTEXT, --context=CONTEXT |
42 | 1 | Adrian Georgescu | document context, users or global; default is users |
43 | 1 | Adrian Georgescu | for everything except xcap-caps |
44 | 1 | Adrian Georgescu | --etag=ETAG perform a conditional operation |
45 | 1 | Adrian Georgescu | -i INPUT_FILENAME source file for the PUT request; default is <stdin> |
46 | 1 | Adrian Georgescu | -o OUTPUT_FILENAME output file for the body of the server response |
47 | 1 | Adrian Georgescu | (successful or not); default is <stdout> |
48 | 1 | Adrian Georgescu | -d, --dump print HTTP traffic to stderr |
49 | 2 | Adrian Georgescu | }}} |
50 | 2 | Adrian Georgescu | |
51 | 2 | Adrian Georgescu | |
52 | 3 | Adrian Georgescu | == Example for pres-rules == |
53 | 1 | Adrian Georgescu | |
54 | 3 | Adrian Georgescu | === PUT === |
55 | 3 | Adrian Georgescu | |
56 | 2 | Adrian Georgescu | {{{ |
57 | 2 | Adrian Georgescu | adigeo@ag-imac3:~$xcapclient -a alice PUT -i work/python-xcaplib/examples/pres-rules.xml |
58 | 2 | Adrian Georgescu | put https://xcap.sipthor.net/xcap-root/pres-rules/users/sip:alice@example.com/index |
59 | 2 | Adrian Georgescu | 201 Created |
60 | 2 | Adrian Georgescu | etag: "345ba7c1ce125b2ff2438c19b25b4077" |
61 | 2 | Adrian Georgescu | content-type: application/auth-policy+xml |
62 | 2 | Adrian Georgescu | }}} |
63 | 1 | Adrian Georgescu | |
64 | 2 | Adrian Georgescu | |
65 | 3 | Adrian Georgescu | === GET === |
66 | 2 | Adrian Georgescu | |
67 | 2 | Adrian Georgescu | {{{ |
68 | 2 | Adrian Georgescu | adigeo@ag-imac3:~$xcapclient -a alice --app pres-rules get |
69 | 2 | Adrian Georgescu | get https://xcap.sipthor.net/xcap-root/pres-rules/users/sip:alice@example.com/index |
70 | 2 | Adrian Georgescu | etag: "345ba7c1ce125b2ff2438c19b25b4077" |
71 | 2 | Adrian Georgescu | content-type: application/auth-policy+xml |
72 | 2 | Adrian Georgescu | content-length: 939 |
73 | 2 | Adrian Georgescu | <?xml version="1.0" encoding="UTF-8"?> |
74 | 2 | Adrian Georgescu | <ruleset xmlns="urn:ietf:params:xml:ns:common-policy" xmlns:pr="urn:ietf:params:xml:ns:pres-rules" xmlns:cp="www.counterpath.com/privacy-lists"> |
75 | 2 | Adrian Georgescu | <rule id="pres_whitelist"> |
76 | 2 | Adrian Georgescu | <conditions> |
77 | 2 | Adrian Georgescu | <identity> |
78 | 2 | Adrian Georgescu | <one id="sip:bob@example.com"/> |
79 | 2 | Adrian Georgescu | <one id="sip:alice@example.com"/> |
80 | 2 | Adrian Georgescu | <many domain="ag-projects.com"> |
81 | 2 | Adrian Georgescu | </many> |
82 | 2 | Adrian Georgescu | </identity> |
83 | 2 | Adrian Georgescu | </conditions> |
84 | 2 | Adrian Georgescu | <actions> |
85 | 2 | Adrian Georgescu | <pr:sub-handling>allow</pr:sub-handling> |
86 | 2 | Adrian Georgescu | </actions> |
87 | 2 | Adrian Georgescu | <transformations> |
88 | 2 | Adrian Georgescu | <pr:provide-services> |
89 | 2 | Adrian Georgescu | <pr:all-services/> |
90 | 2 | Adrian Georgescu | </pr:provide-services> |
91 | 2 | Adrian Georgescu | <pr:provide-persons> |
92 | 2 | Adrian Georgescu | <pr:all-persons/> |
93 | 2 | Adrian Georgescu | </pr:provide-persons> |
94 | 2 | Adrian Georgescu | <pr:provide-devices> |
95 | 2 | Adrian Georgescu | <pr:all-devices/> |
96 | 2 | Adrian Georgescu | </pr:provide-devices> |
97 | 2 | Adrian Georgescu | <pr:provide-all-attributes/> |
98 | 2 | Adrian Georgescu | </transformations> |
99 | 2 | Adrian Georgescu | </rule> |
100 | 2 | Adrian Georgescu | <rule id="pres_blacklist"> |
101 | 2 | Adrian Georgescu | <conditions> |
102 | 2 | Adrian Georgescu | <identity> |
103 | 2 | Adrian Georgescu | <one id="sip:40316600024@abc.com"/> |
104 | 2 | Adrian Georgescu | </identity> |
105 | 2 | Adrian Georgescu | </conditions> |
106 | 2 | Adrian Georgescu | <actions> |
107 | 2 | Adrian Georgescu | <pr:sub-handling>block</pr:sub-handling> |
108 | 2 | Adrian Georgescu | </actions> |
109 | 2 | Adrian Georgescu | <transformations/> |
110 | 2 | Adrian Georgescu | </rule> |
111 | 1 | Adrian Georgescu | </ruleset> |
112 | 2 | Adrian Georgescu | }}} |
113 | 2 | Adrian Georgescu | |
114 | 3 | Adrian Georgescu | === DELETE === |
115 | 2 | Adrian Georgescu | |
116 | 2 | Adrian Georgescu | {{{ |
117 | 2 | Adrian Georgescu | adigeo@ag-imac3:~$xcapclient -a alice --app pres-rules DELETE |
118 | 1 | Adrian Georgescu | delete https://xcap.sipthor.net/xcap-root/pres-rules/users/sip:alice@example.com/index |
119 | 1 | Adrian Georgescu | 200 OK |
120 | 1 | Adrian Georgescu | content-type: application/auth-policy+xml |
121 | 3 | Adrian Georgescu | }}} |
122 | 3 | Adrian Georgescu | |
123 | 3 | Adrian Georgescu | |
124 | 3 | Adrian Georgescu | == Resource-lists == |
125 | 3 | Adrian Georgescu | |
126 | 3 | Adrian Georgescu | === PUT === |
127 | 3 | Adrian Georgescu | |
128 | 3 | Adrian Georgescu | {{{ |
129 | 3 | Adrian Georgescu | adigeo@ag-imac3:~$xcapclient -a alice PUT -i work/python-xcaplib/examples/resource-lists.xml |
130 | 3 | Adrian Georgescu | put https://xcap.sipthor.net/xcap-root/resource-lists/users/sip:alice@example.com/index |
131 | 3 | Adrian Georgescu | 201 Created |
132 | 3 | Adrian Georgescu | etag: "f8c47352d61b5b256ee80d964e03efd6" |
133 | 3 | Adrian Georgescu | content-type: application/resource-lists+xml |
134 | 3 | Adrian Georgescu | }}} |
135 | 3 | Adrian Georgescu | |
136 | 3 | Adrian Georgescu | === GET === |
137 | 3 | Adrian Georgescu | |
138 | 3 | Adrian Georgescu | {{{ |
139 | 3 | Adrian Georgescu | adigeo@ag-imac3:~$xcapclient -a alice --app resource-lists GET |
140 | 3 | Adrian Georgescu | get https://xcap.sipthor.net/xcap-root/resource-lists/users/sip:alice@example.com/index |
141 | 3 | Adrian Georgescu | etag: "f8c47352d61b5b256ee80d964e03efd6" |
142 | 3 | Adrian Georgescu | content-type: application/resource-lists+xml |
143 | 3 | Adrian Georgescu | content-length: 991 |
144 | 3 | Adrian Georgescu | <?xml version="1.0" encoding="UTF-8"?> |
145 | 3 | Adrian Georgescu | <resource-lists xmlns="urn:ietf:params:xml:ns:resource-lists" |
146 | 3 | Adrian Georgescu | xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> |
147 | 3 | Adrian Georgescu | <list name="friends"> |
148 | 3 | Adrian Georgescu | <entry uri="sip:bill@example.com"> |
149 | 3 | Adrian Georgescu | <display-name>Bill Doe</display-name> |
150 | 3 | Adrian Georgescu | </entry> |
151 | 3 | Adrian Georgescu | <entry-ref ref="resource-lists/users/sip:bill@example.com/index/~~/resource-lists/list%5b@name=%22list1%22%5d/entry%5b@uri=%22sip:petri@example.com%22%5d"/> |
152 | 3 | Adrian Georgescu | <list name="close-friends"> |
153 | 3 | Adrian Georgescu | <display-name>Close Friends</display-name> |
154 | 3 | Adrian Georgescu | <entry uri="sip:joe@example.com"> |
155 | 3 | Adrian Georgescu | <display-name>Joe Smith</display-name> |
156 | 3 | Adrian Georgescu | </entry> |
157 | 3 | Adrian Georgescu | <entry uri="sip:nancy@example.com"> |
158 | 3 | Adrian Georgescu | <display-name>Nancy Gross</display-name> |
159 | 3 | Adrian Georgescu | </entry> |
160 | 3 | Adrian Georgescu | <external anchor="http://xcap.example.org/resource-lists/users/sip:a@example.org/index/~~/resource-lists/list%5b@name=%22mkting%22%5d"> |
161 | 3 | Adrian Georgescu | <display-name>Marketing</display-name> |
162 | 3 | Adrian Georgescu | </external> |
163 | 3 | Adrian Georgescu | </list> |
164 | 3 | Adrian Georgescu | </list> |
165 | 3 | Adrian Georgescu | </resource-lists> |
166 | 3 | Adrian Georgescu | }}} |
167 | 3 | Adrian Georgescu | |
168 | 3 | Adrian Georgescu | === DELETE === |
169 | 3 | Adrian Georgescu | |
170 | 3 | Adrian Georgescu | {{{ |
171 | 3 | Adrian Georgescu | adigeo@ag-imac3:~$xcapclient -a alice --app resource-lists DELETE |
172 | 3 | Adrian Georgescu | delete https://xcap.sipthor.net/xcap-root/resource-lists/users/sip:alice@example.com/index |
173 | 3 | Adrian Georgescu | 200 OK |
174 | 3 | Adrian Georgescu | content-type: application/resource-lists+xml |
175 | 3 | Adrian Georgescu | adigeo@ag-imac3:~$ |
176 | 1 | Adrian Georgescu | }}} |
177 | 4 | Adrian Georgescu | |
178 | 4 | Adrian Georgescu | == RLS-services == |
179 | 4 | Adrian Georgescu | |
180 | 4 | Adrian Georgescu | === PUT === |
181 | 4 | Adrian Georgescu | |
182 | 4 | Adrian Georgescu | {{{ |
183 | 4 | Adrian Georgescu | adigeo@ag-imac3:~$xcapclient -a alice PUT -i work/python-xcaplib/examples/rls-services.xml |
184 | 4 | Adrian Georgescu | put https://xcap.sipthor.net/xcap-root/rls-services/users/sip:alice@example.com/index |
185 | 4 | Adrian Georgescu | 201 Created |
186 | 4 | Adrian Georgescu | etag: "44f5fca1b08352815ee12f1a0c32d812" |
187 | 4 | Adrian Georgescu | content-type: application/rls-services+xml |
188 | 4 | Adrian Georgescu | }}} |
189 | 4 | Adrian Georgescu | |
190 | 4 | Adrian Georgescu | === GET === |
191 | 4 | Adrian Georgescu | |
192 | 4 | Adrian Georgescu | {{{ |
193 | 4 | Adrian Georgescu | adigeo@ag-imac3:~$xcapclient -a alice --app rls-services GET |
194 | 4 | Adrian Georgescu | get https://xcap.sipthor.net/xcap-root/rls-services/users/sip:alice@example.com/index |
195 | 4 | Adrian Georgescu | etag: "44f5fca1b08352815ee12f1a0c32d812" |
196 | 4 | Adrian Georgescu | content-type: application/rls-services+xml |
197 | 4 | Adrian Georgescu | content-length: 797 |
198 | 4 | Adrian Georgescu | <?xml version="1.0" encoding="UTF-8"?> |
199 | 4 | Adrian Georgescu | <rls-services xmlns="urn:ietf:params:xml:ns:rls-services" |
200 | 4 | Adrian Georgescu | xmlns:rl="urn:ietf:params:xml:ns:resource-lists" |
201 | 4 | Adrian Georgescu | xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> |
202 | 4 | Adrian Georgescu | <service uri="sip:mybuddies@example.com"> |
203 | 4 | Adrian Georgescu | <resource-list>https://xcap.example.com/xcap-root/resource-lists/users/sip:alice@example.com/index/~~/resource-lists/list%5b@name=%22l1%22%5d</resource-list> |
204 | 4 | Adrian Georgescu | <packages> |
205 | 4 | Adrian Georgescu | <package>presence</package> |
206 | 4 | Adrian Georgescu | </packages> |
207 | 4 | Adrian Georgescu | </service> |
208 | 4 | Adrian Georgescu | <service uri="sip:marketing@example.com"> |
209 | 4 | Adrian Georgescu | <list name="marketing"> |
210 | 4 | Adrian Georgescu | <rl:entry uri="sip:joe@example.com"/> |
211 | 4 | Adrian Georgescu | <rl:entry uri="sip:sudhir@example.com"/> |
212 | 4 | Adrian Georgescu | </list> |
213 | 4 | Adrian Georgescu | <packages> |
214 | 4 | Adrian Georgescu | <package>presence</package> |
215 | 4 | Adrian Georgescu | </packages> |
216 | 4 | Adrian Georgescu | </service> |
217 | 4 | Adrian Georgescu | </rls-services> |
218 | 4 | Adrian Georgescu | }}} |
219 | 4 | Adrian Georgescu | |
220 | 4 | Adrian Georgescu | === DELETE === |
221 | 4 | Adrian Georgescu | |
222 | 4 | Adrian Georgescu | {{{ |
223 | 4 | Adrian Georgescu | adigeo@ag-imac3:~$xcapclient -a alice --app rls-services DELETE |
224 | 4 | Adrian Georgescu | delete https://xcap.sipthor.net/xcap-root/rls-services/users/sip:alice@example.com/index |
225 | 4 | Adrian Georgescu | 200 OK |
226 | 4 | Adrian Georgescu | content-type: application/rls-services+xml |
227 | 4 | Adrian Georgescu | }}} |