lib/ionoscloud/api_client.rb in ionoscloud-5.1.0 vs lib/ionoscloud/api_client.rb in ionoscloud-5.1.1
- old
+ new
@@ -4,11 +4,11 @@
#An enterprise-grade Infrastructure is provided as a Service (IaaS) solution that can be managed through a browser-based \"Data Center Designer\" (DCD) tool or via an easy to use API. The API allows you to perform a variety of management tasks such as spinning up additional servers, adding volumes, adjusting networking, and so forth. It is designed to allow users to leverage the same power and flexibility found within the DCD visual tool. Both tools are consistent with their concepts and lend well to making the experience smooth and intuitive.
The version of the OpenAPI document: 5.0
Generated by: https://openapi-generator.tech
-OpenAPI Generator version: 5.0.1-SNAPSHOT
+OpenAPI Generator version: 5.2.1-SNAPSHOT
=end
require 'date'
require 'json'
@@ -36,11 +36,11 @@
# Initializes the ApiClient
# @option config [Configuration] Configuration for initializing the object, default to Configuration.default
def initialize(config = Configuration.default)
@config = config
- @user_agent = "ionos-cloud-sdk-ruby/v5"
+ @user_agent = "ionos-cloud-sdk-ruby/5.1.1"
@default_headers = {
'Content-Type' => 'application/json',
'User-Agent' => @user_agent
}
end
@@ -52,10 +52,11 @@
# Call an API with given options.
#
# @return [Array<(Object, Integer, Hash)>] an array of 3 elements:
# the data deserialized from response body (could be nil), response status code and response headers.
def call_api(http_method, path, opts = {})
+
retry_count = 0
request = build_request(http_method, path, opts)
while true
retry_count += 1
@@ -70,10 +71,10 @@
backoff_time = @config.wait_time
when TooManyRequests
backoff_time = @config.wait_time
begin
backoff_time = Integer(response.headers['Retry-After'])
- rescue ArgumentError
+ rescue *[ArgumentError, TypeError]
end
else
break
end