maxcompute-tea-openapi 1.1.0__tar.gz → 1.2.0__tar.gz
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.
- {maxcompute_tea_openapi-1.1.0 → maxcompute_tea_openapi-1.2.0}/PKG-INFO +2 -2
- maxcompute_tea_openapi-1.2.0/maxcompute_tea_openapi/__init__.py +1 -0
- {maxcompute_tea_openapi-1.1.0 → maxcompute_tea_openapi-1.2.0}/maxcompute_tea_openapi/client.py +52 -4
- {maxcompute_tea_openapi-1.1.0 → maxcompute_tea_openapi-1.2.0}/maxcompute_tea_openapi/models.py +58 -0
- {maxcompute_tea_openapi-1.1.0 → maxcompute_tea_openapi-1.2.0}/maxcompute_tea_openapi.egg-info/PKG-INFO +2 -2
- {maxcompute_tea_openapi-1.1.0 → maxcompute_tea_openapi-1.2.0}/maxcompute_tea_openapi.egg-info/requires.txt +1 -1
- {maxcompute_tea_openapi-1.1.0 → maxcompute_tea_openapi-1.2.0}/setup.py +2 -2
- maxcompute_tea_openapi-1.1.0/maxcompute_tea_openapi/__init__.py +0 -1
- {maxcompute_tea_openapi-1.1.0 → maxcompute_tea_openapi-1.2.0}/maxcompute_tea_openapi.egg-info/SOURCES.txt +0 -0
- {maxcompute_tea_openapi-1.1.0 → maxcompute_tea_openapi-1.2.0}/maxcompute_tea_openapi.egg-info/dependency_links.txt +0 -0
- {maxcompute_tea_openapi-1.1.0 → maxcompute_tea_openapi-1.2.0}/maxcompute_tea_openapi.egg-info/top_level.txt +0 -0
- {maxcompute_tea_openapi-1.1.0 → maxcompute_tea_openapi-1.2.0}/setup.cfg +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: maxcompute_tea_openapi
|
|
3
|
-
Version: 1.
|
|
3
|
+
Version: 1.2.0
|
|
4
4
|
Summary: Alibaba Cloud MaxCompute openapi SDK Library for Python
|
|
5
5
|
Home-page: https://github.com/aliyun/aliyun-odps-openapi-sdk
|
|
6
6
|
Author: Alibaba Cloud MaxCompute Team
|
|
@@ -21,7 +21,7 @@ Classifier: Topic :: Software Development
|
|
|
21
21
|
Requires-Python: >=3.6
|
|
22
22
|
Description-Content-Type: text/markdown
|
|
23
23
|
Requires-Dist: maxcompute_tea_util<1.0.0,>=0.0.1
|
|
24
|
-
Requires-Dist: alibabacloud_tea_util<1.0.0,>=0.3.
|
|
24
|
+
Requires-Dist: alibabacloud_tea_util<1.0.0,>=0.3.14
|
|
25
25
|
Requires-Dist: alibabacloud_credentials<2.0.0,>=1.0.2
|
|
26
26
|
Dynamic: author
|
|
27
27
|
Dynamic: author-email
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
__version__ = "1.2.0"
|
{maxcompute_tea_openapi-1.1.0 → maxcompute_tea_openapi-1.2.0}/maxcompute_tea_openapi/client.py
RENAMED
|
@@ -30,6 +30,7 @@ class Client:
|
|
|
30
30
|
_headers: Dict[str, str] = None
|
|
31
31
|
_suffix: str = None
|
|
32
32
|
_global_parameters: openapi_models.GlobalParameters = None
|
|
33
|
+
_odps_endpoint: str = None
|
|
33
34
|
|
|
34
35
|
def __init__(
|
|
35
36
|
self,
|
|
@@ -75,6 +76,7 @@ class Client:
|
|
|
75
76
|
self._signature_version = config.signature_version
|
|
76
77
|
self._global_parameters = config.global_parameters
|
|
77
78
|
self._suffix = config.suffix
|
|
79
|
+
self._odps_endpoint = config.odps_endpoint
|
|
78
80
|
|
|
79
81
|
def do_request(
|
|
80
82
|
self,
|
|
@@ -123,12 +125,14 @@ class Client:
|
|
|
123
125
|
_retry_times = _retry_times + 1
|
|
124
126
|
try:
|
|
125
127
|
_request = TeaRequest()
|
|
126
|
-
_request.protocol = UtilClient.default_string(self._protocol, params.protocol)
|
|
128
|
+
_request.protocol = UtilClient.default_string(request.protocol_override, UtilClient.default_string(self._protocol, params.protocol))
|
|
127
129
|
_request.method = params.method
|
|
128
130
|
if not UtilClient.is_unset(self._suffix):
|
|
129
131
|
_request.pathname = f'/{self._suffix}{params.pathname}'
|
|
130
132
|
else:
|
|
131
133
|
_request.pathname = params.pathname
|
|
134
|
+
if not UtilClient.is_unset(request.pathname_prefix):
|
|
135
|
+
_request.pathname = f'{request.pathname_prefix}{_request.pathname}'
|
|
132
136
|
global_queries = {}
|
|
133
137
|
global_headers = {}
|
|
134
138
|
if not UtilClient.is_unset(self._global_parameters):
|
|
@@ -150,7 +154,7 @@ class Client:
|
|
|
150
154
|
request.query)
|
|
151
155
|
# endpoint is setted in product client
|
|
152
156
|
_request.headers = TeaCore.merge({
|
|
153
|
-
'host': self._endpoint,
|
|
157
|
+
'host': UtilClient.default_string(request.endpoint_override, self._endpoint),
|
|
154
158
|
'user-agent': self.get_user_agent(),
|
|
155
159
|
'x-odps-user-agent': self.get_user_agent(),
|
|
156
160
|
'Date': McUtilClient.get_api_timestamp()
|
|
@@ -301,12 +305,14 @@ class Client:
|
|
|
301
305
|
_retry_times = _retry_times + 1
|
|
302
306
|
try:
|
|
303
307
|
_request = TeaRequest()
|
|
304
|
-
_request.protocol = UtilClient.default_string(self._protocol, params.protocol)
|
|
308
|
+
_request.protocol = UtilClient.default_string(request.protocol_override, UtilClient.default_string(self._protocol, params.protocol))
|
|
305
309
|
_request.method = params.method
|
|
306
310
|
if not UtilClient.is_unset(self._suffix):
|
|
307
311
|
_request.pathname = f'/{self._suffix}{params.pathname}'
|
|
308
312
|
else:
|
|
309
313
|
_request.pathname = params.pathname
|
|
314
|
+
if not UtilClient.is_unset(request.pathname_prefix):
|
|
315
|
+
_request.pathname = f'{request.pathname_prefix}{_request.pathname}'
|
|
310
316
|
global_queries = {}
|
|
311
317
|
global_headers = {}
|
|
312
318
|
if not UtilClient.is_unset(self._global_parameters):
|
|
@@ -328,7 +334,7 @@ class Client:
|
|
|
328
334
|
request.query)
|
|
329
335
|
# endpoint is setted in product client
|
|
330
336
|
_request.headers = TeaCore.merge({
|
|
331
|
-
'host': self._endpoint,
|
|
337
|
+
'host': UtilClient.default_string(request.endpoint_override, self._endpoint),
|
|
332
338
|
'user-agent': self.get_user_agent(),
|
|
333
339
|
'x-odps-user-agent': self.get_user_agent(),
|
|
334
340
|
'Date': McUtilClient.get_api_timestamp()
|
|
@@ -512,6 +518,44 @@ class Client:
|
|
|
512
518
|
)
|
|
513
519
|
return await self.call_api_async(openapi_params, req, runtime)
|
|
514
520
|
|
|
521
|
+
def call_routing_api(self) -> openapi_models.RoutingResponse:
|
|
522
|
+
req = openapi_models.OpenApiRequest(
|
|
523
|
+
endpoint_override=self._odps_endpoint,
|
|
524
|
+
pathname_prefix='/api'
|
|
525
|
+
)
|
|
526
|
+
openapi_params = openapi_models.Params(
|
|
527
|
+
pathname='/catalogapi',
|
|
528
|
+
method='GET',
|
|
529
|
+
body_type='string'
|
|
530
|
+
)
|
|
531
|
+
return TeaCore.from_map(
|
|
532
|
+
openapi_models.RoutingResponse(),
|
|
533
|
+
self.do_request(openapi_params, req, util_models.RuntimeOptions())
|
|
534
|
+
)
|
|
535
|
+
|
|
536
|
+
async def call_routing_api_async(self) -> openapi_models.RoutingResponse:
|
|
537
|
+
req = openapi_models.OpenApiRequest(
|
|
538
|
+
endpoint_override=self._odps_endpoint,
|
|
539
|
+
pathname_prefix='/api'
|
|
540
|
+
)
|
|
541
|
+
openapi_params = openapi_models.Params(
|
|
542
|
+
pathname='/catalogapi',
|
|
543
|
+
method='GET',
|
|
544
|
+
body_type='string'
|
|
545
|
+
)
|
|
546
|
+
return TeaCore.from_map(
|
|
547
|
+
openapi_models.RoutingResponse(),
|
|
548
|
+
await self.do_request_async(openapi_params, req, util_models.RuntimeOptions())
|
|
549
|
+
)
|
|
550
|
+
|
|
551
|
+
def get_catalog_endpoint(self) -> str:
|
|
552
|
+
resp = self.call_routing_api()
|
|
553
|
+
return resp.body
|
|
554
|
+
|
|
555
|
+
async def get_catalog_endpoint_async(self) -> str:
|
|
556
|
+
resp = await self.call_routing_api_async()
|
|
557
|
+
return resp.body
|
|
558
|
+
|
|
515
559
|
def call_api(
|
|
516
560
|
self,
|
|
517
561
|
params: openapi_models.Params,
|
|
@@ -523,6 +567,8 @@ class Client:
|
|
|
523
567
|
'code': 'ParameterMissing',
|
|
524
568
|
'message': "'params' can not be unset"
|
|
525
569
|
})
|
|
570
|
+
if UtilClient.empty(self._endpoint) and not UtilClient.empty(self._odps_endpoint):
|
|
571
|
+
self._endpoint = self.get_catalog_endpoint()
|
|
526
572
|
return self.do_request(params, request, runtime)
|
|
527
573
|
|
|
528
574
|
async def call_api_async(
|
|
@@ -536,6 +582,8 @@ class Client:
|
|
|
536
582
|
'code': 'ParameterMissing',
|
|
537
583
|
'message': "'params' can not be unset"
|
|
538
584
|
})
|
|
585
|
+
if UtilClient.empty(self._endpoint) and not UtilClient.empty(self._odps_endpoint):
|
|
586
|
+
self._endpoint = await self.get_catalog_endpoint_async()
|
|
539
587
|
return await self.do_request_async(params, request, runtime)
|
|
540
588
|
|
|
541
589
|
def get_user_agent(self) -> str:
|
{maxcompute_tea_openapi-1.1.0 → maxcompute_tea_openapi-1.2.0}/maxcompute_tea_openapi/models.py
RENAMED
|
@@ -62,6 +62,7 @@ class Config(TeaModel):
|
|
|
62
62
|
suffix: str = None,
|
|
63
63
|
signature_version: str = None,
|
|
64
64
|
global_parameters: GlobalParameters = None,
|
|
65
|
+
odps_endpoint: str = None,
|
|
65
66
|
):
|
|
66
67
|
# project
|
|
67
68
|
self.project = project
|
|
@@ -97,6 +98,8 @@ class Config(TeaModel):
|
|
|
97
98
|
self.signature_version = signature_version
|
|
98
99
|
# Global Parameters
|
|
99
100
|
self.global_parameters = global_parameters
|
|
101
|
+
# ODPS endpoint, used to resolve catalog endpoint via routing API when endpoint is not set
|
|
102
|
+
self.odps_endpoint = odps_endpoint
|
|
100
103
|
|
|
101
104
|
def validate(self):
|
|
102
105
|
if self.global_parameters:
|
|
@@ -142,6 +145,8 @@ class Config(TeaModel):
|
|
|
142
145
|
result['signatureVersion'] = self.signature_version
|
|
143
146
|
if self.global_parameters is not None:
|
|
144
147
|
result['globalParameters'] = self.global_parameters.to_map()
|
|
148
|
+
if self.odps_endpoint is not None:
|
|
149
|
+
result['odpsEndpoint'] = self.odps_endpoint
|
|
145
150
|
return result
|
|
146
151
|
|
|
147
152
|
def from_map(self, m: dict = None):
|
|
@@ -181,6 +186,8 @@ class Config(TeaModel):
|
|
|
181
186
|
if m.get('globalParameters') is not None:
|
|
182
187
|
temp_model = GlobalParameters()
|
|
183
188
|
self.global_parameters = temp_model.from_map(m['globalParameters'])
|
|
189
|
+
if m.get('odpsEndpoint') is not None:
|
|
190
|
+
self.odps_endpoint = m.get('odpsEndpoint')
|
|
184
191
|
return self
|
|
185
192
|
|
|
186
193
|
|
|
@@ -269,6 +276,8 @@ class OpenApiRequest(TeaModel):
|
|
|
269
276
|
stream: BinaryIO = None,
|
|
270
277
|
host_map: Dict[str, str] = None,
|
|
271
278
|
endpoint_override: str = None,
|
|
279
|
+
pathname_prefix: str = None,
|
|
280
|
+
protocol_override: str = None,
|
|
272
281
|
):
|
|
273
282
|
self.headers = headers
|
|
274
283
|
self.query = query
|
|
@@ -276,6 +285,8 @@ class OpenApiRequest(TeaModel):
|
|
|
276
285
|
self.stream = stream
|
|
277
286
|
self.host_map = host_map
|
|
278
287
|
self.endpoint_override = endpoint_override
|
|
288
|
+
self.pathname_prefix = pathname_prefix
|
|
289
|
+
self.protocol_override = protocol_override
|
|
279
290
|
|
|
280
291
|
def validate(self):
|
|
281
292
|
pass
|
|
@@ -298,6 +309,10 @@ class OpenApiRequest(TeaModel):
|
|
|
298
309
|
result['hostMap'] = self.host_map
|
|
299
310
|
if self.endpoint_override is not None:
|
|
300
311
|
result['endpointOverride'] = self.endpoint_override
|
|
312
|
+
if self.pathname_prefix is not None:
|
|
313
|
+
result['pathnamePrefix'] = self.pathname_prefix
|
|
314
|
+
if self.protocol_override is not None:
|
|
315
|
+
result['protocolOverride'] = self.protocol_override
|
|
301
316
|
return result
|
|
302
317
|
|
|
303
318
|
def from_map(self, m: dict = None):
|
|
@@ -314,6 +329,49 @@ class OpenApiRequest(TeaModel):
|
|
|
314
329
|
self.host_map = m.get('hostMap')
|
|
315
330
|
if m.get('endpointOverride') is not None:
|
|
316
331
|
self.endpoint_override = m.get('endpointOverride')
|
|
332
|
+
if m.get('pathnamePrefix') is not None:
|
|
333
|
+
self.pathname_prefix = m.get('pathnamePrefix')
|
|
334
|
+
if m.get('protocolOverride') is not None:
|
|
335
|
+
self.protocol_override = m.get('protocolOverride')
|
|
336
|
+
return self
|
|
337
|
+
|
|
338
|
+
|
|
339
|
+
class RoutingResponse(TeaModel):
|
|
340
|
+
def __init__(
|
|
341
|
+
self,
|
|
342
|
+
body: str = None,
|
|
343
|
+
headers: Dict[str, str] = None,
|
|
344
|
+
status_code: int = None,
|
|
345
|
+
):
|
|
346
|
+
self.body = body
|
|
347
|
+
self.headers = headers
|
|
348
|
+
self.status_code = status_code
|
|
349
|
+
|
|
350
|
+
def validate(self):
|
|
351
|
+
pass
|
|
352
|
+
|
|
353
|
+
def to_map(self):
|
|
354
|
+
_map = super().to_map()
|
|
355
|
+
if _map is not None:
|
|
356
|
+
return _map
|
|
357
|
+
|
|
358
|
+
result = dict()
|
|
359
|
+
if self.body is not None:
|
|
360
|
+
result['body'] = self.body
|
|
361
|
+
if self.headers is not None:
|
|
362
|
+
result['headers'] = self.headers
|
|
363
|
+
if self.status_code is not None:
|
|
364
|
+
result['statusCode'] = self.status_code
|
|
365
|
+
return result
|
|
366
|
+
|
|
367
|
+
def from_map(self, m: dict = None):
|
|
368
|
+
m = m or dict()
|
|
369
|
+
if m.get('body') is not None:
|
|
370
|
+
self.body = m.get('body')
|
|
371
|
+
if m.get('headers') is not None:
|
|
372
|
+
self.headers = m.get('headers')
|
|
373
|
+
if m.get('statusCode') is not None:
|
|
374
|
+
self.status_code = m.get('statusCode')
|
|
317
375
|
return self
|
|
318
376
|
|
|
319
377
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: maxcompute_tea_openapi
|
|
3
|
-
Version: 1.
|
|
3
|
+
Version: 1.2.0
|
|
4
4
|
Summary: Alibaba Cloud MaxCompute openapi SDK Library for Python
|
|
5
5
|
Home-page: https://github.com/aliyun/aliyun-odps-openapi-sdk
|
|
6
6
|
Author: Alibaba Cloud MaxCompute Team
|
|
@@ -21,7 +21,7 @@ Classifier: Topic :: Software Development
|
|
|
21
21
|
Requires-Python: >=3.6
|
|
22
22
|
Description-Content-Type: text/markdown
|
|
23
23
|
Requires-Dist: maxcompute_tea_util<1.0.0,>=0.0.1
|
|
24
|
-
Requires-Dist: alibabacloud_tea_util<1.0.0,>=0.3.
|
|
24
|
+
Requires-Dist: alibabacloud_tea_util<1.0.0,>=0.3.14
|
|
25
25
|
Requires-Dist: alibabacloud_credentials<2.0.0,>=1.0.2
|
|
26
26
|
Dynamic: author
|
|
27
27
|
Dynamic: author-email
|
|
@@ -24,7 +24,7 @@ from setuptools import setup, find_packages
|
|
|
24
24
|
"""
|
|
25
25
|
setup module for maxcompute_tea_openapi.
|
|
26
26
|
|
|
27
|
-
Created on
|
|
27
|
+
Created on 26/05/2026
|
|
28
28
|
|
|
29
29
|
@author: Alibaba Cloud MaxCompute Team
|
|
30
30
|
"""
|
|
@@ -38,7 +38,7 @@ URL = "https://github.com/aliyun/aliyun-odps-openapi-sdk"
|
|
|
38
38
|
VERSION = __import__(PACKAGE).__version__
|
|
39
39
|
REQUIRES = [
|
|
40
40
|
"maxcompute_tea_util>=0.0.1, <1.0.0",
|
|
41
|
-
"alibabacloud_tea_util>=0.3.
|
|
41
|
+
"alibabacloud_tea_util>=0.3.14, <1.0.0",
|
|
42
42
|
"alibabacloud_credentials>=1.0.2, <2.0.0"
|
|
43
43
|
]
|
|
44
44
|
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
__version__ = "1.1.0"
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|