securityrules

package
v0.20231005.1141651 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 5, 2023 License: MPL-2.0 Imports: 11 Imported by: 0

README

github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/securityrules Documentation

The securityrules SDK allows for interaction with the Azure Resource Manager Service network (API Version 2023-05-01).

This readme covers example usages, but further information on using this SDK can be found in the project root.

Import Path

import "github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/securityrules"

Client Initialization

client := securityrules.NewSecurityRulesClientWithBaseURI("https://management.azure.com")
client.Client.Authorizer = authorizer

Example Usage: SecurityRulesClient.CreateOrUpdate

ctx := context.TODO()
id := securityrules.NewSecurityRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkSecurityGroupValue", "securityRuleValue")

payload := securityrules.SecurityRule{
	// ...
}


if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil {
	// handle the error
}

Example Usage: SecurityRulesClient.DefaultSecurityRulesGet

ctx := context.TODO()
id := securityrules.NewDefaultSecurityRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkSecurityGroupValue", "defaultSecurityRuleValue")

read, err := client.DefaultSecurityRulesGet(ctx, id)
if err != nil {
	// handle the error
}
if model := read.Model; model != nil {
	// do something with the model/response object
}

Example Usage: SecurityRulesClient.DefaultSecurityRulesList

ctx := context.TODO()
id := securityrules.NewNetworkSecurityGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkSecurityGroupValue")

// alternatively `client.DefaultSecurityRulesList(ctx, id)` can be used to do batched pagination
items, err := client.DefaultSecurityRulesListComplete(ctx, id)
if err != nil {
	// handle the error
}
for _, item := range items {
	// do something
}

Example Usage: SecurityRulesClient.Delete

ctx := context.TODO()
id := securityrules.NewSecurityRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkSecurityGroupValue", "securityRuleValue")

if err := client.DeleteThenPoll(ctx, id); err != nil {
	// handle the error
}

Example Usage: SecurityRulesClient.Get

ctx := context.TODO()
id := securityrules.NewSecurityRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkSecurityGroupValue", "securityRuleValue")

read, err := client.Get(ctx, id)
if err != nil {
	// handle the error
}
if model := read.Model; model != nil {
	// do something with the model/response object
}

Example Usage: SecurityRulesClient.List

ctx := context.TODO()
id := securityrules.NewNetworkSecurityGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkSecurityGroupValue")

// alternatively `client.List(ctx, id)` can be used to do batched pagination
items, err := client.ListComplete(ctx, id)
if err != nil {
	// handle the error
}
for _, item := range items {
	// do something
}

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func PossibleValuesForProvisioningState

func PossibleValuesForProvisioningState() []string

func PossibleValuesForSecurityRuleAccess

func PossibleValuesForSecurityRuleAccess() []string

func PossibleValuesForSecurityRuleDirection

func PossibleValuesForSecurityRuleDirection() []string

func PossibleValuesForSecurityRuleProtocol

func PossibleValuesForSecurityRuleProtocol() []string

func ValidateDefaultSecurityRuleID

func ValidateDefaultSecurityRuleID(input interface{}, key string) (warnings []string, errors []error)

ValidateDefaultSecurityRuleID checks that 'input' can be parsed as a Default Security Rule ID

func ValidateNetworkSecurityGroupID

func ValidateNetworkSecurityGroupID(input interface{}, key string) (warnings []string, errors []error)

ValidateNetworkSecurityGroupID checks that 'input' can be parsed as a Network Security Group ID

func ValidateSecurityRuleID

func ValidateSecurityRuleID(input interface{}, key string) (warnings []string, errors []error)

ValidateSecurityRuleID checks that 'input' can be parsed as a Security Rule ID

Types

type ApplicationSecurityGroup

type ApplicationSecurityGroup struct {
	Etag       *string                                   `json:"etag,omitempty"`
	Id         *string                                   `json:"id,omitempty"`
	Location   *string                                   `json:"location,omitempty"`
	Name       *string                                   `json:"name,omitempty"`
	Properties *ApplicationSecurityGroupPropertiesFormat `json:"properties,omitempty"`
	Tags       *map[string]string                        `json:"tags,omitempty"`
	Type       *string                                   `json:"type,omitempty"`
}

type ApplicationSecurityGroupPropertiesFormat

type ApplicationSecurityGroupPropertiesFormat struct {
	ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"`
	ResourceGuid      *string            `json:"resourceGuid,omitempty"`
}

type CreateOrUpdateOperationResponse

type CreateOrUpdateOperationResponse struct {
	Poller       pollers.Poller
	HttpResponse *http.Response
	OData        *odata.OData
}

type DefaultSecurityRuleId

type DefaultSecurityRuleId struct {
	SubscriptionId           string
	ResourceGroupName        string
	NetworkSecurityGroupName string
	DefaultSecurityRuleName  string
}

DefaultSecurityRuleId is a struct representing the Resource ID for a Default Security Rule

func NewDefaultSecurityRuleID

func NewDefaultSecurityRuleID(subscriptionId string, resourceGroupName string, networkSecurityGroupName string, defaultSecurityRuleName string) DefaultSecurityRuleId

NewDefaultSecurityRuleID returns a new DefaultSecurityRuleId struct

func ParseDefaultSecurityRuleID

func ParseDefaultSecurityRuleID(input string) (*DefaultSecurityRuleId, error)

ParseDefaultSecurityRuleID parses 'input' into a DefaultSecurityRuleId

func ParseDefaultSecurityRuleIDInsensitively

func ParseDefaultSecurityRuleIDInsensitively(input string) (*DefaultSecurityRuleId, error)

ParseDefaultSecurityRuleIDInsensitively parses 'input' case-insensitively into a DefaultSecurityRuleId note: this method should only be used for API response data and not user input

func (DefaultSecurityRuleId) ID

func (id DefaultSecurityRuleId) ID() string

ID returns the formatted Default Security Rule ID

func (DefaultSecurityRuleId) Segments

func (id DefaultSecurityRuleId) Segments() []resourceids.Segment

Segments returns a slice of Resource ID Segments which comprise this Default Security Rule ID

func (DefaultSecurityRuleId) String

func (id DefaultSecurityRuleId) String() string

String returns a human-readable description of this Default Security Rule ID

type DefaultSecurityRulesGetOperationResponse

type DefaultSecurityRulesGetOperationResponse struct {
	HttpResponse *http.Response
	OData        *odata.OData
	Model        *SecurityRule
}

type DefaultSecurityRulesListCompleteResult

type DefaultSecurityRulesListCompleteResult struct {
	Items []SecurityRule
}

type DefaultSecurityRulesListOperationResponse

type DefaultSecurityRulesListOperationResponse struct {
	HttpResponse *http.Response
	OData        *odata.OData
	Model        *[]SecurityRule
}

type DeleteOperationResponse

type DeleteOperationResponse struct {
	Poller       pollers.Poller
	HttpResponse *http.Response
	OData        *odata.OData
}

type GetOperationResponse

type GetOperationResponse struct {
	HttpResponse *http.Response
	OData        *odata.OData
	Model        *SecurityRule
}

type ListCompleteResult

type ListCompleteResult struct {
	Items []SecurityRule
}

type ListOperationResponse

type ListOperationResponse struct {
	HttpResponse *http.Response
	OData        *odata.OData
	Model        *[]SecurityRule
}

type NetworkSecurityGroupId

type NetworkSecurityGroupId struct {
	SubscriptionId           string
	ResourceGroupName        string
	NetworkSecurityGroupName string
}

NetworkSecurityGroupId is a struct representing the Resource ID for a Network Security Group

func NewNetworkSecurityGroupID

func NewNetworkSecurityGroupID(subscriptionId string, resourceGroupName string, networkSecurityGroupName string) NetworkSecurityGroupId

NewNetworkSecurityGroupID returns a new NetworkSecurityGroupId struct

func ParseNetworkSecurityGroupID

func ParseNetworkSecurityGroupID(input string) (*NetworkSecurityGroupId, error)

ParseNetworkSecurityGroupID parses 'input' into a NetworkSecurityGroupId

func ParseNetworkSecurityGroupIDInsensitively

func ParseNetworkSecurityGroupIDInsensitively(input string) (*NetworkSecurityGroupId, error)

ParseNetworkSecurityGroupIDInsensitively parses 'input' case-insensitively into a NetworkSecurityGroupId note: this method should only be used for API response data and not user input

func (NetworkSecurityGroupId) ID

ID returns the formatted Network Security Group ID

func (NetworkSecurityGroupId) Segments

func (id NetworkSecurityGroupId) Segments() []resourceids.Segment

Segments returns a slice of Resource ID Segments which comprise this Network Security Group ID

func (NetworkSecurityGroupId) String

func (id NetworkSecurityGroupId) String() string

String returns a human-readable description of this Network Security Group ID

type ProvisioningState

type ProvisioningState string
const (
	ProvisioningStateDeleting  ProvisioningState = "Deleting"
	ProvisioningStateFailed    ProvisioningState = "Failed"
	ProvisioningStateSucceeded ProvisioningState = "Succeeded"
	ProvisioningStateUpdating  ProvisioningState = "Updating"
)

func (*ProvisioningState) UnmarshalJSON

func (s *ProvisioningState) UnmarshalJSON(bytes []byte) error

type SecurityRule

type SecurityRule struct {
	Etag       *string                       `json:"etag,omitempty"`
	Id         *string                       `json:"id,omitempty"`
	Name       *string                       `json:"name,omitempty"`
	Properties *SecurityRulePropertiesFormat `json:"properties,omitempty"`
	Type       *string                       `json:"type,omitempty"`
}

type SecurityRuleAccess

type SecurityRuleAccess string
const (
	SecurityRuleAccessAllow SecurityRuleAccess = "Allow"
	SecurityRuleAccessDeny  SecurityRuleAccess = "Deny"
)

func (*SecurityRuleAccess) UnmarshalJSON

func (s *SecurityRuleAccess) UnmarshalJSON(bytes []byte) error

type SecurityRuleDirection

type SecurityRuleDirection string
const (
	SecurityRuleDirectionInbound  SecurityRuleDirection = "Inbound"
	SecurityRuleDirectionOutbound SecurityRuleDirection = "Outbound"
)

func (*SecurityRuleDirection) UnmarshalJSON

func (s *SecurityRuleDirection) UnmarshalJSON(bytes []byte) error

type SecurityRuleId

type SecurityRuleId struct {
	SubscriptionId           string
	ResourceGroupName        string
	NetworkSecurityGroupName string
	SecurityRuleName         string
}

SecurityRuleId is a struct representing the Resource ID for a Security Rule

func NewSecurityRuleID

func NewSecurityRuleID(subscriptionId string, resourceGroupName string, networkSecurityGroupName string, securityRuleName string) SecurityRuleId

NewSecurityRuleID returns a new SecurityRuleId struct

func ParseSecurityRuleID

func ParseSecurityRuleID(input string) (*SecurityRuleId, error)

ParseSecurityRuleID parses 'input' into a SecurityRuleId

func ParseSecurityRuleIDInsensitively

func ParseSecurityRuleIDInsensitively(input string) (*SecurityRuleId, error)

ParseSecurityRuleIDInsensitively parses 'input' case-insensitively into a SecurityRuleId note: this method should only be used for API response data and not user input

func (SecurityRuleId) ID

func (id SecurityRuleId) ID() string

ID returns the formatted Security Rule ID

func (SecurityRuleId) Segments

func (id SecurityRuleId) Segments() []resourceids.Segment

Segments returns a slice of Resource ID Segments which comprise this Security Rule ID

func (SecurityRuleId) String

func (id SecurityRuleId) String() string

String returns a human-readable description of this Security Rule ID

type SecurityRuleOperationPredicate

type SecurityRuleOperationPredicate struct {
	Etag *string
	Id   *string
	Name *string
	Type *string
}

func (SecurityRuleOperationPredicate) Matches

type SecurityRulePropertiesFormat

type SecurityRulePropertiesFormat struct {
	Access                               SecurityRuleAccess          `json:"access"`
	Description                          *string                     `json:"description,omitempty"`
	DestinationAddressPrefix             *string                     `json:"destinationAddressPrefix,omitempty"`
	DestinationAddressPrefixes           *[]string                   `json:"destinationAddressPrefixes,omitempty"`
	DestinationApplicationSecurityGroups *[]ApplicationSecurityGroup `json:"destinationApplicationSecurityGroups,omitempty"`
	DestinationPortRange                 *string                     `json:"destinationPortRange,omitempty"`
	DestinationPortRanges                *[]string                   `json:"destinationPortRanges,omitempty"`
	Direction                            SecurityRuleDirection       `json:"direction"`
	Priority                             int64                       `json:"priority"`
	Protocol                             SecurityRuleProtocol        `json:"protocol"`
	ProvisioningState                    *ProvisioningState          `json:"provisioningState,omitempty"`
	SourceAddressPrefix                  *string                     `json:"sourceAddressPrefix,omitempty"`
	SourceAddressPrefixes                *[]string                   `json:"sourceAddressPrefixes,omitempty"`
	SourceApplicationSecurityGroups      *[]ApplicationSecurityGroup `json:"sourceApplicationSecurityGroups,omitempty"`
	SourcePortRange                      *string                     `json:"sourcePortRange,omitempty"`
	SourcePortRanges                     *[]string                   `json:"sourcePortRanges,omitempty"`
}

type SecurityRuleProtocol

type SecurityRuleProtocol string
const (
	SecurityRuleProtocolAh   SecurityRuleProtocol = "Ah"
	SecurityRuleProtocolAny  SecurityRuleProtocol = "*"
	SecurityRuleProtocolEsp  SecurityRuleProtocol = "Esp"
	SecurityRuleProtocolIcmp SecurityRuleProtocol = "Icmp"
	SecurityRuleProtocolTcp  SecurityRuleProtocol = "Tcp"
	SecurityRuleProtocolUdp  SecurityRuleProtocol = "Udp"
)

func (*SecurityRuleProtocol) UnmarshalJSON

func (s *SecurityRuleProtocol) UnmarshalJSON(bytes []byte) error

type SecurityRulesClient

type SecurityRulesClient struct {
	Client *resourcemanager.Client
}

func NewSecurityRulesClientWithBaseURI

func NewSecurityRulesClientWithBaseURI(sdkApi sdkEnv.Api) (*SecurityRulesClient, error)

func (SecurityRulesClient) CreateOrUpdate

CreateOrUpdate ...

func (SecurityRulesClient) CreateOrUpdateThenPoll

func (c SecurityRulesClient) CreateOrUpdateThenPoll(ctx context.Context, id SecurityRuleId, input SecurityRule) error

CreateOrUpdateThenPoll performs CreateOrUpdate then polls until it's completed

func (SecurityRulesClient) DefaultSecurityRulesGet

DefaultSecurityRulesGet ...

func (SecurityRulesClient) DefaultSecurityRulesList

DefaultSecurityRulesList ...

func (SecurityRulesClient) DefaultSecurityRulesListComplete

DefaultSecurityRulesListComplete retrieves all the results into a single object

func (SecurityRulesClient) DefaultSecurityRulesListCompleteMatchingPredicate

func (c SecurityRulesClient) DefaultSecurityRulesListCompleteMatchingPredicate(ctx context.Context, id NetworkSecurityGroupId, predicate SecurityRuleOperationPredicate) (result DefaultSecurityRulesListCompleteResult, err error)

DefaultSecurityRulesListCompleteMatchingPredicate retrieves all the results and then applies the predicate

func (SecurityRulesClient) Delete

Delete ...

func (SecurityRulesClient) DeleteThenPoll

func (c SecurityRulesClient) DeleteThenPoll(ctx context.Context, id SecurityRuleId) error

DeleteThenPoll performs Delete then polls until it's completed

func (SecurityRulesClient) Get

Get ...

func (SecurityRulesClient) List

List ...

func (SecurityRulesClient) ListComplete

ListComplete retrieves all the results into a single object

func (SecurityRulesClient) ListCompleteMatchingPredicate

func (c SecurityRulesClient) ListCompleteMatchingPredicate(ctx context.Context, id NetworkSecurityGroupId, predicate SecurityRuleOperationPredicate) (result ListCompleteResult, err error)

ListCompleteMatchingPredicate retrieves all the results and then applies the predicate

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL