1#The MIT License (MIT) 2#Copyright (c) 2014 Microsoft Corporation 3 4#Permission is hereby granted, free of charge, to any person obtaining a copy 5#of this software and associated documentation files (the "Software"), to deal 6#in the Software without restriction, including without limitation the rights 7#to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8#copies of the Software, and to permit persons to whom the Software is 9#furnished to do so, subject to the following conditions: 10 11#The above copyright notice and this permission notice shall be included in all 12#copies or substantial portions of the Software. 13 14#THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15#IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16#FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17#AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18#LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19#OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 20#SOFTWARE. 21 22"""Class for retry options in the Azure Cosmos database service. 23""" 24 25class RetryOptions(object): 26 """The retry options to be applied to all requests when retrying 27 28 :ivar int MaxRetryAttemptCount: 29 Max number of retries to be performed for a request. Default value 9. 30 :ivar int FixedRetryIntervalInMilliseconds: 31 Fixed retry interval in milliseconds to wait between each retry ignoring the retryAfter returned as part of the response. 32 :ivar int MaxWaitTimeInSeconds: 33 Max wait time in seconds to wait for a request while the retries are happening. Default value 30 seconds. 34 """ 35 def __init__(self, max_retry_attempt_count = 9, fixed_retry_interval_in_milliseconds = None, max_wait_time_in_seconds = 30): 36 self._max_retry_attempt_count = max_retry_attempt_count 37 self._fixed_retry_interval_in_milliseconds = fixed_retry_interval_in_milliseconds 38 self._max_wait_time_in_seconds = max_wait_time_in_seconds 39 40 @property 41 def MaxRetryAttemptCount(self): 42 return self._max_retry_attempt_count 43 44 @property 45 def FixedRetryIntervalInMilliseconds(self): 46 return self._fixed_retry_interval_in_milliseconds 47 48 @property 49 def MaxWaitTimeInSeconds(self): 50 return self._max_wait_time_in_seconds