Quantcast

How to use the python binding?

classic Classic list List threaded Threaded
11 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

How to use the python binding?

Imre Farkas
Hi,

I am trying to convert a wsmancli command to python, using the python
binding.

Here's the command which produces the correct output:
$ wsman get
http://schemas.dell.com/wbem/wscim/1/cim-schema/2/root/dcim/DCIM_ComputerSystem?CreationClassName="DCIM_ComputerSystem",Name="srv:system"
-h $HOST -P $PORT -u $USER -p $PASS -V -v -c dummy.cert

Here's the python version:
client = pywsman.Client("<a href="https://user:pass@host:port/wsman">https://user:pass@host:port/wsman")
pywsman.wsman_transport_set_verify_peer(client, False)
options = pywsman.ClientOptions()
doc = client.get(options,
'http://schemas.dell.com/wbem/wscim/1/cim-schema/2/root/dcim/DCIM_ComputerSystem?CreationClassName="DCIM_ComputerSystem",Name="srv:system"')

The code above fails generating the following output:
<?xml version="1.0" encoding="UTF-8"?>
<s:Envelope xmlns:s="http://www.w3.org/2003/05/soap-envelope"
xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/08/addressing">
   <s:Header>
 
<wsa:To>http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous</wsa:To>
 
<wsa:Action>http://schemas.xmlsoap.org/ws/2004/08/addressing/fault</wsa:Action>
 
<wsa:RelatesTo>uuid:79193a22-fa86-1a86-8002-849f0ae9f240</wsa:RelatesTo>
 
<wsa:MessageID>uuid:aa10949a-fa8a-1a8a-8062-fcc71555dbe0</wsa:MessageID>
   </s:Header>
   <s:Body>
     <s:Fault>
       <s:Code>
         <s:Value>s:Sender</s:Value>
         <s:Subcode>
           <s:Value>wsa:DestinationUnreachable</s:Value>
         </s:Subcode>
       </s:Code>
       <s:Reason>
         <s:Text xml:lang="en"/>
       </s:Reason>
     </s:Fault>
   </s:Body>
</s:Envelope>

I also tried to encode the params in the resource uri, but without much
success:
params = urllib.urlencode({'CreationClassName': '"DCIM_ComputerSystem"',
'Name': '"srv:system"'})
resource_uri =
"<a href="http://schemas.dell.com/wbem/wscim/1/cim-schema/2/root/dcim/DCIM_ComputerSystem?%s">http://schemas.dell.com/wbem/wscim/1/cim-schema/2/root/dcim/DCIM_ComputerSystem?%s"
% params
doc = client.get(options, resource_uri)

The output:
<?xml version="1.0" encoding="UTF-8"?>
<s:Envelope xmlns:s="http://www.w3.org/2003/05/soap-envelope"
xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/08/addressing"
xmlns:wsman="http://schemas.dmtf.org/wbem/wsman/1/wsman.xsd">
   <s:Header>
 
<wsa:To>http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous</wsa:To>
 
<wsa:Action>http://schemas.xmlsoap.org/ws/2004/08/addressing/fault</wsa:Action>
 
<wsa:RelatesTo>uuid:ec31d42f-fa86-1a86-8005-849f0ae9f240</wsa:RelatesTo>
 
<wsa:MessageID>uuid:1d1bc33d-fa8b-1a8b-8066-fcc71555dbe0</wsa:MessageID>
   </s:Header>
   <s:Body>
     <s:Fault>
       <s:Code>
         <s:Value>s:Sender</s:Value>
         <s:Subcode>
           <s:Value>wsa:DestinationUnreachable</s:Value>
         </s:Subcode>
       </s:Code>
       <s:Reason>
         <s:Text xml:lang="en">No route can be determined to reach the
destination role defined by the WS-Addressing To.</s:Text>
       </s:Reason>
       <s:Detail>
 
<wsman:FaultDetail>http://schemas.dmtf.org/wbem/wsman/1/wsman/faultDetail/InvalidResourceURI</wsman:FaultDetail>
       </s:Detail>
     </s:Fault>
   </s:Body>
</s:Envelope>

Can someone help me with what I am missing here? Are there any examples
of the usage of the python binding apart the few test cases at:
https://github.com/Openwsman/openwsman/tree/master/bindings/python/tests

Thanks,
Imre Farkas

------------------------------------------------------------------------------
Time is money. Stop wasting it! Get your web API in 5 minutes.
www.restlet.com/download
http://p.sf.net/sfu/restlet
_______________________________________________
Openwsman-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/openwsman-devel
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: How to use the python binding?

Klaus Kaempf
Hi Imre,

* Imre Farkas <[hidden email]> [May 29. 2014 12:14]:

> Hi,
>
> I am trying to convert a wsmancli command to python, using the python
> binding.
>
> Here's the command which produces the correct output:
> $ wsman get
> http://schemas.dell.com/wbem/wscim/1/cim-schema/2/root/dcim/DCIM_ComputerSystem?CreationClassName="DCIM_ComputerSystem",Name="srv:system"
> -h $HOST -P $PORT -u $USER -p $PASS -V -v -c dummy.cert
>
> Here's the python version:
> client = pywsman.Client("<a href="https://user:pass@host:port/wsman">https://user:pass@host:port/wsman")
> pywsman.wsman_transport_set_verify_peer(client, False)
> options = pywsman.ClientOptions()
> doc = client.get(options,
> 'http://schemas.dell.com/wbem/wscim/1/cim-schema/2/root/dcim/DCIM_ComputerSystem?CreationClassName="DCIM_ComputerSystem",Name="srv:system"')

you're mixing the resource URI with the resource selectors here. You need to
specify them separately:

  options.add_selector("CreationClassName", "DCIM_ComputerSystem")
  options.add_selector("Name", "srv:system")

  uri = 'http://schemas.dell.com/wbem/wscim/1/cim-schema/2/root/dcim/DCIM_ComputerSystem'
  oc = client.get(options, uri)

Since 'DCIM' is a known class scheme, you can also let Openwsman find
out the matching resource uri via

  uri = pywsman.epr_uri_for 'root/dcim', 'DCIM_ComputerSystem')


Hth,

Klaus
--
SUSE LINUX Products GmbH, GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer, HRB 16746 (AG Nürnberg)
Maxfeldstraße 5, 90409 Nürnberg, Germany

------------------------------------------------------------------------------
Time is money. Stop wasting it! Get your web API in 5 minutes.
www.restlet.com/download
http://p.sf.net/sfu/restlet
_______________________________________________
Openwsman-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/openwsman-devel
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: How to use the python binding?

Imre Farkas
Hi Klaus,
On 05/30/2014 12:28 PM, Klaus Kaempf wrote:

> Hi Imre,
>
> * Imre Farkas <[hidden email]> [May 29. 2014 12:14]:
>> Hi,
>>
>> I am trying to convert a wsmancli command to python, using the python
>> binding.
>>
>> Here's the command which produces the correct output:
>> $ wsman get
>> http://schemas.dell.com/wbem/wscim/1/cim-schema/2/root/dcim/DCIM_ComputerSystem?CreationClassName="DCIM_ComputerSystem",Name="srv:system"
>> -h $HOST -P $PORT -u $USER -p $PASS -V -v -c dummy.cert
>>
>> Here's the python version:
>> client = pywsman.Client("<a href="https://user:pass@host:port/wsman">https://user:pass@host:port/wsman")
>> pywsman.wsman_transport_set_verify_peer(client, False)
>> options = pywsman.ClientOptions()
>> doc = client.get(options,
>> 'http://schemas.dell.com/wbem/wscim/1/cim-schema/2/root/dcim/DCIM_ComputerSystem?CreationClassName="DCIM_ComputerSystem",Name="srv:system"')
>
> you're mixing the resource URI with the resource selectors here. You need to
> specify them separately:
>
>    options.add_selector("CreationClassName", "DCIM_ComputerSystem")
>    options.add_selector("Name", "srv:system")
>
>    uri = 'http://schemas.dell.com/wbem/wscim/1/cim-schema/2/root/dcim/DCIM_ComputerSystem'
>    oc = client.get(options, uri)
>

Thanks for the clarification! I tried adding the selectors, so now the
python snippet looks like the following:
options = pywsman.ClientOptions()
options.add_selector("CreationClassName", "DCIM_ComputerSystem")
options.add_selector("Name", "srv:system")
resource_uri =
'http://schemas.dell.com/wbem/wscim/1/cim-schema/2/root/dcim/DCIM_ComputerSystem'
doc = client.get(options, resource_uri)

Unfortunately it still fails:
<?xml version="1.0" encoding="UTF-8"?>
<s:Envelope xmlns:s="http://www.w3.org/2003/05/soap-envelope"
xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/08/addressing"
xmlns:wsman="http://schemas.dmtf.org/wbem/wsman/1/wsman.xsd">
   <s:Header>
 
<wsa:To>http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous</wsa:To>
 
<wsa:Action>http://schemas.dmtf.org/wbem/wsman/1/wsman/fault</wsa:Action>
 
<wsa:RelatesTo>uuid:494cf478-fad9-1ad9-8002-8bf1cb005452</wsa:RelatesTo>
 
<wsa:MessageID>uuid:7a614c6c-fadd-1add-806a-fcc71555dbe0</wsa:MessageID>
   </s:Header>
   <s:Body>
     <s:Fault>
       <s:Code>
         <s:Value>s:Sender</s:Value>
         <s:Subcode>
           <s:Value>wsman:InvalidParameter</s:Value>
         </s:Subcode>
       </s:Code>
       <s:Reason>
         <s:Text xml:lang="en">CMPI_RC_ERR_INVALID_PARAMETER</s:Text>
       </s:Reason>
       <s:Detail>
 
<wsman:FaultDetail>http://schemas.dmtf.org/wbem/wsman/1/wsman/faultDetail/MissingValues</wsman:FaultDetail>
       </s:Detail>
     </s:Fault>
   </s:Body>
</s:Envelope>

However, the original wsmancli command works:
$ wsman get
http://schemas.dell.com/wbem/wscim/1/cim-schema/2/root/dcim/DCIM_ComputerSystem?CreationClassName="DCIM_ComputerSystem",Name="srv:system"
-h $HOST -P $PORT -u $USER -p $PASS -V -v -c dummy.cert


> Since 'DCIM' is a known class scheme, you can also let Openwsman find
> out the matching resource uri via
>
>    uri = pywsman.epr_uri_for 'root/dcim', 'DCIM_ComputerSystem')
>

That's pretty convenient! Was it added recently? I am using 2.4.7 but I
am getting "'module' object has no attribute 'epr_uri_for'" for
import pywsman
pywsman.epr_uri_for('root/dcim', 'DCIM_ComputerSystem')

Thanks,
Imre


------------------------------------------------------------------------------
Learn Graph Databases - Download FREE O'Reilly Book
"Graph Databases" is the definitive new guide to graph databases and their
applications. Written by three acclaimed leaders in the field,
this first edition is now available. Download your free book today!
http://p.sf.net/sfu/NeoTech
_______________________________________________
Openwsman-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/openwsman-devel
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: How to use the python binding?

Klaus Kaempf
* Imre Farkas <[hidden email]> [Jun 02. 2014 14:56]:

>
> >Since 'DCIM' is a known class scheme, you can also let Openwsman find
> >out the matching resource uri via
> >
> >   uri = pywsman.epr_uri_for 'root/dcim', 'DCIM_ComputerSystem')
> >
>
> That's pretty convenient! Was it added recently? I am using 2.4.7
> but I am getting "'module' object has no attribute 'epr_uri_for'"
> for
> import pywsman
> pywsman.epr_uri_for('root/dcim', 'DCIM_ComputerSystem')

Argh, sorry, epr_uri_for is Ruby-specific.

But you can use
  pywsman.uri_prefix("DCIM_ComputerSystem")
to get the base URI, to which you need to add the CIM namespace and
the classname.

Hth,

Klaus
--
SUSE LINUX Products GmbH, GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer, HRB 16746 (AG Nürnberg)
Maxfeldstraße 5, 90409 Nürnberg, Germany

------------------------------------------------------------------------------
Learn Graph Databases - Download FREE O'Reilly Book
"Graph Databases" is the definitive new guide to graph databases and their
applications. Written by three acclaimed leaders in the field,
this first edition is now available. Download your free book today!
http://p.sf.net/sfu/NeoTech
_______________________________________________
Openwsman-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/openwsman-devel
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: How to use the python binding?

Klaus Kaempf
In reply to this post by Imre Farkas
* Imre Farkas <[hidden email]> [Jun 02. 2014 14:56]:

> However, the original wsmancli command works:
> $ wsman get http://schemas.dell.com/wbem/wscim/1/cim-schema/2/root/dcim/DCIM_ComputerSystem?CreationClassName="DCIM_ComputerSystem",Name="srv:system"
> -h $HOST -P $PORT -u $USER -p $PASS -V -v -c dummy.cert

What is the output of this command ?

Please send me the output of this command with an additional "-R"
(--print-request) parameter.

Thanks,

Klaus
--
SUSE LINUX Products GmbH, GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer, HRB 16746 (AG Nürnberg)
Maxfeldstraße 5, 90409 Nürnberg, Germany

------------------------------------------------------------------------------
Learn Graph Databases - Download FREE O'Reilly Book
"Graph Databases" is the definitive new guide to graph databases and their
applications. Written by three acclaimed leaders in the field,
this first edition is now available. Download your free book today!
http://p.sf.net/sfu/NeoTech
_______________________________________________
Openwsman-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/openwsman-devel
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: How to use the python binding?

Imre Farkas
On 06/02/2014 03:58 PM, Klaus Kaempf wrote:

> * Imre Farkas <[hidden email]> [Jun 02. 2014 14:56]:
>
>> However, the original wsmancli command works:
>> $ wsman get http://schemas.dell.com/wbem/wscim/1/cim-schema/2/root/dcim/DCIM_ComputerSystem?CreationClassName="DCIM_ComputerSystem",Name="srv:system"
>> -h $HOST -P $PORT -u $USER -p $PASS -V -v -c dummy.cert
>
> What is the output of this command ?
>
> Please send me the output of this command with an additional "-R"
> (--print-request) parameter.

$ wsman get
http://schemas.dell.com/wbem/wscim/1/cim-schema/2/root/dcim/DCIM_ComputerSystem?CreationClassName="DCIM_ComputerSystem",Name="srv:system"
-h $HOST -P $PORT -u $USER -p $PASS -V -v -c dummy.cert -R
<?xml version="1.0"?>
<s:Envelope xmlns:s="http://www.w3.org/2003/05/soap-envelope"
xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/08/addressing"
xmlns:wsman="http://schemas.dmtf.org/wbem/wsman/1/wsman.xsd">
   <s:Header>
     <wsa:Action
s:mustUnderstand="true">http://schemas.xmlsoap.org/ws/2004/09/transfer/Get</wsa:Action>
     <wsa:To s:mustUnderstand="true">https://10.1.8.213:443/wsman</wsa:To>
     <wsman:ResourceURI
s:mustUnderstand="true">http://schemas.dell.com/wbem/wscim/1/cim-schema/2/root/dcim/DCIM_ComputerSystem</wsman:ResourceURI>
     <wsa:MessageID
s:mustUnderstand="true">uuid:d7426bbd-fada-1ada-8002-849f0ae9f240</wsa:MessageID>
     <wsa:ReplyTo>
 
<wsa:Address>http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous</wsa:Address>
     </wsa:ReplyTo>
     <wsman:SelectorSet>
       <wsman:Selector Name="Name">srv:system</wsman:Selector>
       <wsman:Selector
Name="CreationClassName">DCIM_ComputerSystem</wsman:Selector>
     </wsman:SelectorSet>
   </s:Header>
   <s:Body/>
</s:Envelope>
<?xml version="1.0" encoding="UTF-8"?>
<s:Envelope xmlns:s="http://www.w3.org/2003/05/soap-envelope"
xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/08/addressing"
xmlns:n1="http://schemas.dell.com/wbem/wscim/1/cim-schema/2/DCIM_ComputerSystem">
   <s:Header>
 
<wsa:To>http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous</wsa:To>
 
<wsa:Action>http://schemas.xmlsoap.org/ws/2004/09/transfer/GetResponse</wsa:Action>
 
<wsa:RelatesTo>uuid:d7426bbd-fada-1ada-8002-849f0ae9f240</wsa:RelatesTo>
 
<wsa:MessageID>uuid:082e7de6-fadf-1adf-806f-fcc71555dbe0</wsa:MessageID>
   </s:Header>
   <s:Body>
     <n1:DCIM_ComputerSystem>
       <n1:CreationClassName>DCIM_ComputerSystem</n1:CreationClassName>
       <n1:Dedicated>0</n1:Dedicated>
       <n1:ElementName/>
       <n1:EnabledState>2</n1:EnabledState>
       <n1:HealthState>5</n1:HealthState>
       <n1:IdentifyingDescriptions>CIM:GUID</n1:IdentifyingDescriptions>
       <n1:IdentifyingDescriptions>CIM:Tag</n1:IdentifyingDescriptions>
 
<n1:IdentifyingDescriptions>DCIM:ServiceTag</n1:IdentifyingDescriptions>
       <n1:Name>srv:system</n1:Name>
       <n1:OperationalStatus>2</n1:OperationalStatus>
 
<n1:OtherIdentifyingInfo>4c4c4544-0048-5710-8057-b7c04f365831</n1:OtherIdentifyingInfo>
       <n1:OtherIdentifyingInfo>mainsystemchassis</n1:OtherIdentifyingInfo>
       <n1:OtherIdentifyingInfo>7HWW6X1</n1:OtherIdentifyingInfo>
       <n1:PrimaryStatus>1</n1:PrimaryStatus>
       <n1:RequestedState>0</n1:RequestedState>
     </n1:DCIM_ComputerSystem>
   </s:Body>
</s:Envelope>

Thanks,
Imre

------------------------------------------------------------------------------
Learn Graph Databases - Download FREE O'Reilly Book
"Graph Databases" is the definitive new guide to graph databases and their
applications. Written by three acclaimed leaders in the field,
this first edition is now available. Download your free book today!
http://p.sf.net/sfu/NeoTech
_______________________________________________
Openwsman-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/openwsman-devel
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: How to use the python binding?

Klaus Kaempf
* Imre Farkas <[hidden email]> [Jun 02. 2014 16:05]:

> On 06/02/2014 03:58 PM, Klaus Kaempf wrote:
> >* Imre Farkas <[hidden email]> [Jun 02. 2014 14:56]:
> >
> >>However, the original wsmancli command works:
> >>$ wsman get http://schemas.dell.com/wbem/wscim/1/cim-schema/2/root/dcim/DCIM_ComputerSystem?CreationClassName="DCIM_ComputerSystem",Name="srv:system"
> >>-h $HOST -P $PORT -u $USER -p $PASS -V -v -c dummy.cert
> >
> >What is the output of this command ?
> >
> >Please send me the output of this command with an additional "-R"
> >(--print-request) parameter.
>
> $ wsman get http://schemas.dell.com/wbem/wscim/1/cim-schema/2/root/dcim/DCIM_ComputerSystem?CreationClassName="DCIM_ComputerSystem",Name="srv:system"
> -h $HOST -P $PORT -u $USER -p $PASS -V -v -c dummy.cert -R
> <?xml version="1.0"?>
> <s:Envelope xmlns:s="http://www.w3.org/2003/05/soap-envelope"
> xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/08/addressing"
> xmlns:wsman="http://schemas.dmtf.org/wbem/wsman/1/wsman.xsd">

Thanks.

Now please add
  options.set_dump_request
to your Python code and send me its output.

Klaus
--
SUSE LINUX Products GmbH, GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer, HRB 16746 (AG Nürnberg)
Maxfeldstraße 5, 90409 Nürnberg, Germany

------------------------------------------------------------------------------
Learn Graph Databases - Download FREE O'Reilly Book
"Graph Databases" is the definitive new guide to graph databases and their
applications. Written by three acclaimed leaders in the field,
this first edition is now available. Download your free book today!
http://p.sf.net/sfu/NeoTech
_______________________________________________
Openwsman-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/openwsman-devel
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: How to use the python binding?

Imre Farkas
On 06/02/2014 04:09 PM, Klaus Kaempf wrote:

> * Imre Farkas <[hidden email]> [Jun 02. 2014 16:05]:
>> On 06/02/2014 03:58 PM, Klaus Kaempf wrote:
>>> * Imre Farkas <[hidden email]> [Jun 02. 2014 14:56]:
>>>
>>>> However, the original wsmancli command works:
>>>> $ wsman get http://schemas.dell.com/wbem/wscim/1/cim-schema/2/root/dcim/DCIM_ComputerSystem?CreationClassName="DCIM_ComputerSystem",Name="srv:system"
>>>> -h $HOST -P $PORT -u $USER -p $PASS -V -v -c dummy.cert
>>>
>>> What is the output of this command ?
>>>
>>> Please send me the output of this command with an additional "-R"
>>> (--print-request) parameter.
>>
>> $ wsman get http://schemas.dell.com/wbem/wscim/1/cim-schema/2/root/dcim/DCIM_ComputerSystem?CreationClassName="DCIM_ComputerSystem",Name="srv:system"
>> -h $HOST -P $PORT -u $USER -p $PASS -V -v -c dummy.cert -R
>> <?xml version="1.0"?>
>> <s:Envelope xmlns:s="http://www.w3.org/2003/05/soap-envelope"
>> xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/08/addressing"
>> xmlns:wsman="http://schemas.dmtf.org/wbem/wsman/1/wsman.xsd">
>
> Thanks.
>
> Now please add
>    options.set_dump_request
> to your Python code and send me its output.
>

Hmm, the selectors seem to be passed incorrectly:
options = pywsman.ClientOptions()
options.set_dump_request()
options.add_selector("CreationClassName", "DCIM_ComputerSystem")
options.add_selector("Name", "srv:system")
resource_uri =
'http://schemas.dell.com/wbem/wscim/1/cim-schema/2/root/dcim/DCIM_ComputerSystem'
doc = client.get(options, resource_uri)

<?xml version="1.0"?>
<s:Envelope xmlns:s="http://www.w3.org/2003/05/soap-envelope"
xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/08/addressing"
xmlns:wsman="http://schemas.dmtf.org/wbem/wsman/1/wsman.xsd">
   <s:Header>
     <wsa:Action
s:mustUnderstand="true">http://schemas.xmlsoap.org/ws/2004/09/transfer/Get</wsa:Action>
     <wsa:To s:mustUnderstand="true">https://10.2.5.14:443/wsman</wsa:To>
     <wsman:ResourceURI
s:mustUnderstand="true">http://schemas.dell.com/wbem/wscim/1/cim-schema/2/root/dcim/DCIM_ComputerSystem</wsman:ResourceURI>
     <wsa:MessageID
s:mustUnderstand="true">uuid:1cab2f56-fadb-1adb-8002-8bf1cb005452</wsa:MessageID>
     <wsa:ReplyTo>
 
<wsa:Address>http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous</wsa:Address>
     </wsa:ReplyTo>
     <wsman:SelectorSet>
       <wsman:Selector Name="Name">__i_changed</wsman:Selector>
       <wsman:Selector Name="__builtins__">resource_uri</wsman:Selector>
     </wsman:SelectorSet>
   </s:Header>
   <s:Body/>
</s:Envelope>

Thanks,
Imre

------------------------------------------------------------------------------
Learn Graph Databases - Download FREE O'Reilly Book
"Graph Databases" is the definitive new guide to graph databases and their
applications. Written by three acclaimed leaders in the field,
this first edition is now available. Download your free book today!
http://p.sf.net/sfu/NeoTech
_______________________________________________
Openwsman-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/openwsman-devel
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: How to use the python binding?

Klaus Kaempf
* Imre Farkas <[hidden email]> [Jun 02. 2014 16:24]:

> On 06/02/2014 04:09 PM, Klaus Kaempf wrote:
> >* Imre Farkas <[hidden email]> [Jun 02. 2014 16:05]:
> >>On 06/02/2014 03:58 PM, Klaus Kaempf wrote:
> >>>* Imre Farkas <[hidden email]> [Jun 02. 2014 14:56]:
> >>>
> >>>>However, the original wsmancli command works:
> >>>>$ wsman get http://schemas.dell.com/wbem/wscim/1/cim-schema/2/root/dcim/DCIM_ComputerSystem?CreationClassName="DCIM_ComputerSystem",Name="srv:system"
> >>>>-h $HOST -P $PORT -u $USER -p $PASS -V -v -c dummy.cert
> >>>
> >>>What is the output of this command ?
> >>>
> >>>Please send me the output of this command with an additional "-R"
> >>>(--print-request) parameter.
> >>
> >>$ wsman get http://schemas.dell.com/wbem/wscim/1/cim-schema/2/root/dcim/DCIM_ComputerSystem?CreationClassName="DCIM_ComputerSystem",Name="srv:system"
> >>-h $HOST -P $PORT -u $USER -p $PASS -V -v -c dummy.cert -R
> >><?xml version="1.0"?>
> >><s:Envelope xmlns:s="http://www.w3.org/2003/05/soap-envelope"
> >>xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/08/addressing"
> >>xmlns:wsman="http://schemas.dmtf.org/wbem/wsman/1/wsman.xsd">
> >
> >Thanks.
> >
> >Now please add
> >   options.set_dump_request
> >to your Python code and send me its output.
> >
>
> Hmm, the selectors seem to be passed incorrectly:

Argh, this looks like a SWIG or Python problem. Which version of SWIG
are you using ? Which version of Python ?


Klaus
--
SUSE LINUX Products GmbH, GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer, HRB 16746 (AG Nürnberg)
Maxfeldstraße 5, 90409 Nürnberg, Germany

------------------------------------------------------------------------------
Learn Graph Databases - Download FREE O'Reilly Book
"Graph Databases" is the definitive new guide to graph databases and their
applications. Written by three acclaimed leaders in the field,
this first edition is now available. Download your free book today!
http://p.sf.net/sfu/NeoTech
_______________________________________________
Openwsman-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/openwsman-devel
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: How to use the python binding?

Imre Farkas
On 06/02/2014 04:34 PM, Klaus Kaempf wrote:

> * Imre Farkas <[hidden email]> [Jun 02. 2014 16:24]:
>> On 06/02/2014 04:09 PM, Klaus Kaempf wrote:
>>> * Imre Farkas <[hidden email]> [Jun 02. 2014 16:05]:
>>>> On 06/02/2014 03:58 PM, Klaus Kaempf wrote:
>>>>> * Imre Farkas <[hidden email]> [Jun 02. 2014 14:56]:
>>>>>
>>>>>> However, the original wsmancli command works:
>>>>>> $ wsman get http://schemas.dell.com/wbem/wscim/1/cim-schema/2/root/dcim/DCIM_ComputerSystem?CreationClassName="DCIM_ComputerSystem",Name="srv:system"
>>>>>> -h $HOST -P $PORT -u $USER -p $PASS -V -v -c dummy.cert
>>>>>
>>>>> What is the output of this command ?
>>>>>
>>>>> Please send me the output of this command with an additional "-R"
>>>>> (--print-request) parameter.
>>>>
>>>> $ wsman get http://schemas.dell.com/wbem/wscim/1/cim-schema/2/root/dcim/DCIM_ComputerSystem?CreationClassName="DCIM_ComputerSystem",Name="srv:system"
>>>> -h $HOST -P $PORT -u $USER -p $PASS -V -v -c dummy.cert -R
>>>> <?xml version="1.0"?>
>>>> <s:Envelope xmlns:s="http://www.w3.org/2003/05/soap-envelope"
>>>> xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/08/addressing"
>>>> xmlns:wsman="http://schemas.dmtf.org/wbem/wsman/1/wsman.xsd">
>>>
>>> Thanks.
>>>
>>> Now please add
>>>    options.set_dump_request
>>> to your Python code and send me its output.
>>>
>>
>> Hmm, the selectors seem to be passed incorrectly:
>
> Argh, this looks like a SWIG or Python problem. Which version of SWIG
> are you using ? Which version of Python ?
>

Oh, it was because I played with it in an iPython shell. It works
perfectly with Python 2.7.5 which is great for me.

Thanks for your great help Klaus!

Imre

------------------------------------------------------------------------------
Learn Graph Databases - Download FREE O'Reilly Book
"Graph Databases" is the definitive new guide to graph databases and their
applications. Written by three acclaimed leaders in the field,
this first edition is now available. Download your free book today!
http://p.sf.net/sfu/NeoTech
_______________________________________________
Openwsman-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/openwsman-devel
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: How to use the python binding?

Klaus Kaempf
* Imre Farkas <[hidden email]> [Jun 02. 2014 17:27]:
>
> Oh, it was because I played with it in an iPython shell. It works
> perfectly with Python 2.7.5 which is great for me.

Phew ! You got me a bit nervous yesterday ;-)

Glad that it works for you now.

Klaus
--
SUSE LINUX Products GmbH, GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer, HRB 16746 (AG Nürnberg)
Maxfeldstraße 5, 90409 Nürnberg, Germany

------------------------------------------------------------------------------
Learn Graph Databases - Download FREE O'Reilly Book
"Graph Databases" is the definitive new guide to graph databases and their
applications. Written by three acclaimed leaders in the field,
this first edition is now available. Download your free book today!
http://p.sf.net/sfu/NeoTech
_______________________________________________
Openwsman-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/openwsman-devel
Loading...