Edit scenario
    • PDF

    Edit scenario

    • PDF

    Article summary

    Overview

    Edit a scenario of the SourceDeploy project.

    Requests

    API URL

    PATCH 	{SOURCEDEPLOY_API_URL}/project/{projectId}/stage/{stageId}/scenario/{scenarioId}
    

    Request parameters

    ItemTypeDescriptionNote
    projectIdstringProject IDView projectList
    stageIdstringstage IDView stageList

    Request queries

    None

    Request bodies

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

    TScenarioServer

    {
        "strategy": "normal",
        "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"
                }
            ]
        },
    }
    
    ItemTypeRequiredDefaultDescriptionNote
    strategystringNDeployment strategy"normal"
    sequencebooleanNtrueConsecutive deployment statusWhen false is entered, deployed simultaneously
    file.typestringN
    Required when editing a deployed file
    Deployment 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
    rollbackbooleanNRoll 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"
        }
    }
    
    ItemTypeRequiredDefaultDescriptionNote
    strategystringNDeployment strategy"normal" | "blueGreen"
    sequencebooleanNtrueConsecutive deployment statusWhen false is entered, deployed simultaneously
    file.typestringN
    Required when editing a deployed file
    Deployment 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
    rollbackbooleanNRoll 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"
        }
    }
    
    ItemTypeRequiredDescriptionNote
    strategystringNDeployment strategy"rolling" | "blueGreen" | "canary"
    manifest.typestringNManifest file repository"SourceCommit"
    manifest.repositorystringNRepositoryView with sourceCommitRepositoryList API
    manifest.branchstringNRepository branchView with sourceCommitBranchList API
    manifest.pathstring[]NFile 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 strategy=canary & 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 and when canaryConfig.metrics.queryType="default," required)
    Metric
    canaryConfig.metrics.filterstringN
    (When strategy=canary & canaryConfig.analysisType=auto and when canaryConfig.metrics.queryType="default," required)
    Filter
    canaryConfig.metrics.querystringN
    (When strategy=canary & canaryConfig.analysisType=auto and when 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"
                }
        ]
    }
    
    ItemTypeRequiredDescriptionNote
    file.typestringN
    Required when editing a deployed file
    Deployment 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"
    }
    
    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.