RuleAction represents a rule action
type RuleAction string
These constants represent the possible rule actions
const ( RuleActionAllow RuleAction = "Allow" RuleActionDeny RuleAction = "Deny" )
RuleProtocol represents a rule protocol
type RuleProtocol string
These constants represent the possible rule types
const ( RuleProtocolTCP RuleProtocol = "TCP" RuleProtocolUDP RuleProtocol = "UDP" RuleProtocolAll RuleProtocol = "*" )
RuleRequest represents a single rule of a network security group
https://msdn.microsoft.com/en-us/library/azure/dn913821.aspx#bk_rules
type RuleRequest struct { XMLName xml.Name `xml:"http://schemas.microsoft.com/windowsazure Rule"` Name string Type RuleType Priority int Action RuleAction SourceAddressPrefix string SourcePortRange string DestinationAddressPrefix string DestinationPortRange string Protocol RuleProtocol }
RuleResponse represents a single rule of a network security group
https://msdn.microsoft.com/en-us/library/azure/dn913821.aspx#bk_rules
type RuleResponse struct { XMLName xml.Name `xml:"http://schemas.microsoft.com/windowsazure Rule"` Name string Type RuleType Priority int Action RuleAction SourceAddressPrefix string SourcePortRange string DestinationAddressPrefix string DestinationPortRange string Protocol RuleProtocol State string `xml:",omitempty"` IsDefault bool `xml:",omitempty"` }
RuleType represents a rule type
type RuleType string
These constants represent the possible rule types
const ( RuleTypeInbound RuleType = "Inbound" RuleTypeOutbound RuleType = "Outbound" )
SecurityGroupClient is used to perform operations on network security groups
type SecurityGroupClient struct {
// contains filtered or unexported fields
}
func NewClient(client management.Client) SecurityGroupClient
NewClient is used to instantiate a new SecurityGroupClient from an Azure client
func (sg SecurityGroupClient) AddNetworkSecurityToSubnet( name string, subnet string, virtualNetwork string) (management.OperationID, error)
AddNetworkSecurityToSubnet associates the network security group with specified subnet in a virtual network
https://msdn.microsoft.com/en-us/library/azure/dn913822.aspx
func (sg SecurityGroupClient) CreateNetworkSecurityGroup( name string, label string, location string) (management.OperationID, error)
CreateNetworkSecurityGroup creates a new network security group within the context of the specified subscription
https://msdn.microsoft.com/en-us/library/azure/dn913818.aspx
func (sg SecurityGroupClient) DeleteNetworkSecurityGroup( name string) (management.OperationID, error)
DeleteNetworkSecurityGroup deletes the specified network security group from the subscription
https://msdn.microsoft.com/en-us/library/azure/dn913825.aspx
func (sg SecurityGroupClient) DeleteNetworkSecurityGroupRule( securityGroup string, rule string) (management.OperationID, error)
DeleteNetworkSecurityGroupRule deletes a network security group rule from the specified network security group
https://msdn.microsoft.com/en-us/library/azure/dn913816.aspx
func (sg SecurityGroupClient) GetNetworkSecurityGroup(name string) (SecurityGroupResponse, error)
GetNetworkSecurityGroup returns information about the specified network security group
https://msdn.microsoft.com/en-us/library/azure/dn913821.aspx
func (sg SecurityGroupClient) GetNetworkSecurityGroupForSubnet( subnet string, virtualNetwork string) (SecurityGroupResponse, error)
GetNetworkSecurityGroupForSubnet returns information about the network security group associated with a subnet
https://msdn.microsoft.com/en-us/library/azure/dn913817.aspx
func (sg SecurityGroupClient) ListNetworkSecurityGroups() (SecurityGroupList, error)
ListNetworkSecurityGroups returns a list of the network security groups in the specified subscription
https://msdn.microsoft.com/en-us/library/azure/dn913815.aspx
func (sg SecurityGroupClient) RemoveNetworkSecurityGroupFromSubnet( name string, subnet string, virtualNetwork string) (management.OperationID, error)
RemoveNetworkSecurityGroupFromSubnet removes the association of the specified network security group from the specified subnet
https://msdn.microsoft.com/en-us/library/azure/dn913820.aspx
func (sg SecurityGroupClient) SetNetworkSecurityGroupRule( securityGroup string, rule RuleRequest) (management.OperationID, error)
SetNetworkSecurityGroupRule adds or updates a network security rule that is associated with the specified network security group
https://msdn.microsoft.com/en-us/library/azure/dn913819.aspx
SecurityGroupList represents a list of security groups
type SecurityGroupList []SecurityGroupResponse
SecurityGroupRequest represents a network security group
https://msdn.microsoft.com/en-us/library/azure/dn913821.aspx
type SecurityGroupRequest struct { XMLName xml.Name `xml:"http://schemas.microsoft.com/windowsazure NetworkSecurityGroup"` Name string Label string `xml:",omitempty"` Location string `xml:",omitempty"` }
SecurityGroupResponse represents a network security group
https://msdn.microsoft.com/en-us/library/azure/dn913821.aspx
type SecurityGroupResponse struct { XMLName xml.Name `xml:"http://schemas.microsoft.com/windowsazure NetworkSecurityGroup"` Name string Label string `xml:",omitempty"` Location string `xml:",omitempty"` State SecurityGroupState `xml:",omitempty"` Rules []RuleResponse `xml:">Rule,omitempty"` }
SecurityGroupState represents a security group state
type SecurityGroupState string
These constants represent the possible security group states
const ( SecurityGroupStateCreated SecurityGroupState = "Created" SecurityGroupStateCreating SecurityGroupState = "Creating" SecurityGroupStateUpdating SecurityGroupState = "Updating" SecurityGroupStateDeleting SecurityGroupState = "Deleting" SecurityGroupState = "Unavailable" )