Skip to content

Commit 5647df4

Browse files
authored
fix api of uphost and mark region config is optional (#15)
BUGFIX: - Mark `region` config is optional - Update field `CPUSet` at the model `PHostSetSchema`
1 parent 3e42543 commit 5647df4

File tree

6 files changed

+400
-426
lines changed

6 files changed

+400
-426
lines changed

ucloud/core/client/_cfg.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
class ConfigSchema(schema.Schema):
77
fields = {
8-
"region": fields.Str(required=True),
8+
"region": fields.Str(),
99
"project_id": fields.Str(),
1010
"base_url": fields.Str(default="https://api.ucloud.cn"),
1111
"user_agent": fields.Str(),
@@ -46,7 +46,7 @@ class Config:
4646

4747
def __init__(
4848
self,
49-
region: str,
49+
region: str = None,
5050
project_id: str = None,
5151
base_url: str = "https://api.ucloud.cn",
5252
user_agent: str = None,

ucloud/core/client/_client.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,4 +130,4 @@ def _build_user_agent(self) -> str:
130130
return user_agent
131131

132132
def __repr__(self):
133-
return '<{}("{}")>'.format(self.__class__.__name__, self.config.region)
133+
return '<{}(region="{}")>'.format(self.__class__.__name__, self.config.region)

0 commit comments

Comments
 (0)