-
Notifications
You must be signed in to change notification settings - Fork 0
/
requirements.txt
223 lines (165 loc) · 8.23 KB
/
requirements.txt
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
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
import mailroute
mailroute.configure(username="blabla", apikey="blabla")
Reseller resource and common actions/interface.
reseller_list = mailroute.Reseller.list() # list
reseller_list = mailroute.Reseller.list().limit(20) # list
reseller_list = mailroute.Reseller.list().offset(20) # list
reseller = mailroute.Reseller.get(id=12) # 1 instance
reseller.name = "newname"
reseller.save()
reseller = mailroute.Reseller.get(name="test") # 1 instance
reseller.name # test
reseller.delete()
reseller_list = mailroute.Reseller.search("searchstr") # list
reseller_list = mailroute.Reseller.filter(name__startswith="begin") # list
reseller_list = mailroute.Reseller.filter(name__exact="begin") # list
reseller_list = mailroute.Reseller.filter(name="begin") # list
# all list field allow ordering
reseller_list = mailroute.Reseller.filter(name="begin").order_by("-name") # list
reseller_list = mailroute.Reseller.filter(name="begin").order_by("name") # list
reseller_list = mailroute.Reseller.filter(name="begin").order_by("created_at") # list
new_reseller = mailroute.Reseller.create(name="newresl")
mailroute.Reseller.bulk_create([{'name':"r1"},{"name":"r2"}]) # mass create
mailroute.Reseller.delete([reseller1,reseller2]) # mass delete of resellers by instance of list of pk
reseller.customers # list of customers - additional api call , cached
reseller.admins # list of admins - additional api call , cached
reseller.contacts # list of contacts - additional api call , cached
reseller.branding_info # branding info instance for this reseller, api call, cached
reseller.create_admin(email, send_welcome)
reseller.delete_admin(email)
reseller.create_contact(params)
reseller.create_customer(params)
CUSTOMER RESORUCE
# crud same as reseller.
customer = mailroute.Customer.get(id=12)
# create
customer_new = mailroute.Customer.create({'name':"newresl", "customer":mailroute.Customer.get(id=12)})
customer_new = mailroute.Customer.create({'name':"newresl", "customer":"customername"}) # reference via name
customer_new = mailroute.Customer.create({'name':"newresl", "customer":3}) # reference via id
# When create references can be object or their key fields
get fields = id, name
create fields required = name, reseller
filter = name , reseller
ordering = ['name', 'created_at']
relation fields list = reseller, domains, contacts, admins
relation fields one = branding_info
customer.create_domain(params)
customer.create_contact(params)
customer.create_admin(email, send_welcome)
customer.delete_admin(email)
DOMAIN RESORUCE
get fields = id, name
filter = name , customer
create fields required = name, customer
create fields optional = hold_email, active, deliveryport, userlist_complete, outbound_enabled
ordering = ['name', 'created_at', 'active', 'hold_email' ]
relation fields list = customer (R), domain_aliases , email_accounts, mail_servers, outbound_servers, contacts, blacklist, whitelist , outbound_servers
relation fields one = policy (RU), notification_task (RU)
domain.get_quarantine() # return quarantine list
domain.move_to_customer(customer_instance) # move domain
domain.create_contact(params)
domain.create_mailserver(params)
domain.create_outbound_server(params)
domain.create_email_account(params)
domain.bulk_create_email_account([{},{}])
domain.create_alias(params)
domain.create_outbound_server("1.2.1.1")
domain.add_to_blacklist("[email protected]")
domain.add_to_whitelist("[email protected]")
DOMAINALIASRESOURCE
get fields = id,name
filter = domain
ordering = ['name', 'created_at']
create fields required = name, domain
create fields optional = active
relation fields one = domain
MAILSERVERRESOURCE
get fields = id
filter = domain
ordering = ['server', 'priority', ]
create fields required = server, domain
create fields optional = active
relation fields one = domain
POLICYDOMAINRESOURCE - ONLY RU
get fields = id
mailroute.Policy.get_default_policy() # return global default policy
relation fields one = domain
POLICYUSERRESOURCE - ONLY RU
get fields = id
relation fields one = email_account
notification_account_task.use_domain_policy()
notification_account_task.use_self_policy()
notification_account_task.is_active()
EMAILACCOUNTRESOURCE
get fields = id, localpart+domain
filter = domain, localpart
ordering = ['localpart', 'priority', 'domain', 'created_at']
create fields required = name, domain, localpart, create_opt ( choice of "generate_pwd","set_pwd")
create fields opt = password, send_welcome
relation fields one = domain , policy, notification_task , contact
relation fields list = aliases, blacklist, whitelist, quarantine
email_account.set_password("newpsswwd")
email_account.create_user(password=None, send_welcome=True)
mailroute.EmailAccount.create("[email protected]")
email_account.create_user(password=None, send_welcome=True)
mailroute.EmailAccount.create("[email protected]")
email_account.convert_to_alias()
email_account.bulk_add_alias(["alias1","alias2"])
email_account.add_alias("alias")
email_account.add_to_blacklist("[email protected]")
email_account.add_to_whitelist("[email protected]")
LOCALPARTALIASRESOURCE
get fields = id
filter = email_account
ordering = ['localpart', 'created_at', 'updated_at', ]
create fields required = email_account, localpart
relation fields one = email_account, domain
RESELLERCONTACTRESOURCE,CUSTOMERCONTACTRESOURCE,DOMAINCONTACTRESOURCE
get fields = id
filter = email, ( customer,reseller,domain)
ordering = ['first_name', 'last_name', 'email', 'is_technical', 'is_billing', 'is_emergency']
create fields required = email
create fields opt = first_name ,last_name,email, city,state, zipcode ,country, phone, address , address2 , is_technical, is_billing , is_emergency
relation fields one = ( customer,reseller,domain)
EMAILACCOUNTCONTACTRESOURCE
get fields = id
filter = email_account, email
ordering = ['first_name', 'last_name', 'email', 'is_technical', 'is_billing', 'is_emergency']
create fields required = email
create fields opt = first_name ,last_name,email, city,state, zipcode ,country, phone, address , address2 , is_technical , is_billing , is_emergency
relation fields one = email_account
OUTBOUNDSERVERRESOURCE
get fields = id
filter = domain
create fields required = server
relation fields one = domain
NOTIFICATIONDOMAINTASKRESOURCE
get fields = id
filter = domain
relation fields one = domain
NOTIFICATIONACCOUNTTASKRESOURCE
get fields = id
filter = email_account
relation fields one = email_account
notification_account_task.use_domain_notification()
notification_account_task.use_self_notification()
notification_account_task.is_active()
WBLISTRESOURCE
get fields = id
filter = domain, email_account, wb
create fields required = email, (email_account or domain), wb ( b for blacklist, w for whitelist)
relation fields one = domain, email_account
ADMINRESOURCE
get fields = id
filter = domain, email_account, wb
create fields required = email, (email_account or domain), wb ( b for blacklist, w for whitelist)
relation fields one = domain, email_account
QUARANTINERESOURCE
filter = domain, email_account , content ,rs,rid,email
ordering_dict = recipient,from_addr,spam_level,time_num,size,subject
message.whitelist_sender()
message.recover()
qlist = mailroute.Quarantine.filter(email_account=email_account_inst)
qlist.delete()
qlist.recover()
qlist.whitelist_sender(what='email',for='domain') # values for what email, domain for - domain,emailaccount.