-
Notifications
You must be signed in to change notification settings - Fork 48
Tag and Cloud Driver API
ByoungSeob Kim edited this page Jun 24, 2024
·
22 revisions
- CB-Spider Tag Specification V0.1
- V0.1 : CSP Tag 기능의 추상화 제공, 추후 필요시 Spider-Managed Tag 제공
- Spider는 연동된 클라우드의 관리 자원들에 Tag 기능을 제공한다.
- 사용자는 Tag를 사용하여 자원들을 그룹화하고 식별할 수 있으며,
- 이를 통해 대규모 자원의 관리 자동화, 비용 관리 등 다양한 목적에 맞게 활용할 수 있다.
- Spider는 다음과 같이 두 가지 Tag 타입을 지원한다.
-
(1) CLOUD-TAG: 클라우드의 대상 자원에 Tag를 직접 저장/관리
- 장점: Spider API를 통하지 않는 경우에도 대상 자원의 Tag 활용 가능
- 단점: 대상 Cloud가 Tag를 제공하는 자원만 제공 가능
-
(2) SPIDER-TAG: Driver와 무관하며, 서버에서 메타 정보로 관리 제공
- 장점: 빠른 Tag 검색, 모든 자원에 대한 Tag 제공 등
- 단점: Spider API를 통하지 않는 경우 Tag 활용 불가
-
-
[Tag 구성]
- 하나의 Tag는 문자열 Key와 문자열 Value 쌍으로 구성되며,
- Key 값은 필수이나, Value는 옵션으로 생략 가능하다.
-
[자원 타입]
- 자원 타입별로 생성한 자원에 Tag를 관리할 수 있으며,
- 자원 타입의 종류는 다음과 같다.(latest)
type RSType string const ( ALL RSType = "all" IMAGE RSType = "image" # Tag에서는 사용하지 않음 VPC RSType = "vpc" SUBNET RSType = "subnet" SG RSType = "sg" KEY RSType = "keypair" VM RSType = "vm" NLB RSType = "nlb" DISK RSType = "disk" MYIMAGE RSType = "myimage" CLUSTER RSType = "cluster" NODEGROUP RSType = "nodegroup" # Tag에서는 사용하지 않음 )
-
[Tag 정보]
- 하나의 Tag 정보를 표현하기 위하여 다음과 같은 정보 구조를 제공한다.
type TagInfo struct { ResType RSType // VPC, SUBNET, VM, etc.,.) ResIId IID // {NameId, SystemId} TagList []KeyValue KeyValueList []KeyValue // reserved for optinal usage }
- 하나의 Tag 정보를 표현하기 위하여 다음과 같은 정보 구조를 제공한다.
-
[Tag 추가]
- AddTag(resTyp RSType, resIID IID, tag KeyValue) (TagInfo, error)
- 특정 자원 타입의 특정 자원을 대상으로 Tag 추가 가능
- ex) AddTag(VPC, vpc-01, {tag01, value01})
- ※ 동일 자원에 동일 이름의 Key는 중복 추가할 수 없음
- ※ AddTag()의 resType은 ALL 타입 사용 불가
-
[Tag 목록]
- ListTag(resTyp RSType, resIID IID) ([]*TagInfo, error)
- 특정 자원 타입의 특정 자원에 포함된 모든 Tag 정보 목록 제공
- ex) ListTag(VPC, vpc-01)
- ※ ListTag()의 resType은 ALL 타입 사용 불가
-
[Tag 정보]
- GetTag(resTyp RSType, resIID IID, key string) (TagInfo, error)
- 특정 자원 타입의 특정 자원에 포함된 특정 Tag 정보 제공
- ex) GetTag(VPC, vpc-01, tag01)
- ※ GetTag()의 resType은 ALL 타입 사용 불가
- ※ GetTag()의 key는 strict match 지원
-
[Tag 삭제]
- RemoveTag(resType RSType, resIID IID, key string) (bool, error)
- 특정 자원 타입의 특정 자원에 포함된 특정 Tag 삭제
- ex) RemoveTag(VPC, vpc-01, tag01)
- ※ RemoveTag()의 resType은 ALL 타입 사용 불가
- ※ RemoveTag()의 key는 strict match 지원
-
[Tag 찾기]
- FindTag(resType RSType, keyword string) ([]*TagInfo, error)
- 모든 자원 타입의 모든 자원에 포함된 Tag 정보 중 Key나 Value에 keyword를 포함하는 Tag 정보 목록 제공
- ex) FindTag(ALL, tag0)
- ex) FindTag(ALL, value0)
- 특정 자원 타입의 모든 자원에 포함된 Tag 정보 중 Key나 Value에 keyword를 포함하는 Tag 정보 목록 제공
- ex) FindTag(VPC, tag0)
- ex) FindTag(VPC, value0)
-
Source Tree
$tree cb-spider/cloud-control-manager/cloud-driver/interfaces/ cb-spider/cloud-control-manager/cloud-driver/interfaces/ |-- CloudDriver.go |-- README.md |-- connect | `-- CloudConnect.go `-- resources |-- AnyCallHandler.go |-- ClusterHandler.go |-- DiskHandler.go |-- IId.go |-- ImageHandler.go |-- KeyPairHandler.go |-- KeyValue.go |-- MyImageHandler.go |-- NLBHandler.go |-- PriceInfoHandler.go |-- RegionZoneHandler.go |-- ResourceType.go |-- SecurityHandler.go |-- TagHandler.go <================= Region/Zone Driver API |-- VMHandler.go |-- VMSpecHandler.go `-- VPCHandler.go
-
Driver API Spec (latest)
package resources type TagInfo struct { ResType RSType // VPC, SUBNET, VM, etc.,.) ResIId IID // {NameId, SystemId} TagList []KeyValue KeyValueList []KeyValue // reserved for optinal usage } type TagHandler interface { AddTag(resTyp RSType, resIID IID, tag KeyValue) (TagInfo, error) ListTag(resTyp RSType, resIID IID) ([]*TagInfo, error) GetTag(resTyp RSType, resIID IID, key string) (TagInfo, error) RemoveTag(resType RSType, resIID IID, key string) (bool, error) // Find tags by tag key or value // resType: ALL | VPC, SUBNET, etc.,. // keyword: The keyword to search for in the tag key or value. // if you want to find all tags, set keyword to "" or "*". FindTag(resType RSType, keyword string) ([]*TagInfo, error) }
package resources type RSType string const ( ALL RSType = "all" IMAGE RSType = "image" VPC RSType = "vpc" SUBNET RSType = "subnet" SG RSType = "sg" KEY RSType = "keypair" VM RSType = "vm" NLB RSType = "nlb" DISK RSType = "disk" MYIMAGE RSType = "myimage" CLUSTER RSType = "cluster" NODEGROUP RSType = "nodegroup" )
- TBD
-
Install & Start Guide
-
Features & Usage
-
- AdminWeb Tool Guide
- CLI Tool Guide
- REST API 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
- Price 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 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]