File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed
Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -36,7 +36,7 @@ def get_ark_token(region: str = "cn-beijing") -> str:
3636 session_token = cred .session_token
3737
3838 res = ve_request (
39- request_body = {"ProjectName" : "default" , "Filter" : {}},
39+ request_body = {"ProjectName" : "default" , "Filter" : {"AllowAll" : True }},
4040 header = {"X-Security-Token" : session_token },
4141 action = "ListApiKeys" ,
4242 ak = access_key ,
@@ -48,6 +48,10 @@ def get_ark_token(region: str = "cn-beijing") -> str:
4848 )
4949 try :
5050 first_api_key_id = res ["Result" ]["Items" ][0 ]["Id" ]
51+ logger .warning ("By default, VeADK fetches the first API Key in the list." )
52+ logger .info (
53+ f"Try to fetch ARK API Key with id={ first_api_key_id } , name={ res ['Result' ]['Items' ][0 ]['Name' ]} "
54+ )
5155 except KeyError :
5256 raise ValueError (f"Failed to get ARK api key list: { res } " )
5357
@@ -65,7 +69,7 @@ def get_ark_token(region: str = "cn-beijing") -> str:
6569 )
6670 try :
6771 api_key = res ["Result" ]["ApiKey" ]
68- logger .info ("Successfully fetching ARK API Key." )
72+ logger .info (f "Successfully fetched ARK API Key (starts with { api_key [: 8 ] } ) ." )
6973 return api_key
7074 except KeyError :
7175 raise ValueError (f"Failed to get ARK api key: { res } " )
You can’t perform that action at this time.
0 commit comments