Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove historic add VM way #1210

Merged
merged 1 commit into from
Oct 19, 2022
Merged

Remove historic add VM way #1210

merged 1 commit into from
Oct 19, 2022

Conversation

seokho-son
Copy link
Member

  • 기존의 MCIS에 단일 VM을 추가하던 방식을 삭제
  • VM을 1개라도 생성하면, 해당 VM은 1개의 subGroup에 기본으로 소속됨
  • MCIS에 VM을 추가하는 API는 1개로 단일화함
    • POST /ns/{nsId}/mcis/{mcisId}/vm
    • subGroupSize에 따라서 동종의 VM이 생성
    • 만약 해당 필드를 사용하지 않거나, 값이 0 이하인 경우에도, 이 값은 1로 자체 보정하여, VM이 subGroup에 속하도록 함.

"subGroupSize": "3" 를 지정한 경우 예시

{
  "connectionName": "aws-ap-northeast-2",
  "description": "Description",
  "imageId": "aws-ap-northeast-2-ubuntu18-04",
  "label": "no",
  "name": "g2",
  "rootDiskSize": "default",
  "rootDiskType": "default",
  "securityGroupIds": [
      "ns01-systemdefault-aws-ap-northeast-2"
  ],
  "specId": "aws-ap-northeast-2-t3a-nano",
  "sshKeyId": "ns01-systemdefault-aws-ap-northeast-2",
  "subGroupSize": "3",
  "subnetId": "ns01-systemdefault-aws-ap-northeast-2",
  "vNetId": "ns01-systemdefault-aws-ap-northeast-2"
}

VM 6개에서 9개로 추가
image

"subGroupSize": "" 필드를 제시하지 않은 경우 예시

{
  "connectionName": "aws-ap-northeast-2",
  "description": "Description",
  "imageId": "aws-ap-northeast-2-ubuntu18-04",
  "label": "no",
  "name": "g2",
  "rootDiskSize": "default",
  "rootDiskType": "default",
  "securityGroupIds": [
      "ns01-systemdefault-aws-ap-northeast-2"
  ],
  "specId": "aws-ap-northeast-2-t3a-nano",
  "sshKeyId": "ns01-systemdefault-aws-ap-northeast-2",
  "subnetId": "ns01-systemdefault-aws-ap-northeast-2",
  "vNetId": "ns01-systemdefault-aws-ap-northeast-2"
}

기존과 동일하게 VM이 1개만 추가됨.
image

@lgtm-com
Copy link

lgtm-com bot commented Oct 18, 2022

This pull request fixes 6 alerts when merging dad335a into c2dc04a - view on LGTM.com

fixed alerts:

  • 6 for Log entries created from user input

Copy link
Member

@jihoon-seo jihoon-seo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

제가 파악한 내용을 메모해 보았습니다 😊

@@ -187,11 +187,10 @@ func RunServer(port string) {
g.DELETE("/:nsId/mcis", rest_mcis.RestDelAllMcis)

g.POST("/:nsId/mcis/:mcisId/vm", rest_mcis.RestPostMcisVm)
g.POST("/:nsId/mcis/:mcisId/subgroup", rest_mcis.RestPostMcisSubGroup)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

MCIS에 VM을 추가하는 API는 1개로 단일화함

POST /ns/:nsId/mcis/:mcisId/subgroup REST API가
POST /ns/:nsId/mcis/:mcisId/vm 으로 통합되었군요 ㅎㅎ

Copy link
Member

@jihoon-seo jihoon-seo Oct 19, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TODO:

  • cb-tumblebug/src/testclient/scripts/8.mcis/add-vmgroup-to-mcis.sh 삭제
  • cb-tumblebug/src/testclient/scripts/8.mcis/add-vm-to-mcis.sh 에 다음을 추가
    • "subGroupSize": "'${NUMVM}'",
  • mv cb-tumblebug/src/testclient/scripts/8.mcis/id-list-vmgroup.sh -> id-list-subgroup.sh

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jihoon-seo 파일명을 살펴보지 않았네요! ㅎㅎ
다음 PR에서 진행해도 될까요?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

넵!

// @Failure 404 {object} common.SimpleMsg
// @Failure 500 {object} common.SimpleMsg
// @Router /ns/{nsId}/mcis/{mcisId}/subgroup [post]
func RestPostMcisSubGroup(c echo.Context) error {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

POST /ns/:nsId/mcis/:mcisId/vm

  • 기존: MCIS에 단일 VM을 추가하는 API
  • 변경: MCIS에 VM n개(subGroup)를 추가하는 API

@jihoon-seo jihoon-seo merged commit 54555f3 into cloud-barista:main Oct 19, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants