VCS API for managing version control repository settings.
URI: https://hub.cfengine.com/api/vcs/settings
Method: GET
Example request (curl):
curl -k --user <username>:<password> \
-X GET \
https://hub.cfengine.com/api/vcs/settings
'
Example response:
{
"meta": {
"page": 1,
"count": 10,
"total": 1,
"timestamp": 1535717855
},
"data": {
"GIT_URL": "https://github.com/cfengine/masterfiles.git",
"GIT_REFSPEC": "master",
"GIT_USERNAME": "username",
"GIT_PASSWORD": "passwordOrToken",
"GIT_WORKING_BRANCH": "CF_WORKING_BRANCH",
"PKEY": "/opt/cfengine/userworkdir/admin/.ssh/id_rsa.pvt",
"SCRIPT_DIR": "/var/cfengine/httpd/htdocs/api/dc-scripts",
"VCS_TYPE": "GIT"
}
}
URI: https://hub.cfengine.com/api/vcs/settings
Method: POST
Parameters:
Emp: https://github.com/cfengine/masterfiles.git
. Required parameter.Example request (curl):
curl -k --user <username>:<password> \
-X POST \
https://hub.cfengine.com/api/vcs/settings \
-H 'content-type: application/json' \
-d '{
"gitServer":"https://github.com/cfengine/masterfiles.git",
"gitRefspec":"master",
"gitUsername":"gituser",
"gitPassword":"passwordOrToken",
"gitPrivateKey" "Private key raw content"
}
'
Example response:
{
"gitServer": "https://github.com/cfengine/masterfiles.git",
"gitRefspec": "master",
"gitUsername": "gituser",
"gitPassword": "passwordOrToken",
"gitPrivateKey": "/opt/cfengine/userworkdir/admin/.ssh/id_rsa.pvt"
}