Application Data Protection as a Service in OpenStack
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

api.py 4.2KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124
  1. # Licensed under the Apache License, Version 2.0 (the "License"); you may
  2. # not use this file except in compliance with the License. You may obtain
  3. # a copy of the License at
  4. #
  5. # http://www.apache.org/licenses/LICENSE-2.0
  6. #
  7. # Unless required by applicable law or agreed to in writing, software
  8. # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
  9. # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
  10. # License for the specific language governing permissions and limitations
  11. # under the License.
  12. """Handles all requests relating to protection service."""
  13. from karbor.db import base
  14. from karbor.services.protection import rpcapi as protection_rpcapi
  15. class API(base.Base):
  16. """API for interacting with the protection manager."""
  17. def __init__(self, db_driver=None):
  18. self.protection_rpcapi = protection_rpcapi.ProtectionAPI()
  19. super(API, self).__init__(db_driver)
  20. def restore(self, context, restore, restore_auth):
  21. return self.protection_rpcapi.restore(context, restore, restore_auth)
  22. def verification(self, context, verification):
  23. return self.protection_rpcapi.verification(context, verification)
  24. def protect(self, context, plan, checkpoint_properties):
  25. return self.protection_rpcapi.protect(context, plan,
  26. checkpoint_properties)
  27. def copy(self, context, plan):
  28. return self.protection_rpcapi.copy(context, plan)
  29. def delete(self, context, provider_id, checkpoint_id):
  30. return self.protection_rpcapi.delete(
  31. context,
  32. provider_id,
  33. checkpoint_id
  34. )
  35. def show_checkpoint(self, context, provider_id, checkpoint_id):
  36. return self.protection_rpcapi.show_checkpoint(
  37. context,
  38. provider_id,
  39. checkpoint_id
  40. )
  41. def list_checkpoints(self, context, provider_id, marker, limit,
  42. sort_keys, sort_dirs, filters, offset, all_tenants):
  43. return self.protection_rpcapi.list_checkpoints(
  44. context,
  45. provider_id,
  46. marker,
  47. limit,
  48. sort_keys,
  49. sort_dirs,
  50. filters,
  51. all_tenants
  52. )
  53. def list_protectable_types(self, context):
  54. return self.protection_rpcapi.list_protectable_types(context)
  55. def show_protectable_type(self, context, protectable_type):
  56. return self.protection_rpcapi.show_protectable_type(
  57. context,
  58. protectable_type
  59. )
  60. def list_protectable_instances(self, context, protectable_type,
  61. marker, limit, sort_keys,
  62. sort_dirs, filters, offset, parameters):
  63. return self.protection_rpcapi.list_protectable_instances(
  64. context,
  65. protectable_type,
  66. marker,
  67. limit,
  68. sort_keys,
  69. sort_dirs,
  70. filters,
  71. parameters
  72. )
  73. def list_protectable_dependents(self, context,
  74. protectable_id,
  75. protectable_type,
  76. protectable_name):
  77. return self.protection_rpcapi.list_protectable_dependents(
  78. context,
  79. protectable_id,
  80. protectable_type,
  81. protectable_name
  82. )
  83. def show_protectable_instance(self, context,
  84. protectable_type,
  85. protectable_id,
  86. parameters=None):
  87. return self.protection_rpcapi.show_protectable_instance(
  88. context,
  89. protectable_type,
  90. protectable_id,
  91. parameters=parameters
  92. )
  93. def show_provider(self, context, provider_id):
  94. return self.protection_rpcapi.show_provider(context, provider_id)
  95. def list_providers(self, context, marker, limit,
  96. sort_keys, sort_dirs, filters, offset):
  97. return self.protection_rpcapi.list_providers(
  98. context,
  99. marker,
  100. limit,
  101. sort_keys,
  102. sort_dirs,
  103. filters
  104. )