Xcapclient » History » Revision 2
Revision 1 (Adrian Georgescu, 10/26/2008 01:55 PM) → Revision 2/22 (Adrian Georgescu, 10/26/2008 02:02 PM)
== xcapclient == To use this script you must to have a valid [wiki:configuration_file configuration file]. === Description === 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. {{{ adigeo@ag-imac3:~$xcapclient -h xcapclient: Client for managing full or partial XML documents on XCAP servers (RFC 4825) xcapclient [OPTIONS] --app AUID ACTION [NODE-SELECTOR] ACTION is an operation to perform: get, replace, insert, put or delete. Presence of NODE-SELECTOR indicates that action is to be performed on an element or an attribute. Options: -h, --help show this help message and exit -a NAME, --account-name=NAME the account name from which to read account settings. Corresponds to section Account_NAME in the configuration file. If not supplied, the section [Account] will be read. --show-config show options from the configuration file; use together with --account-name --xcap-root=XCAP_ROOT XCAP root, e.g. https://xcap.example.com/xcap-root --sip-address=SIP_ADDRESS SIP address of the user in the form username@domain -p PASSWORD, --password=PASSWORD password to use if authentication is required. If not supplied will be asked interactively --app=AUID Application Unique ID. There's no default value; however, it may be guessed from NODE-SELECTOR or from the input file. Known apps: watchers, pidf- manipulation, rls-services, resource-lists, xcap- caps, pres-rules, test-app --filename=FILENAME -c CONTEXT, --context=CONTEXT document context, users or global; default is users for everything except xcap-caps --etag=ETAG perform a conditional operation -i INPUT_FILENAME source file for the PUT request; default is <stdin> -o OUTPUT_FILENAME output file for the body of the server response (successful or not); default is <stdout> -d, --dump print HTTP traffic to stderr }}} == Example for PUT pres-rules == {{{ adigeo@ag-imac3:~$xcapclient -a alice PUT -i work/python-xcaplib/examples/pres-rules.xml put https://xcap.sipthor.net/xcap-root/pres-rules/users/sip:alice@example.com/index 201 Created etag: "345ba7c1ce125b2ff2438c19b25b4077" content-type: application/auth-policy+xml }}} == Example for GET pres-rules == {{{ adigeo@ag-imac3:~$xcapclient -a alice --app pres-rules get get https://xcap.sipthor.net/xcap-root/pres-rules/users/sip:alice@example.com/index etag: "345ba7c1ce125b2ff2438c19b25b4077" content-type: application/auth-policy+xml content-length: 939 <?xml version="1.0" encoding="UTF-8"?> <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"> <rule id="pres_whitelist"> <conditions> <identity> <one id="sip:bob@example.com"/> <one id="sip:alice@example.com"/> <many domain="ag-projects.com"> </many> </identity> </conditions> <actions> <pr:sub-handling>allow</pr:sub-handling> </actions> <transformations> <pr:provide-services> <pr:all-services/> </pr:provide-services> <pr:provide-persons> <pr:all-persons/> </pr:provide-persons> <pr:provide-devices> <pr:all-devices/> </pr:provide-devices> <pr:provide-all-attributes/> </transformations> </rule> <rule id="pres_blacklist"> <conditions> <identity> <one id="sip:40316600024@abc.com"/> </identity> </conditions> <actions> <pr:sub-handling>block</pr:sub-handling> </actions> <transformations/> </rule> </ruleset> }}} == Example for DELETE pres-rules == {{{ adigeo@ag-imac3:~$xcapclient -a alice --app pres-rules DELETE delete https://xcap.sipthor.net/xcap-root/pres-rules/users/sip:alice@example.com/index 200 OK content-type: application/auth-policy+xml }}}