package
0.20240715.1103416
Repository: https://github.com/hashicorp/go-azure-sdk.git
Documentation: pkg.go.dev
# README
github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-09-01/connectionmonitors
Documentation
The connectionmonitors
SDK allows for interaction with the Azure Resource Manager Service network
(API Version 2023-09-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-09-01/connectionmonitors"
Client Initialization
client := connectionmonitors.NewConnectionMonitorsClientWithBaseURI("https://management.azure.com")
client.Client.Authorizer = authorizer
Example Usage: ConnectionMonitorsClient.CreateOrUpdate
ctx := context.TODO()
id := connectionmonitors.NewConnectionMonitorID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkWatcherValue", "connectionMonitorValue")
payload := connectionmonitors.ConnectionMonitor{
// ...
}
if err := client.CreateOrUpdateThenPoll(ctx, id, payload, connectionmonitors.DefaultCreateOrUpdateOperationOptions()); err != nil {
// handle the error
}
Example Usage: ConnectionMonitorsClient.Delete
ctx := context.TODO()
id := connectionmonitors.NewConnectionMonitorID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkWatcherValue", "connectionMonitorValue")
if err := client.DeleteThenPoll(ctx, id); err != nil {
// handle the error
}
Example Usage: ConnectionMonitorsClient.Get
ctx := context.TODO()
id := connectionmonitors.NewConnectionMonitorID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkWatcherValue", "connectionMonitorValue")
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: ConnectionMonitorsClient.List
ctx := context.TODO()
id := connectionmonitors.NewNetworkWatcherID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkWatcherValue")
read, err := client.List(ctx, id)
if err != nil {
// handle the error
}
if model := read.Model; model != nil {
// do something with the model/response object
}
Example Usage: ConnectionMonitorsClient.Query
ctx := context.TODO()
id := connectionmonitors.NewConnectionMonitorID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkWatcherValue", "connectionMonitorValue")
if err := client.QueryThenPoll(ctx, id); err != nil {
// handle the error
}
Example Usage: ConnectionMonitorsClient.Start
ctx := context.TODO()
id := connectionmonitors.NewConnectionMonitorID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkWatcherValue", "connectionMonitorValue")
if err := client.StartThenPoll(ctx, id); err != nil {
// handle the error
}
Example Usage: ConnectionMonitorsClient.Stop
ctx := context.TODO()
id := connectionmonitors.NewConnectionMonitorID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkWatcherValue", "connectionMonitorValue")
if err := client.StopThenPoll(ctx, id); err != nil {
// handle the error
}
Example Usage: ConnectionMonitorsClient.UpdateTags
ctx := context.TODO()
id := connectionmonitors.NewConnectionMonitorID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkWatcherValue", "connectionMonitorValue")
payload := connectionmonitors.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
}