MENU
      Create scenario

        Create scenario


        Article summary

        Overview

        Create a scenario of the SourceDeploy project.

        Requests

        API URL

        POST 	{SOURCEDEPLOY_API_URL}/project/{projectId}/stage/{stageId}/scenario
        Plain text

        Request parameters

        ItemTypeDescriptionNote
        projectIdstringProject IDView projectList
        stageIdstringstage IDView stageList

        Request queries

        None

        Request bodies

        {
            "name": "string",
            "description": "string",
            "config": "TScenarioServer" | "TScenarioAutoScalingGroup" | "TSecnarioKubernetesService" | "TSecnarioObjectStorage"
        }
        JSON
        ItemTypeRequiredDescriptionNote
        namestringYScenario name
        descriptionstringNScenario description
        ConfigTScenarioServer | TScenarioAutoScalingGroup| TSecnarioKubernetesService|TSecnarioObjectStorageYScenario settingsView stage type with stageDetail API
        When stage type="Server," TScenarioServer
        When stage type="AutoScalingGroup," TScenarioAutoScalingGroup
        When stage type="KubernetesService," TScenarioKubernetesService
        When stage type="ObjectStorage," TScenarioObjectStorage

        TScenarioServer

        {
            "strategy": "string",
            "sequence": "boolean",
            "file": {
                "type": "string",
                "ObjectStorage": {
                    "bucket": "string",
                    "object": "string"
                },
                "SourceBuild": {
                    "id": "number"
                }
            },
            "rollback": "boolean",
            "cmd": {
                "pre": [
                    {
                        "user": "string",
                        "cmd": "string"
                    }
                ],
                "deploy": [
                    {
                        "sourcePath": "string",
                        "deployPath": "string"
                    }
                ],
                "post": [
                    {
                        "user": "string",
                        "cmd": "string"
                    }
                ]
            },
        }
        JSON
        ItemTypeRequiredDefaultDescriptionNote
        strategystringYDeployment strategy"normal"
        sequencebooleanNtrueConsecutive deployment statusWhen false is entered, deployed simultaneously
        file.typestringYDeployment file type"ObjectStorage" | "SourceBuild" | "later"
        file.ObjectStorage.bucketstringN
        (When file.type=ObjectStorage, required)
        ObjectStorage bucket nameView with objectStorageBucketList API
        file.ObjectStorage.objectstringN
        (When file.type=ObjectStorage, required)
        ObjectStorage object locationView with objectstorageobjectlist API
        file.SourceBuild.idnumberN
        (When file.type=SourceBuild, required)
        SourceBuild idView with sourceBuildList API
        rollbackbooleanYRoll back if deployment fails
        cmd.pre.userstringNRun before deployment>Account
        cmd.pre.cmdstringNRun before deployment>Command
        cmd.deploy.sourcePathstringNFile deployment>Source file path
        cmd.deploy.deployPathstringNFile deployment>Deployment path
        cmd.post.userstringNRun after deployment>Account
        cmd.post.cmdstringNRun after deployment>Command

        TScenarioAutoScalingGroup

        {
            "strategy": "string",
            "sequence": "boolean",
            "file": {
                "type": "string",
                "ObjectStorage": {
                    "bucket": "string",
                    "object": "string"
                },
                "SourceBuild": {
                    "id": "number"
                 }
            },
            "rollback": "boolean",
            "cmd": {
                "pre": [
                    {
                        "user": "string",
                        "cmd": "string"
                    }
                ],
                "deploy": [
                    {
                        "sourcePath": "string",
                        "deployPath": "string"
                    }
                ],
                "post": [
                    {
                        "user": "string",
                        "cmd": "string"
                    }
                ]
            },
            "loadBalancer": {
                "loadBalancerTargetGroupNo": "number",
                "deleteAsg": "boolean",
                "deleteServer": "boolean"
            }
        }
        JSON
        ItemTypeRequiredDefaultDescriptionNote
        strategystringYDeployment strategy"normal" | "blueGreen"
        sequencebooleanNtrueConsecutive deployment statusWhen false is entered, deployed simultaneously
        file.typestringYDeployment file type"ObjectStorage" | "SourceBuild" | "later"
        file.ObjectStorage.bucketstringN
        (When file.type=ObjectStorage, required)
        ObjectStorage bucket nameView with objectStorageBucketList API
        file.ObjectStorage.objectstringN
        (When file.type=ObjectStorage, required)
        ObjectStorage object locationView with objectstorageobjectlist API
        file.SourceBuild.idnumberN
        (When file.type=SourceBuild, required)
        SourceBuild idView with sourceBuildList API
        rollbackbooleanYRoll back if deployment fails
        cmd.pre.userstringNRun before deployment>Account
        cmd.pre.cmdstringNRun before deployment>Command
        cmd.deploy.sourcePathstringNFile deployment>Source file path
        cmd.deploy.deployPathstringNFile deployment>Deployment path
        cmd.post.userstringNRun after deployment>Account
        cmd.post.cmdstringNRun after deployment>Command
        loadBalancer.loadBalancerTargetGroupNonumberN
        (When strategy=blueGreen, required)
        Load Balancer target group numberView with targetGroupList API
        loadBalancer.deleteAsgbooleanN
        (When strategy=blueGreen, optional)
        falseExisting Auto Scaling Group deletion status
        loadBalancer.deleteServerbooleanN
        (When strategy=blueGreen, required)
        Deletion status of server in the existing Auto Scaling GroupWhen loadBalancer.deleteAsg value is true, only true can be entered

        TSecnarioKubernetesService

        {
         {
        
            "manifest": {
                "type": "string",
                "repository": "string",
                "branch": "string",
                "path": ["string"]
            },
            "strategy": "string",
            "canaryConfig": {
                "canaryCount": "number",
                "analysisType": "string",
                "timeout": "number",
                "prometheus": "string",
                "env": {
                    "baseline": "string",
                    "canary": "string"
                },
                "metrics": [
                    {
                        "name": "string",
                        "successCriteria": "string",
                        "queryType": "string",
                        "weight": "number",
                        "metric": "string",
                        "filter": "string",
                        "query": "string"
                    }
                ],
                "analysisConfig": {
                    "duration": "number",
                    "delay": "number",
                    "interval": "number",
                    "step": "number"
                },
                "passScore": "number"
            }
        }
        JSON
        ItemTypeRequiredDescriptionNote
        strategystringYDeployment strategy"rolling" | "blueGreen" | "canary"
        manifest.typestringYManifest file repository"SourceCommit"
        manifest.repositorystringYRepositoryView with sourceCommitRepositoryList API
        manifest.branchstringYRepository branchView with sourceCommitBranchList API
        manifest.pathstring[]YFile location
        canaryConfig.analysisTypestringN
        (When strategy=canary, required)
        Canary analysis method"manual" | "auto"
        canaryConfig.timeoutnumberN
        (strategy=canary &
        When canaryConfig.analysisType=manual, required)
        Maximum time of deployment/cancellation
        canaryConfig.canaryCountnumberN
        (When canaryConfig.analysisType=auto, required)
        Number of baselines and canary pods
        canaryConfig.prometheusstringN
        (When strategy=canary & canaryConfig.analysisType=auto, required)
        Prometheus Url
        canaryConfig.env.baselinestringN
        (When strategy=canary & canaryConfig.analysisType=auto, required)
        Analysis environment variable > baseline
        canaryConfig.env.canarystringN
        (When strategy=canary & canaryConfig.analysisType=auto, required)
        Analysis environment variable > canary
        canaryConfig.metrics.namestringN
        (When strategy=canary & canaryConfig.analysisType=auto, required)
        Metric name
        canaryConfig.metrics.successCriteriastringN
        (When strategy=canary & canaryConfig.analysisType=auto, required)
        Succeeded criteria"base" | "canary"
        canaryConfig.metrics.queryTypestringN
        (When strategy=canary & canaryConfig.analysisType=auto, required)
        Query type"default" | "promQL"
        canaryConfig.metrics.weightnumberN
        (When strategy=canary & canaryConfig.analysisType=auto, required)
        Weight
        canaryConfig.metrics.metricstringN
        (When strategy=canary & canaryConfig.analysisType=auto & canaryConfig.metrics.queryType="default," required)
        Metric
        canaryConfig.metrics.filterstringN
        (When strategy=canary & canaryConfig.analysisType=auto & canaryConfig.metrics.queryType="default," required)
        Filter
        canaryConfig.metrics.querystringN
        (When strategy=canary & canaryConfig.analysisType=auto & canaryConfig.metrics.queryType="promQL," required)
        Query
        canaryConfig.analysisConfig.durationnumberN
        (When strategy=canary & canaryConfig.analysisType=auto, required)
        Analysis time
        canaryConfig.analysisConfig.delaynumberN
        (When strategy=canary & canaryConfig.analysisType=auto, required)
        Analysis delay time
        canaryConfig.analysisConfig.intervalnumberN
        (When strategy=canary & canaryConfig.analysisType=auto, required)
        Analysis cycle
        canaryConfig.analysisConfig.stepnumberN
        (When strategy=canary & canaryConfig.analysisType=auto, required)
        Metric collection cycle
        canaryConfig.passScorenumberN
        (When strategy=canary & canaryConfig.analysisType=auto, required)
        Analysis success score

        TSecnarioObjectStorage

        {
            "file": {
                "type": "string",
                "ObjectStorage": {
                    "bucket": "string",
                    "object": "string"
                },
                "SourceBuild": {
                    "id": "number"
                }
            },
            "path": [
                    {
                        "sourcePath": "string",
                        "deployPath": "string"
                    }
            ]
        }
        JSON
        ItemTypeRequiredDescriptionNote
        file.typestringYDeployment file type"ObjectStorage" | "SourceBuild" | "later"
        file.ObjectStorage.bucketstringN
        (When file.type=ObjectStorage, required)
        ObjectStorage bucket nameView with objectStorageBucketList API
        file.ObjectStorage.objectstringN
        (When file.type=ObjectStorage, required)
        ObjectStorage object locationView with objectstorageobjectlist API
        file.SourceBuild.idnumberN
        (When file.type=SourceBuild, required)
        SourceBuild idView with sourceBuildList API
        path.sourcePathstringNSource file path
        path.deployPathstringNDeployment path

        Responses

        Response bodies

        {
        	"id": "number",
        	"name": "string"
        }
        JSON
        ItemTypeDescriptionNote
        idnumberScenario ID
        namestringScenario name

        Was this article helpful?

        Changing your password will log you out immediately. Use the new password to log back in.
        First name must have atleast 2 characters. Numbers and special characters are not allowed.
        Last name must have atleast 1 characters. Numbers and special characters are not allowed.
        Enter a valid email
        Enter a valid password
        Your profile has been successfully updated.