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
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
|
# Copyright 2012 Managed I.T.
#
# Author: Kiall Mac Innes <kiall@managedit.ie>
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
import abc
from designate.plugin import DriverPlugin
class Storage(DriverPlugin, metaclass=abc.ABCMeta):
"""Base class for storage plugins"""
__plugin_ns__ = 'designate.storage'
__plugin_type__ = 'storage'
@abc.abstractmethod
def create_quota(self, context, quota):
"""
Create a Quota.
:param context: RPC Context.
:param quota: Quota object with the values to be created.
"""
@abc.abstractmethod
def get_quota(self, context, quota_id):
"""
Get a Quota via ID.
:param context: RPC Context.
:param quota_id: Quota ID to get.
"""
@abc.abstractmethod
def find_quotas(self, context, criterion=None, marker=None,
limit=None, sort_key=None, sort_dir=None):
"""
Find Quotas
:param context: RPC Context.
:param criterion: Criteria to filter by.
:param marker: Resource ID from which after the requested page will
start after
:param limit: Integer limit of objects of the page size after the
marker
:param sort_key: Key from which to sort after.
:param sort_dir: Direction to sort after using sort_key.
"""
@abc.abstractmethod
def find_quota(self, context, criterion):
"""
Find a single Quota.
:param context: RPC Context.
:param criterion: Criteria to filter by.
"""
@abc.abstractmethod
def update_quota(self, context, quota):
"""
Update a Quota
:param context: RPC Context.
:param quota: Quota to update.
"""
@abc.abstractmethod
def delete_quota(self, context, quota_id):
"""
Delete a Quota via ID.
:param context: RPC Context.
:param quota_id: Delete a Quota via ID
"""
@abc.abstractmethod
def create_tld(self, context, tld):
"""
Create a TLD.
:param context: RPC Context.
:param tld: Tld object with the values to be created.
"""
@abc.abstractmethod
def get_tld(self, context, tld_id):
"""
Get a TLD via ID.
:param context: RPC Context.
:param tld_id: TLD ID to get.
"""
@abc.abstractmethod
def find_tlds(self, context, criterion=None, marker=None,
limit=None, sort_key=None, sort_dir=None):
"""
Find TLDs
:param context: RPC Context.
:param criterion: Criteria to filter by.
:param marker: Resource ID from which after the requested page will
start after
:param limit: Integer limit of objects of the page size after the
marker
:param sort_key: Key from which to sort after.
:param sort_dir: Direction to sort after using sort_key.
"""
@abc.abstractmethod
def find_tld(self, context, criterion):
"""
Find a single TLD.
:param context: RPC Context.
:param criterion: Criteria to filter by.
"""
@abc.abstractmethod
def update_tld(self, context, tld):
"""
Update a TLD
:param context: RPC Context.
:param tld: TLD to update.
"""
@abc.abstractmethod
def delete_tld(self, context, tld_id):
"""
Delete a TLD via ID.
:param context: RPC Context.
:param tld_id: Delete a TLD via ID
"""
@abc.abstractmethod
def create_tsigkey(self, context, tsigkey):
"""
Create a TSIG Key.
:param context: RPC Context.
:param tsigkey: TsigKey object with the values to be created.
"""
@abc.abstractmethod
def find_tsigkeys(self, context, criterion=None,
marker=None, limit=None, sort_key=None, sort_dir=None):
"""
Find TSIG Keys.
:param context: RPC Context.
:param criterion: Criteria to filter by.
:param marker: Resource ID from which after the requested page will
start after
:param limit: Integer limit of objects of the page size after the
marker
:param sort_key: Key from which to sort after.
:param sort_dir: Direction to sort after using sort_key.
"""
@abc.abstractmethod
def get_tsigkey(self, context, tsigkey_id):
"""
Get a TSIG Key via ID.
:param context: RPC Context.
:param tsigkey_id: Server ID to get.
"""
@abc.abstractmethod
def update_tsigkey(self, context, tsigkey):
"""
Update a TSIG Key
:param context: RPC Context.
:param tsigkey: TSIG Keyto update.
"""
@abc.abstractmethod
def delete_tsigkey(self, context, tsigkey_id):
"""
Delete a TSIG Key via ID.
:param context: RPC Context.
:param tsigkey_id: Delete a TSIG Key via ID
"""
@abc.abstractmethod
def find_tenants(self, context):
"""
Find all Tenants.
:param context: RPC Context.
"""
@abc.abstractmethod
def get_tenant(self, context, tenant_id):
"""
Get all Tenants.
:param context: RPC Context.
:param tenant_id: ID of the Tenant.
"""
@abc.abstractmethod
def count_tenants(self, context):
"""
Count tenants
:param context: RPC Context.
"""
@abc.abstractmethod
def create_zone(self, context, zone):
"""
Create a new Zone.
:param context: RPC Context.
:param zone: Zone object with the values to be created.
"""
@abc.abstractmethod
def get_zone(self, context, zone_id):
"""
Get a Zone via its ID.
:param context: RPC Context.
:param zone_id: ID of the Zone.
"""
@abc.abstractmethod
def find_zones(self, context, criterion=None, marker=None,
limit=None, sort_key=None, sort_dir=None):
"""
Find zones
:param context: RPC Context.
:param criterion: Criteria to filter by.
:param marker: Resource ID from which after the requested page will
start after
:param limit: Integer limit of objects of the page size after the
marker
:param sort_key: Key from which to sort after.
:param sort_dir: Direction to sort after using sort_key.
"""
@abc.abstractmethod
def find_zone(self, context, criterion):
"""
Find a single Zone.
:param context: RPC Context.
:param criterion: Criteria to filter by.
"""
@abc.abstractmethod
def update_zone(self, context, zone):
"""
Update a Zone
:param context: RPC Context.
:param zone: Zone object.
"""
@abc.abstractmethod
def delete_zone(self, context, zone_id):
"""
Delete a Zone
:param context: RPC Context.
:param zone_id: Zone ID to delete.
"""
@abc.abstractmethod
def purge_zone(self, context, zone):
"""
Purge a Zone
:param context: RPC Context.
:param zone: Zone to delete.
"""
@abc.abstractmethod
def count_zones(self, context, criterion=None):
"""
Count zones
:param context: RPC Context.
:param criterion: Criteria to filter by.
"""
@abc.abstractmethod
def create_recordset(self, context, zone_id, recordset):
"""
Create a recordset on a given Zone ID
:param context: RPC Context.
:param zone_id: Zone ID to create the recordset in.
:param recordset: RecordSet object with the values to be created.
"""
@abc.abstractmethod
def get_recordset(self, context, recordset_id):
"""
Get a recordset via ID
:param context: RPC Context.
:param recordset_id: RecordSet ID to get
"""
@abc.abstractmethod
def find_recordsets(self, context, criterion=None, marker=None, limit=None,
sort_key=None, sort_dir=None, force_index=False):
"""
Find RecordSets.
:param context: RPC Context.
:param criterion: Criteria to filter by.
:param marker: Resource ID from which after the requested page will
start after
:param limit: Integer limit of objects of the page size after the
marker
:param sort_key: Key from which to sort after.
:param sort_dir: Direction to sort after using sort_key.
"""
@abc.abstractmethod
def find_recordsets_axfr(self, context, criterion=None):
"""
Find RecordSets.
:param context: RPC Context.
:param criterion: Criteria to filter by.
"""
@abc.abstractmethod
def find_recordset(self, context, criterion):
"""
Find a single RecordSet.
:param context: RPC Context.
:param criterion: Criteria to filter by.
"""
@abc.abstractmethod
def update_recordset(self, context, recordset):
"""
Update a recordset
:param context: RPC Context.
:param recordset: RecordSet to update
"""
@abc.abstractmethod
def delete_recordset(self, context, recordset_id):
"""
Delete a recordset
:param context: RPC Context.
:param recordset_id: RecordSet ID to delete
"""
@abc.abstractmethod
def count_recordsets(self, context, criterion=None):
"""
Count recordsets
:param context: RPC Context.
:param criterion: Criteria to filter by.
"""
@abc.abstractmethod
def create_record(self, context, zone_id, recordset_id, record):
"""
Create a record on a given Zone ID
:param context: RPC Context.
:param zone_id: Zone ID to create the record in.
:param recordset_id: RecordSet ID to create the record in.
:param record: Record object with the values to be created.
"""
@abc.abstractmethod
def get_record(self, context, record_id):
"""
Get a record via ID
:param context: RPC Context.
:param record_id: Record ID to get
"""
@abc.abstractmethod
def find_records(self, context, criterion=None, marker=None,
limit=None, sort_key=None, sort_dir=None):
"""
Find Records.
:param context: RPC Context.
:param criterion: Criteria to filter by.
:param marker: Resource ID from which after the requested page will
start after
:param limit: Integer limit of objects of the page size after the
marker
:param sort_key: Key from which to sort after.
:param sort_dir: Direction to sort after using sort_key.
"""
@abc.abstractmethod
def find_record(self, context, criterion):
"""
Find a single Record.
:param context: RPC Context.
:param criterion: Criteria to filter by.
"""
@abc.abstractmethod
def update_record(self, context, record):
"""
Update a record
:param context: RPC Context.
:param record: Record to update
"""
@abc.abstractmethod
def delete_record(self, context, record_id):
"""
Delete a record
:param context: RPC Context.
:param record_id: Record ID to delete
"""
@abc.abstractmethod
def count_records(self, context, criterion=None):
"""
Count records
:param context: RPC Context.
:param criterion: Criteria to filter by.
"""
@abc.abstractmethod
def create_blacklist(self, context, blacklist):
"""
Create a Blacklist.
:param context: RPC Context.
:param blacklist: Blacklist object with the values to be created.
"""
@abc.abstractmethod
def get_blacklist(self, context, blacklist_id):
"""
Get a Blacklist via ID.
:param context: RPC Context.
:param blacklist_id: Blacklist ID to get.
"""
@abc.abstractmethod
def find_blacklists(self, context, criterion=None, marker=None,
limit=None, sort_key=None, sort_dir=None):
"""
Find Blacklists
:param context: RPC Context.
:param criterion: Criteria to filter by.
:param marker: Resource ID from which after the requested page will
start after
:param limit: Integer limit of objects of the page size after the
marker
:param sort_key: Key from which to sort after.
:param sort_dir: Direction to sort after using sort_key.
"""
@abc.abstractmethod
def find_blacklist(self, context, criterion):
"""
Find a single Blacklist.
:param context: RPC Context.
:param criterion: Criteria to filter by.
"""
@abc.abstractmethod
def update_blacklist(self, context, blacklist):
"""
Update a Blacklist
:param context: RPC Context.
:param blacklist: Blacklist to update.
"""
@abc.abstractmethod
def delete_blacklist(self, context, blacklist_id):
"""
Delete a Blacklist via ID.
:param context: RPC Context.
:param blacklist_id: Delete a Blacklist via ID
"""
@abc.abstractmethod
def create_pool(self, context, pool):
"""
Create a Pool.
:param context: RPC Context.
:param pool: Pool object with the values to be created.
"""
@abc.abstractmethod
def find_pools(self, context, criterion=None, marker=None,
limit=None, sort_key=None, sort_dir=None):
"""
Find all Pools
:param context: RPC Context.
:param criterion: Criteria by which to filter
:param marker: Resource ID used by paging. The next page will start
at the next resource after the marker
:param limit: Integer limit of objects on the page
:param sort_key: Key used to sort the returned list
:param sort_dir: Directions to sort after using sort_key
"""
@abc.abstractmethod
def find_pool(self, context, criterion):
"""
Find a single Pool.
:param context: RPC Context.
:param criterion: Criteria to filter by.
"""
@abc.abstractmethod
def get_pool(self, context, pool_id):
"""
Get a Pool via the id
:param context: RPC Context.
:param pool_id: The ID of the pool to get
"""
@abc.abstractmethod
def update_pool(self, context, pool):
"""
Update the specified pool
:param context: RPC Context.
:param pool: Pool to update.
"""
@abc.abstractmethod
def delete_pool(self, context, pool_id):
"""
Delete the pool with the matching id
:param context: RPC Context.
:param pool_id: The ID of the pool to be deleted
"""
@abc.abstractmethod
def create_pool_attribute(self, context, pool_id, pool_attribute):
"""
Create a PoolAttribute.
:param context: RPC Context.
:param pool_id: The ID of the pool to which the attribute belongs.
:param pool_attribute: PoolAttribute object with the values created.
"""
@abc.abstractmethod
def find_pool_attributes(self, context, criterion=None, marker=None,
limit=None, sort_key=None, sort_dir=None):
"""
Find all PoolAttributes
:param context: RPC Context
:param criterion: Criteria by which to filer
:param marker: Resource ID used by paging. The next page will start
at the next resource after the marker
:param limit: Integer limit of objects on the page
:param sort_key: Key used to sort the returned list
:param sort_dir: Directions to sort after using sort_key
"""
@abc.abstractmethod
def find_pool_attribute(self, context, criterion):
"""
Find a single PoolAttribute
:param context: RPC Context.
:param criterion: Criteria to filter by.
"""
@abc.abstractmethod
def get_pool_attribute(self, context, pool_attribute_id):
"""
Get a PoolAttribute via the ID
:param context: RPC Context.
:param pool_attribute_id: The ID of the PoolAttribute to get
"""
@abc.abstractmethod
def update_pool_attribute(self, context, pool_attribute):
"""
Update the specified pool
:param context: RPC Context.
:param pool_attribute: PoolAttribute to update
"""
@abc.abstractmethod
def delete_pool_attribute(self, context, pool_attribute_id):
"""
Delete the pool with the matching id
:param context: RPC Context.
:param pool_attribute_id: The ID of the PoolAttribute to be deleted
"""
@abc.abstractmethod
def create_zone_import(self, context, zone_import):
"""
Create a Zone Import.
:param context: RPC Context.
:param zone_import: Zone Import object with the values to be created.
"""
@abc.abstractmethod
def get_zone_import(self, context, zone_import_id):
"""
Get a Zone Import via ID.
:param context: RPC Context.
:param zone_import_id: Zone Import ID to get.
"""
@abc.abstractmethod
def find_zone_imports(self, context, criterion=None, marker=None,
limit=None, sort_key=None, sort_dir=None):
"""
Find Zone Imports
:param context: RPC Context.
:param criterion: Criteria to filter by.
:param marker: Resource ID from which after the requested page will
start after
:param limit: Integer limit of objects of the page size after the
marker
:param sort_key: Key from which to sort after.
:param sort_dir: Direction to sort after using sort_key.
"""
@abc.abstractmethod
def find_zone_import(self, context, criterion):
"""
Find a single Zone Import.
:param context: RPC Context.
:param criterion: Criteria to filter by.
"""
@abc.abstractmethod
def update_zone_import(self, context, zone_import):
"""
Update a Zone Import
:param context: RPC Context.
:param zone_import: Zone Import to update.
"""
@abc.abstractmethod
def delete_zone_import(self, context, zone_import_id):
"""
Delete a Zone Import via ID.
:param context: RPC Context.
:param zone_import_id: Delete a Zone Import via ID
"""
@abc.abstractmethod
def create_zone_export(self, context, zone_export):
"""
Create a Zone Export.
:param context: RPC Context.
:param zone_export: Zone Export object with the values to be created.
"""
@abc.abstractmethod
def get_zone_export(self, context, zone_export_id):
"""
Get a Zone Export via ID.
:param context: RPC Context.
:param zone_export_id: Zone Export ID to get.
"""
@abc.abstractmethod
def find_zone_exports(self, context, criterion=None, marker=None,
limit=None, sort_key=None, sort_dir=None):
"""
Find Zone Exports
:param context: RPC Context.
:param criterion: Criteria to filter by.
:param marker: Resource ID from which after the requested page will
start after
:param limit: Integer limit of objects of the page size after the
marker
:param sort_key: Key from which to sort after.
:param sort_dir: Direction to sort after using sort_key.
"""
@abc.abstractmethod
def find_zone_export(self, context, criterion):
"""
Find a single Zone Export.
:param context: RPC Context.
:param criterion: Criteria to filter by.
"""
@abc.abstractmethod
def update_zone_export(self, context, zone_export):
"""
Update a Zone Export
:param context: RPC Context.
:param zone_export: Zone Export to update.
"""
@abc.abstractmethod
def delete_zone_export(self, context, zone_export_id):
"""
Delete a Zone Export via ID.
:param context: RPC Context.
:param zone_export_id: Delete a Zone Export via ID
"""
@abc.abstractmethod
def find_service_statuses(self, context, criterion=None, marker=None,
limit=None, sort_key=None, sort_dir=None):
"""
Retrieve status for services
:param context: RPC Context.
:param criterion: Criteria to filter by.
:param marker: Resource ID from which after the requested page will
start after
:param limit: Integer limit of objects of the page size after the
marker
:param sort_key: Key from which to sort after.
:param sort_dir: Direction to sort after using sort_key.
"""
@abc.abstractmethod
def find_service_status(self, context, criterion):
"""
Find a single Service Status.
:param context: RPC Context.
:param criterion: Criteria to filter by.
"""
@abc.abstractmethod
def update_service_status(self, context, service_status):
"""
Update the Service status for a service.
:param context: RPC Context.
:param service_status: Set the status for a service.
"""
|