Update REST API of LookupImage & LookupSpec #444
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Tumblebug 에 LookupImage 함수가 있습니다. (호출되면 Spider 에 Lookup 요청 보냄)
그런데, LookupImage 에 대한 REST API 를 호출하면, Tumblebug 이 Spider 를 호출하지 않고 바로 404 Not Found 를 리턴하는 현상이 있었습니다.
(GCP 의
cspImageId
가 URL 형식이라서 발생하는 현상으로 추정)[요청]
GET http://$TumblebugServer/tumblebug/lookupImage/https://www.googleapis.com/compute/v1/projects/ubuntu-os-cloud/global/images/ubuntu-minimal-1804-bionic-v20191024
[응답]
그래서,
cspImageId
를GET 요청의 URL 이 아니라
JSON 바디에 넣는 것으로 바꾸니
[요청]
GET http://$TumblebugServer/tumblebug/lookupImage
이 현상이 사라졌습니다. (Tumblebug 이 404 에러를 리턴하지 않고, Spider 를 호출함. 하지만 이번에는 Spider 가 404 를 리턴함)
[REST API 변경사항]
func RestLookupImage
cspImageId
를 명시해야 함func RestLookupImageList
func RestLookupSpec
cspSpecName
을 명시해야 함func RestLookupSpecList