Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions alibabacloud_oss_v2/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ def __init__(
user_agent: Optional[str] = None,
cloud_box_id: Optional[str] = None,
enable_auto_detect_cloud_box_id: Optional[bool] = None,
user_id: Optional[str] = None
account_id: Optional[str] = None
) -> None:
"""
Args:
Expand Down Expand Up @@ -74,7 +74,7 @@ def __init__(
user_agent: (str, optional): The optional user specific identifier appended to the User-Agent header.
cloud_box_id: (str, optional): The cloud box id.
enable_auto_detect_cloud_box_id: (bool, optional): The cloud box id is automatically extracted from endpoint.
user_id: (str, optional): The user id, must be required in vectors options.
account_id: (str, optional): The account id, must be required in vectors options.
"""
self.region = region
self.endpoint = endpoint
Expand All @@ -100,7 +100,7 @@ def __init__(
self.user_agent = user_agent
self.cloud_box_id = cloud_box_id
self.enable_auto_detect_cloud_box_id = enable_auto_detect_cloud_box_id
self.user_id = user_id
self.account_id = account_id

def load_default() -> Config:
"""Using the SDK's default configuration"""
Expand Down
10 changes: 5 additions & 5 deletions alibabacloud_oss_v2/signer/vectors_v4.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ class VectorsSignerV4(Signer):
"""Signer Vectors V4
"""

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

def sign(self, signing_ctx: SigningContext) -> None:
if signing_ctx is None:
Expand All @@ -30,9 +30,9 @@ def sign(self, signing_ctx: SigningContext) -> None:
raise exceptions.ParamNullOrEmptyError(
field="SigningContext.request")

if self._user_id is None or self._user_id == '':
if self._account_id is None or self._account_id == '':
raise exceptions.ParamNullOrEmptyError(
field="SignerVectorsV4.user_id")
field="SignerVectorsV4.account_id")

if signing_ctx.auth_method_query:
return self._auth_query(signing_ctx)
Expand Down Expand Up @@ -238,7 +238,7 @@ def _calc_canonical_request(self,
request = signing_ctx.request

# canonical uri
uri = f'/acs:ossvector:{signing_ctx.region}:{self._user_id}:'
uri = f'/acs:ossvector:{signing_ctx.region}:{self._account_id}:'
if signing_ctx.bucket is not None:
uri = uri + signing_ctx.bucket + '/'
if signing_ctx.key is not None:
Expand Down
4 changes: 2 additions & 2 deletions alibabacloud_oss_v2/vectors/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,9 @@ def __init__(self, config: Config, **kwargs) -> None:
self._resolve_vectors_endpoint(_config)
self._build_vectors_user_agent(_config)
self._client = _SyncClientImpl(_config, **kwargs)
self._client._options.signer = VectorsSignerV4(user_id=config.user_id)
self._client._options.signer = VectorsSignerV4(account_id=config.account_id)
self._client._options.endpoint_provider = endpoints.VectorsEndpointProvider(
account_id=config.user_id,
account_id=config.account_id,
endpoint=self._client._options.endpoint
)

Expand Down
4 changes: 2 additions & 2 deletions sample/vector/vector_delete_bucket.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
parser.add_argument('--region', help='The region in which the bucket is located.', required=True)
parser.add_argument('--bucket', help='The name of the bucket.', required=True)
parser.add_argument('--endpoint', help='The domain names that other services can use to access OSS')
parser.add_argument('--uid', help='The user id.', required=True)
parser.add_argument('--account_id', help='The account id.', required=True)

def main():
args = parser.parse_args()
Expand All @@ -18,7 +18,7 @@ def main():
cfg = oss.config.load_default()
cfg.credentials_provider = credentials_provider
cfg.region = args.region
cfg.user_id = args.uid
cfg.account_id = args.account_id

if args.endpoint is not None:
cfg.endpoint = args.endpoint
Expand Down
4 changes: 2 additions & 2 deletions sample/vector/vector_delete_bucket_logging.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
parser.add_argument('--region', help='The region in which the bucket is located.', required=True)
parser.add_argument('--bucket', help='The name of the bucket.', required=True)
parser.add_argument('--endpoint', help='The domain names that other services can use to access OSS')
parser.add_argument('--uid', help='The user id.', required=True)
parser.add_argument('--account_id', help='The account id.', required=True)

def main():
args = parser.parse_args()
Expand All @@ -18,7 +18,7 @@ def main():
cfg = oss.config.load_default()
cfg.credentials_provider = credentials_provider
cfg.region = args.region
cfg.user_id = args.uid
cfg.account_id = args.account_id
if args.endpoint is not None:
cfg.endpoint = args.endpoint

Expand Down
4 changes: 2 additions & 2 deletions sample/vector/vector_delete_bucket_policy.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
parser.add_argument('--region', help='The region in which the bucket is located.', required=True)
parser.add_argument('--bucket', help='The name of the bucket.', required=True)
parser.add_argument('--endpoint', help='The domain names that other services can use to access OSS')
parser.add_argument('--uid', help='The user id.', required=True)
parser.add_argument('--account_id', help='The account id.', required=True)

def main():
args = parser.parse_args()
Expand All @@ -18,7 +18,7 @@ def main():
cfg = oss.config.load_default()
cfg.credentials_provider = credentials_provider
cfg.region = args.region
cfg.user_id = args.uid
cfg.account_id = args.account_id
if args.endpoint is not None:
cfg.endpoint = args.endpoint

Expand Down
4 changes: 2 additions & 2 deletions sample/vector/vector_delete_bucket_tags.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
parser.add_argument('--region', help='The region in which the bucket is located.', required=True)
parser.add_argument('--bucket', help='The name of the bucket.', required=True)
parser.add_argument('--endpoint', help='The domain names that other services can use to access OSS')
parser.add_argument('--uid', help='The user id.', required=True)
parser.add_argument('--account_id', help='The account id.', required=True)

def main():
args = parser.parse_args()
Expand All @@ -18,7 +18,7 @@ def main():
cfg = oss.config.load_default()
cfg.credentials_provider = credentials_provider
cfg.region = args.region
cfg.user_id = args.uid
cfg.account_id = args.account_id
if args.endpoint is not None:
cfg.endpoint = args.endpoint

Expand Down
4 changes: 2 additions & 2 deletions sample/vector/vector_delete_vector_index.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
parser.add_argument('--bucket', help='The name of the bucket.', required=True)
parser.add_argument('--endpoint', help='The domain names that other services can use to access OSS')
parser.add_argument('--index_name', help='The name of the vector index.', required=True)
parser.add_argument('--uid', help='The user id.', required=True)
parser.add_argument('--account_id', help='The account id.', required=True)

def main():
args = parser.parse_args()
Expand All @@ -19,7 +19,7 @@ def main():
cfg = oss.config.load_default()
cfg.credentials_provider = credentials_provider
cfg.region = args.region
cfg.user_id = args.uid
cfg.account_id = args.account_id
if args.endpoint is not None:
cfg.endpoint = args.endpoint

Expand Down
4 changes: 2 additions & 2 deletions sample/vector/vector_delete_vectors.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
parser.add_argument('--bucket', help='The name of the bucket.', required=True)
parser.add_argument('--endpoint', help='The domain names that other services can use to access OSS')
parser.add_argument('--index_name', help='The name of the vector index.', required=True)
parser.add_argument('--uid', help='The user id.', required=True)
parser.add_argument('--account_id', help='The account id.', required=True)

def main():
args = parser.parse_args()
Expand All @@ -19,7 +19,7 @@ def main():
cfg = oss.config.load_default()
cfg.credentials_provider = credentials_provider
cfg.region = args.region
cfg.user_id = args.uid
cfg.account_id = args.account_id
if args.endpoint is not None:
cfg.endpoint = args.endpoint

Expand Down
4 changes: 2 additions & 2 deletions sample/vector/vector_get_bucket.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
parser.add_argument('--region', help='The region in which the bucket is located.', required=True)
parser.add_argument('--bucket', help='The name of the bucket.', required=True)
parser.add_argument('--endpoint', help='The domain names that other services can use to access OSS')
parser.add_argument('--uid', help='The user id.', required=True)
parser.add_argument('--account_id', help='The account id.', required=True)

def main():
args = parser.parse_args()
Expand All @@ -18,7 +18,7 @@ def main():
cfg = oss.config.load_default()
cfg.credentials_provider = credentials_provider
cfg.region = args.region
cfg.user_id = args.uid
cfg.account_id = args.account_id
if args.endpoint is not None:
cfg.endpoint = args.endpoint

Expand Down
4 changes: 2 additions & 2 deletions sample/vector/vector_get_bucket_logging.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
parser.add_argument('--region', help='The region in which the bucket is located.', required=True)
parser.add_argument('--bucket', help='The name of the bucket.', required=True)
parser.add_argument('--endpoint', help='The domain names that other services can use to access OSS')
parser.add_argument('--uid', help='The user id.', required=True)
parser.add_argument('--account_id', help='The account id.', required=True)

def main():
args = parser.parse_args()
Expand All @@ -18,7 +18,7 @@ def main():
cfg = oss.config.load_default()
cfg.credentials_provider = credentials_provider
cfg.region = args.region
cfg.user_id = args.uid
cfg.account_id = args.account_id
if args.endpoint is not None:
cfg.endpoint = args.endpoint

Expand Down
4 changes: 2 additions & 2 deletions sample/vector/vector_get_bucket_policy.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
parser.add_argument('--region', help='The region in which the bucket is located.', required=True)
parser.add_argument('--bucket', help='The name of the bucket.', required=True)
parser.add_argument('--endpoint', help='The domain names that other services can use to access OSS')
parser.add_argument('--uid', help='The user id.', required=True)
parser.add_argument('--account_id', help='The account id.', required=True)

def main():
args = parser.parse_args()
Expand All @@ -18,7 +18,7 @@ def main():
cfg = oss.config.load_default()
cfg.credentials_provider = credentials_provider
cfg.region = args.region
cfg.user_id = args.uid
cfg.account_id = args.account_id
if args.endpoint is not None:
cfg.endpoint = args.endpoint

Expand Down
4 changes: 2 additions & 2 deletions sample/vector/vector_get_bucket_resource_group.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
parser.add_argument('--region', help='The region in which the bucket is located.', required=True)
parser.add_argument('--bucket', help='The name of the bucket.', required=True)
parser.add_argument('--endpoint', help='The domain names that other services can use to access OSS')
parser.add_argument('--uid', help='The user id.', required=True)
parser.add_argument('--account_id', help='The account id.', required=True)

def main():
args = parser.parse_args()
Expand All @@ -18,7 +18,7 @@ def main():
cfg = oss.config.load_default()
cfg.credentials_provider = credentials_provider
cfg.region = args.region
cfg.user_id = args.uid
cfg.account_id = args.account_id
if args.endpoint is not None:
cfg.endpoint = args.endpoint

Expand Down
4 changes: 2 additions & 2 deletions sample/vector/vector_get_bucket_tags.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
parser.add_argument('--region', help='The region in which the bucket is located.', required=True)
parser.add_argument('--bucket', help='The name of the bucket.', required=True)
parser.add_argument('--endpoint', help='The domain names that other services can use to access OSS')
parser.add_argument('--uid', help='The user id.', required=True)
parser.add_argument('--account_id', help='The account id.', required=True)

def main():
args = parser.parse_args()
Expand All @@ -18,7 +18,7 @@ def main():
cfg = oss.config.load_default()
cfg.credentials_provider = credentials_provider
cfg.region = args.region
cfg.user_id = args.uid
cfg.account_id = args.account_id
if args.endpoint is not None:
cfg.endpoint = args.endpoint

Expand Down
4 changes: 2 additions & 2 deletions sample/vector/vector_get_vector_index.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
parser.add_argument('--bucket', help='The name of the bucket.', required=True)
parser.add_argument('--endpoint', help='The domain names that other services can use to access OSS')
parser.add_argument('--index_name', help='The name of the vector index.', required=True)
parser.add_argument('--uid', help='The user id.', required=True)
parser.add_argument('--account_id', help='The account id.', required=True)

def main():
args = parser.parse_args()
Expand All @@ -19,7 +19,7 @@ def main():
cfg = oss.config.load_default()
cfg.credentials_provider = credentials_provider
cfg.region = args.region
cfg.user_id = args.uid
cfg.account_id = args.account_id
if args.endpoint is not None:
cfg.endpoint = args.endpoint

Expand Down
4 changes: 2 additions & 2 deletions sample/vector/vector_get_vectors.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
parser.add_argument('--bucket', help='The name of the bucket.', required=True)
parser.add_argument('--endpoint', help='The domain names that other services can use to access OSS')
parser.add_argument('--index_name', help='The name of the vector index.', required=True)
parser.add_argument('--uid', help='The user id.', required=True)
parser.add_argument('--account_id', help='The account id.', required=True)

def main():
args = parser.parse_args()
Expand All @@ -19,7 +19,7 @@ def main():
cfg = oss.config.load_default()
cfg.credentials_provider = credentials_provider
cfg.region = args.region
cfg.user_id = args.uid
cfg.account_id = args.account_id
if args.endpoint is not None:
cfg.endpoint = args.endpoint

Expand Down
4 changes: 2 additions & 2 deletions sample/vector/vector_list_buckets.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

parser.add_argument('--region', help='The region in which the bucket is located.', required=True)
parser.add_argument('--endpoint', help='The domain names that other services can use to access OSS')
parser.add_argument('--uid', help='The user id.', required=True)
parser.add_argument('--account_id', help='The account id.', required=True)

def main():

Expand All @@ -19,7 +19,7 @@ def main():
cfg = oss.config.load_default()
cfg.credentials_provider = credentials_provider
cfg.region = args.region
cfg.user_id = args.uid
cfg.account_id = args.account_id
if args.endpoint is not None:
cfg.endpoint = args.endpoint

Expand Down
4 changes: 2 additions & 2 deletions sample/vector/vector_list_vector_index.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

parser.add_argument('--region', help='The region in which the bucket is located.', required=True)
parser.add_argument('--endpoint', help='The domain names that other services can use to access OSS')
parser.add_argument('--uid', help='The user id.', required=True)
parser.add_argument('--account_id', help='The account id.', required=True)
parser.add_argument('--bucket', help='The name of the bucket.', required=True)

def main():
Expand All @@ -20,7 +20,7 @@ def main():
cfg = oss.config.load_default()
cfg.credentials_provider = credentials_provider
cfg.region = args.region
cfg.user_id = args.uid
cfg.account_id = args.account_id
if args.endpoint is not None:
cfg.endpoint = args.endpoint

Expand Down
4 changes: 2 additions & 2 deletions sample/vector/vector_list_vectors.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

parser.add_argument('--region', help='The region in which the bucket is located.', required=True)
parser.add_argument('--endpoint', help='The domain names that other services can use to access OSS')
parser.add_argument('--uid', help='The user id.', required=True)
parser.add_argument('--account_id', help='The account id.', required=True)
parser.add_argument('--bucket', help='The name of the bucket.', required=True)
parser.add_argument('--iindex_name', help='The name of the vector index.', required=True)

Expand All @@ -21,7 +21,7 @@ def main():
cfg = oss.config.load_default()
cfg.credentials_provider = credentials_provider
cfg.region = args.region
cfg.user_id = args.uid
cfg.account_id = args.account_id
if args.endpoint is not None:
cfg.endpoint = args.endpoint

Expand Down
4 changes: 2 additions & 2 deletions sample/vector/vector_put_bucket.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
parser.add_argument('--region', help='The region in which the bucket is located.', required=True)
parser.add_argument('--bucket', help='The name of the bucket.', required=True)
parser.add_argument('--endpoint', help='The domain names that other services can use to access OSS')
parser.add_argument('--uid', help='The user id.', required=True)
parser.add_argument('--account_id', help='The account id.', required=True)

def main():
args = parser.parse_args()
Expand All @@ -18,7 +18,7 @@ def main():
cfg = oss.config.load_default()
cfg.credentials_provider = credentials_provider
cfg.region = args.region
cfg.user_id = args.uid
cfg.account_id = args.account_id
if args.endpoint is not None:
cfg.endpoint = args.endpoint

Expand Down
4 changes: 2 additions & 2 deletions sample/vector/vector_put_bucket_logging.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
parser.add_argument('--region', help='The region in which the bucket is located.', required=True)
parser.add_argument('--bucket', help='The name of the bucket.', required=True)
parser.add_argument('--endpoint', help='The domain names that other services can use to access OSS')
parser.add_argument('--uid', help='The user id.', required=True)
parser.add_argument('--account_id', help='The account id.', required=True)

def main():
args = parser.parse_args()
Expand All @@ -18,7 +18,7 @@ def main():
cfg = oss.config.load_default()
cfg.credentials_provider = credentials_provider
cfg.region = args.region
cfg.user_id = args.uid
cfg.account_id = args.account_id
if args.endpoint is not None:
cfg.endpoint = args.endpoint

Expand Down
Loading