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.1KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123
  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):
  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. )
  52. def list_protectable_types(self, context):
  53. return self.protection_rpcapi.list_protectable_types(context)
  54. def show_protectable_type(self, context, protectable_type):
  55. return self.protection_rpcapi.show_protectable_type(
  56. context,
  57. protectable_type
  58. )
  59. def list_protectable_instances(self, context, protectable_type,
  60. marker, limit, sort_keys,
  61. sort_dirs, filters, offset, parameters):
  62. return self.protection_rpcapi.list_protectable_instances(
  63. context,
  64. protectable_type,
  65. marker,
  66. limit,
  67. sort_keys,
  68. sort_dirs,
  69. filters,
  70. parameters
  71. )
  72. def list_protectable_dependents(self, context,
  73. protectable_id,
  74. protectable_type,
  75. protectable_name):
  76. return self.protection_rpcapi.list_protectable_dependents(
  77. context,
  78. protectable_id,
  79. protectable_type,
  80. protectable_name
  81. )
  82. def show_protectable_instance(self, context,
  83. protectable_type,
  84. protectable_id,
  85. parameters=None):
  86. return self.protection_rpcapi.show_protectable_instance(
  87. context,
  88. protectable_type,
  89. protectable_id,
  90. parameters=parameters
  91. )
  92. def show_provider(self, context, provider_id):
  93. return self.protection_rpcapi.show_provider(context, provider_id)
  94. def list_providers(self, context, marker, limit,
  95. sort_keys, sort_dirs, filters, offset):
  96. return self.protection_rpcapi.list_providers(
  97. context,
  98. marker,
  99. limit,
  100. sort_keys,
  101. sort_dirs,
  102. filters
  103. )