MENU
      시나리오 생성

        시나리오 생성


        기사 요약

        개요

        SourceDeploy 프로젝트의 시나리오를 생성합니다.

        요청

        API URL

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

        요청 Parameter

        항목타입설명비고
        projectIdstring프로젝트 IDprojectList 조회
        stageIdstringstage IDstageList 조회

        요청 Query

        없음

        요청 Body

        {
            "name": "string",
            "description": "string",
            "config": "TScenarioServer" | "TScenarioAutoScalingGroup" | "TSecnarioKubernetesService" | "TSecnarioObjectStorage"
        }
        JSON
        항목타입필수 여부설명비고
        namestringY시나리오 이름
        descriptionstringN시나리오 설명
        ConfigTScenarioServer | TScenarioAutoScalingGroup| TSecnarioKubernetesService|TSecnarioObjectStorageY시나리오 설정stageDetail API로 stage type 조회
        stage type="Server"일때, TScenarioServer
        stage type="AutoScalingGroup" 일때, TScenarioAutoScalingGroup
        stage type="KubernetesService" 일때, TSecnarioKubernetesService
        stage type="ObjectStroage" 일때, TSecnarioObjectStorage

        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
        항목타입필수여부Default설명비고
        strategystringY배포 전략"normal"
        sequencebooleanNtrue순차 배포 여부false 입력 시 동시 배포
        file.typestringY배포 파일 type"ObjectStorage" | "SourceBuild" | "later"
        file.ObjectStorage.bucketstringN
        (file.type=ObjectStorage 일때, 필수)
        ObjectStorage 버킷이름objectStorageBucketList API로 조회
        file.ObjectStorage.objectstringN
        (file.type=ObjectStorage 일때, 필수)
        ObjectStorage object 위치objectstorageobjectlist API로 조회
        file.SourceBuild.idnumberN
        (file.type=SourceBuild 일때, 필수)
        SourceBuild idsourceBuildList API로 조회
        rollbackbooleanY배포 실패 시 롤백
        cmd.pre.userstringN배포 전 실행>실행 계정
        cmd.pre.cmdstringN배포 전 실행>실행 명령
        cmd.deploy.sourcePathstringN파일 배포> 소스 파일 경로
        cmd.deploy.deployPathstringN파일 배포>배포 경로
        cmd.post.userstringN배포 후 실행>실행 계정
        cmd.post.cmdstringN배포 후 실행>실행 명령

        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
        항목타입필수 여부Default설명비고
        strategystringY배포 전략"normal" | "blueGreen"
        sequencebooleanNtrue순차 배포 여부false 입력 시 동시 배포
        file.typestringY배포 파일 type"ObjectStorage" | "SourceBuild" | "later"
        file.ObjectStorage.bucketstringN
        (file.type=ObjectStorage 일때, 필수)
        ObjectStorage 버킷이름objectStorageBucketList API로 조회
        file.ObjectStorage.objectstringN
        (file.type=ObjectStorage 일때, 필수)
        ObjectStorage object 위치objectstorageobjectlist API로 조회
        file.SourceBuild.idnumberN
        (file.type=SourceBuild 일때, 필수)
        SourceBuild idsourceBuildList API로 조회
        rollbackbooleanY배포 실패 시 롤백
        cmd.pre.userstringN배포 전 실행>실행 계정
        cmd.pre.cmdstringN배포 전 실행>실행 명령
        cmd.deploy.sourcePathstringN파일 배포> 소스 파일 경로
        cmd.deploy.deployPathstringN파일 배포>배포 경로
        cmd.post.userstringN배포 후 실행>실행 계정
        cmd.post.cmdstringN배포 후 실행>실행 명령
        loadBalancer.loadBalancerTargetGroupNonumberN
        (strategy=blueGreen 일때, 필수)
        로드밸런서 Target Group notargetGroupList API 로 조회
        loadBalancer.deleteAsgbooleanN
        (strategy=blueGreen 일때, 옵션)
        false기존 Auto Scaling Group 삭제 여부
        loadBalancer.deleteServerbooleanN
        (strategy=blueGreen 일때, 필수)
        기존 Auto Scaling Group 내 서버 삭제 여부loadBalancer.deleteAsg 값이 true인 경우, true 로만 입력 가능

        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
        항목타입필수 여부설명비고
        strategystringY배포 전략"rolling" | "blueGreen" | "canary"
        manifest.typestringY매니페스트 파일 저장소"SourceCommit"
        manifest.repositorystringY리파지토리sourceCommitRepostiroyList API 로 조회
        manifest.branchstringY리파지토리 브랜치sourceCommitBranchList API 로 조회
        manifest.pathstring[]Y파일 위치
        canaryConfig.analysisTypestringN
        (strategy=canary 일때, 필수)
        Canary 분석 방법"manual" | "auto"
        canaryConfig.timeoutnumberN
        (strategy=canary &
        canaryConfig.analysisType=manual 일때, 필수)
        배포/취소 최대시간
        canaryConfig.canaryCountnumberN
        (canaryConfig.analysisType=auto 일때, 필수)
        Baseline, Canary Pod 개수
        canaryConfig.prometheusstringN
        (strategy=canary & canaryConfig.analysisType=auto 일때, 필수)
        Prometheus Url
        canaryConfig.env.baselinestringN
        (strategy=canary & canaryConfig.analysisType=auto 일때, 필수)
        분석 환경변수 > baseline
        canaryConfig.env.canarystringN
        (strategy=canary & canaryConfig.analysisType=auto 일때, 필수)
        분석 환경변수 > canary
        canaryConfig.metrics.namestringN
        (strategy=canary & canaryConfig.analysisType=auto 일때, 필수)
        메트릭 이름
        canaryConfig.metrics.successCriteriastringN
        (strategy=canary & canaryConfig.analysisType=auto 일때, 필수)
        성공 기준"base" | "canary"
        canaryConfig.metrics.queryTypestringN
        (strategy=canary & canaryConfig.analysisType=auto 일때, 필수)
        쿼리 타입"default" | "promQL"
        canaryConfig.metrics.weightnumberN
        (strategy=canary & canaryConfig.analysisType=auto 일때, 필수)
        가중치
        canaryConfig.metrics.metricstringN
        (strategy=canary & canaryConfig.analysisType=auto &canaryConfig.metrics.queryType="default" 일때 , 필수)
        메트릭
        canaryConfig.metrics.filterstringN
        (strategy=canary & canaryConfig.analysisType=auto & canaryConfig.metrics.queryType="default" 일때 , 필수)
        Filter
        canaryConfig.metrics.querystringN
        (strategy=canary & canaryConfig.analysisType=auto & canaryConfig.metrics.queryType="promQL" 일때 , 필수)
        쿼리
        canaryConfig.analysisConfig.durationnumberN
        (strategy=canary & canaryConfig.analysisType=auto 일때, 필수)
        분석 시간
        canaryConfig.analysisConfig.delaynumberN
        (strategy=canary & canaryConfig.analysisType=auto 일때, 필수)
        분석 지연 시간
        canaryConfig.analysisConfig.intervalnumberN
        (strategy=canary & canaryConfig.analysisType=auto 일때, 필수)
        분석 주기
        canaryConfig.analysisConfig.stepnumberN
        (strategy=canary & canaryConfig.analysisType=auto 일때, 필수)
        Metric 수집 주기
        canaryConfig.passScorenumberN
        (strategy=canary & canaryConfig.analysisType=auto 일때, 필수)
        분석 성공 점수

        TSecnarioObjectStorage

        {
            "file": {
                "type": "string",
                "ObjectStorage": {
                    "bucket": "string",
                    "object": "string"
                },
                "SourceBuild": {
                    "id": "number"
                }
            },
            "path": [
                    {
                        "sourcePath": "string",
                        "deployPath": "string"
                    }
            ]
        }
        JSON
        항목타입필수여부설명비고
        file.typestringY배포 파일 type"ObjectStorage" | "SourceBuild" | "later"
        file.ObjectStorage.bucketstringN
        (file.type=ObjectStorage 일때, 필수)
        ObjectStorage 버킷이름objectStorageBucketList API로 조회
        file.ObjectStorage.objectstringN
        (file.type=ObjectStorage 일때, 필수)
        ObjectStorage object 위치objectstorageobjectlist API로 조회
        file.SourceBuild.idnumberN
        (file.type=SourceBuild 일때, 필수)
        SourceBuild idsourceBuildList API로 조회
        path.sourcePathstringN소스 파일 경로
        path.deployPathstringN배포 경로

        응답

        응답 Body

        {
        	"id": "number",
        	"name": "string"
        }
        JSON
        항목타입설명비고
        idnumber시나리오 id
        namestring시나리오 이름

        이 문서가 도움이 되었습니까?

        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.