package
0.20240125.1100331
Repository: https://github.com/hashicorp/go-azure-sdk.git
Documentation: pkg.go.dev

# README

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

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

Client Initialization

client := virtualnetworkgatewayconnections.NewVirtualNetworkGatewayConnectionsClientWithBaseURI("https://management.azure.com")
client.Client.Authorizer = authorizer

Example Usage: VirtualNetworkGatewayConnectionsClient.CreateOrUpdate

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

payload := virtualnetworkgatewayconnections.VirtualNetworkGatewayConnection{
	// ...
}


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

Example Usage: VirtualNetworkGatewayConnectionsClient.Delete

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

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

Example Usage: VirtualNetworkGatewayConnectionsClient.Get

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

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: VirtualNetworkGatewayConnectionsClient.GetIkeSas

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

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

Example Usage: VirtualNetworkGatewayConnectionsClient.GetSharedKey

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

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

Example Usage: VirtualNetworkGatewayConnectionsClient.List

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

// 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: VirtualNetworkGatewayConnectionsClient.ResetConnection

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

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

Example Usage: VirtualNetworkGatewayConnectionsClient.ResetSharedKey

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

payload := virtualnetworkgatewayconnections.ConnectionResetSharedKey{
	// ...
}


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

Example Usage: VirtualNetworkGatewayConnectionsClient.SetSharedKey

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

payload := virtualnetworkgatewayconnections.ConnectionSharedKey{
	// ...
}


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

Example Usage: VirtualNetworkGatewayConnectionsClient.StartPacketCapture

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

payload := virtualnetworkgatewayconnections.VpnPacketCaptureStartParameters{
	// ...
}


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

Example Usage: VirtualNetworkGatewayConnectionsClient.StopPacketCapture

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

payload := virtualnetworkgatewayconnections.VpnPacketCaptureStopParameters{
	// ...
}


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

Example Usage: VirtualNetworkGatewayConnectionsClient.UpdateTags

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

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


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