-
Notifications
You must be signed in to change notification settings - Fork 45
/
SecurityHandler.go
49 lines (40 loc) · 1.33 KB
/
SecurityHandler.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
43
44
45
46
47
48
49
// Cloud Driver Interface 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
//
// This is Resouces interfaces of Cloud Driver.
//
// by CB-Spider Team, 2020.04.
// by CB-Spider Team, 2019.06.
package resources
type SecurityReqInfo struct {
IId IID // {NameId, SystemId}
VpcIID IID // {NameId, SystemId}
//Direction string // To be deprecated
SecurityRules *[]SecurityRuleInfo
}
// @definitionAlias cres.SecurityRuleInfo
type SecurityRuleInfo struct {
Direction string
IPProtocol string
FromPort string
ToPort string
CIDR string
}
type SecurityInfo struct {
IId IID // {NameId, SystemId}
VpcIID IID // {NameId, SystemId}
//Direction string // @todo userd??
SecurityRules *[]SecurityRuleInfo
KeyValueList []KeyValue
}
type SecurityHandler interface {
CreateSecurity(securityReqInfo SecurityReqInfo) (SecurityInfo, error)
ListSecurity() ([]*SecurityInfo, error)
GetSecurity(securityIID IID) (SecurityInfo, error)
DeleteSecurity(securityIID IID) (bool, error)
AddRules(sgIID IID, securityRules *[]SecurityRuleInfo) (SecurityInfo, error)
RemoveRules(sgIID IID, securityRules *[]SecurityRuleInfo) (bool, error)
}