mirror of
https://gitee.com/milvus-io/milvus.git
synced 2026-02-04 11:18:44 +08:00
[skip e2e] Add new func on utils (#13860)
Signed-off-by: wangting0128 <ting.wang@zilliz.com>
This commit is contained in:
parent
b256a5b98a
commit
4b54710466
@ -276,3 +276,23 @@ def get_token(url):
|
||||
token = ''
|
||||
print("Can not get token.")
|
||||
return token
|
||||
|
||||
|
||||
def get_tags(url, token):
|
||||
headers = {'Content-type': "application/json",
|
||||
"charset": "UTF-8",
|
||||
"Accept": "application/vnd.docker.distribution.manifest.v2+json",
|
||||
"Authorization": "Bearer %s" % token}
|
||||
try:
|
||||
rep = requests.get(url, headers=headers)
|
||||
data = json.loads(rep.text)
|
||||
|
||||
tags = []
|
||||
if 'tags' in data:
|
||||
tags = data["tags"]
|
||||
else:
|
||||
print("Can not get the tag list")
|
||||
return tags
|
||||
except:
|
||||
print("Can not get the tag list")
|
||||
return []
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user