Question on existent APIs

Jelmer Vernooij jelmer at samba.org
Sat Mar 23 20:42:23 MDT 2013


Hi David,

On Thu, Mar 21, 2013 at 11:16:23AM -0800, David Paz wrote:
> I would like to  write some web/REST services to interact with samba4 from
> an external web site or application. I would like to do so with python;
> then, I was wondering if there are some api that I could use for such
> purpose, or maybe wrapping some C api with python to achieve the same.
> 
> For the time being what I want is simply be able to manipulate active
> directory users from externals applications. Achieving that will be a good
> starting point.
> 
> Does anybody has any advice or can point me to the right direction to do
> this? Any help will be greatly appreciated.
There are a few APIs available. We don't include a REST API, but there are 
a number of other options, especially if you are using Python.

Samba 4 provides an Active Directory; if you just want to do a trivial 
user change, you can probably use the 'ldb' Python module to do so over LDAP.
The LDB Python API and the LDAP schema are really stable.

We also have a fairly extensive higher-level Python API in Samba that can take
care of this for you. This should take all actual work away from you in theory,
but in practice I suspect it may not work as well yet as the first option.
Our Python APIs being what they are I suspect this would also be more prone to
breakage if things change.

Another option is to talk to the DCE/RPC server, using the Python DCE/RPC
client. I think that would probably be harder than the other two options I
mentioned; the only advantage would be that you can also use DCE/RPC client
against Windows servers, including pre-AD windows servers.

HTH,

Cheers,

Jelmer


More information about the samba-technical mailing list