-
Notifications
You must be signed in to change notification settings - Fork 47
/
os.go
42 lines (30 loc) · 1013 Bytes
/
os.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
// gRPC Runtime of CB-Spider.
// The CB-Spider is a sub-Framework of the Cloud-Barista Multi-Cloud Project.
// The CB-Spider Mission is to connect all the clouds with a single interface.
//
// * Cloud-Barista: https://github.com/cloud-barista
//
// by CB-Spider Team, 2020.09.
package request
import (
"context"
gc "github.com/cloud-barista/cb-spider/api-runtime/grpc-runtime/common"
pb "github.com/cloud-barista/cb-spider/api-runtime/grpc-runtime/stub/cbspider"
)
// ===== [ Constants and Variables ] =====
// ===== [ Types ] =====
// ===== [ Implementations ] =====
// ListCloudOS -Cloud OS 목록
func (r *CIMRequest) ListCloudOS() (string, error) {
// 서버에 요청
ctx, cancel := context.WithTimeout(context.Background(), r.Timeout)
defer cancel()
resp, err := r.Client.ListCloudOS(ctx, &pb.Empty{})
if err != nil {
return "", err
}
// 결과값 마샬링
return gc.ConvertToOutput(r.OutType, &resp)
}
// ===== [ Private Functions ] =====
// ===== [ Public Functions ] =====