Documentation
¶
Index ¶
- type Action
- type ActionsByCategory
- type Application
- type Applications
- type CreateSecurityPolicyAPI
- type DeleteSecurityPolicyAPI
- type GetAllSecurityPoliciesAPI
- type GetSecurityPolicyAPI
- type SecurityGroup
- type SecurityPolicies
- type SecurityPolicy
- func (sp *SecurityPolicy) AddInboundFirewallAction(name, action, direction string, applicationObjectIDs []string) error
- func (sp *SecurityPolicy) AddOutboundFirewallAction(name, action, direction string, ...) error
- func (sp *SecurityPolicy) AddSecurityGroupBinding(objectID string)
- func (sp *SecurityPolicy) CheckFirewallRuleByUUID(uuid string) bool
- func (sp *SecurityPolicy) GetFirewallRuleByName(name string) *Action
- func (sp *SecurityPolicy) GetFirewallRuleByUUID(uuid string) *Action
- func (sp SecurityPolicy) MarshalToXML() string
- func (sp *SecurityPolicy) RemoveFirewallActionByName(actionName string)
- func (sp *SecurityPolicy) RemoveFirewallActionByUUID(uuid string)
- func (sp *SecurityPolicy) RemoveSecurityGroupBinding(objectID string)
- func (sp SecurityPolicy) String() string
- type UpdateSecurityPolicyAPI
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Action ¶
type Action struct { XMLName xml.Name `xml:"action"` Class string `xml:"class,attr"` ObjectID string `xml:"objectId,omitempty"` ObjectTypeName string `xml:"objectTypeName,omitempty"` VsmUUID string `xml:"vsmUuid,omitempty"` NodeID string `xml:"nodeId,omitempty"` Revision int `xml:"revision,omitempty"` TypeName string `xml:"type,omitempty>typeName,omitempty"` Name string `xml:"name,omitempty"` Action string `xml:"action"` Category string `xml:"category"` Direction string `xml:"direction"` IsEnabled bool `xml:"isEnabled,omitempty"` SecondarySecurityGroup []SecurityGroup `xml:"secondarySecurityGroup,omitempty"` Applications *Applications `xml:"applications,omitempty"` }
Action element of ActionsByCategory list.
type ActionsByCategory ¶
type ActionsByCategory struct { XMLName xml.Name `xml:"actionsByCategory"` Category string `xml:"category,omitempty"` Actions []Action `xml:"action,omitempty"` }
ActionsByCategory element of SecurityPolicy.
type Application ¶
type Application struct { //XMLName xml.Name `xml:"application,omitempty"` ObjectID string `xml:"objectId,omitempty"` Name string `xml:"name,omitempty"` }
Application element of Applications List
type Applications ¶
type Applications struct {
Applications []Application `xml:"application,omitempty"`
}
Applications object struct
type CreateSecurityPolicyAPI ¶
CreateSecurityPolicyAPI api object
func NewCreate ¶
func NewCreate(name, precedence, description string, securityGroups []string, actions []Action) *CreateSecurityPolicyAPI
NewCreate returns a new object of CreatePolicyAPI.
func (CreateSecurityPolicyAPI) GetResponse ¶
func (ca CreateSecurityPolicyAPI) GetResponse() string
GetResponse returns a ResponseObject of CreateServiceAPI.
type DeleteSecurityPolicyAPI ¶
DeleteSecurityPolicyAPI - struct
func NewDelete ¶
func NewDelete(securityPolicyID string, force bool) *DeleteSecurityPolicyAPI
NewDelete - Generates a new DeleteSecurityPolicyAPI object.
type GetAllSecurityPoliciesAPI ¶
GetAllSecurityPoliciesAPI - struct
func NewGetAll ¶
func NewGetAll() *GetAllSecurityPoliciesAPI
NewGetAll - returns GetAll api object of GetAllSecurityPoliciesAPI type.
func (GetAllSecurityPoliciesAPI) GetResponse ¶
func (getAllAPI GetAllSecurityPoliciesAPI) GetResponse() *SecurityPolicies
GetResponse - Returns ResponseObject from GetAllSecurityPoliciesAPI.
type GetSecurityPolicyAPI ¶
GetSecurityPolicyAPI base object.
func NewGet ¶
func NewGet(securityPolicyID string) *GetSecurityPolicyAPI
NewGet returns new object of GetSecurityPolicyAPI.
func (GetSecurityPolicyAPI) GetResponse ¶
func (ga GetSecurityPolicyAPI) GetResponse() *SecurityPolicy
GetResponse returns ResponseObject of GetSecurityPolicyAPI.
type SecurityGroup ¶
type SecurityGroup struct {
ObjectID string `xml:"objectId,omitempty"`
}
SecurityGroup object struct
type SecurityPolicies ¶
type SecurityPolicies struct {
SecurityPolicies []SecurityPolicy `xml:"securityPolicy"`
}
SecurityPolicies top level struct
func (SecurityPolicies) FilterByName ¶
func (spList SecurityPolicies) FilterByName(name string) *SecurityPolicy
FilterByName returns a single security policy object if it matches the name in SecurityPolicies list.
func (SecurityPolicies) RemoveSecurityPolicyByName ¶
func (spList SecurityPolicies) RemoveSecurityPolicyByName(policyName string) *SecurityPolicies
RemoveSecurityPolicyByName - Removes the SecurityPolicy from a list of SecurityPolicies provided it matches the given name.
func (SecurityPolicies) String ¶
func (spList SecurityPolicies) String() string
type SecurityPolicy ¶
type SecurityPolicy struct { XMLName xml.Name `xml:"securityPolicy"` ObjectID string `xml:"objectId,omitempty"` ObjectTypeName string `xml:"objectTypeName,omitempty"` VsmUUID string `xml:"vsmUuid,omitempty"` NodeID string `xml:"nodeId,omitempty"` Revision int `xml:"revision,omitempty"` TypeName string `xml:"type,omitempty>typeName,omitempty"` Name string `xml:"name,omitempty"` Description string `xml:"description,omitempty"` Precedence string `xml:"precedence"` IsUniversal bool `xml:"isUniversal,omitempty"` InheritanceAllowed bool `xml:"inheritanceAllowed,omitempty"` ActionsByCategory ActionsByCategory `xml:"actionsByCategory,omitempty"` SecurityGroupBinding []SecurityGroup `xml:"securityGroupBinding,omitempty"` }
SecurityPolicy object struct
func (*SecurityPolicy) AddInboundFirewallAction ¶
func (sp *SecurityPolicy) AddInboundFirewallAction(name, action, direction string, applicationObjectIDs []string) error
AddInboundFirewallAction adds outbound firewall action rule into security policy.
func (*SecurityPolicy) AddOutboundFirewallAction ¶
func (sp *SecurityPolicy) AddOutboundFirewallAction(name, action, direction string, secGroupObjectIDs, applicationObjectIDs []string) error
AddOutboundFirewallAction adds outbound firewall action rule into security policy.
func (*SecurityPolicy) AddSecurityGroupBinding ¶
func (sp *SecurityPolicy) AddSecurityGroupBinding(objectID string)
AddSecurityGroupBinding - Adds security group to list of SecurityGroupBinding if it doesn't exists.
func (*SecurityPolicy) CheckFirewallRuleByUUID ¶
func (sp *SecurityPolicy) CheckFirewallRuleByUUID(uuid string) bool
CheckFirewallRuleByUUID - Checks if the rule with UUID exists in the firewall rules of security policy.
func (*SecurityPolicy) GetFirewallRuleByName ¶
func (sp *SecurityPolicy) GetFirewallRuleByName(name string) *Action
GetFirewallRuleByName - Checks if the rule with given name exists in the firewall rules of security policy.
func (*SecurityPolicy) GetFirewallRuleByUUID ¶
func (sp *SecurityPolicy) GetFirewallRuleByUUID(uuid string) *Action
GetFirewallRuleByUUID - Checks if the rule with given name exists in the firewall rules of security policy.
func (SecurityPolicy) MarshalToXML ¶
func (sp SecurityPolicy) MarshalToXML() string
MarshalToXML converts the object into XML
func (*SecurityPolicy) RemoveFirewallActionByName ¶
func (sp *SecurityPolicy) RemoveFirewallActionByName(actionName string)
RemoveFirewallActionByName - Removes the firewalla ction from security policy object if it exists.
func (*SecurityPolicy) RemoveFirewallActionByUUID ¶
func (sp *SecurityPolicy) RemoveFirewallActionByUUID(uuid string)
RemoveFirewallActionByUUID - Removes the firewall action from security policy object if it exists by it's UUID.
func (*SecurityPolicy) RemoveSecurityGroupBinding ¶
func (sp *SecurityPolicy) RemoveSecurityGroupBinding(objectID string)
RemoveSecurityGroupBinding - Adds security group to list of SecurityGroupBinding if it doesn't exists.
func (SecurityPolicy) String ¶
func (sp SecurityPolicy) String() string
type UpdateSecurityPolicyAPI ¶
UpdateSecurityPolicyAPI ...
func NewUpdate ¶
func NewUpdate(securityPolicyID string, securityPolicyPayload *SecurityPolicy) *UpdateSecurityPolicyAPI
NewUpdate creates a new object of UpdateSecurityPolicyAPI
func (UpdateSecurityPolicyAPI) GetResponse ¶
func (updateAPI UpdateSecurityPolicyAPI) GetResponse() string
GetResponse returns the ResponseObject from UpdateSecurityPolicyAPI