시나리오 생성

Prev Next

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

요청

API URL

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

요청 Parameter

항목 타입 설명 비고
projectId string 프로젝트 ID projectList 조회
stageId string stage ID stageList 조회

요청 Query

없음

요청 Body

{
    "name": "string",
    "description": "string",
    "config": "TScenarioServer" | "TScenarioAutoScalingGroup" | "TSecnarioKubernetesService" | "TSecnarioObjectStorage"
}
항목 타입 필수 여부 설명 비고
name string Y 시나리오 이름
description string N 시나리오 설명
Config TScenarioServer | TScenarioAutoScalingGroup| TSecnarioKubernetesService|TSecnarioObjectStorage Y 시나리오 설정 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"
                }
            ]
        },
    }
    
    항목 타입 필수여부 Default 설명 비고
    strategy string Y 배포 전략 "normal"
    sequence boolean N true 순차 배포 여부 false 입력 시 동시 배포
    file.type string Y 배포 파일 type "ObjectStorage" | "SourceBuild" | "later"
    file.ObjectStorage.bucket string N
    (file.type=ObjectStorage 일 때 필수)
    ObjectStorage 버킷이름 objectStorageBucketList API로 조회
    file.ObjectStorage.object string N
    (file.type=ObjectStorage 일 때 필수)
    ObjectStorage object 위치 objectstorageobjectlist API로 조회
    file.SourceBuild.id number N
    (file.type=SourceBuild 일 때 필수)
    SourceBuild id sourceBuildList API로 조회
    rollback boolean Y 배포 실패 시 롤백
    cmd.pre.user string N 배포 전 실행 > 실행 계정
    cmd.pre.cmd string N 배포 전 실행 > 실행 명령
    cmd.deploy.sourcePath string N 파일 배포 > 소스 파일 경로
    cmd.deploy.deployPath string N 파일 배포 > 배포 경로
    cmd.post.user string N 배포 후 실행 > 실행 계정
    cmd.post.cmd string N 배포 후 실행 > 실행 명령

    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" 
        }
    }
    
    항목 타입 필수 여부 Default 설명 비고
    strategy string Y 배포 전략 "normal" | "blueGreen"
    sequence boolean N true 순차 배포 여부 false 입력 시 동시 배포
    file.type string Y 배포 파일 type "ObjectStorage" | "SourceBuild" | "later"
    file.ObjectStorage.bucket string N
    (file.type=ObjectStorage 일 때 필수)
    ObjectStorage 버킷이름 objectStorageBucketList API로 조회
    file.ObjectStorage.object string N
    (file.type=ObjectStorage 일 때 필수)
    ObjectStorage object 위치 objectstorageobjectlist API로 조회
    file.SourceBuild.id number N
    (file.type=SourceBuild 일 때 필수)
    SourceBuild id sourceBuildList API로 조회
    rollback boolean Y 배포 실패 시 롤백
    cmd.pre.user string N 배포 전 실행 > 실행 계정
    cmd.pre.cmd string N 배포 전 실행 > 실행 명령
    cmd.deploy.sourcePath string N 파일 배포 > 소스 파일 경로
    cmd.deploy.deployPath string N 파일 배포 > 배포 경로
    cmd.post.user string N 배포 후 실행 > 실행 계정
    cmd.post.cmd string N 배포 후 실행 > 실행 명령
    loadBalancer.loadBalancerTargetGroupNo number N
    (strategy=blueGreen 일때, 필수)
    로드밸런서 Target Group no targetGroupList API 로 조회
    loadBalancer.deleteAsg boolean N
    (strategy=blueGreen 일때, 옵션)
    false 기존 Auto Scaling Group 삭제 여부
    loadBalancer.deleteServer boolean N
    (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"
        }
    }
    
    항목 타입 필수 여부 설명 비고
    strategy string Y 배포 전략 "rolling" | "blueGreen" | "canary"
    manifest.type string Y 매니페스트 파일 저장소 "SourceCommit"
    manifest.repository string Y 리포지토리 sourceCommitRepostiroyList API 로 조회
    manifest.branch string Y 리포지토리 브랜치 sourceCommitBranchList API 로 조회
    manifest.path string[] Y 파일 위치
    canaryConfig.analysisType string N
    (strategy=canary 일때, 필수)
    Canary 분석 방법 "manual" | "auto"
    canaryConfig.timeout number N
    (strategy=canary &
    canaryConfig.analysisType=manual 일 때 필수)
    배포/취소 최대시간
    canaryConfig.canaryCount number N
    (canaryConfig.analysisType=auto 일 때 필수)
    Baseline, Canary Pod 개수
    canaryConfig.prometheus string N
    (strategy=canary & canaryConfig.analysisType=auto 일 때 필수)
    Prometheus Url
    canaryConfig.env.baseline string N
    (strategy=canary & canaryConfig.analysisType=auto 일 때 필수)
    분석 환경변수 > baseline
    canaryConfig.env.canary string N
    (strategy=canary & canaryConfig.analysisType=auto 일 때 필수)
    분석 환경변수 > canary
    canaryConfig.metrics.name string N
    (strategy=canary & canaryConfig.analysisType=auto 일 때 필수)
    메트릭 이름
    canaryConfig.metrics.successCriteria string N
    (strategy=canary & canaryConfig.analysisType=auto 일 때 필수)
    성공 기준 "base" | "canary"
    canaryConfig.metrics.queryType string N
    (strategy=canary & canaryConfig.analysisType=auto 일 때 필수)
    쿼리 타입 "default" | "promQL"
    canaryConfig.metrics.weight number N
    (strategy=canary & canaryConfig.analysisType=auto 일때, 필수)
    가중치
    canaryConfig.metrics.metric string N
    (strategy=canary & canaryConfig.analysisType=auto &canaryConfig.metrics.queryType="default" 일 때 필수)
    메트릭
    canaryConfig.metrics.filter string N
    (strategy=canary & canaryConfig.analysisType=auto & canaryConfig.metrics.queryType="default" 일 때 필수)
    Filter
    canaryConfig.metrics.query string N
    (strategy=canary & canaryConfig.analysisType=auto & canaryConfig.metrics.queryType="promQL" 일 때 필수)
    쿼리
    canaryConfig.analysisConfig.duration number N
    (strategy=canary & canaryConfig.analysisType=auto 일 때 필수)
    분석 시간
    canaryConfig.analysisConfig.delay number N
    (strategy=canary & canaryConfig.analysisType=auto 일 때 필수)
    분석 지연 시간
    canaryConfig.analysisConfig.interval number N
    (strategy=canary & canaryConfig.analysisType=auto 일 때 필수)
    분석 주기
    canaryConfig.analysisConfig.step number N
    (strategy=canary & canaryConfig.analysisType=auto 일 때 필수)
    Metric 수집 주기
    canaryConfig.passScore number N
    (strategy=canary & canaryConfig.analysisType=auto 일 때 필수)
    분석 성공 점수

    TSecnarioObjectStorage

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

    응답

    응답 Body

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