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

Add get VM list in a VMGroup within a MCIS #1176

Merged
merged 6 commits into from
Sep 20, 2022

Conversation

seokho-son
Copy link
Member

Add get VM list in a VMGroup within a MCIS

API

GET
​/ns​/{nsId}​/mcis​/{mcisId}​/group​/{groupId}
List VMs with a VMGroup label in a specified MCIS

예시

입력

curl -X 'GET'
'http://localhost:1323/tumblebug/ns/ns01/mcis/mc-s5irj/group/group-1?option=id'
-H 'accept: application/json'

출력

200 Response bodyDownload{ "output": [ "group-0-0", "group-0-1", "group-0-2" ] }

image

@seokho-son
Copy link
Member Author

// ListVmByFilter is func to get list VMs in a MCIS by a filter consist of Key and Value
func ListVmByFilter(nsId string, mcisId string, filterKey string, filterVal string) ([]string, error)

// ListMcisGroupVms is func to get VM list with a VMGroup label in a specified MCIS
func ListMcisGroupVms(nsId string, mcisId string, groupId string) ([]string, error)

이외에도 다양하게 활용할 수 있도록 구성하였습니다.

@seokho-son
Copy link
Member Author

참고로 reflect pkg 를 활용하였습니다.

@seokho-son
Copy link
Member Author

해당 그룹 VM 리스트 조회 기능을 활용하여,

nlb 생성 요청 인자를 간소화할 필요가 있겠습니다. (@jihoon-seo)

@lgtm-com
Copy link

lgtm-com bot commented Sep 19, 2022

This pull request introduces 2 alerts when merging 2f3a7fa into 1a77b5b - view on LGTM.com

new alerts:

  • 2 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.

@seokho-son 한번 확인 부탁드립니다 😊

src/api/rest/docs/docs.go Outdated Show resolved Hide resolved
src/api/rest/server/mcis/manageInfo.go Outdated Show resolved Hide resolved
src/api/rest/server/server.go Outdated Show resolved Hide resolved
src/api/rest/server/server.go Show resolved Hide resolved
@seokho-son
Copy link
Member Author

@jihoon-seo 리뷰 감사합니다!
전부 반영하였고, 추가적으로 mcis 및 ns 존재 여부를 확인하여, 없으면 error를 발생시키는 로직도 추가하였습니다.

@lgtm-com
Copy link

lgtm-com bot commented Sep 20, 2022

This pull request introduces 3 alerts when merging ef0c090 into 1a77b5b - view on LGTM.com

new alerts:

  • 2 for Log entries created from user input
  • 1 for Useless assignment to local variable

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.

@seokho-son 감사합니다!

@jihoon-seo jihoon-seo merged commit 8f24474 into cloud-barista:main Sep 20, 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