You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
35 lines
675 B
Python
35 lines
675 B
Python
9 months ago
|
import requests
|
||
|
|
||
|
base_url = 'http://git.deploy.in.ixiaochuan.cn'
|
||
|
token = '49b60357fc0a65639f8030c69128241d6c5cb487'
|
||
|
|
||
|
|
||
|
# 获取所有仓库
|
||
|
def get_all_repos():
|
||
|
url = base_url + f'/api/v1/user/repos?token={token}'
|
||
|
headers = {
|
||
|
"Content-Type": "application/json",
|
||
|
}
|
||
|
response = requests.get(url, headers=headers)
|
||
|
|
||
|
res = response.json()
|
||
|
|
||
|
projects = []
|
||
|
|
||
|
for i in res:
|
||
|
projects.append(i.get('id'))
|
||
|
|
||
|
return projects
|
||
|
|
||
|
|
||
|
def update_repo():
|
||
|
url = base_url + f'/api/v1/user/repos{token}'
|
||
|
response = requests.post(url)
|
||
|
|
||
|
print(response.text)
|
||
|
|
||
|
|
||
|
if __name__ == '__main__':
|
||
|
repo = "project/zy-recoff-recpool"
|
||
|
get_all_repos()
|