bce-python-sdk 0.9.68__py3-none-any.whl → 0.9.70__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
baidubce/__init__.py CHANGED
@@ -18,7 +18,7 @@ from builtins import bytes
18
18
  from . import protocol
19
19
 
20
20
 
21
- SDK_VERSION = b'0.9.68'
21
+ SDK_VERSION = b'0.9.70'
22
22
  DEFAULT_SERVICE_DOMAIN = b'bcebos.com'
23
23
  URL_PREFIX = b'/v1'
24
24
  DEFAULT_ENCODING = 'UTF-8'
@@ -52,7 +52,6 @@ def _get_connection(protocol, host, port, connection_timeout_in_millis, proxy_ho
52
52
  _logger.debug('Using proxy host: %s, port: %d' % (proxy_host, proxy_port))
53
53
  conn = http.client.HTTPConnection(host=proxy_host, port=proxy_port,
54
54
  timeout=connection_timeout_in_millis / 1000)
55
- conn.set_tunnel(host, port)
56
55
  return conn
57
56
  return http.client.HTTPConnection(
58
57
  host=host, port=port, timeout=connection_timeout_in_millis / 1000)
@@ -8151,6 +8151,43 @@ class BccClient(bce_base_client.BceBaseClient):
8151
8151
  return self._send_request(http_methods.POST, path, json.dumps(body),
8152
8152
  params=params, config=config)
8153
8153
 
8154
+ def query_reserved_instance_price(self, spec_id, spec, offering_type, zone_name,
8155
+ scope=None, reserved_instance_count=None,
8156
+ price_time_unit=None, reserved_instance_time=None,
8157
+ purchase_num=None, client_token=None, config=None):
8158
+ """
8159
+ query_reserved_instance_price
8160
+ """
8161
+ path = b'/v2/reservedInstance/price'
8162
+ params = {
8163
+ 'interfaceName': 'apiV2_reservedInstancePrice'
8164
+ }
8165
+ if client_token is None:
8166
+ params['clientToken'] = generate_client_token()
8167
+ else:
8168
+ params['clientToken'] = client_token
8169
+
8170
+ body = {
8171
+ 'specId': spec_id,
8172
+ 'spec': spec,
8173
+ 'offeringType': offering_type,
8174
+ 'zoneName': zone_name,
8175
+ }
8176
+ if scope is not None:
8177
+ body['scope'] = scope
8178
+ if reserved_instance_count is not None:
8179
+ body['reservedInstanceCount'] = reserved_instance_count
8180
+ if price_time_unit is not None:
8181
+ body['priceTimeUnit'] = price_time_unit
8182
+ if reserved_instance_time is not None:
8183
+ body['reservedInstanceTime'] = reserved_instance_time
8184
+ if purchase_num is not None:
8185
+ body['purchaseNum'] = purchase_num
8186
+
8187
+ return self._send_request(http_methods.POST, path, json.dumps(body),
8188
+ params=params, config=config)
8189
+
8190
+
8154
8191
 
8155
8192
  def generate_client_token_by_uuid():
8156
8193
  """