Skip to content

Commit bd899e1

Browse files
zhuxiaolong37huiguangjun
authored andcommitted
Change user ID to account ID
1 parent e947200 commit bd899e1

29 files changed

+71
-71
lines changed

alibabacloud_oss_v2/config.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ def __init__(
3030
user_agent: Optional[str] = None,
3131
cloud_box_id: Optional[str] = None,
3232
enable_auto_detect_cloud_box_id: Optional[bool] = None,
33-
user_id: Optional[str] = None
33+
account_id: Optional[str] = None
3434
) -> None:
3535
"""
3636
Args:
@@ -74,7 +74,7 @@ def __init__(
7474
user_agent: (str, optional): The optional user specific identifier appended to the User-Agent header.
7575
cloud_box_id: (str, optional): The cloud box id.
7676
enable_auto_detect_cloud_box_id: (bool, optional): The cloud box id is automatically extracted from endpoint.
77-
user_id: (str, optional): The user id, must be required in vectors options.
77+
account_id: (str, optional): The account id, must be required in vectors options.
7878
"""
7979
self.region = region
8080
self.endpoint = endpoint
@@ -100,7 +100,7 @@ def __init__(
100100
self.user_agent = user_agent
101101
self.cloud_box_id = cloud_box_id
102102
self.enable_auto_detect_cloud_box_id = enable_auto_detect_cloud_box_id
103-
self.user_id = user_id
103+
self.account_id = account_id
104104

105105
def load_default() -> Config:
106106
"""Using the SDK's default configuration"""

alibabacloud_oss_v2/signer/vectors_v4.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ class VectorsSignerV4(Signer):
1515
"""Signer Vectors V4
1616
"""
1717

18-
def __init__(self, user_id: str) -> None:
19-
self._user_id = user_id
18+
def __init__(self, account_id: str) -> None:
19+
self._account_id = account_id
2020

2121
def sign(self, signing_ctx: SigningContext) -> None:
2222
if signing_ctx is None:
@@ -30,9 +30,9 @@ def sign(self, signing_ctx: SigningContext) -> None:
3030
raise exceptions.ParamNullOrEmptyError(
3131
field="SigningContext.request")
3232

33-
if self._user_id is None or self._user_id == '':
33+
if self._account_id is None or self._account_id == '':
3434
raise exceptions.ParamNullOrEmptyError(
35-
field="SignerVectorsV4.user_id")
35+
field="SignerVectorsV4.account_id")
3636

3737
if signing_ctx.auth_method_query:
3838
return self._auth_query(signing_ctx)
@@ -238,7 +238,7 @@ def _calc_canonical_request(self,
238238
request = signing_ctx.request
239239

240240
# canonical uri
241-
uri = f'/acs:ossvector:{signing_ctx.region}:{self._user_id}:'
241+
uri = f'/acs:ossvector:{signing_ctx.region}:{self._account_id}:'
242242
if signing_ctx.bucket is not None:
243243
uri = uri + signing_ctx.bucket + '/'
244244
if signing_ctx.key is not None:

alibabacloud_oss_v2/vectors/client.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,9 @@ def __init__(self, config: Config, **kwargs) -> None:
3333
self._resolve_vectors_endpoint(_config)
3434
self._build_vectors_user_agent(_config)
3535
self._client = _SyncClientImpl(_config, **kwargs)
36-
self._client._options.signer = VectorsSignerV4(user_id=config.user_id)
36+
self._client._options.signer = VectorsSignerV4(account_id=config.account_id)
3737
self._client._options.endpoint_provider = endpoints.VectorsEndpointProvider(
38-
account_id=config.user_id,
38+
account_id=config.account_id,
3939
endpoint=self._client._options.endpoint
4040
)
4141

sample/vector/vector_delete_bucket.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
parser.add_argument('--region', help='The region in which the bucket is located.', required=True)
77
parser.add_argument('--bucket', help='The name of the bucket.', required=True)
88
parser.add_argument('--endpoint', help='The domain names that other services can use to access OSS')
9-
parser.add_argument('--uid', help='The user id.', required=True)
9+
parser.add_argument('--account_id', help='The account id.', required=True)
1010

1111
def main():
1212
args = parser.parse_args()
@@ -18,7 +18,7 @@ def main():
1818
cfg = oss.config.load_default()
1919
cfg.credentials_provider = credentials_provider
2020
cfg.region = args.region
21-
cfg.user_id = args.uid
21+
cfg.account_id = args.account_id
2222

2323
if args.endpoint is not None:
2424
cfg.endpoint = args.endpoint

sample/vector/vector_delete_bucket_logging.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
parser.add_argument('--region', help='The region in which the bucket is located.', required=True)
77
parser.add_argument('--bucket', help='The name of the bucket.', required=True)
88
parser.add_argument('--endpoint', help='The domain names that other services can use to access OSS')
9-
parser.add_argument('--uid', help='The user id.', required=True)
9+
parser.add_argument('--account_id', help='The account id.', required=True)
1010

1111
def main():
1212
args = parser.parse_args()
@@ -18,7 +18,7 @@ def main():
1818
cfg = oss.config.load_default()
1919
cfg.credentials_provider = credentials_provider
2020
cfg.region = args.region
21-
cfg.user_id = args.uid
21+
cfg.account_id = args.account_id
2222
if args.endpoint is not None:
2323
cfg.endpoint = args.endpoint
2424

sample/vector/vector_delete_bucket_policy.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
parser.add_argument('--region', help='The region in which the bucket is located.', required=True)
77
parser.add_argument('--bucket', help='The name of the bucket.', required=True)
88
parser.add_argument('--endpoint', help='The domain names that other services can use to access OSS')
9-
parser.add_argument('--uid', help='The user id.', required=True)
9+
parser.add_argument('--account_id', help='The account id.', required=True)
1010

1111
def main():
1212
args = parser.parse_args()
@@ -18,7 +18,7 @@ def main():
1818
cfg = oss.config.load_default()
1919
cfg.credentials_provider = credentials_provider
2020
cfg.region = args.region
21-
cfg.user_id = args.uid
21+
cfg.account_id = args.account_id
2222
if args.endpoint is not None:
2323
cfg.endpoint = args.endpoint
2424

sample/vector/vector_delete_bucket_tags.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
parser.add_argument('--region', help='The region in which the bucket is located.', required=True)
77
parser.add_argument('--bucket', help='The name of the bucket.', required=True)
88
parser.add_argument('--endpoint', help='The domain names that other services can use to access OSS')
9-
parser.add_argument('--uid', help='The user id.', required=True)
9+
parser.add_argument('--account_id', help='The account id.', required=True)
1010

1111
def main():
1212
args = parser.parse_args()
@@ -18,7 +18,7 @@ def main():
1818
cfg = oss.config.load_default()
1919
cfg.credentials_provider = credentials_provider
2020
cfg.region = args.region
21-
cfg.user_id = args.uid
21+
cfg.account_id = args.account_id
2222
if args.endpoint is not None:
2323
cfg.endpoint = args.endpoint
2424

sample/vector/vector_delete_vector_index.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
parser.add_argument('--bucket', help='The name of the bucket.', required=True)
88
parser.add_argument('--endpoint', help='The domain names that other services can use to access OSS')
99
parser.add_argument('--index_name', help='The name of the vector index.', required=True)
10-
parser.add_argument('--uid', help='The user id.', required=True)
10+
parser.add_argument('--account_id', help='The account id.', required=True)
1111

1212
def main():
1313
args = parser.parse_args()
@@ -19,7 +19,7 @@ def main():
1919
cfg = oss.config.load_default()
2020
cfg.credentials_provider = credentials_provider
2121
cfg.region = args.region
22-
cfg.user_id = args.uid
22+
cfg.account_id = args.account_id
2323
if args.endpoint is not None:
2424
cfg.endpoint = args.endpoint
2525

sample/vector/vector_delete_vectors.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
parser.add_argument('--bucket', help='The name of the bucket.', required=True)
88
parser.add_argument('--endpoint', help='The domain names that other services can use to access OSS')
99
parser.add_argument('--index_name', help='The name of the vector index.', required=True)
10-
parser.add_argument('--uid', help='The user id.', required=True)
10+
parser.add_argument('--account_id', help='The account id.', required=True)
1111

1212
def main():
1313
args = parser.parse_args()
@@ -19,7 +19,7 @@ def main():
1919
cfg = oss.config.load_default()
2020
cfg.credentials_provider = credentials_provider
2121
cfg.region = args.region
22-
cfg.user_id = args.uid
22+
cfg.account_id = args.account_id
2323
if args.endpoint is not None:
2424
cfg.endpoint = args.endpoint
2525

sample/vector/vector_get_bucket.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
parser.add_argument('--region', help='The region in which the bucket is located.', required=True)
77
parser.add_argument('--bucket', help='The name of the bucket.', required=True)
88
parser.add_argument('--endpoint', help='The domain names that other services can use to access OSS')
9-
parser.add_argument('--uid', help='The user id.', required=True)
9+
parser.add_argument('--account_id', help='The account id.', required=True)
1010

1111
def main():
1212
args = parser.parse_args()
@@ -18,7 +18,7 @@ def main():
1818
cfg = oss.config.load_default()
1919
cfg.credentials_provider = credentials_provider
2020
cfg.region = args.region
21-
cfg.user_id = args.uid
21+
cfg.account_id = args.account_id
2222
if args.endpoint is not None:
2323
cfg.endpoint = args.endpoint
2424

0 commit comments

Comments
 (0)