Полезная нагрузка:
Код: Выделить всё
payload = {
"authorization":{"scheme":"UsernamePassword","parameters":{"username":"","password":f"{git personal access token}"}},
"data":{"accessExternalGitServer":"true"},
"name":"",
"serviceEndpointProjectReferences":[{"description":"","name":"GitLabServiceConnection","projectReference":{"id":f"{project_id}","name":f"{project_name}"}}],
"type":"git",
"url":f"{gitlab_url}",
"isShared":False,
"owner":"library"
}

Служебное соединение создано успешно. Однако когда я попытался импортировать репозиторий GitLab, используя это подключение к службе, я получил ошибку 400 Bad Request. Ниже представлена полезная нагрузка для импорта репозитория:
Код: Выделить всё
{
"parameters": {
"gitSource": {
"url": f"{gitlabURL}",
"overwrite": False},
"serviceEndpointId": f"{service_connection_id}",
"tfvcSource": None,
"deleteServiceEndpointAfterImportIsDone": True
}
}
Код: Выделить всё
400 Client Error: Bad Request for url
Подробнее здесь: https://stackoverflow.com/questions/792 ... g-rest-api
Мобильная версия