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/2022-07-01/privateendpoints
Documentation
The privateendpoints
SDK allows for interaction with the Azure Resource Manager Service network
(API Version 2022-07-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-helpers/resourcemanager/commonids"
import "github.com/hashicorp/go-azure-sdk/resource-manager/network/2022-07-01/privateendpoints"
Client Initialization
client := privateendpoints.NewPrivateEndpointsClientWithBaseURI("https://management.azure.com")
client.Client.Authorizer = authorizer
Example Usage: PrivateEndpointsClient.AvailablePrivateEndpointTypesList
ctx := context.TODO()
id := privateendpoints.NewLocationID("12345678-1234-9876-4563-123456789012", "locationValue")
// alternatively `client.AvailablePrivateEndpointTypesList(ctx, id)` can be used to do batched pagination
items, err := client.AvailablePrivateEndpointTypesListComplete(ctx, id)
if err != nil {
// handle the error
}
for _, item := range items {
// do something
}
Example Usage: PrivateEndpointsClient.AvailablePrivateEndpointTypesListByResourceGroup
ctx := context.TODO()
id := privateendpoints.NewProviderLocationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "locationValue")
// alternatively `client.AvailablePrivateEndpointTypesListByResourceGroup(ctx, id)` can be used to do batched pagination
items, err := client.AvailablePrivateEndpointTypesListByResourceGroupComplete(ctx, id)
if err != nil {
// handle the error
}
for _, item := range items {
// do something
}
Example Usage: PrivateEndpointsClient.CreateOrUpdate
ctx := context.TODO()
id := privateendpoints.NewPrivateEndpointID("12345678-1234-9876-4563-123456789012", "example-resource-group", "privateEndpointValue")
payload := privateendpoints.PrivateEndpoint{
// ...
}
if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil {
// handle the error
}
Example Usage: PrivateEndpointsClient.Delete
ctx := context.TODO()
id := privateendpoints.NewPrivateEndpointID("12345678-1234-9876-4563-123456789012", "example-resource-group", "privateEndpointValue")
if err := client.DeleteThenPoll(ctx, id); err != nil {
// handle the error
}
Example Usage: PrivateEndpointsClient.Get
ctx := context.TODO()
id := privateendpoints.NewPrivateEndpointID("12345678-1234-9876-4563-123456789012", "example-resource-group", "privateEndpointValue")
read, err := client.Get(ctx, id, privateendpoints.DefaultGetOperationOptions())
if err != nil {
// handle the error
}
if model := read.Model; model != nil {
// do something with the model/response object
}
Example Usage: PrivateEndpointsClient.List
ctx := context.TODO()
id := commonids.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: PrivateEndpointsClient.ListBySubscription
ctx := context.TODO()
id := commonids.NewSubscriptionID("12345678-1234-9876-4563-123456789012")
// alternatively `client.ListBySubscription(ctx, id)` can be used to do batched pagination
items, err := client.ListBySubscriptionComplete(ctx, id)
if err != nil {
// handle the error
}
for _, item := range items {
// do something
}