EDP allows you to create three codebase types: Application, Autotest and Library. There are also several strategy types for each codebase: Create, Clone and Import. Depending on the selected codebase type and the respective strategy, you should specify a different set of fields in a request.
NOTE: The Route, Database and VCS are optional fields. In accordance with the necessary deploy set, you have to add the necessary fields into request.
POST /api/v1/edp/codebase
{
"name": "app01",
"type": "application",
"strategy": "create",
"lang": "java",
"framework": "springboot",
"buildTool": "maven",
"multiModule": false,
"route": {
"site": "api",
"path": "/"
},
"database": {
"kind": "postgresql",
"version": "postgres:9.6",
"capacity": "1Gi",
"storage": "efs"
},
"description": "Description",
"gitServer": "gerrit",
"jenkinsSlave": "maven",
"jobProvisioning": "default",
"deploymentScript": "openshift-template"
}
{
"name": "app01",
"type": "application",
"strategy": "clone",
"lang": "java",
"framework": "springboot",
"buildTool": "maven",
"multiModule": false,
"repository": {
"url": "http(s)://git.sample.com/sample.git",
// login and password are required only if repo is private
"login": "login",
"password": "password"
},
"description": "Description",
"gitServer": "gerrit",
"jenkinsSlave": "maven",
"jobProvisioning": "default",
"deploymentScript": "openshift-template"
}
{
"type": "application",
"strategy": "import",
"lang": "java",
"framework": "springboot",
"buildTool": "maven",
"multiModule": false,
"description": "Description",
"gitServer": "git-epam",
"gitUrlPath": "/relative/path/to/repo",
"jenkinsSlave": "maven",
"jobProvisioning": "default",
"deploymentScript": "openshift-template"
}
{
"name": "aut01",
"type": "autotests",
"strategy": "clone",
"lang": "java",
"framework": "springboot",
"buildTool": "maven",
"testReportFramework": "allure",
"repository": {
"url": "http(s)://git.sample.com/sample.git",
// login and password are required only if repo is private
"login": "login",
"password": "password"
},
"description": "Description",
"jenkinsSlave": "maven",
"jobProvisioning": "default"
}
{
"type": "autotests",
"strategy": "import",
"lang": "java",
"framework": "springboot",
"buildTool": "maven",
"testReportFramework": "allure",
"description": "Description",
"gitServer": "git-epam",
"gitRelativePath": "/relative/path/to/repo",
"jenkinsSlave": "maven",
"jobProvisioning": "default"
}
{
"name": "lib01",
"type": "library",
"strategy": "create",
"lang": "java",
"buildTool": "maven",
"multiModule": false,
"jenkinsSlave": "maven",
"jobProvisioning": "default",
}
{
"name": "lib01",
"type": "library",
"strategy": "clone",
"lang": "java",
"buildTool": "maven",
"multiModule": false,
"repository": {
"url": "http(s)://git.sample.com/sample.git",
// login and password are required only if repo is private
"login": "login",
"password": "password"
},
"vcs": null,
"jenkinsSlave": "maven",
"jobProvisioning": "default",
}
{
"type": "library",
"strategy": "import",
"lang": "java",
"buildTool": "maven",
"multiModule": false,
"gitServer": "git-epam",
"gitUrlPath": "/relative/path/to/repo",
"jenkinsSlave": "maven",
"jobProvisioning": "default",
}
Status 200 OK
GET /api/v1/edp/codebase/{codebaseName}
example: localhost/api/v1/edp/codebase/app01
Status 200 OK
{
"id": 1,
"name": "app01",
"language": "java",
"build_tool": "maven",
"framework": "springboot",
"strategy": "create",
"git_url": "",
"route_site": "api",
"route_path": "/",
"db_kind": "postgresql",
"db_version": "postgres:9.6",
"db_capacity": "1Gi",
"db_storage": "efs",
"type": "application",
"status": "active",
"testReportFramework": "",
"description": "Description",
"codebase_branch": [
{
"id": 1,
"branchName": "master",
"from_commit": "",
"status": "active",
"branchLink": "",
"jenkinsLink": "",
"appName": "",
"codebaseDockerStream": null
}
],
"gitServer": "gerrit",
"gitProjectPath": null,
"jenkinsSlave": "maven",
"jobProvisioning": "default",
"deploymentScript": "openshift-template"
}
GET /api/v1/edp/codebase?type={codebaseType}
example: localhost/api/v1/edp/codebase?type=application
Status 200 OK
[
{
"id": 1,
"name": "app01",
"language": "java",
"build_tool": "maven",
"framework": "springboot",
"strategy": "create",
"git_url": "",
"route_site": "api",
"route_path": "/",
"db_kind": "postgresql",
"db_version": "postgres:9.6",
"db_capacity": "1Gi",
"db_storage": "efs",
"type": "application",
"status": "active",
"testReportFramework": "",
"description": "Description",
"codebase_branch": [
{
"id": 1,
"branchName": "master",
"from_commit": "",
"status": "active",
"branchLink": "",
"jenkinsLink": "",
"appName": "",
"codebaseDockerStream": [
{
"id": 1,
"ocImageStreamName": "app01-master",
"imageLink": "",
"jenkinsLink": ""
}
]
}
],
"gitServer": "gerrit",
"gitProjectPath": null,
"jenkinsSlave": "maven",
"jobProvisioning": "",
"deploymentScript": "openshift-template"
},
{
"id": 2,
"name": "app02",
"language": "java",
"build_tool": "maven",
"framework": "springboot",
"strategy": "create",
"git_url": "",
"route_site": "app",
"route_path": "/",
"db_kind": "PostgreSQL",
"db_version": "postgres:9.6",
"db_capacity": "1Mi",
"db_storage": "efs",
"type": "application",
"status": "failed",
"testReportFramework": "",
"description": "",
"codebase_branch": [
{
"id": 2,
"branchName": "master",
"from_commit": "",
"status": "inactive",
"branchLink": "",
"jenkinsLink": "",
"appName": "",
"codebaseDockerStream": [
{
"id": 2,
"ocImageStreamName": "app02-master",
"imageLink": "",
"jenkinsLink": ""
}
]
}
],
"gitServer": "gerrit",
"gitProjectPath": null,
"jenkinsSlave": "maven",
"jobProvisioning": "",
"deploymentScript": "openshift-template"
}
]
POST /api/v1/edp/cd-pipeline
{
"name":"pipe1",
"applications":[
{
"appName":"app01",
"inputDockerStream":"app01-master"
}
],
"stages":[
{
"name":"sit",
"description":"description-sit",
"qualityGateType":"manual",
"stepName":"approve",
"triggerType":"manual",
"order":0,
"qualityGates": [
{
"qualityGateType":"manual",
"stepName":"step-one-one",
"autotestName": null,
"branchName": null
},
{
"qualityGateType":"manual",
"stepName":"step-two-two",
"autotestName": null,
"branchName": null
}
]
}
]
}
Status 200 OK
GET /api/v1/edp/cd-pipeline/{cdPipelineName}
example: localhost/api/v1/edp/cd-pipeline/pipe1
Status 200 OK
{
"id": 1,
"name": "pipe1",
"status": "active",
"jenkinsLink": "",
"codebaseBranches": [
{
"id": 1,
"branchName": "master",
"from_commit": "",
"status": "active",
"branchLink": "",
"jenkinsLink": "",
"appName": "java-springboot-helloworld",
"codebaseDockerStream": [
{
"id": 1,
"ocImageStreamName": "java-springboot-helloworld-master",
"imageLink": "",
"jenkinsLink": ""
}
]
}
],
"stages": [
{
"id": 1,
"name": "sit",
"description": "sit",
"triggerType": "manual",
"order": 0,
"platformProjectLink": "",
"platformProjectName": env-am-test-deploy-sit",
"qualityGates": [
{
"id": 1,
"qualityGateType": "manual",
"stepName": "manual",
"cdStageId": 1,
"autotest": null,
"codebaseBranch": null
}
],
"source": {
"type": "library",
"library": {
"name": "lib01",
"branch": "master"
}
}
}
],
"services": [],
"applicationsToPromote": [
"java-springboot-helloworld"
]
}
GET /api/v1/edp/cd-pipeline/{cdPipelineName}/stage/{stageName}
example: `localhost/api/v1/edp/cd-pipeline/pipe1/stage/sit
{
"name": "sit",
"cdPipeline": "pipe1",
"description": "sit",
"triggerType": "manual",
"order": "0",
"applications": [
{
"name": "java-springboot-helloworld",
"branchName": "master",
"inputIs": "java-springboot-helloworld-master",
"outputIs": "am-test-deploy-sit-java-springboot-helloworld-verified"
}
],
"qualityGates": [
{
"id": 1,
"qualityGateType": "manual",
"stepName": "manual",
"cdStageId": 1,
"autotest": null,
"codebaseBranch": null
}
]
}
PUT /api/v1/edp/cd-pipeline/{cdPipelineName}/update
example: localhost/api/v1/edp/cd-pipeline/pipe1/update
{
"applications":[
{
"appName":"app01",
"inputDockerStream":"app01-master"
},
{
"appName":"app02",
"inputDockerStream":"app02"
}
]
}
204 No Content
{
"stages": [
{
"name": "sit",
"description": "sit",
"triggerType": "manual",
"order": 0,
"platformProjectLink": "",
"platformProjectName": env-deploy-sit",
"qualityGates": [
{
"id": 1,
"qualityGateType": "manual",
"stepName": "manual",
"cdStageId": 1,
"autotest": null,
"codebaseBranch": null
}
],
"source": {
"type": "library",
"library": {
"name": "lib01",
"branch": "master"
}
}
}
]
}
204 No Content