Get project

Prev Next

Available in Classic and VPC

Get details of a deployment project.

Request

This section describes the request format. The method and URI are as follows:

Method URI
GET /api/v1/project/{projectId}

Request headers

For information about the headers common to all SourceBuild APIs, see SourceBuild request headers.

Request path parameters

You can use the following path parameters with your request:

Field Type Required Description
projectId String Required Project ID

Request example

The request example is as follows:

curl --location --request GET 'https://sourcebuild.apigw.ntruss.com/api/v1/project/20***' \
--header 'x-ncp-iam-access-key: {Access Key}' \
--header 'x-ncp-apigw-timestamp: {Timestamp}' \
--header 'x-ncp-apigw-signature-v2: {API Gateway Signature}'

Response

This section describes the response format.

Response body

The response body includes the following data:

Field Type Required Description
result Object - Response result
result.id Number - Project ID
result.name String - Project name
result.description String - Project description
result.created Object - Project creation information
result.created.timestamp Number - Project creation date and time
  • Unix timestamp format
result.created.user String - Creator ID
result.source Object - Source storage information
result.source.type String - Source storage type
  • SourceCommit | Github | Bitbucket | Github Enterprise Server
result.source.config Object - Source storage repository information
result.source.config.repository String - Source storage repository name
  • Display if source.type is SourceCommit or Github.
result.source.config.branch String - Source storage repository branch name
  • Display if source.type is SourceCommit or Github.
result.source.config.workspace.id String - Bitbucket workspace ID
  • Display if source.type is Bitbucket.
result.source.config.workspace.name String - Bitbucket workspace name
  • Display if source.type is Bitbucket.
owner String - Github Enterprise Server owner
  • Display if source.type is Github Enterprise Server.
url String - Git repository URL
  • Display if source.type is Github Enterprise Server and logged in with the SSH key method.
serverUrl String - Server URL
  • Display if source.type is Github Enterprise Server and logged in with the OAuth, personal access token, or username/password method.
result.env Object - Build environment information
result.env.timeout Number - Build execution timeout (minute)
result.env.envVars Array - Build environment variable information
result.env.compute Object - Computing type information
result.env.compute.id Number - Computing type ID
result.env.compute.cpu Number - Number of vCPUs
result.env.compute.mem Number - Memory capacity (GB)
result.env.platform Object - Build environment platform information
result.env.platform.type String - Image storage type
  • SourceBuild | ContainerRegistry | PublicRegistry
    • SourceBuild: image managed by SourceBuild
    • ContainerRegistry: Container Registry image
    • PublicRegistry: public registry image
result.env.platform.config Object - Build environment configuration information
result.env.platform.config.os Object - Operating system information
  • If env.platform.type is SourceBuild, display including sub-information.
result.env.platform.config.os.id Number - Operating system ID
result.env.platform.config.os.name String - Operating system name
result.env.platform.config.os.version String - Operating system version
result.env.platform.config.os.archi String - Operating system architecture
result.env.platform.config.runtime Object - Runtime information
  • If env.platform.type is SourceBuild, display including sub-information.
result.env.platform.config.runtime.id Number - Runtime type ID
result.env.platform.config.runtime.name String - Runtime name
result.env.platform.config.runtime.version Object - Runtime version information
result.env.platform.config.runtime.version.id Number - Runtime version ID
result.env.platform.config.runtime.version.name String - Runtime version name
result.env.platform.config.registry Object - Registry information
  • Display if env.platform.type is ContainerRegistry.
result.env.platform.config.image String - Image name
  • Display if env.platform.type is ContainerRegistry or PublicRegistry.
result.env.platform.config.tag String - Image tag name
  • Display if env.platform.type is ContainerRegistry or PublicRegistry.
result.env.docker Object - Docker engine information
result.env.docker.use Boolean - Whether to include Docker engine
  • true | false
    • true: include
    • false: not include
result.env.docker.id Number - Docker engine version ID
  • Display if result.env.docker.use is true.
result.env.docker.name String - Docker engine name
  • Display if result.env.docker.use is true.
result.cmd Object - Build command information
result.cmd.pre Array - Command before build
result.cmd.build Array - Command during build
result.cmd.post Array - Command after build
result.cmd.dockerbuild Object - Docker image build information
  • If result.cmd.dockerbuild.use is true, display including sub-information.
result.cmd.dockerbuild.use Boolean - Whether to use Docker image build settings
  • true | false
    • true: use
    • false: not use
result.cmd.dockerbuild.dockerfile String - dockerfile path
result.cmd.dockerbuild.registry String - Container Registry name
result.cmd.dockerbuild.image String - Image name
result.cmd.dockerbuild.tag String - Image tag name
result.cmd.dockerbuild.latest Boolean - Whether to set latest tag
  • true | false
    • true: set
    • false: not set
result.artifact Object - Build result information
  • If result.artifact.use is true, display including sub-information.
result.artifact.use Boolean - Whether to save build results
  • true | false
    • true: save
    • false: not save
result.artifact.path String - Build result storage path
result.artifact.storage Object - Result storage information
result.artifact.storage.bucket String - Object Storage bucket name to save the results
result.artifact.storage.path String - The path within the Object Storage bucket to save the results
result.artifact.storage.filename String - File name to save the results
result.artifact.backup Boolean - Whether to back up results
  • true | false
    • true: back up
    • false: no backup
result.cache Object - Post-build image storage information
  • If result.cache.use is true, display including sub-information.
result.cache.use Boolean - Whether to store image after build completion
  • true | false
    • true: save
    • false: not save
result.cache.registry String - Container Registry name
result.cache.image String - Image name
result.cache.tag String - Image tag name
result.cache.latest Boolean - Whether to set latest tag
  • true | false
    • true: set
    • false: not set
result.linked Object - Integrated service information
result.linked.FileSafer Boolean - File Safer integration
  • true | false
    • true: integrate
    • false: not integrate
result.linked.CloudLogAnalytics Boolean - Cloud Log Analytics integration
  • true | false
    • true: integrate
    • false: not integrate
result.lastBuild Object - Latest build job information
result.lastBuild.id String - Build number
  • If there is no initial job, it is not displayed.
result.lastBuild.timestamp Number - Build date and time
  • If there is no initial job, display null.
result.lastBuild.status String - Build status
  • prepare | upload | success | fail | canceled
    • prepare: build execution in progress
    • upload: saving build results
    • success: build execution complete (final result saved)
    • fail: build execution failed
    • canceled: build execution canceled
  • If there is no initial job, display null.

envVars

The following describes envVars.

Field Type Required Description
key String - Environment variable key
value String - Environment variable value

Response status codes

For information about the response status codes common to all SourceBuild APIs, see SourceBuild response status codes.

Response example

The response example is as follows:

{
    "result": {
        "id": 20***,
        "name": "Build001",
        "description": "Build001",
        "created": {
            "timestamp": 1747294359000,
            "user": "nb******"
        },
        "source": {
            "type": "SourceCommit",
            "config": {
                "repository": "repository001",
                "branch": "master"
            }
        },
        "env": {
            "timeout": 60,
            "envVars": [
                {
                    "key": "env1",
                    "value": "value1"
                }
            ],
            "compute": {
                "id": 1,
                "cpu": 2,
                "mem": 4
            },
            "platform": {
                "type": "SourceBuild",
                "config": {
                    "os": {
                        "id": 1,
                        "name": "ubuntu",
                        "version": "16.04",
                        "archi": "x64"
                    },
                    "runtime": {
                        "id": 5,
                        "name": "python",
                        "version": {
                            "id": 27,
                            "name": "3.10-1.0.0"
                        }
                    }
                }
            },
            "docker": {
                "use": true,
                "id": 1,
                "name": "Docker:18.09.1"
            }
        },
        "cmd": {
            "pre": [],
            "build": [],
            "post": [],
            "dockerbuild": {
                "use": false
            }
        },
        "artifact": {
            "use": false
        },
        "cache": {
            "use": false
        },
        "linked": {
            "FileSafer": false,
            "CloudLogAnalytics": false
        },
        "lastBuild": {
            "id": "4e3c7860-****-****-****-4db7e2de2984",
            "timestamp": 1747363743000,
            "status": "success"
        }
    }
}