adminrules

package
v0.20240214.1100807 Latest Latest
Warning

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

Go to latest
Published: Feb 14, 2024 License: MPL-2.0 Imports: 12 Imported by: 0

README

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

The adminrules 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/adminrules"

Client Initialization

client := adminrules.NewAdminRulesClientWithBaseURI("https://management.azure.com")
client.Client.Authorizer = authorizer

Example Usage: AdminRulesClient.CreateOrUpdate

ctx := context.TODO()
id := adminrules.NewRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerValue", "securityAdminConfigurationValue", "ruleCollectionValue", "ruleValue")

payload := adminrules.BaseAdminRule{
	// ...
}


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

Example Usage: AdminRulesClient.Delete

ctx := context.TODO()
id := adminrules.NewRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerValue", "securityAdminConfigurationValue", "ruleCollectionValue", "ruleValue")

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

Example Usage: AdminRulesClient.Get

ctx := context.TODO()
id := adminrules.NewRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerValue", "securityAdminConfigurationValue", "ruleCollectionValue", "ruleValue")

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: AdminRulesClient.List

ctx := context.TODO()
id := adminrules.NewRuleCollectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerValue", "securityAdminConfigurationValue", "ruleCollectionValue")

// 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 PossibleValuesForAddressPrefixType

func PossibleValuesForAddressPrefixType() []string

func PossibleValuesForAdminRuleKind

func PossibleValuesForAdminRuleKind() []string

func PossibleValuesForProvisioningState

func PossibleValuesForProvisioningState() []string

func PossibleValuesForSecurityConfigurationRuleAccess

func PossibleValuesForSecurityConfigurationRuleAccess() []string

func PossibleValuesForSecurityConfigurationRuleDirection

func PossibleValuesForSecurityConfigurationRuleDirection() []string

func PossibleValuesForSecurityConfigurationRuleProtocol

func PossibleValuesForSecurityConfigurationRuleProtocol() []string

func ValidateRuleCollectionID

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

ValidateRuleCollectionID checks that 'input' can be parsed as a Rule Collection ID

func ValidateRuleID

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

ValidateRuleID checks that 'input' can be parsed as a Rule ID

Types

type AddressPrefixItem

type AddressPrefixItem struct {
	AddressPrefix     *string            `json:"addressPrefix,omitempty"`
	AddressPrefixType *AddressPrefixType `json:"addressPrefixType,omitempty"`
}

type AddressPrefixType

type AddressPrefixType string
const (
	AddressPrefixTypeIPPrefix   AddressPrefixType = "IPPrefix"
	AddressPrefixTypeServiceTag AddressPrefixType = "ServiceTag"
)

func (*AddressPrefixType) UnmarshalJSON

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

type AdminPropertiesFormat

type AdminPropertiesFormat struct {
	Access                SecurityConfigurationRuleAccess    `json:"access"`
	Description           *string                            `json:"description,omitempty"`
	DestinationPortRanges *[]string                          `json:"destinationPortRanges,omitempty"`
	Destinations          *[]AddressPrefixItem               `json:"destinations,omitempty"`
	Direction             SecurityConfigurationRuleDirection `json:"direction"`
	Priority              int64                              `json:"priority"`
	Protocol              SecurityConfigurationRuleProtocol  `json:"protocol"`
	ProvisioningState     *ProvisioningState                 `json:"provisioningState,omitempty"`
	ResourceGuid          *string                            `json:"resourceGuid,omitempty"`
	SourcePortRanges      *[]string                          `json:"sourcePortRanges,omitempty"`
	Sources               *[]AddressPrefixItem               `json:"sources,omitempty"`
}

type AdminRule

type AdminRule struct {
	Properties *AdminPropertiesFormat `json:"properties,omitempty"`

	// Fields inherited from BaseAdminRule
	Etag       *string                `json:"etag,omitempty"`
	Id         *string                `json:"id,omitempty"`
	Name       *string                `json:"name,omitempty"`
	SystemData *systemdata.SystemData `json:"systemData,omitempty"`
	Type       *string                `json:"type,omitempty"`
}

func (AdminRule) MarshalJSON

func (s AdminRule) MarshalJSON() ([]byte, error)

type AdminRuleKind

type AdminRuleKind string
const (
	AdminRuleKindCustom  AdminRuleKind = "Custom"
	AdminRuleKindDefault AdminRuleKind = "Default"
)

func (*AdminRuleKind) UnmarshalJSON

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

type AdminRulesClient

type AdminRulesClient struct {
	Client *resourcemanager.Client
}

func NewAdminRulesClientWithBaseURI

func NewAdminRulesClientWithBaseURI(sdkApi sdkEnv.Api) (*AdminRulesClient, error)

func (AdminRulesClient) CreateOrUpdate

func (c AdminRulesClient) CreateOrUpdate(ctx context.Context, id RuleId, input BaseAdminRule) (result CreateOrUpdateOperationResponse, err error)

CreateOrUpdate ...

func (AdminRulesClient) Delete

Delete ...

func (AdminRulesClient) DeleteThenPoll

func (c AdminRulesClient) DeleteThenPoll(ctx context.Context, id RuleId, options DeleteOperationOptions) error

DeleteThenPoll performs Delete then polls until it's completed

func (AdminRulesClient) Get

func (c AdminRulesClient) Get(ctx context.Context, id RuleId) (result GetOperationResponse, err error)

Get ...

func (AdminRulesClient) List

List ...

func (AdminRulesClient) ListComplete

ListComplete retrieves all the results into a single object

func (AdminRulesClient) ListCompleteMatchingPredicate

func (c AdminRulesClient) ListCompleteMatchingPredicate(ctx context.Context, id RuleCollectionId, predicate BaseAdminRuleOperationPredicate) (result ListCompleteResult, err error)

ListCompleteMatchingPredicate retrieves all the results and then applies the predicate

type BaseAdminRule

type BaseAdminRule interface {
}

type BaseAdminRuleOperationPredicate

type BaseAdminRuleOperationPredicate struct {
}

func (BaseAdminRuleOperationPredicate) Matches

type CreateOrUpdateOperationResponse

type CreateOrUpdateOperationResponse struct {
	HttpResponse *http.Response
	OData        *odata.OData
	Model        *BaseAdminRule
}

type DefaultAdminPropertiesFormat

type DefaultAdminPropertiesFormat struct {
	Access                *SecurityConfigurationRuleAccess    `json:"access,omitempty"`
	Description           *string                             `json:"description,omitempty"`
	DestinationPortRanges *[]string                           `json:"destinationPortRanges,omitempty"`
	Destinations          *[]AddressPrefixItem                `json:"destinations,omitempty"`
	Direction             *SecurityConfigurationRuleDirection `json:"direction,omitempty"`
	Flag                  *string                             `json:"flag,omitempty"`
	Priority              *int64                              `json:"priority,omitempty"`
	Protocol              *SecurityConfigurationRuleProtocol  `json:"protocol,omitempty"`
	ProvisioningState     *ProvisioningState                  `json:"provisioningState,omitempty"`
	ResourceGuid          *string                             `json:"resourceGuid,omitempty"`
	SourcePortRanges      *[]string                           `json:"sourcePortRanges,omitempty"`
	Sources               *[]AddressPrefixItem                `json:"sources,omitempty"`
}

type DefaultAdminRule

type DefaultAdminRule struct {
	Properties *DefaultAdminPropertiesFormat `json:"properties,omitempty"`

	// Fields inherited from BaseAdminRule
	Etag       *string                `json:"etag,omitempty"`
	Id         *string                `json:"id,omitempty"`
	Name       *string                `json:"name,omitempty"`
	SystemData *systemdata.SystemData `json:"systemData,omitempty"`
	Type       *string                `json:"type,omitempty"`
}

func (DefaultAdminRule) MarshalJSON

func (s DefaultAdminRule) MarshalJSON() ([]byte, error)

type DeleteOperationOptions

type DeleteOperationOptions struct {
	Force *bool
}

func DefaultDeleteOperationOptions

func DefaultDeleteOperationOptions() DeleteOperationOptions

func (DeleteOperationOptions) ToHeaders

func (o DeleteOperationOptions) ToHeaders() *client.Headers

func (DeleteOperationOptions) ToOData

func (o DeleteOperationOptions) ToOData() *odata.Query

func (DeleteOperationOptions) ToQuery

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        *BaseAdminRule
}

type ListCompleteResult

type ListCompleteResult struct {
	LatestHttpResponse *http.Response
	Items              []BaseAdminRule
}

type ListOperationResponse

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

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 RawBaseAdminRuleImpl

type RawBaseAdminRuleImpl struct {
	Type   string
	Values map[string]interface{}
}

RawBaseAdminRuleImpl is returned when the Discriminated Value doesn't match any of the defined types NOTE: this should only be used when a type isn't defined for this type of Object (as a workaround) and is used only for Deserialization (e.g. this cannot be used as a Request Payload).

type RuleCollectionId

type RuleCollectionId struct {
	SubscriptionId                 string
	ResourceGroupName              string
	NetworkManagerName             string
	SecurityAdminConfigurationName string
	RuleCollectionName             string
}

RuleCollectionId is a struct representing the Resource ID for a Rule Collection

func NewRuleCollectionID

func NewRuleCollectionID(subscriptionId string, resourceGroupName string, networkManagerName string, securityAdminConfigurationName string, ruleCollectionName string) RuleCollectionId

NewRuleCollectionID returns a new RuleCollectionId struct

func ParseRuleCollectionID

func ParseRuleCollectionID(input string) (*RuleCollectionId, error)

ParseRuleCollectionID parses 'input' into a RuleCollectionId

func ParseRuleCollectionIDInsensitively

func ParseRuleCollectionIDInsensitively(input string) (*RuleCollectionId, error)

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

func (*RuleCollectionId) FromParseResult

func (id *RuleCollectionId) FromParseResult(input resourceids.ParseResult) error

func (RuleCollectionId) ID

func (id RuleCollectionId) ID() string

ID returns the formatted Rule Collection ID

func (RuleCollectionId) Segments

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

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

func (RuleCollectionId) String

func (id RuleCollectionId) String() string

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

type RuleId

type RuleId struct {
	SubscriptionId                 string
	ResourceGroupName              string
	NetworkManagerName             string
	SecurityAdminConfigurationName string
	RuleCollectionName             string
	RuleName                       string
}

RuleId is a struct representing the Resource ID for a Rule

func NewRuleID

func NewRuleID(subscriptionId string, resourceGroupName string, networkManagerName string, securityAdminConfigurationName string, ruleCollectionName string, ruleName string) RuleId

NewRuleID returns a new RuleId struct

func ParseRuleID

func ParseRuleID(input string) (*RuleId, error)

ParseRuleID parses 'input' into a RuleId

func ParseRuleIDInsensitively

func ParseRuleIDInsensitively(input string) (*RuleId, error)

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

func (*RuleId) FromParseResult

func (id *RuleId) FromParseResult(input resourceids.ParseResult) error

func (RuleId) ID

func (id RuleId) ID() string

ID returns the formatted Rule ID

func (RuleId) Segments

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

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

func (RuleId) String

func (id RuleId) String() string

String returns a human-readable description of this Rule ID

type SecurityConfigurationRuleAccess

type SecurityConfigurationRuleAccess string
const (
	SecurityConfigurationRuleAccessAllow       SecurityConfigurationRuleAccess = "Allow"
	SecurityConfigurationRuleAccessAlwaysAllow SecurityConfigurationRuleAccess = "AlwaysAllow"
	SecurityConfigurationRuleAccessDeny        SecurityConfigurationRuleAccess = "Deny"
)

func (*SecurityConfigurationRuleAccess) UnmarshalJSON

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

type SecurityConfigurationRuleDirection

type SecurityConfigurationRuleDirection string
const (
	SecurityConfigurationRuleDirectionInbound  SecurityConfigurationRuleDirection = "Inbound"
	SecurityConfigurationRuleDirectionOutbound SecurityConfigurationRuleDirection = "Outbound"
)

func (*SecurityConfigurationRuleDirection) UnmarshalJSON

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

type SecurityConfigurationRuleProtocol

type SecurityConfigurationRuleProtocol string
const (
	SecurityConfigurationRuleProtocolAh   SecurityConfigurationRuleProtocol = "Ah"
	SecurityConfigurationRuleProtocolAny  SecurityConfigurationRuleProtocol = "Any"
	SecurityConfigurationRuleProtocolEsp  SecurityConfigurationRuleProtocol = "Esp"
	SecurityConfigurationRuleProtocolIcmp SecurityConfigurationRuleProtocol = "Icmp"
	SecurityConfigurationRuleProtocolTcp  SecurityConfigurationRuleProtocol = "Tcp"
	SecurityConfigurationRuleProtocolUdp  SecurityConfigurationRuleProtocol = "Udp"
)

func (*SecurityConfigurationRuleProtocol) UnmarshalJSON

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

Jump to

Keyboard shortcuts

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