-
Notifications
You must be signed in to change notification settings - Fork 50
AnyCall API Extension Guide
ByoungSeob Kim edited this page Sep 21, 2022
·
11 revisions
- 멀티클라우드 공통 제어를 제공하는 CB-Spider API는 특정 Cloud의 세밀한 제어가 불충분할 때가 있다.
- AnyCall API 확장(
AnyCall API Extension) 기능은 특정 CSP에 대한 부가 API를 쉽게 추가할 수 있는 방법을 제공한다. - AnyCall 기능은 아래 그림과 같이
(1)AnyCall MSG,(2)AnyCall API,(3)AnyCallHandler및 추가되는(4)Ext-Function들로 구성되며,
[CB-Spider AnyCall API 확장 기능 개요]
- 각 요소별 세부 내용은 다음과 같다.
- (1) AnyCall MSG
- 추가할 함수로 전달될 input msg와 함수 실행 결과를 포함하는 output msg가 존재한다.
- AnyCall MSG가 포함하는 정보는 다음과 같다.
- To. Cloud: 함수를 실행할 대상 클라우드 - Function ID: Driver 내에 추가할 함수 이름 - input List: 함수에 입력할 인자 리스트 - output List: 함수 결과 정보 리스트
- (2) AnyCall API
- (3) AnyCall Handler
- (4) Ext-Functions
- (1) AnyCall MSG
-
Mock Driver를 예를 들어 설명하면,
- Mock Cloud에서만 VPC 및 Security Group 자원의 갯수를 제공하는 함수를 추가하는 방법은 다음과 같다.
- ConnectionName: mock-config01
- FID: countAll
- IKeyValueList: { "Key" : "rsType", "Value" : "vpc" }
- OKeyValueList: { "Key" : "Count", "Value" : "10" }
- Mock Cloud에서만 VPC 및 Security Group 자원의 갯수를 제공하는 함수를 추가하는 방법은 다음과 같다.
-
사용자 REST API 예시는 다음과 같습니다.
curl -sX POST http://localhost:1024/spider/anycall -H 'Content-Type: application/json' -d \ '{ "ConnectionName" : "mock-config01", "ReqInfo" : { "FID" : "countAll", "IKeyValueList" : [{"Key":"rsType", "Value":"vpc"}] } }' | json_pp -
실행 결과 예시는 다음과 같습니다.
{
"FID" : "countAll",
"IKeyValueList" : [
{
"Key" : "rsType",
"Value" : "vpc"
}
],
"OKeyValueList" : [
{
"Key" : "Count",
"Value" : "10"
}
]
}
-
Driver 내 함수 구현 방법은 다음의
Mock Driver의countAll을 참고합니다. -
이때, 대상 Driver에 AnyCallHandler가 존재하지 않는다면 추가합니다.
-
신규 AnyCallHandler 추가하는 방법
- (1) 다음 예시를 참고하여
{driver}/connect/*위치에 CreateAnyCallHandler() 함수를 추가합니다. - (2) 다음 예시를 참고하여
{driver}/resources/AnyCallHandler.go를 추가합니다.- 예시: AnyCallHandler.go`
- (1) 다음 예시를 참고하여
-
Install & Start Guide
-
Features & Usage
-
- AdminWeb Tool Guide
- CLI Tool Guide
- REST API Guide
- NLI Guide
-
Design
-
Developer Guide
-
Cloud Driver Developer Guide
- Cloud Driver Developer Guide-WIP
- VM SSH Key Development Guide-WIP
- VM User Development Guide
- What is the CSP SDK API Version of drivers
- Region Zone Info and Driver API
- (StartVM TerminateVM) API Call Counts and Waiting
- StartVM and TerminateVM Main Flow of drivers
- VM Root Disk Configuration Guide
- Security Group Rules and Driver API
- Network Load Balancer and Driver API
- VM Snapshot, MyImage and Disk Overview
- Kubernetes and Driver API(PMKS, K8S)
- Tag and Cloud Driver API
- AnyCall API Extension Guide
-
Test Reports
- v0.2.8-for-espresso-release
- v0.3.0-espresso-release
- Azure:Terminating VM
- cb-user@VM: ssh login, sudo run
- v0.3.14 test for SG Source
- v0.4.0-cafemocha-release
- Test via REST API Gateway
- Test Reports of v0.4.11 (IID2 initial Version)
- Test Reports of v0.4.12 (Register & Unregister existing Resources)
- Test Reports for v0.6.0 Release
- How to ...
- How to Use AWS S3 with Credentials
- How to Use Alibaba ECS i1.* Instance Types
- How to provision GPU VMs
- How to Resolve the 'Failed to Connect to Database' Error
- How to test CB Spider with Mock Driver
- How to install CB Spider on WSL2 under 공유기/사설망
- How to install CB Spider on macOS
- How to run CB Spider Container on macOS
- How to install OpenStack on a VM for CB Spider Testing
- How to get Azure available Regions
- How to profile memory usage in Golang
- Deprecated:How to install protoc and plugins
- [For Cloud-Migrator]