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

Update REST API of LookupImage & LookupSpec #444

Conversation

jihoon-seo
Copy link
Member

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

{
  "connectionName": "gcp-asia-east1"
}

[응답]

{
  "message": "Not Found"
}

그래서, cspImageId
GET 요청의 URL 이 아니라
JSON 바디에 넣는 것으로 바꾸니

[요청]
GET http://$TumblebugServer/tumblebug/lookupImage

{
  "connectionName": "gcp-asia-east1",
  "cspImageId": "https://www.googleapis.com/compute/v1/projects/ubuntu-os-cloud/global/images/ubuntu-minimal-1804-bionic-v20191024"
}

이 현상이 사라졌습니다. (Tumblebug 이 404 에러를 리턴하지 않고, Spider 를 호출함. 하지만 이번에는 Spider 가 404 를 리턴함)


[REST API 변경사항]

  • func RestLookupImage
    • GET /lookupImage/{imageId} => /lookupImage
    • 요청의 JSON 바디에 cspImageId 를 명시해야 함
  • func RestLookupImageList
    • GET /lookupImage => /lookupImages
  • func RestLookupSpec
    • GET /lookupSpec/{specId} => /lookupSpec
    • 요청의 JSON 바디에 cspSpecName 을 명시해야 함
  • func RestLookupSpecList
    • GET /lookupSpec => /lookupSpecs

@jihoon-seo jihoon-seo requested a review from seokho-son April 5, 2021 09:59
@seokho-son seokho-son enabled auto-merge April 5, 2021 12:55
@seokho-son
Copy link
Member

/lgtm

@seokho-son
Copy link
Member

/approve

@github-actions github-actions bot added the lgtm This PR is acceptable by at least one reviewer label Apr 5, 2021
@seokho-son seokho-son merged commit 9184073 into cloud-barista:master Apr 5, 2021
@jihoon-seo jihoon-seo deleted the 210405-Update-LookupImage-LookupSpec-REST-API branch April 6, 2021 01:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
lgtm This PR is acceptable by at least one reviewer
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants