Documentation ¶
Index ¶
- Constants
- type AgentELFCluster
- type EverouteCluster
- type EverouteClusterWhitelist
- type EverouteControllerInstance
- type GlobalPolicyAction
- type GroupMemberType
- type Host
- type IDSystemEndpoint
- type IPPortSystemEndpoint
- type IsolationMode
- type IsolationPolicy
- type KSCNamespacedName
- type Label
- type LabelGroup
- type LabelList
- type MutationEvent
- type MutationType
- type NetworkPolicyRule
- type NetworkPolicyRulePort
- type NetworkPolicyRulePortAlgProtocol
- type NetworkPolicyRulePortProtocol
- type NetworkPolicyRuleService
- type NetworkPolicyRuleType
- type NetworkType
- type Nic
- type Object
- type ObjectMeta
- type ObjectReference
- type PodLabel
- type PodLabelGroup
- type PolicyMode
- type SecurityGroup
- type SecurityPolicy
- type SecurityPolicyApply
- type SecurityPolicyType
- type SystemEndpoints
- func (*SystemEndpoints) GetID() string
- func (s *SystemEndpoints) GetSubscriptionRequest(skipFields map[string][]string) string
- func (s *SystemEndpoints) UnmarshalEvent(raw json.RawMessage, event *MutationEvent) error
- func (s *SystemEndpoints) UnmarshalSlice(raw json.RawMessage, slice interface{}) error
- type Task
- type TaskStatus
- type VM
- type VMList
- type VMNic
- type VMNicModel
- type VMStatus
- type Vlan
Constants ¶
View Source
const ( PolicyModeMonitor = "MONITOR" PolicyModeWork = "WORK" )
View Source
const ( NetworkStorage = "STORAGE" NetworkManagement = "MANAGEMENT" NetworkVM = "VM" NetworkAccess = "ACCESS" NetworkMigration = "MIGRATION" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AgentELFCluster ¶
type AgentELFCluster struct { ObjectMeta LocalID string `json:"local_id"` }
type EverouteCluster ¶
type EverouteCluster struct { ObjectMeta AgentELFClusters []AgentELFCluster `json:"agent_elf_clusters"` AgentELFVDSes []ObjectReference `json:"agent_elf_vdses,omitempty"` ControllerInstances []EverouteControllerInstance `json:"controller_instances"` GlobalDefaultAction GlobalPolicyAction `json:"global_default_action"` GlobalWhitelist EverouteClusterWhitelist `json:"global_whitelist,omitempty"` EnableLogging bool `json:"enable_logging,omitempty"` }
EverouteCluster defines everoute cluster
type EverouteClusterWhitelist ¶
type EverouteClusterWhitelist struct { Egress []NetworkPolicyRule `json:"egress"` Enable bool `json:"enable"` Ingress []NetworkPolicyRule `json:"ingress"` }
type EverouteControllerInstance ¶
type EverouteControllerInstance struct {
IPAddr string `json:"ipAddr"`
}
type GlobalPolicyAction ¶
type GlobalPolicyAction string
const ( GlobalPolicyActionAllow GlobalPolicyAction = "ALLOW" GlobalPolicyActionDrop GlobalPolicyAction = "DROP" )
type GroupMemberType ¶
type GroupMemberType string
const ( VMGroupType GroupMemberType = "VM" PodGroupType GroupMemberType = "POD" )
type Host ¶
type Host struct { ObjectMeta Name string `json:"name,omitempty"` Nics []Nic `json:"nics,omitempty"` }
Host defines elf host node
type IDSystemEndpoint ¶
type IPPortSystemEndpoint ¶
type IsolationMode ¶
type IsolationMode string
const ( IsolationModeAll IsolationMode = "ALL" IsolationModePartial IsolationMode = "PARTIAL" )
type IsolationPolicy ¶
type IsolationPolicy struct { ObjectMeta EverouteCluster ObjectReference `json:"everoute_cluster"` VM ObjectReference `json:"vm"` Mode IsolationMode `json:"mode"` Ingress []NetworkPolicyRule `json:"ingress,omitempty"` Egress []NetworkPolicyRule `json:"egress,omitempty"` EnableLogging bool `json:"enable_logging,omitempty"` }
type KSCNamespacedName ¶
type Label ¶
type Label struct { ObjectMeta Key string `json:"key"` Value string `json:"value,omitempty"` VMs []ObjectReference `json:"vms,omitempty"` }
type LabelGroup ¶
type LabelGroup struct {
Labels []ObjectReference `json:"labels"`
}
type LabelList ¶
type LabelList struct {
Labels []Label `json:"labels,omitempty"`
}
LabelList is a list of labels
type MutationEvent ¶
type MutationEvent struct { Mutation MutationType `json:"mutation"` PreviousValues json.RawMessage `json:"previousValues"` Node json.RawMessage `json:"node"` }
MutationEvent is the event subscribed from tower
type MutationType ¶
type MutationType string
const ( CreateEvent MutationType = "CREATED" DeleteEvent MutationType = "DELETED" UpdateEvent MutationType = "UPDATED" )
type NetworkPolicyRule ¶
type NetworkPolicyRule struct { OnlyApplyToExternalTraffic bool `json:"only_apply_to_external_traffic"` Type NetworkPolicyRuleType `json:"type"` Ports []NetworkPolicyRulePort `json:"ports,omitempty"` Services []ObjectReference `json:"services,omitempty"` // IPBlock may be multi ip blocks, ip ranges or single ip IPBlock *string `json:"ip_block"` ExceptIPBlock []string `json:"except_ip_block,omitempty"` Selector []ObjectReference `json:"selector"` SecurityGroup *ObjectReference `json:"security_group,omitempty"` }
type NetworkPolicyRulePort ¶
type NetworkPolicyRulePort struct { Port *string `json:"port,omitempty"` Protocol NetworkPolicyRulePortProtocol `json:"protocol"` AlgProtocol NetworkPolicyRulePortAlgProtocol `json:"alg_protocol"` }
type NetworkPolicyRulePortAlgProtocol ¶
type NetworkPolicyRulePortAlgProtocol string
const ( NetworkPolicyRulePortAlgProtocolFTP NetworkPolicyRulePortAlgProtocol = "FTP" NetworkPolicyRulePortAlgProtocolTFTP NetworkPolicyRulePortAlgProtocol = "TFTP" )
type NetworkPolicyRulePortProtocol ¶
type NetworkPolicyRulePortProtocol string
const ( NetworkPolicyRulePortProtocolIcmp NetworkPolicyRulePortProtocol = "ICMP" NetworkPolicyRulePortProtocolTCP NetworkPolicyRulePortProtocol = "TCP" NetworkPolicyRulePortProtocolUDP NetworkPolicyRulePortProtocol = "UDP" NetworkPolicyRulePortProtocolALG NetworkPolicyRulePortProtocol = "ALG" NetworkPolicyRulePortProtocolIPIP NetworkPolicyRulePortProtocol = "IPIP" )
type NetworkPolicyRuleService ¶
type NetworkPolicyRuleService struct { ObjectMeta Members []NetworkPolicyRulePort `json:"members"` }
type NetworkPolicyRuleType ¶
type NetworkPolicyRuleType string
const ( NetworkPolicyRuleTypeAll NetworkPolicyRuleType = "ALL" // NetworkPolicyRuleTypeIPBlock may be multi ip blocks, ip ranges or single ip NetworkPolicyRuleTypeIPBlock NetworkPolicyRuleType = "IP_BLOCK" NetworkPolicyRuleTypeSelector NetworkPolicyRuleType = "SELECTOR" NetworkPolicyRuleTypeSecurityGroup NetworkPolicyRuleType = "SECURITY_GROUP" )
type Nic ¶
type Nic struct { ObjectMeta Physical bool `json:"physical"` Name string `json:"name,omitempty"` MacAddress string `json:"mac_address,omitempty"` IPAddress string `json:"ip_address,omitempty"` }
type Object ¶
type Object interface { // GetID returns the object ID. GetID() string }
Object lets you work with object metadata from tower.
type ObjectMeta ¶
type ObjectMeta struct { // ID is the unique in time and space value for this object ID string `json:"id"` }
ObjectMeta is metadata that all tower resources must have.
type ObjectReference ¶
type ObjectReference ObjectMeta
ObjectReference is the reference to other object
type PodLabelGroup ¶
type PodLabelGroup struct { KSC KSCNamespacedName `json:"ksc"` Namespaces []string `json:"namespaces"` PodLabels []PodLabel `json:"pod_labels"` }
type PolicyMode ¶
type PolicyMode string
type SecurityGroup ¶
type SecurityGroup struct { ObjectMeta MemberType *GroupMemberType `json:"member_type"` EverouteCluster ObjectReference `json:"everoute_cluster"` LabelGroups []LabelGroup `json:"label_groups"` VMs []ObjectReference `json:"vms"` PodLabelGroups []PodLabelGroup `json:"pod_label_groups"` }
type SecurityPolicy ¶
type SecurityPolicy struct { ObjectMeta Name string `json:"name"` EverouteCluster ObjectReference `json:"everoute_cluster"` ApplyTo []SecurityPolicyApply `json:"apply_to"` Ingress []NetworkPolicyRule `json:"ingress,omitempty"` Egress []NetworkPolicyRule `json:"egress,omitempty"` PolicyMode PolicyMode `json:"policy_mode,omitempty"` IsBlocklist bool `json:"is_blocklist,omitempty"` EnableLogging bool `json:"enable_logging,omitempty"` }
type SecurityPolicyApply ¶
type SecurityPolicyApply struct { Type SecurityPolicyType `json:"type"` Communicable bool `json:"communicable"` Selector []ObjectReference `json:"selector"` SecurityGroup *ObjectReference `json:"security_group,omitempty"` }
type SecurityPolicyType ¶
type SecurityPolicyType string
const ( SecurityPolicyTypeSelector SecurityPolicyType = "SELECTOR" SecurityPolicyTypeSecurityGroup SecurityPolicyType = "SECURITY_GROUP" )
type SystemEndpoints ¶
type SystemEndpoints struct { IDEndpoints []IDSystemEndpoint `json:"id_endpoints,omitempty"` IPPortEndpoints []IPPortSystemEndpoint `json:"ip_port_endpoints,omitempty"` }
SystemEndpoints contains all internal system endpoints
func (*SystemEndpoints) GetID ¶
func (*SystemEndpoints) GetID() string
GetID implements Object systemEndpoints has only one instance, we use "systemEndpoints" as its ID
func (*SystemEndpoints) GetSubscriptionRequest ¶
func (s *SystemEndpoints) GetSubscriptionRequest(skipFields map[string][]string) string
func (*SystemEndpoints) UnmarshalEvent ¶
func (s *SystemEndpoints) UnmarshalEvent(raw json.RawMessage, event *MutationEvent) error
func (*SystemEndpoints) UnmarshalSlice ¶
func (s *SystemEndpoints) UnmarshalSlice(raw json.RawMessage, slice interface{}) error
type Task ¶
type Task struct { ObjectMeta Description string `json:"description"` ErrorCode *string `json:"error_code"` ErrorMessage *string `json:"error_message"` Internal bool `json:"internal"` Progress float64 `json:"progress"` Snapshot string `json:"snapshot"` Status TaskStatus `json:"status"` }
type TaskStatus ¶
type TaskStatus string
const ( TaskStatusExecuting TaskStatus = "EXECUTING" TaskStatusFailed TaskStatus = "FAILED" TaskStatusPending TaskStatus = "PENDING" TaskStatusSuccessed TaskStatus = "SUCCESSED" )
type VMNic ¶
type VMNic struct { ObjectMeta Vlan Vlan `json:"vlan,omitempty"` Enabled bool `json:"enabled,omitempty"` Mirror bool `json:"mirror,omitempty"` Model VMNicModel `json:"model,omitempty"` MacAddress string `json:"mac_address,omitempty"` IPAddress string `json:"ip_address,omitempty"` InterfaceID string `json:"interface_id,omitempty"` }
type VMNicModel ¶
type VMNicModel string
VMNicModel is enumeration of vnic models
const ( VMNicModelE1000 VMNicModel = "E1000" VMNicModelVIRTIO VMNicModel = "VIRTIO" )
type Vlan ¶
type Vlan struct { ObjectMeta VDS ObjectReference `json:"vds"` Name string `json:"name,omitempty"` VlanID int `json:"vlan_id"` Type NetworkType `json:"type,omitempty"` }
Click to show internal directories.
Click to hide internal directories.