Get scenario

Prev Next

Available in Classic and VPC

Get details of a deployment scenario.

Request

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

Method URI
GET /api/v1/project/{projectId}/stage/{stageId}/scenario/{scenarioId}

Request headers

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

Request path parameters

You can use the following path parameters with your request:

Field Type Required Description
projectId String Required Project ID
stageId String Required Deployment stage ID
scenarioId String Required Deployment scenario ID

Request example

The request example is as follows:

curl --location --request GET 'https://vpcsourcedeploy.apigw.ntruss.com/api/v1/project/2***/stage/3***/scenario/2***' \
--header 'x-ncp-apigw-timestamp: {Timestamp}' \
--header 'x-ncp-iam-access-key: {Access Key}' \
--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.project Object - Project information
result.project.id Number - Project ID
result.project.name String - Project name
result.stage Object - Deployment stage information
result.stage.id Number - Deployment stage ID
result.stage.name String - Deployment stage name
result.id Number - Deployment scenario ID
result.name String - Deployment scenario name
result.description String - Deployment scenario description
result.type String - Deployment target
  • Server | AutoScalingGroup | KubernetesService | ObjectStorage
result.config Object - Deployment target settings

TScenarioServer

The following describes TScenarioServer.

Field Type Required Description
strategy String - Deployment strategy
  • normal: default (valid value)
sequence Boolean - Sequential deployment
  • true | false
    • true: sequential deployment
    • false: simultaneous deployment
file Object - Deployment file information
file.type String - Deployment file location
  • ObjectStorage | SourceBuild | later
    • ObjectStorage: Object Storage
    • SourceBuild: SourceBuild
    • later: Set up later.
file.ObjectStorage Object - Object Storage information
  • If file.type is ObjectStorage, display including sub-information.
file.ObjectStorage.bucket String - Bucket name
file.ObjectStorage.object String - File name
file.SourceBuild Object - SourceBuild information
  • If file.type is SourceBuild, display including sub-information.
file.SourceBuild.id Number - Build project ID
file.SourceBuild.name String - Build project name
rollback Boolean - Whether to use rollback upon deployment failure
  • true | false
    • true: use
    • false: not use
cmd.pre Array - List of pre-deployment execution commands
cmd.deploy Array - List of file deployment paths
cmd.post Array - List of post-deployment execution commands

pre

The following describes pre.

Field Type Required Description
user String - Account
cmd String - Execution command

deploy

The following describes deploy.

Field Type Required Description
sourcePath String - Source file path
deployPath String - Deployment path

post

The following describes post.

Field Type Required Description
user String - Account
cmd String - Execution command

TScenarioAutoScalingGroup

The following describes TScenarioAutoScalingGroup.

Field Type Required Description
strategy String - Deployment strategy
  • normal | blueGreen
    • normal: default
    • blueGreen: blue/green
sequence Boolean - Sequential deployment
  • true | false
    • true: sequential deployment
    • false: simultaneous deployment
file Object - Deployment file information
file.type String - Deployment file location
  • ObjectStorage | SourceBuild | later
    • ObjectStorage: Object Storage
    • SourceBuild: SourceBuild
    • later: Set up later.
file.ObjectStorage Object - Object Storage information
  • If file.type is ObjectStorage, display including sub-information.
file.ObjectStorage.bucket String - Bucket name
file.ObjectStorage.object String - File name
file.SourceBuild Object - SourceBuild information
  • If file.type is SourceBuild, display including sub-information.
file.SourceBuild.id Number - Build project ID
file.SourceBuild.name String - Build project name
rollback Boolean - Whether to use rollback upon deployment failure
  • true | false
    • true: use
    • false: not use
cmd.pre Array - List of pre-deployment execution commands
cmd.deploy Array - List of file deployment paths
cmd.post Array - List of post-deployment execution commands
loadBalancer Object - Load balancer information
  • If strategy is blueGreen, display including sub-information.
loadBalancer.loadBalancerTargetGroupNo Number - Load balancer target group ID
loadBalancer.loadBalancerTargetGroupName String - Load balancer target group name
loadBalancer.deleteAsg Boolean - Whether to delete existing Auto Scaling group
  • true | false
    • true: delete and terminate
    • false: maintain
loadBalancer.deleteServer Boolean - Whether to terminate servers in the existing Auto Scaling group
  • true | false
    • true: terminate
    • false: maintain

pre

The following describes pre.

Field Type Required Description
user String - Account
cmd String - Execution command

deploy

The following describes deploy.

Field Type Required Description
sourcePath String - Source file path
deployPath String - Deployment path

post

The following describes post.

Field Type Required Description
user String - Account
cmd String - Execution command

TScenarioKubernetesService

The following describes TScenarioKubernetesService.

Field Type Required Description
strategy String - Deployment strategy
  • rolling | blueGreen | canary
    • rolling: rolling
    • blueGreen: blue/green
    • canary: canary
manifest Object - Manifest information
manifest.type String - Manifest file repository
  • SourceCommit | Github Enterprise Server
manifest.url String - Git repository URL
  • Display if manifest.type is Github Enterprise Server and logged in with the SSH key method.
manifest.serverUrl String - Server URL
  • Display if manifest.type is Github Enterprise Server and logged in with the OAuth, personal access token, or username/password method.
result.env Object - Build environment information
manifest.owner String - Github Enterprise Server owner
  • Display if manifest.type is Github Enterprise Server.
manifest.repository String - Repository name
  • Display if manifest.type is SourceCommit.
manifest.branch String - Branch name
  • Display if manifest.type is SourceCommit.
manifest.path Array - File location list
canaryConfig Object - Canary analysis settings
  • If strategy is canary, display including sub-information.
canaryConfig.analysisType String - Canary analysis method
  • manual | auto
    • manual: manual
    • auto: automatic
canaryConfig.canaryCount Number - Number of baseline and canary pods
canaryConfig.timeout Number - Timeout (minute)
  • Maximum decision time for canary deployment/cancellation
  • Display if canaryConfig.analysisType is manual.
canaryConfig.prometheus String - Prometheus URL
  • Display if canaryConfig.analysisType is auto.
canaryConfig.env Object - Analysis environment variable
  • If canaryConfig.analysisType is auto, display including sub-information.
canaryConfig.env.baseline String - Analysis environment variable: baseline name
canaryConfig.env.canary String - Analysis environment variable: canary name
canaryConfig.metrics Array - Metric settings list
  • Display if canaryConfig.analysisType is auto.
canaryConfig.analysisConfig Object - Analysis settings
  • If canaryConfig.analysisType is auto, display including sub-information.
canaryConfig.analysisConfig.duration Number - Analysis time (minute)
canaryConfig.analysisConfig.delay Number - Analysis delay time (minute)
canaryConfig.analysisConfig.interval Number - Analysis cycle (minute)
canaryConfig.analysisConfig.step Number - Metric collection cycle (second)
canaryConfig.passScore Number - Analysis success score

metrics

The following describes metrics.

Field Type Required Description
name String - Metric name
successCriteria String - Success criteria
  • base | canary
    • base: baseline > canary
    • canary: baseline < canary
queryType String - Query type
  • default | promQL
weight Number - Metric weight
metric String - Metric value
  • Display if queryType is default.
filter String - Filter value
  • Display if queryType is default.
  • query String - Query
    • Display if queryType is promQL.

    TScenarioObjectStorage

    The following describes result.config if the deployment target is ObjectStorage.

    Field Type Required Description
    file Object - Deployment file information
    file.type String - Deployment file location
    • ObjectStorage | SourceBuild | later
      • ObjectStorage: Object Storage
      • SourceBuild: SourceBuild
      • later: Set up later.
    file.ObjectStorage Object - Object Storage information
    • If file.type is ObjectStorage, display including sub-information.
    file.ObjectStorage.bucket String - Bucket name
    file.ObjectStorage.object String - File name
    file.SourceBuild Object - SourceBuild information
    • If file.type is SourceBuild, display including sub-information.
    file.SourceBuild.id Number - Build project ID
    file.SourceBuild.name String - Build project name
    path Array - List of file deployment paths

    path

    The following describes path.

    Field Type Required Description
    sourcePath String - Source file path
    deployPath String - Deployment path

    Response status codes

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

    Response example

    The response example is as follows:

    {
        "result": {
            "project": {
                "id": 2***,
                "name": "deploy3"
            },
            "stage": {
                "id": 3***,
                "name": "dev-sv"
            },
            "id": 2***,
            "name": "testscenario",
            "description": "",
            "type": "Server",
            "config": {
                "strategy": "normal",
                "sequence": true,
                "file": {
                    "type": "ObjectStorage",
                    "ObjectStorage": {
                        "bucket": "data2",
                        "object": "sample_build_output.zip"
                    }
                },
                "rollback": true,
                "cmd": {
                    "pre": [
                        {
                            "user": "root",
                            "cmd": "rm -f /home/root/hello-deploy/hello.py"
                        }
                    ],
                    "deploy": [
                        {
                            "sourcePath": "hello.py",
                            "deployPath": "/home/root/hello-deploy/"
                        }
                    ],
                    "post": [
                        {
                            "user": "root",
                            "cmd": "cd /home/root/hello-deploy/ && python3 hello.py"
                        }
                    ]
                }
            }
        }
    }