summaryrefslogtreecommitdiffstats
path: root/ipalib/plugins.py
blob: 7c1dcf91054d6325e91116487fef87df8e32a558 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
# Authors:
#   Jason Gerard DeRose <jderose@redhat.com>
#
# Copyright (C) 2008  Red Hat
# see file 'COPYING' for use and warranty information
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
# published by the Free Software Foundation; version 2 only
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA

"""
Some example plugins.
"""

import crud
import base
from run import api


# Register some methods for the 'user' object:
class user__add(crud.Add):
	pass
api.register(user__add)

class user__del(crud.Del):
	pass
api.register(user__del)

class user__mod(crud.Mod):
	pass
api.register(user__mod)

class user__find(crud.Find):
	pass
api.register(user__find)


# Register some properties for the 'user' object:
class user__firstname(base.Property):
	pass
api.register(user__firstname)

class user__lastname(base.Property):
	pass
api.register(user__lastname)

class user__lastname(base.Property):
	pass
api.register(user__lastname)


# Register some methods for the 'group' object:
class group__add(crud.Add):
	pass
api.register(group__add)

class group__del(crud.Del):
	pass
api.register(group__del)

class group__mod(crud.Mod):
	pass
api.register(group__mod)

class group__find(crud.Find):
	pass
api.register(group__find)


# Register some methods for the 'service' object
class service__add(crud.Add):
	pass
api.register(service__add)

class service__del(crud.Del):
	pass
api.register(service__del)

class service__mod(crud.Mod):
	pass
api.register(service__mod)

class service__find(crud.Find):
	pass
api.register(service__find)


# And to emphasis that the registration order doesn't matter,
# we'll register the objects last:
class group(base.Object):
	pass
api.register(group)

class service(base.Object):
	pass
api.register(service)

class user(base.Object):
	pass
api.register(user)