zenlayercloud-sdk-python 2.0.65__py3-none-any.whl → 2.0.68__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.
zenlayercloud/__init__.py CHANGED
@@ -1,5 +1,5 @@
1
1
  # Zenlayer.com Inc.
2
2
  # Copyright (c) 2014-2023 All Rights Reserved.
3
3
 
4
- __version__ = "2.0.065"
4
+ __version__ = "2.0.068"
5
5
 
@@ -143,6 +143,15 @@ class AbstractClient(object):
143
143
 
144
144
  @staticmethod
145
145
  def _handle_response(resp):
146
+ if resp.status == 403 and resp.header.get("cf-mitigated") == "challenge":
147
+ raise ZenlayerCloudSdkException(
148
+ code=error_code.SECURITY_CHALLENGE,
149
+ message="Request was intercepted by a security challenge (HTTP 403). "
150
+ "This is a network-layer block, not an API error. Contact support if it persists.")
151
+ if resp.status == 451:
152
+ raise ZenlayerCloudSdkException(
153
+ code=error_code.REQUEST_BLOCKED,
154
+ message="Request was blocked by a security policy (HTTP 451). Contact support to investigate.")
146
155
  resp_data = json.loads(resp.data)
147
156
  if resp.status != 200:
148
157
  code = resp_data["code"]
@@ -7,3 +7,7 @@ CREDENTIAL_MISSING_ERROR = "CREDENTIAL_VALUE_MISSING"
7
7
  SDK_INVALID_REQUEST = "SDK_INVALID_REQUEST"
8
8
 
9
9
  REQUEST_LIMIT_EXCEEDED = "REQUEST_LIMIT_EXCEEDED"
10
+
11
+ SECURITY_CHALLENGE = "SECURITY_CHALLENGE"
12
+
13
+ REQUEST_BLOCKED = "REQUEST_BLOCKED"
@@ -1,2 +0,0 @@
1
- # Zenlayer.com Inc.
2
- # Copyright (c) 2014-2023 All Rights Reserved.
@@ -806,6 +806,7 @@ class PrivateConnectEndpoint(AbstractModel):
806
806
  self.dataCenter = None
807
807
  self.vlanId = None
808
808
  self.connectivityStatus = None
809
+ self.sharedChannelId = None
809
810
 
810
811
  def _deserialize(self, params):
811
812
  self.endpointId = params.get("endpointId")
@@ -817,6 +818,7 @@ class PrivateConnectEndpoint(AbstractModel):
817
818
  self.dataCenter = DatacenterInfo(params.get("dataCenter"))
818
819
  self.vlanId = params.get("vlanId")
819
820
  self.connectivityStatus = params.get("connectivityStatus")
821
+ self.sharedChannelId = params.get("sharedChannelId")
820
822
 
821
823
 
822
824
  class DatacenterInfo(AbstractModel):
@@ -1315,6 +1317,7 @@ class CloudRouterEdgePoint(AbstractModel):
1315
1317
  self.bgpConnection = None
1316
1318
  self.staticRoutes = None
1317
1319
  self.createTime = None
1320
+ self.sharedChannelId = None
1318
1321
 
1319
1322
  def _deserialize(self, params):
1320
1323
  self.edgePointId = params.get("edgePointId")
@@ -1339,6 +1342,7 @@ class CloudRouterEdgePoint(AbstractModel):
1339
1342
  obj = IPRoute(item)
1340
1343
  self.staticRoutes.append(obj)
1341
1344
  self.createTime = params.get("createTime")
1345
+ self.sharedChannelId = params.get("sharedChannelId")
1342
1346
 
1343
1347
 
1344
1348
  class BGPConnection(AbstractModel):
File without changes