firewallrules

package
v0.20230807.1063129 Latest Latest
Warning

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

Go to latest
Published: Aug 7, 2023 License: MPL-2.0 Imports: 9 Imported by: 0

README

github.com/hashicorp/go-azure-sdk/resource-manager/sql/2021-02-01-preview/firewallrules Documentation

The firewallrules SDK allows for interaction with the Azure Resource Manager Service sql (API Version 2021-02-01-preview).

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/sql/2021-02-01-preview/firewallrules"

Client Initialization

client := firewallrules.NewFirewallRulesClientWithBaseURI("https://management.azure.com")
client.Client.Authorizer = authorizer

Example Usage: FirewallRulesClient.CreateOrUpdate

ctx := context.TODO()
id := firewallrules.NewFirewallRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverValue", "firewallRuleValue")

payload := firewallrules.FirewallRule{
	// ...
}


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: FirewallRulesClient.Delete

ctx := context.TODO()
id := firewallrules.NewFirewallRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverValue", "firewallRuleValue")

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

Example Usage: FirewallRulesClient.Get

ctx := context.TODO()
id := firewallrules.NewFirewallRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverValue", "firewallRuleValue")

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: FirewallRulesClient.ListByServer

ctx := context.TODO()
id := firewallrules.NewServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverValue")

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

Example Usage: FirewallRulesClient.Replace

ctx := context.TODO()
id := firewallrules.NewServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverValue")

payload := firewallrules.FirewallRuleList{
	// ...
}


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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ValidateFirewallRuleID

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

ValidateFirewallRuleID checks that 'input' can be parsed as a Firewall Rule ID

func ValidateServerID

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

ValidateServerID checks that 'input' can be parsed as a Server ID

Types

type CreateOrUpdateOperationResponse

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

type DeleteOperationResponse

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

type FirewallRule

type FirewallRule struct {
	Id         *string                       `json:"id,omitempty"`
	Name       *string                       `json:"name,omitempty"`
	Properties *ServerFirewallRuleProperties `json:"properties,omitempty"`
	Type       *string                       `json:"type,omitempty"`
}

type FirewallRuleId

type FirewallRuleId struct {
	SubscriptionId    string
	ResourceGroupName string
	ServerName        string
	FirewallRuleName  string
}

FirewallRuleId is a struct representing the Resource ID for a Firewall Rule

func NewFirewallRuleID

func NewFirewallRuleID(subscriptionId string, resourceGroupName string, serverName string, firewallRuleName string) FirewallRuleId

NewFirewallRuleID returns a new FirewallRuleId struct

func ParseFirewallRuleID

func ParseFirewallRuleID(input string) (*FirewallRuleId, error)

ParseFirewallRuleID parses 'input' into a FirewallRuleId

func ParseFirewallRuleIDInsensitively

func ParseFirewallRuleIDInsensitively(input string) (*FirewallRuleId, error)

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

func (FirewallRuleId) ID

func (id FirewallRuleId) ID() string

ID returns the formatted Firewall Rule ID

func (FirewallRuleId) Segments

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

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

func (FirewallRuleId) String

func (id FirewallRuleId) String() string

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

type FirewallRuleList

type FirewallRuleList struct {
	Values *[]FirewallRule `json:"values,omitempty"`
}

type FirewallRuleOperationPredicate

type FirewallRuleOperationPredicate struct {
	Id   *string
	Name *string
	Type *string
}

func (FirewallRuleOperationPredicate) Matches

type FirewallRulesClient

type FirewallRulesClient struct {
	Client *resourcemanager.Client
}

func NewFirewallRulesClientWithBaseURI

func NewFirewallRulesClientWithBaseURI(sdkApi sdkEnv.Api) (*FirewallRulesClient, error)

func (FirewallRulesClient) CreateOrUpdate

CreateOrUpdate ...

func (FirewallRulesClient) Delete

Delete ...

func (FirewallRulesClient) Get

Get ...

func (FirewallRulesClient) ListByServer

func (c FirewallRulesClient) ListByServer(ctx context.Context, id ServerId) (result ListByServerOperationResponse, err error)

ListByServer ...

func (FirewallRulesClient) ListByServerComplete

func (c FirewallRulesClient) ListByServerComplete(ctx context.Context, id ServerId) (ListByServerCompleteResult, error)

ListByServerComplete retrieves all the results into a single object

func (FirewallRulesClient) ListByServerCompleteMatchingPredicate

func (c FirewallRulesClient) ListByServerCompleteMatchingPredicate(ctx context.Context, id ServerId, predicate FirewallRuleOperationPredicate) (result ListByServerCompleteResult, err error)

ListByServerCompleteMatchingPredicate retrieves all the results and then applies the predicate

func (FirewallRulesClient) Replace

Replace ...

type GetOperationResponse

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

type ListByServerCompleteResult

type ListByServerCompleteResult struct {
	Items []FirewallRule
}

type ListByServerOperationResponse

type ListByServerOperationResponse struct {
	HttpResponse *http.Response
	OData        *odata.OData
	Model        *[]FirewallRule
}

type ReplaceOperationResponse

type ReplaceOperationResponse struct {
	HttpResponse *http.Response
	OData        *odata.OData
	Model        *FirewallRule
}

type ServerFirewallRuleProperties

type ServerFirewallRuleProperties struct {
	EndIPAddress   *string `json:"endIpAddress,omitempty"`
	StartIPAddress *string `json:"startIpAddress,omitempty"`
}

type ServerId

type ServerId struct {
	SubscriptionId    string
	ResourceGroupName string
	ServerName        string
}

ServerId is a struct representing the Resource ID for a Server

func NewServerID

func NewServerID(subscriptionId string, resourceGroupName string, serverName string) ServerId

NewServerID returns a new ServerId struct

func ParseServerID

func ParseServerID(input string) (*ServerId, error)

ParseServerID parses 'input' into a ServerId

func ParseServerIDInsensitively

func ParseServerIDInsensitively(input string) (*ServerId, error)

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

func (ServerId) ID

func (id ServerId) ID() string

ID returns the formatted Server ID

func (ServerId) Segments

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

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

func (ServerId) String

func (id ServerId) String() string

String returns a human-readable description of this Server ID

Jump to

Keyboard shortcuts

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