eip_group_model.py 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. # Copyright (c) 2011 X.commerce, a business unit of eBay Inc.
  2. # Copyright 2010 United States Government as represented by the
  3. # Administrator of the National Aeronautics and Space Administration.
  4. # Copyright 2011 Piston Cloud Computing, Inc.
  5. # All Rights Reserved.
  6. #
  7. # Licensed under the Apache License, Version 2.0 (the "License"); you may
  8. # not use this file except in compliance with the License. You may obtain
  9. # a copy of the License at
  10. #
  11. # http://www.apache.org/licenses/LICENSE-2.0
  12. #
  13. # Unless required by applicable law or agreed to in writing, software
  14. # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
  15. # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
  16. # License for the specific language governing permissions and limitations
  17. # under the License.
  18. """
  19. This module provides models for EIP group SDK.
  20. """
  21. class Billing(object):
  22. """
  23. This class define billing.
  24. param: paymentTiming:
  25. The pay time of the payment,
  26. see more detail in https://bce.baidu.com/doc/BCC/API.html#Billing
  27. param: billingMethod:
  28. The charge mode, only used for Postpaid.
  29. available values are 'ByTraffic' and 'ByBandwidth'
  30. param: reservationLength:
  31. The duration to buy in specified time unit,
  32. available values are [1,2,3,4,5,6,7,8,9,12,24,36] now.
  33. param: reservationTimeUnit:
  34. The time unit to specify the duration ,only "Month" can be used now.
  35. """
  36. def __init__(self, paymentTiming=None, billingMethod=None,
  37. reservationLength=1, reservationTimeUnit='Month'):
  38. if paymentTiming:
  39. self.paymentTiming = paymentTiming
  40. if billingMethod:
  41. self.billingMethod = billingMethod
  42. self.reservation = {
  43. 'reservationLength': reservationLength,
  44. 'reservationTimeUnit': reservationTimeUnit
  45. }