ipallocations

package
v0.20230904.1142308 Latest Latest
Warning

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

Go to latest
Published: Sep 4, 2023 License: MPL-2.0 Imports: 12 Imported by: 0

README

github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-04-01/ipallocations Documentation

The ipallocations SDK allows for interaction with the Azure Resource Manager Service network (API Version 2023-04-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-04-01/ipallocations"

Client Initialization

client := ipallocations.NewIPAllocationsClientWithBaseURI("https://management.azure.com")
client.Client.Authorizer = authorizer

Example Usage: IPAllocationsClient.CreateOrUpdate

ctx := context.TODO()
id := ipallocations.NewIPAllocationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "ipAllocationValue")

payload := ipallocations.IPAllocation{
	// ...
}


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

Example Usage: IPAllocationsClient.Delete

ctx := context.TODO()
id := ipallocations.NewIPAllocationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "ipAllocationValue")

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

Example Usage: IPAllocationsClient.Get

ctx := context.TODO()
id := ipallocations.NewIPAllocationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "ipAllocationValue")

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

Example Usage: IPAllocationsClient.List

ctx := context.TODO()
id := ipallocations.NewSubscriptionID("12345678-1234-9876-4563-123456789012")

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

Example Usage: IPAllocationsClient.ListByResourceGroup

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

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

Example Usage: IPAllocationsClient.UpdateTags

ctx := context.TODO()
id := ipallocations.NewIPAllocationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "ipAllocationValue")

payload := ipallocations.TagsObject{
	// ...
}


read, err := client.UpdateTags(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 PossibleValuesForIPAllocationType

func PossibleValuesForIPAllocationType() []string

func PossibleValuesForIPVersion

func PossibleValuesForIPVersion() []string

func ValidateIPAllocationID

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

ValidateIPAllocationID checks that 'input' can be parsed as a I P Allocation ID

Types

type CreateOrUpdateOperationResponse

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

type DeleteOperationResponse

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

type GetOperationOptions

type GetOperationOptions struct {
	Expand *string
}

func DefaultGetOperationOptions

func DefaultGetOperationOptions() GetOperationOptions

func (GetOperationOptions) ToHeaders

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

func (GetOperationOptions) ToOData

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

func (GetOperationOptions) ToQuery

func (o GetOperationOptions) ToQuery() *client.QueryParams

type GetOperationResponse

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

type IPAllocation

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

type IPAllocationId

type IPAllocationId struct {
	SubscriptionId    string
	ResourceGroupName string
	IpAllocationName  string
}

IPAllocationId is a struct representing the Resource ID for a I P Allocation

func NewIPAllocationID

func NewIPAllocationID(subscriptionId string, resourceGroupName string, ipAllocationName string) IPAllocationId

NewIPAllocationID returns a new IPAllocationId struct

func ParseIPAllocationID

func ParseIPAllocationID(input string) (*IPAllocationId, error)

ParseIPAllocationID parses 'input' into a IPAllocationId

func ParseIPAllocationIDInsensitively

func ParseIPAllocationIDInsensitively(input string) (*IPAllocationId, error)

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

func (IPAllocationId) ID

func (id IPAllocationId) ID() string

ID returns the formatted I P Allocation ID

func (IPAllocationId) Segments

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

Segments returns a slice of Resource ID Segments which comprise this I P Allocation ID

func (IPAllocationId) String

func (id IPAllocationId) String() string

String returns a human-readable description of this I P Allocation ID

type IPAllocationOperationPredicate

type IPAllocationOperationPredicate struct {
	Etag     *string
	Id       *string
	Location *string
	Name     *string
	Type     *string
}

func (IPAllocationOperationPredicate) Matches

type IPAllocationPropertiesFormat

type IPAllocationPropertiesFormat struct {
	AllocationTags   *map[string]string `json:"allocationTags,omitempty"`
	IPamAllocationId *string            `json:"ipamAllocationId,omitempty"`
	Prefix           *string            `json:"prefix,omitempty"`
	PrefixLength     *int64             `json:"prefixLength,omitempty"`
	PrefixType       *IPVersion         `json:"prefixType,omitempty"`
	Subnet           *SubResource       `json:"subnet,omitempty"`
	Type             *IPAllocationType  `json:"type,omitempty"`
	VirtualNetwork   *SubResource       `json:"virtualNetwork,omitempty"`
}

type IPAllocationType

type IPAllocationType string
const (
	IPAllocationTypeHypernet  IPAllocationType = "Hypernet"
	IPAllocationTypeUndefined IPAllocationType = "Undefined"
)

func (*IPAllocationType) UnmarshalJSON

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

type IPAllocationsClient

type IPAllocationsClient struct {
	Client *resourcemanager.Client
}

func NewIPAllocationsClientWithBaseURI

func NewIPAllocationsClientWithBaseURI(sdkApi sdkEnv.Api) (*IPAllocationsClient, error)

func (IPAllocationsClient) CreateOrUpdate

CreateOrUpdate ...

func (IPAllocationsClient) CreateOrUpdateThenPoll

func (c IPAllocationsClient) CreateOrUpdateThenPoll(ctx context.Context, id IPAllocationId, input IPAllocation) error

CreateOrUpdateThenPoll performs CreateOrUpdate then polls until it's completed

func (IPAllocationsClient) Delete

Delete ...

func (IPAllocationsClient) DeleteThenPoll

func (c IPAllocationsClient) DeleteThenPoll(ctx context.Context, id IPAllocationId) error

DeleteThenPoll performs Delete then polls until it's completed

func (IPAllocationsClient) Get

Get ...

func (IPAllocationsClient) List

List ...

func (IPAllocationsClient) ListByResourceGroup

ListByResourceGroup ...

func (IPAllocationsClient) ListByResourceGroupComplete

ListByResourceGroupComplete retrieves all the results into a single object

func (IPAllocationsClient) ListByResourceGroupCompleteMatchingPredicate

func (c IPAllocationsClient) ListByResourceGroupCompleteMatchingPredicate(ctx context.Context, id commonids.ResourceGroupId, predicate IPAllocationOperationPredicate) (result ListByResourceGroupCompleteResult, err error)

ListByResourceGroupCompleteMatchingPredicate retrieves all the results and then applies the predicate

func (IPAllocationsClient) ListComplete

ListComplete retrieves all the results into a single object

func (IPAllocationsClient) ListCompleteMatchingPredicate

func (c IPAllocationsClient) ListCompleteMatchingPredicate(ctx context.Context, id commonids.SubscriptionId, predicate IPAllocationOperationPredicate) (result ListCompleteResult, err error)

ListCompleteMatchingPredicate retrieves all the results and then applies the predicate

func (IPAllocationsClient) UpdateTags

UpdateTags ...

type IPVersion

type IPVersion string
const (
	IPVersionIPvFour IPVersion = "IPv4"
	IPVersionIPvSix  IPVersion = "IPv6"
)

func (*IPVersion) UnmarshalJSON

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

type ListByResourceGroupCompleteResult

type ListByResourceGroupCompleteResult struct {
	Items []IPAllocation
}

type ListByResourceGroupOperationResponse

type ListByResourceGroupOperationResponse struct {
	HttpResponse *http.Response
	OData        *odata.OData
	Model        *[]IPAllocation
}

type ListCompleteResult

type ListCompleteResult struct {
	Items []IPAllocation
}

type ListOperationResponse

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

type SubResource

type SubResource struct {
	Id *string `json:"id,omitempty"`
}

type TagsObject

type TagsObject struct {
	Tags *map[string]string `json:"tags,omitempty"`
}

type UpdateTagsOperationResponse

type UpdateTagsOperationResponse struct {
	HttpResponse *http.Response
	OData        *odata.OData
	Model        *IPAllocation
}

Jump to

Keyboard shortcuts

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