- I’m creating a python script using either the requests lib, or python-gitlab to try and set a mirroring-repositorie to PULL from a repo in github. (github >> gitlab).
- when using a curl post, or the requests lib in python I’m getting a 404, the URL apparently does not exist.
`gitdata = {
“import_url”: “https://<githubuser>:<githubtoken>@github.com//.git”,
“mirror”: ‘true’,
“mirror_user_id”: userid,
“mirror_trigger_builds”: ‘false’,
“only_mirror_protected_branches”:‘false’,
“mirror_overwrites_diverged_branches”:‘false’
}
mirroring_request = requests.post(url, headers=custom_headers, json=gitdata)`
The error I get from that code is this: (the xxxxx for the repoid)
requests.exceptions.HTTPError: 400 Client Error: Bad Request for url: https://gitlab.com/api/v4/projects/xxxxx/mirror/pull
The last test I did why trying to follow the "Start the pull mirroring process for a Project " document: curl --request POST --header "PRIVATE-TOKEN: <token>" "https://gitlab.com/api/v4/projects/<repoid>/mirror/pull"
The return is this: {"message":"The project is not mirrored"}
I will really appreciate the help. hvithval