LogoLogo
Cocktail Cloud
  • What is Cocktail Open API?
  • API INFORMATION
    • API Token Issuance
    • API call
    • API response
  • API Reference
    • Common
      • Get volume types
    • Platform
      • Get platform
      • Get platform service maps
    • Cluster
      • Get clusters list
      • Get clusters status list
      • Get cluster details
      • Get cluster nodes list
      • Get cluster node details
      • Get cluster node events list
      • Get cluster storage list
      • Get cluster storage details
      • Get cluster ingress list
      • Get cluster service exposures list
      • Get cluster configuration list
      • Get cluster workloads list
      • Get cluster pods list
      • Get cluster PVC list
      • Get cluster CRD list
      • Get cluster addon list
      • Get cluster package list
      • Get cluster namespace list
      • Get cluster namespace details
      • Get cluster namespace ingress list
      • Get cluster namespace ingress details
      • Get cluster namespace service exposure list
      • Get cluster namespace service exposure details
      • Get cluster namespace configmap list
      • Get cluster namespace configmap details
      • Get cluster namespace secret list
      • Get cluster namespace secret details
      • Get cluster namespace PVC list
      • Get cluster namespace PVC details
      • Get cluster namespace Cronjobs list
      • Get cluster namespace Cronjob details
      • Get cluster namespace DaemonSets list
      • Get cluster namespace DaemonSet details
      • Get cluster namespace Deployments list
      • Get cluster namespace Deployment details
      • Get cluster namespace HAPs list
      • Get cluster namespace Jobs list
      • Get cluster namespace Job details
      • Get cluster namespace ReplicaSets list
      • Get cluster namespace StatefulSets list
      • Get cluster namespace StatefulSet details
      • Get cluster namespace pods logs
      • Get cluster namespace Container log
    • workspaces
      • Get workspaces list
      • Get workspace details
    • service map
      • Get workspace service maps list
      • Get workspace service map details
      • Get service map workloads list
      • Get service map workload details
      • Get service map groups list
    • pipeline
      • Get pipeline list
      • Run pipeline
      • Get pipeline Execution Details
    • Monitoring
      • Monitoring variables
      • Monitoring Cluster
        • Get cluster CPU usage trend (Core)
        • Get cluster Memory usage trend (Byte)
        • Get cluster CPU/Memory request trend (Core/Byte)
        • Get cluster network usage trend (Mbps)
        • Get cluster kube API server request
        • Get cluster kube API server average response time
        • Get cluster restart pod list
        • Get cluster restart pod growth rate
        • Get cluster pod count trend by status
        • Get cluster pod CPU usage Top 5 trend (Core)
        • Get cluster pod Memory usage Top 5 trend (Byte)
      • Monitoring Node
        • Get cluster node CPU usage trend (%)
        • Get cluster node CPU usage trend by status (%)
        • Get cluster node CPU load trend (Average Core)
        • Get cluster node CPU current load (Core Average)
        • Get cluster node Memory usage trend (Byte)
        • Get cluster node disk free space trend
        • Get cluster node disk I/O rate change trend
        • Get cluster node disk detailed usage rate
        • Get cluster node network usage (bps)
        • Get cluster node network usage trend by device
        • Get cluster node uptime
        • Get cluster node availability
      • Monitoring Ingress
        • Get ingress controller average connection count trend
        • Get ingress controller average request rate trend (ReqPS)
        • Get ingress controller request success rate trend
        • Get ingress controller CPU usage trend (Core)
        • Get ingress controller Memory usage trend (MiB)
        • Get ingress controller network usage trend (kBs)
        • Get ingress controller config reload count
        • Get ingress controller config reload success status
        • Get ingress controller request rate trend per ingress
        • Get ingress controller success rate trend per ingress
        • Get ingress controller percentile response time and throughput per ingress
      • Monitoring ETCD
        • Get the existence of ETCD Leader
        • Get the trend of ETCD Leader change count
        • Get the trend of ETCD Proposal count by state
        • Get the trend of ETCD Proposal failure count
        • Get the trend of CPU usage for ETCD nodes
        • Get the trend of Memory usage for ETCD nodes
        • Get the trend of Network transmit and receive volume between ETCD servers
        • Get the trend of Network transmit and receive volume between ETCD servers by node
        • Get the trend of ETCD gRPC call
        • Get the trend of ETCD gRPC Active Streams
        • Get the trend of ETCD Disk processing wait time
        • Get the trend of ETCD Disk processing wait time by node
        • Get the trend of ETCD snapshot save wait time
        • Get the trend of ETCD DB size
      • Monitoring Namespace
        • Get namespace creation time
        • Get namespace CPU total usage (Core)
        • Get namespace Memory total usage (Byte)
        • Get namespace CPU/Memory total quota
        • Get namespace pod CPU usage (Core)
        • Get namespace pod Memory usage (Byte)
        • Get the trend of deployment creation count in namespace
        • Get the list of pods in namespace
        • Get the trend of total number of pods in namespace
        • Get the trend of total number of pods by node in namespace
        • Get pods per namespace QoS
        • Get the number of ready pods in the namespace
        • Get trend of restarted pods count in namespace
        • Get trend of terminated pods count in namespace
        • Get trend of waiting pods count in namespace
        • Get the total number of PVCs in the namespace
        • Get trend of PVCs by status in the namespace
        • Get namespace PVC usage (Byte)
        • Get current total CPU/Memory usage in the namespace
        • Get the number of pods by status in namespace
      • Monitoring Workload
        • Get total CPU/Memory usage of workloads
        • Get workload pod CPU/Memory current quota and usage
        • Get workload pod CPU usage trend (Core)
        • Get workload CPU Usage (Cores)
        • Get workload pod memory usage trend (Bytes)
        • Get workload memory usage (Bytes)
        • Get workload CPU/Memory total quota
        • Get workload pod network usage trend (bps)
        • Get workload network usage (bps)
        • Get workload pod CPU/Memory current usage
      • Monitoring GPU
        • GPU Temperature Trend
        • GPU Framebuffer Memory Usage Trend
        • GPU Power Consumption Trend
        • GPU GR Engine Usage Trend
        • GPU Tensor Core Usage Trend
        • GPU GR Engine Activation Ratio
        • GPU Framebuffer Memory Usage
        • GPU Timeslicing Status
        • GPU Instances
    • Event
      • Get alarms
      • Get events
    • Build
      • Create a build
      • Run build - Create a tag
      • Get build execution log
      • Get build image tag list
      • Delete bulid
    • Backup/Restore
      • Get backup list
      • Get backup details
      • Get the list of restore points in Backup Details
      • Run backup
      • Start/stop the backup execution schedule
      • Get restore point details
      • Get Restore Point Resource List
      • Get restore point logs
Powered by GitBook
On this page

Was this helpful?

Export as PDF
  1. API Reference
  2. Build

Create a build

PreviousBuildNextRun build - Create a tag

Was this helpful?

Create a build

post

Create a build.

Query parameters
callbackUrlstringOptional

callback URL

Body

Build modification model

accountSeqintegerOptional

Account number (your system's account number)

Example: 1
autotagUseYnstringOptional

automatic tagging usage status (enabled: Y, unused: N)

Example: N
autotagPrefixstringOptionalExample: test
autotagSeqTypestringOptional

autotag sequence number type('DATETIME' or 'SEQUENCE')

Example: DATETIME
descriptionstringOptionalExample: build test
editTypestringRequired

Edit type (New: N)

Example: N
externalRegistrySeqintegerOptional

External registry number (number of the external registry to store build images).

Example: 0
imageNamestringOptional

Image name (name of the image to be built)

Example: build-api-test-gradle
registryNamestringOptional

Registry name (name of the registry to store the build image)

Example: dev
registryProjectIdintegerOptional

Registry project ID (project ID of the registry to store the build image)

Example: 27
tagNamestringOptional

Image tag name (tag name of the image to be built)

Example: 8u292-rmsoft
Responses
200
OK
*/*
post
POST /v1/build HTTP/1.1
Host: 
Content-Type: application/json
Accept: */*
Content-Length: 2220

{
  "accountSeq": 1,
  "autotagUseYn": "N",
  "autotagPrefix": "test",
  "autotagSeqType": "DATETIME",
  "buildSteps": [
    {
      "stepType": "CODE_DOWN",
      "useFlag": true,
      "buildStepSeq": 0,
      "buildStepConfig": {
        "stepType": "CODE_DOWN",
        "repositoryType": "GIT",
        "stepTitle": "Code repository task",
        "repositoryUrl": "github.com/codefresh-contrib/gradle-sample-app.git",
        "branchName": "master",
        "codeSaveDir": "repo",
        "commonType": "COMMON",
        "protocolType": "https"
      },
      "stepOrder": 1
    },
    {
      "stepType": "USER_TASK",
      "useFlag": true,
      "buildStepSeq": 1,
      "buildStepConfig": {
        "stepType": "USER_TASK",
        "stepTitle": "user task",
        "cmd": [
          "mvn",
          "clean",
          "install"
        ],
        "workingDir": "/build",
        "imageName": "build-api-test-gradle",
        "imageTag": "8u292-rmsoft",
        "dockerVolumeMountVOList": [
          {
            "containerPath": "/build",
            "hostPath": "$PWD/repo"
          }
        ]
      },
      "stepOrder": 2
    },
    {
      "stepType": "FTP",
      "useFlag": true,
      "buildStepSeq": 2,
      "buildStepConfig": {
        "stepType": "FTP",
        "stepTitle": "file(FTP) task",
        "url": "test-ftp.gradle-sample-test",
        "ftpType": "SFTP",
        "username": "runapps",
        "sourceFiles": "/data/dataset",
        "remoteDirectory": "data/gradle-sample-dataset",
        "ftpExecType": "DIR_FTP_DOWN"
      },
      "stepOrder": 1
    },
    {
      "stepType": "HTTP",
      "useFlag": true,
      "buildStepSeq": 3,
      "buildStepConfig": {
        "stepType": "CODE_DOWN",
        "repositoryType": "GIT",
        "stepTitle": "Source Download",
        "repositoryUrl": "github.com/codefresh-contrib/gradle-sample-app.git",
        "branchName": "master",
        "codeSaveDir": "repo",
        "commonType": "COMMON",
        "protocolType": "https"
      },
      "stepOrder": 3
    },
    {
      "stepType": "SHELL",
      "useFlag": true,
      "buildStepSeq": 4,
      "buildStepConfig": {
        "stepType": "SHELL",
        "stepTitle": "Script task.",
        "shellType": "SCRIPT",
        "command": "echo \">>> move app source \"\ncd repo\n\necho \">>> node_modules Compression\"\ntar -cf node_modules.tar node_modules/\n\nls -al"
      },
      "stepOrder": 4
    },
    {
      "stepType": "CREATE_IMAGE",
      "useFlag": true,
      "buildStepSeq": 5,
      "buildStepConfig": {
        "stepType": "CREATE_IMAGE",
        "buildStepSeq": 5,
        "exitCode": "0",
        "dockerFileType": "CONTENTS",
        "stepTitle": "Image Build task",
        "dockerFile": "FROM gradle:6.9.2-jdk8",
        "severity": "",
        "registryId": 27,
        "registryName": "dev",
        "imageTag": "8u292-rmsoft",
        "imageName": "buildapi-test-gradle"
      },
      "stepOrder": 5
    }
  ],
  "description": "build test",
  "editType": "N",
  "externalRegistrySeq": 0,
  "imageName": "build-api-test-gradle",
  "registryName": "dev",
  "registryProjectId": 27,
  "tagName": "8u292-rmsoft"
}
200

OK

[
  {
    "useYn": "Y",
    "created": "2022-12-02 08:42:46",
    "updated": "2022-12-02 08:42:46",
    "buildSeq": 1,
    "buildNo": 1,
    "buildName": "build-test",
    "buildDesc": "build test",
    "accountSeq": 1,
    "registryProjectId": 27,
    "registryName": "dev",
    "imageName": "build-api-test-gradle",
    "autotagUseYn": "N",
    "autotagPrefix": "test",
    "autotagSeqType": "DATETIME",
    "tagName": "8u292-rmsoft",
    "externalRegistrySeq": 0,
    "buildServerHost": "topic:build-20230623-ws-namespace-thingcluster",
    "buildServerTlsVerify": "N",
    "buildServerCacrt": "",
    "buildServerClientCert": "",
    "buildServerClientKey": "",
    "buildSteps": [
      {
        "stepType": "CODE_DOWN",
        "useFlag": true,
        "buildStepSeq": 0,
        "buildStepConfig": {
          "stepType": "CODE_DOWN",
          "repositoryType": "GIT",
          "stepTitle": "Code repository task.",
          "repositoryUrl": "github.com/codefresh-contrib/gradle-sample-app.git",
          "branchName": "master",
          "codeSaveDir": "repo",
          "commonType": "COMMON",
          "protocolType": "https"
        },
        "stepOrder": 1
      },
      {
        "stepType": "USER_TASK",
        "useFlag": true,
        "buildStepSeq": 0,
        "buildStepConfig": {
          "stepType": "USER_TASK",
          "stepTitle": "user task.",
          "cmd": [
            "mvn",
            "clean",
            "install"
          ],
          "workingDir": "/build",
          "imageName": "build-api-test-gradle",
          "imageTag": "8u292-rmsoft",
          "dockerVolumeMountVOList": [
            {
              "containerPath": "/build",
              "hostPath": "$PWD/repo"
            }
          ]
        },
        "stepOrder": 2
      },
      {
        "stepType": "FTP",
        "useFlag": true,
        "buildStepSeq": 110,
        "buildStepConfig": {
          "stepType": "FTP",
          "stepTitle": "file(FTP) task.",
          "url": "test-ftp.gradle-sample-test",
          "ftpType": "SFTP",
          "username": "runapps",
          "sourceFiles": "/data/dataset",
          "remoteDirectory": "data/gradle-sample-dataset",
          "ftpExecType": "DIR_FTP_DOWN"
        },
        "stepOrder": 3
      },
      {
        "stepType": "HTTP",
        "useFlag": true,
        "buildStepSeq": 0,
        "buildStepConfig": {
          "stepType": "HTTP",
          "stepTitle": "REST call task",
          "url": "https://priv-regi.cocktailcloud.io/api/gradle-sample-dataset",
          "httpMode": "GET",
          "ignoreSslErrors": false,
          "username": "admin",
          "timeout": 5,
          "validResponseCodes": "200",
          "outputFile": "project-list.txt",
          "consoleLogResponseBody": false
        },
        "stepOrder": 4
      },
      {
        "stepType": "SHELL",
        "useFlag": true,
        "buildStepSeq": 0,
        "buildStepConfig": {
          "stepType": "SHELL",
          "stepTitle": "script task",
          "shellType": "SCRIPT",
          "command": "echo \">>> move app source\"\ncd repo\n\necho \">>> node_modules compression\"\ntar -cf node_modules.tar node_modules/\n\nls -al"
        },
        "stepOrder": 5
      },
      {
        "stepType": "CREATE_IMAGE",
        "useFlag": true,
        "buildStepSeq": 0,
        "buildStepConfig": {
          "stepType": "CREATE_IMAGE",
          "buildStepSeq": 0,
          "exitCode": "0",
          "dockerFileType": "CONTENTS",
          "stepTitle": "image build task",
          "dockerFile": "FROM gradle:6.9.2-jdk8",
          "severity": "",
          "registryId": 27,
          "registryName": "dev",
          "imageTag": "8u292-rmsoft",
          "imageName": "build-api-test-gradle"
        },
        "stepOrder": 6
      }
    ],
    "hostUrl": "dev.cocktailcloud.io",
    "buildCount": 6,
    "runningCount": 6,
    "doneCount": 3,
    "errorCount": 3,
    "pipelineCount": 1,
    "tagCount": 3,
    "buildTimeAvg": 606,
    "imgSizeAvg": 351720643,
    "latestBuildTime": 752,
    "latestImgSize": 352886544,
    "latestExecTime": "2022-12-02 08:42:46"
  }
]