bes_model.py 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. # Copyright 2014 Baidu, Inc.
  2. #
  3. # Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file
  4. # except in compliance with the License. You may obtain a copy of the License at
  5. #
  6. # http://www.apache.org/licenses/LICENSE-2.0
  7. #
  8. # Unless required by applicable law or agreed to in writing, software distributed under the
  9. # License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
  10. # either express or implied. See the License for the specific language governing permissions
  11. # and limitations under the License.
  12. """
  13. This module provides models for BES-SDK.
  14. """
  15. class Billing(object):
  16. """
  17. Billing Class
  18. """
  19. def __init__(self, payment_type, time):
  20. self.paymentType = payment_type
  21. self.time = time
  22. class Module(object):
  23. """
  24. Module Class
  25. """
  26. def __init__(self, type=None,
  27. instance_num=None,
  28. version=None,
  29. slot_type=None,
  30. desire_instance_num=None,
  31. disk_slot_info=None):
  32. if type is not None:
  33. self.type = type
  34. if instance_num is not None:
  35. self.instanceNum = instance_num
  36. if version is not None:
  37. self.version = version
  38. if slot_type is not None:
  39. self.slotType = slot_type
  40. if desire_instance_num is not None:
  41. self.desireInstanceNum = desire_instance_num
  42. if disk_slot_info is not None:
  43. self.diskSlotInfo = disk_slot_info.__dict__
  44. class DiskSlotInfo(object):
  45. """
  46. DiskSlotInfo class
  47. """
  48. def __init__(self, type=None, size=None, instance_num=None):
  49. if type is not None:
  50. self.type = type
  51. if size is not None:
  52. self.size = size