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 UpdateSshKey feature #1023

Merged

Conversation

jihoon-seo
Copy link
Member

[Ref]

[테스트 결과]

❯ ./get-sshKey.sh -n jhseo -c mock -r 1
####################################################################
## 5. sshKey: Get
####################################################################


- Get sshKey in mock-seoul
{
  "id": "mock-seoul-jhseo",
  "name": "mock-seoul-jhseo",
  "connectionName": "mock-seoul",
  "cspSshKeyName": "ns01-mock-seoul-jhseo",
  "fingerprint": "XXXXFingerprint",
  "username": "cb-user",
  "publicKey": "XXXXPublicKey",
  "privateKey": "XXXXPrivateKey"
}
❯ head test-update-sshKey.sh 
...
curl -H "${AUTH}" -sX PUT http://$TumblebugServer/tumblebug/ns/$NSID/resources/sshKey/${CONN_CONFIG[$INDEX,$REGION]}-${POSTFIX} -H 'Content-Type: application/json' -d \
'{ 
    "description": "UpdateSshKey() test"
}'
❯ ./test-update-sshKey.sh -n jhseo -c mock -r 1
####################################################################
## 5. sshKey: Update
####################################################################


- Update sshKey in mock-seoul
{
  "id": "mock-seoul-jhseo",
  "name": "mock-seoul-jhseo",
  "connectionName": "mock-seoul",
  "description": "UpdateSshKey() test",
  "cspSshKeyName": "ns01-mock-seoul-jhseo",
  "fingerprint": "XXXXFingerprint",
  "username": "cb-user",
  "publicKey": "XXXXPublicKey",
  "privateKey": "XXXXPrivateKey"
}

("description": "UpdateSshKey() test" 필드가 추가됨)

@jihoon-seo jihoon-seo requested a review from seokho-son January 28, 2022 05:00
@jihoon-seo jihoon-seo linked an issue Jan 28, 2022 that may be closed by this pull request
@seokho-son
Copy link
Member

@jihoon-seo
PUT 인 경우에 업데이트 할 수 없는 항목에 대한 표기가 필요할까요? (API 문서로 사용자에게 쉽게 가이드할 수 있는 방법)

@jihoon-seo
Copy link
Member Author

@seokho-son 현재는 id 를 제외한 모든 필드를 업데이트 할 수 있게 해 놓았습니다.
추후 업데이트 불가능한 필드를 지정할 경우, Swagger doc 표기는..

  • 쉽게 추가할 수 있고, 시인성/전달성/명확성 등이 좋으면 추가해 볼 수 있겠습니다.
  • 쉽지 않다면, 해당 상황 발생 시 에러 메시지를 통해 사용자에게 알려주는 방법도 있겠습니다. 😊

@seokho-son
Copy link
Member

감사합니다! 일단은 api 문서상의 description 에 처리되도록 해둬야겠네요 :)
(in Put method, updating ID is not allowed)

Copy link
Member

@seokho-son seokho-son left a comment

Choose a reason for hiding this comment

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

LGTM :)

@seokho-son seokho-son merged commit 9c8b009 into cloud-barista:main Jan 28, 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.

Add UpdateSshKey feature
2 participants