Movatterモバイル変換


[0]ホーム

URL:


CFEngine documentation homepage

VCS settings API

Suggest changes
Table of contents

VCS API for managing version control repository settings.

Get VCS settings

URI:https://hub.cfengine.com/api/vcs/settings

Method: GET

Example request (curl):

code
curl -k --user <username>:<password> \  -X GET \  https://hub.cfengine.com/api/vcs/settings'

Example response:

code
{    "meta": {        "page": 1,        "count": 10,        "total": 1,        "timestamp": 1535717855    },    "data": {        "GIT_URL": "https://github.com/cfengine/masterfiles.git",        "GIT_REFSPEC": "master",        "PROJECT_SUBDIRECTORY": "path/to/policies",        "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"    }}

Change VCS settings

URI:https://hub.cfengine.com/api/vcs/settings

Method: POST

Parameters:

  • vscType(string)VCS type. Allowed values:GIT,GIT_CFBS. Default value:GIT
  • gitServer(string)Git repository URLEmp: https://github.com/cfengine/masterfiles.git. Required parameter.
  • gitRefspec(string)The Git refspec to checkout. It can be a branch name, a tag name, a commit hash or a partial hash. Required parameter.
  • projectSubdirectory(string)Subdirectory inside Git repository where the project is located.Optional parameter.
  • gitUsername(string)Git username for authentication, not needed for public repositories.
  • gitPassword(string)Git password or token for authentication, not needed for public repositories.
  • gitPrivateKey(string)Git private key raw content for authentication.

Example request (curl):

code
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",        "projectSubdirectory":"",        "gitUsername":"gituser",        "gitPassword":"passwordOrToken",        "gitPrivateKey" "Private key raw content"      }'

Example response:

code
{    "gitServer": "https://github.com/cfengine/masterfiles.git",    "gitRefspec": "master",    "projectSubdirectory": "",    "gitUsername": "gituser",    "gitPassword": "passwordOrToken",    "gitPrivateKey": "/opt/cfengine/userworkdir/admin/.ssh/id_rsa.pvt"}

History

  • vscType parameter added in 3.19.0, 3.18.1
  • projectSubdirectory parameter added in 3.21.7, 3.24.2, 3.26.0

Still need help?

Chat Ask a question on Github Mailing list
Version 
master3.24 (LTS)3.21 (LTS)view all versions

[8]ページ先頭

©2009-2025 Movatter.jp