Registry / aws / alibabacloud-openplatform20191219

alibabacloud-openplatform20191219

JSON →
library2.0.0pypypi✓ verified 69d ago

The official Alibaba Cloud SDK for OpenPlatform API version 20191219, providing Python bindings to interact with Alibaba Cloud OpenPlatform services such as file upload, authorization, and more. Current version is 2.0.0, requiring Python >=3.6. Released as part of the Alibaba Cloud Python SDK ecosystem.

pip install alibabacloud-openplatform20191219
INSTALL
IMPORT
SIG · ALIBABACLOUD-OPENP
A
alibabacloud-openplatform20191219
awspythonv2.0.0
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

Client
from alibabacloud_openplatform20191219.client import Client
from alibabacloud_openplatform20191219 import Client
Direct import of Client from the package root fails; must use client submodule.
AuthorizeFileUploadRequest
from alibabacloud_openplatform20191219.models import AuthorizeFileUploadRequest
Models are in the models submodule; no common wrong import known.

Create a client, authorize a file upload for OSS. Requires valid Alibaba Cloud credentials set as environment variables.

import os from alibabacloud_openplatform20191219.client import Client from alibabacloud_openplatform20191219.models import AuthorizeFileUploadRequest from alibabacloud_tea_openapi.models import Config config = Config( access_key_id=os.environ.get('ALIBABA_CLOUD_ACCESS_KEY_ID', ''), access_key_secret=os.environ.get('ALIBABA_CLOUD_ACCESS_KEY_SECRET', ''), endpoint='openplatform.cn-shanghai.aliyuncs.com' ) client = Client(config) request = AuthorizeFileUploadRequest( product='oss', region_id='cn-shanghai' ) try: response = client.authorize_file_upload(request) print(response.to_map()) except Exception as e: print(e)
Debug
Known issues
breakingVersion 2.0.0 changed the import structure. Previously, you could import Client directly from the top-level package; now you must import from the 'client' submodule.
fix
Change 'from alibabacloud_openplatform20191219 import Client' to 'from alibabacloud_openplatform20191219.client import Client'.
affects: 1.x -> 2.0.0
gotchaEndpoint configuration is required and varies by region. Using the wrong endpoint leads to connection errors.
fix
Set the endpoint to the correct regional endpoint (e.g., 'openplatform.cn-shanghai.aliyuncs.com') in the Config.
affects: all
deprecatedThe old way of passing credentials directly in the constructor (using `access_key_id` etc.) is still supported but deprecated. Prefer using a Credential client from alibabacloud_credentials.
fix
Use `from alibabacloud_credentials.client import Client as CredClient` and pass the credential client to Config.
affects: 2.0.0+
Errors
Common errors & fixes
AttributeError: module 'alibabacloud_openplatform20191219' has no attribute 'Client'
Importing Client from the top-level package (wrong import path).
fix
Use 'from alibabacloud_openplatform20191219.client import Client'.
TeaException: RegionId is mandatory. Can not be empty.
Missing or incorrect region_id in request parameters.
fix
Ensure region_id is set in the request, e.g., AuthorizeFileUploadRequest(region_id='cn-shanghai').
Upgrade
Version history
2.0.0latest on PyPI · released Sep 21, 2022
Audit
Dependencies
alibabacloud_credentialsoptionalUsed for authentication (AccessKey, STS, etc.)
alibabacloud_gateway_spioptionalRequired for gateway integration
Agent activity
32 hits · last 30 days
node
28
Amazon
1
Resources
alibabacloud-openplatform20191219 — pip install alibabacloud-openplatform20191219 · libregistry