IBM Cloud API Gateway(Legacy)를 통해 Functions 호출
소개
IBM이 제공하는 API 관리 솔루션이라고 하면 API Connect입니다만, IBM Cloud에서는 그 API Connect에 더해 간단하게 간단하게 API 공개를 할 수 있는 API Gateway라고 하는 서비스도 제공되고 있습니다. Legagy라고 붙은 것과 무인의 API Gateway의 2종류가 있는 것 같습니다. Qiita에서는 아직 기사가 보이지 않기 때문에, 간단하게 시험하는 순서를 정리해 보았습니다.
전제


절차
API Gateway 서비스를 먼저 배포합니다.
다음 에서 [Create service]를 클릭하고 서비스 이름과 리소스 그룹을 지정하여 생성합니다.




API를 설정합니다.












4. Review and Test의 각 경로의 Try it 탭에서 Client ID에 API 키를 넣고 POST와 GET을 각각 호출합니다. GET의 경우 200과 함께 Functions 샘플에서 설정된 Hello World가 응답으로 반환됩니다. POST의 경우 본문에 {"name": "Andy"}를 넣고 요청하면 Hello Andy가 응답으로 반환된다는 것을 알 수 있습니다.




5. Postman에서 호출해도 동일하게 되는 것을 알 수 있습니다.


6. Rate Limit를 초과하면 다음과 같이 429 오류를 반환합니다.

7. X-Client-ID 헤더에 의한 API 키를 붙이지 않으면 401 에러를 돌려줍니다.

요약
이상으로 간편하게 IBM Cloud의 간단한 API Gateway 서비스로 간편하게 샘플 API를 게시하는 단계를 요약했습니다. 다음 번에는 Legacy가 아닌 API Gateway를 사용해 보겠습니다.
참고
Reference
이 문제에 관하여(IBM Cloud API Gateway(Legacy)를 통해 Functions 호출), 우리는 이곳에서 더 많은 자료를 발견하고 링크를 클릭하여 보았다 https://qiita.com/rinaxsumomo/items/350ca64160ac41a8f77f텍스트를 자유롭게 공유하거나 복사할 수 있습니다.하지만 이 문서의 URL은 참조 URL로 남겨 두십시오.
우수한 개발자 콘텐츠 발견에 전념
(Collection and Share based on the CC Protocol.)