-
Notifications
You must be signed in to change notification settings - Fork 88
RESTful API For GitLab
Echo edited this page May 4, 2018
·
5 revisions
Request
GET /saltshaker/api/v1.0/gitlab/branch?product_id=p-b4aaef1e322611e8ab56000c298454d8&project_type=state_project
Response
HTTP/1.1 200 OK
Content-Type: application/json
{
"data": [
"dev",
"master"
],
"status": true,
"message": ""
}
Request
GET /saltshaker/api/v1.0/gitlab/file?product_id=p-b4aaef1e322611e8ab56000c298454d8&path=vip&branch=master&project_type=state_project
Response
HTTP/1.1 200 OK
Content-Type: application/json
{
"data": [
{
"title": "root/salt_sls",
"expand": true,
"children": [
{
"title": "a",
"type": "tree",
"expand": false,
"children": [
{
"title": "test"
}
]
},
{
"title": "p",
"type": "tree",
"expand": false,
"children": [
{
"title": "test"
}
]
},
{
"title": "README.md",
"type": "blob",
"expand": true,
"path": "/README.md"
},
{
"title": "git_test.sls",
"type": "blob",
"expand": true,
"path": "/git_test.sls"
},
{
"title": "p_test.sls",
"type": "blob",
"expand": true,
"path": "/p_test.sls"
},
{
"title": "test.sls",
"type": "blob",
"expand": true,
"path": "/test.sls"
},
{
"title": "top.sls",
"type": "blob",
"expand": true,
"path": "/top.sls"
}
]
}
],
"status": true,
"message": ""
}
Request
GET /saltshaker/api/v1.0/gitlab/content?product_id=p-b4aaef1e322611e8ab56000c298454d8&path=common/views.py&branch=master&project_type=pillar_project
Response
HTTP/1.1 200 OK
Content-Type: application/json
{
"data": "# -*- coding:utf-8 -*-\nfrom django.shortcuts import render\n",
"status": true,
"message": ""
}
Request
POST /saltshaker/api/v1.0/gitlab/commit?product_id=p-4bc4a5b83bd011e8aa0e000c298454d8
POST Body
{
"project_type": "pillar_project",
"path": "top.sls",
"branch": "master",
"action": "update",
"content":"base:\n '*':\n - common\n - test\n"
}
Response
HTTP/1.1 200 OK
Content-Type: application/json
{
"status": true,
"message": ""
}