Re: Add new conntion with DBus API

2010-05-05 Thread Pablo Martí Gamboa
On 6 May 2010 07:39, Nguyen Canh Toan toan...@viettel.com.vn wrote:

  Hi all,



 Currently, I have a purpose of programmatically add  remove connection
 configuration through DBus interface
 org.freedesktop.NetworkManagerSettings.Connection.

 I found an API Delete() on
 org.freedesktop.NetworkManagerSettings.Connection but I can’t find what
 function stuff to create new connection.



 Did anyone experience with this issue? Could you please to share it to me?


Hi Nguyen,

you'll need to create it via gconf. A connection is represented as a dict of
dicts in DBus or a dir of dirs in gconf. As gconf lacks a create this tree
atomically command, you'll need to set the values one by one. NMSettings
will send a NewConnection signal when it decides that the profile is
created/ready.

Pablo



 Thanks,

 Toan Nguyen

 ___
 networkmanager-list mailing list
 networkmanager-list@gnome.org
 http://mail.gnome.org/mailman/listinfo/networkmanager-list




-- 
Pablo Martí
http://minimoesfuerzo.org
python -c print
'706d617267616d40676d61696c2e636f6d'.decode('hex')
___
networkmanager-list mailing list
networkmanager-list@gnome.org
http://mail.gnome.org/mailman/listinfo/networkmanager-list


Re: Add new conntion with DBus API

2010-05-05 Thread Jirka Klimes
On Thursday 06 of May 2010 07:39:07 Nguyen Canh Toan wrote:
 Hi all,
 
 
 
 Currently, I have a purpose of programmatically add  remove connection
 configuration through DBus interface
 org.freedesktop.NetworkManagerSettings.Connection.
 
 I found an API Delete() on
 org.freedesktop.NetworkManagerSettings.Connection but I can't find what
 function stuff to create new connection.
 
 
 
 Did anyone experience with this issue? Could you please to share it to me?
 
 
 
 Thanks,
 
 Toan Nguyen

You search for AddConnection() method of 
org.freedesktop.NetworkManagerSettings interface.

For a simple python example see:
http://cgit.freedesktop.org/NetworkManager/NetworkManager/tree/examples/python/add-
system-connection.py

More complex example can be found here:
http://markmail.org/message/2xfwvjqjovu4fk2j

For specification of settings parameters 
see:http://projects.gnome.org/NetworkManager/developers/settings-spec-08.html

Jirka
___
networkmanager-list mailing list
networkmanager-list@gnome.org
http://mail.gnome.org/mailman/listinfo/networkmanager-list


Re: Add new conntion with DBus API

2010-05-05 Thread Pablo Martí Gamboa
On 5 May 2010 10:53, Jirka Klimes jkli...@redhat.com wrote:

 On Thursday 06 of May 2010 07:39:07 Nguyen Canh Toan wrote:
  Hi all,
 
 
 
  Currently, I have a purpose of programmatically add  remove connection
  configuration through DBus interface
  org.freedesktop.NetworkManagerSettings.Connection.
 
  I found an API Delete() on
  org.freedesktop.NetworkManagerSettings.Connection but I can't find what
  function stuff to create new connection.
 
 
 
  Did anyone experience with this issue? Could you please to share it to
 me?
 
 
 
  Thanks,
 
  Toan Nguyen

 You search for AddConnection() method of
 org.freedesktop.NetworkManagerSettings interface.

 For a simple python example see:

 http://cgit.freedesktop.org/NetworkManager/NetworkManager/tree/examples/python/add-
 system-connection.pyhttp://cgit.freedesktop.org/NetworkManager/NetworkManager/tree/examples/python/add-%0Asystem-connection.py

 More complex example can be found here:
 http://markmail.org/message/2xfwvjqjovu4fk2j

 For specification of settings parameters
 see:
 http://projects.gnome.org/NetworkManager/developers/settings-spec-08.html


Wow, I didn't know about this one, thought that gconf was the only was to
edit the connection. When was this added?

-- 
Pablo Martí
http://minimoesfuerzo.org
python -c print '706d617267616d40676d61696c2e636f6d'.decode('hex')
___
networkmanager-list mailing list
networkmanager-list@gnome.org
http://mail.gnome.org/mailman/listinfo/networkmanager-list


Re: Add new conntion with DBus API

2010-05-05 Thread Jirka Klimes
On Wednesday 05 of May 2010 11:28:11 Pablo Martí Gamboa wrote:
 On 5 May 2010 10:53, Jirka Klimes jkli...@redhat.com wrote:
  On Thursday 06 of May 2010 07:39:07 Nguyen Canh Toan wrote:
   Hi all,
   
   
   
   Currently, I have a purpose of programmatically add  remove connection
   configuration through DBus interface
   org.freedesktop.NetworkManagerSettings.Connection.
   
   I found an API Delete() on
   org.freedesktop.NetworkManagerSettings.Connection but I can't find what
   function stuff to create new connection.
   
   
   
   Did anyone experience with this issue? Could you please to share it to
  
  me?
  
   Thanks,
   
   Toan Nguyen
  
  You search for AddConnection() method of
  org.freedesktop.NetworkManagerSettings interface.
  
  For a simple python example see:
  
  http://cgit.freedesktop.org/NetworkManager/NetworkManager/tree/examples/p
  ython/add-
  system-connection.pyhttp://cgit.freedesktop.org/NetworkManager/NetworkM
  anager/tree/examples/python/add-%0Asystem-connection.py
  
  More complex example can be found here:
  http://markmail.org/message/2xfwvjqjovu4fk2j
  
  For specification of settings parameters
  see:
  http://projects.gnome.org/NetworkManager/developers/settings-spec-08.html
 
 Wow, I didn't know about this one, thought that gconf was the only was to
 edit the connection. When was this added?

It's been there for some time now.
The commit is 0d69dfe39ef61b42b2024c7fbd8bbad9e9c6d164 from 23.7.2009.

Jirka
___
networkmanager-list mailing list
networkmanager-list@gnome.org
http://mail.gnome.org/mailman/listinfo/networkmanager-list


Re: Add new conntion with DBus API

2010-05-05 Thread Pablo Martí Gamboa
2010/5/5 Jirka Klimes jkli...@redhat.com

 On Wednesday 05 of May 2010 11:28:11 Pablo Martí Gamboa wrote:
  On 5 May 2010 10:53, Jirka Klimes jkli...@redhat.com wrote:
   On Thursday 06 of May 2010 07:39:07 Nguyen Canh Toan wrote:
Hi all,
   
   
   
Currently, I have a purpose of programmatically add  remove
 connection
configuration through DBus interface
org.freedesktop.NetworkManagerSettings.Connection.
   
I found an API Delete() on
org.freedesktop.NetworkManagerSettings.Connection but I can't find
 what
function stuff to create new connection.
   
   
   
Did anyone experience with this issue? Could you please to share it
 to
  
   me?
  
Thanks,
   
Toan Nguyen
  
   You search for AddConnection() method of
   org.freedesktop.NetworkManagerSettings interface.
  
   For a simple python example see:
  
  
 http://cgit.freedesktop.org/NetworkManager/NetworkManager/tree/examples/p
   ython/add-
   system-connection.py
 http://cgit.freedesktop.org/NetworkManager/NetworkM
   anager/tree/examples/python/add-%0Asystem-connection.py
  
   More complex example can be found here:
   http://markmail.org/message/2xfwvjqjovu4fk2j
  
   For specification of settings parameters
   see:
  
 http://projects.gnome.org/NetworkManager/developers/settings-spec-08.html
 
  Wow, I didn't know about this one, thought that gconf was the only was to
  edit the connection. When was this added?

 It's been there for some time now.
 The commit is 0d69dfe39ef61b42b2024c7fbd8bbad9e9c6d164 from 23.7.2009.


Thanks for the info!


-- 
Pablo Martí
http://minimoesfuerzo.org
python -c print '706d617267616d40676d61696c2e636f6d'.decode('hex')
___
networkmanager-list mailing list
networkmanager-list@gnome.org
http://mail.gnome.org/mailman/listinfo/networkmanager-list


RE: Add new conntion with DBus API

2010-05-05 Thread Nguyen Canh Toan
Dear Jirka,

Thank for helping me,

When I try to run add-system-connection.py without/with root privileged, it
complain with messages as follow respectively:

dbus.exceptions.DBusException:
org.freedesktop.NetworkManagerSettings.System.NotPrivileged:
org.freedesktop.network-manager-settings.system.modify
auth_admin_keep_always

dbus.exceptions.DBusException:
org.freedesktop.NetworkManagerSettings.System.NotPrivileged: Error getting
information about caller: org.freedesktop.ConsoleKit.Manager.GeneralError:
Unable to lookup session information for process '22151'

Could you please explain it to me? It's very lack of information when google
it.

Thanks,
Toan Nguyen


-Original Message-
From: Jirka Klimes [mailto:jkli...@redhat.com] 
Sent: Wednesday, May 05, 2010 1:53 AM
To: networkmanager-list@gnome.org
Cc: Nguyen Canh Toan
Subject: Re: Add new conntion with DBus API

On Thursday 06 of May 2010 07:39:07 Nguyen Canh Toan wrote:
 Hi all,
 
 
 
 Currently, I have a purpose of programmatically add  remove connection
 configuration through DBus interface
 org.freedesktop.NetworkManagerSettings.Connection.
 
 I found an API Delete() on
 org.freedesktop.NetworkManagerSettings.Connection but I can't find what
 function stuff to create new connection.
 
 
 
 Did anyone experience with this issue? Could you please to share it to me?
 
 
 
 Thanks,
 
 Toan Nguyen

You search for AddConnection() method of 
org.freedesktop.NetworkManagerSettings interface.

For a simple python example see:
http://cgit.freedesktop.org/NetworkManager/NetworkManager/tree/examples/pyth
on/add-
system-connection.py

More complex example can be found here:
http://markmail.org/message/2xfwvjqjovu4fk2j

For specification of settings parameters 
see:http://projects.gnome.org/NetworkManager/developers/settings-spec-08.htm
l

Jirka

___
networkmanager-list mailing list
networkmanager-list@gnome.org
http://mail.gnome.org/mailman/listinfo/networkmanager-list