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.
CbrClient
✓ from g42cloudsdkcbr.v1 import CbrClient
✗ from g42cloudsdkcbr import CbrClient
CbrClient is located under the v1 submodule.
BackupResp
✓ from g42cloudsdkcbr.v1.model import BackupResp
✗ from g42cloudsdkcbr.model import BackupResp
Models are in the v1.model submodule.
Basic setup with CbrClient.
from g42cloudsdkcore.auth.credentials import BasicCredentials
from g42cloudsdkcbr.v1 import CbrClient
from g42cloudsdkcbr.v1.region import CbrRegion
ak = os.environ.get('G42_AK', '')
sk = os.environ.get('G42_SK', '')
project_id = os.environ.get('G42_PROJECT_ID', '')
credentials = BasicCredentials(ak, sk, project_id)
client = CbrClient.new_builder()\
.with_credentials(credentials)\
.with_region(CbrRegion.value_of("ap-southeast-1"))\
.build()
print(client.list_protectable([]))
Debug
Known issues
deprecatedPython 2.7 support is deprecated and will be removed in future versions.fixUpgrade to Python 3.6+.
affects: >=0.0.1b0, <=0.0.10b0
gotchaAll endpoints and region codes differ from Huawei Cloud; use G42-specific values.fixUse CbrRegion.value_of('ap-southeast-1') for G42 region. affects: all
gotchaThe SDK is in beta; breaking changes may occur between minor versions without notice.fixPin exact version in requirements.
affects: all
Errors
Common errors & fixes
AttributeError: module 'g42cloudsdkcbr' has no attribute 'CbrClient'
Incorrect import path; CbrClient is in v1 submodule.
fixUse 'from g42cloudsdkcbr.v1 import CbrClient'.
KeyError: 'region'
Using a non-G42 region string or incorrect region ID.
fixUse CbrRegion.value_of('ap-southeast-1') or another valid G42 region. Upgrade
Version history
0.0.10b0latest on PyPI · released Oct 30, 2023
Audit
Dependencies
g42cloudsdkcorerequiredCore SDK required for authentication and HTTP handling