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/containerservice/2024-01-01/managedclusters
Documentation
The managedclusters
SDK allows for interaction with the Azure Resource Manager Service containerservice
(API Version 2024-01-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/containerservice/2024-01-01/managedclusters"
Client Initialization
client := managedclusters.NewManagedClustersClientWithBaseURI("https://management.azure.com")
client.Client.Authorizer = authorizer
Example Usage: ManagedClustersClient.AbortLatestOperation
ctx := context.TODO()
id := commonids.NewKubernetesClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterValue")
if err := client.AbortLatestOperationThenPoll(ctx, id); err != nil {
// handle the error
}
Example Usage: ManagedClustersClient.CreateOrUpdate
ctx := context.TODO()
id := commonids.NewKubernetesClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterValue")
payload := managedclusters.ManagedCluster{
// ...
}
if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil {
// handle the error
}
Example Usage: ManagedClustersClient.Delete
ctx := context.TODO()
id := commonids.NewKubernetesClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterValue")
if err := client.DeleteThenPoll(ctx, id); err != nil {
// handle the error
}
Example Usage: ManagedClustersClient.Get
ctx := context.TODO()
id := commonids.NewKubernetesClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterValue")
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: ManagedClustersClient.GetAccessProfile
ctx := context.TODO()
id := managedclusters.NewAccessProfileID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterValue", "accessProfileValue")
read, err := client.GetAccessProfile(ctx, id)
if err != nil {
// handle the error
}
if model := read.Model; model != nil {
// do something with the model/response object
}
Example Usage: ManagedClustersClient.GetCommandResult
ctx := context.TODO()
id := managedclusters.NewCommandResultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterValue", "commandIdValue")
read, err := client.GetCommandResult(ctx, id)
if err != nil {
// handle the error
}
if model := read.Model; model != nil {
// do something with the model/response object
}
Example Usage: ManagedClustersClient.GetMeshRevisionProfile
ctx := context.TODO()
id := managedclusters.NewMeshRevisionProfileID("12345678-1234-9876-4563-123456789012", "locationValue", "meshRevisionProfileValue")
read, err := client.GetMeshRevisionProfile(ctx, id)
if err != nil {
// handle the error
}
if model := read.Model; model != nil {
// do something with the model/response object
}
Example Usage: ManagedClustersClient.GetMeshUpgradeProfile
ctx := context.TODO()
id := managedclusters.NewMeshUpgradeProfileID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterValue", "meshUpgradeProfileValue")
read, err := client.GetMeshUpgradeProfile(ctx, id)
if err != nil {
// handle the error
}
if model := read.Model; model != nil {
// do something with the model/response object
}
Example Usage: ManagedClustersClient.GetOSOptions
ctx := context.TODO()
id := managedclusters.NewLocationID("12345678-1234-9876-4563-123456789012", "locationValue")
read, err := client.GetOSOptions(ctx, id, managedclusters.DefaultGetOSOptionsOperationOptions())
if err != nil {
// handle the error
}
if model := read.Model; model != nil {
// do something with the model/response object
}
Example Usage: ManagedClustersClient.GetUpgradeProfile
ctx := context.TODO()
id := commonids.NewKubernetesClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterValue")
read, err := client.GetUpgradeProfile(ctx, id)
if err != nil {
// handle the error
}
if model := read.Model; model != nil {
// do something with the model/response object
}
Example Usage: ManagedClustersClient.List
ctx := context.TODO()
id := commonids.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: ManagedClustersClient.ListByResourceGroup
ctx := context.TODO()
id := commonids.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: ManagedClustersClient.ListClusterAdminCredentials
ctx := context.TODO()
id := commonids.NewKubernetesClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterValue")
read, err := client.ListClusterAdminCredentials(ctx, id, managedclusters.DefaultListClusterAdminCredentialsOperationOptions())
if err != nil {
// handle the error
}
if model := read.Model; model != nil {
// do something with the model/response object
}
Example Usage: ManagedClustersClient.ListClusterMonitoringUserCredentials
ctx := context.TODO()
id := commonids.NewKubernetesClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterValue")
read, err := client.ListClusterMonitoringUserCredentials(ctx, id, managedclusters.DefaultListClusterMonitoringUserCredentialsOperationOptions())
if err != nil {
// handle the error
}
if model := read.Model; model != nil {
// do something with the model/response object
}
Example Usage: ManagedClustersClient.ListClusterUserCredentials
ctx := context.TODO()
id := commonids.NewKubernetesClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterValue")
read, err := client.ListClusterUserCredentials(ctx, id, managedclusters.DefaultListClusterUserCredentialsOperationOptions())
if err != nil {
// handle the error
}
if model := read.Model; model != nil {
// do something with the model/response object
}
Example Usage: ManagedClustersClient.ListKubernetesVersions
ctx := context.TODO()
id := managedclusters.NewLocationID("12345678-1234-9876-4563-123456789012", "locationValue")
read, err := client.ListKubernetesVersions(ctx, id)
if err != nil {
// handle the error
}
if model := read.Model; model != nil {
// do something with the model/response object
}
Example Usage: ManagedClustersClient.ListMeshRevisionProfiles
ctx := context.TODO()
id := managedclusters.NewLocationID("12345678-1234-9876-4563-123456789012", "locationValue")
// alternatively `client.ListMeshRevisionProfiles(ctx, id)` can be used to do batched pagination
items, err := client.ListMeshRevisionProfilesComplete(ctx, id)
if err != nil {
// handle the error
}
for _, item := range items {
// do something
}
Example Usage: ManagedClustersClient.ListMeshUpgradeProfiles
ctx := context.TODO()
id := commonids.NewKubernetesClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterValue")
// alternatively `client.ListMeshUpgradeProfiles(ctx, id)` can be used to do batched pagination
items, err := client.ListMeshUpgradeProfilesComplete(ctx, id)
if err != nil {
// handle the error
}
for _, item := range items {
// do something
}
Example Usage: ManagedClustersClient.ListOutboundNetworkDependenciesEndpoints
ctx := context.TODO()
id := commonids.NewKubernetesClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterValue")
// alternatively `client.ListOutboundNetworkDependenciesEndpoints(ctx, id)` can be used to do batched pagination
items, err := client.ListOutboundNetworkDependenciesEndpointsComplete(ctx, id)
if err != nil {
// handle the error
}
for _, item := range items {
// do something
}
Example Usage: ManagedClustersClient.ResetAADProfile
ctx := context.TODO()
id := commonids.NewKubernetesClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterValue")
payload := managedclusters.ManagedClusterAADProfile{
// ...
}
if err := client.ResetAADProfileThenPoll(ctx, id, payload); err != nil {
// handle the error
}
Example Usage: ManagedClustersClient.ResetServicePrincipalProfile
ctx := context.TODO()
id := commonids.NewKubernetesClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterValue")
payload := managedclusters.ManagedClusterServicePrincipalProfile{
// ...
}
if err := client.ResetServicePrincipalProfileThenPoll(ctx, id, payload); err != nil {
// handle the error
}
Example Usage: ManagedClustersClient.RotateClusterCertificates
ctx := context.TODO()
id := commonids.NewKubernetesClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterValue")
if err := client.RotateClusterCertificatesThenPoll(ctx, id); err != nil {
// handle the error
}
Example Usage: ManagedClustersClient.RotateServiceAccountSigningKeys
ctx := context.TODO()
id := commonids.NewKubernetesClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterValue")
if err := client.RotateServiceAccountSigningKeysThenPoll(ctx, id); err != nil {
// handle the error
}
Example Usage: ManagedClustersClient.RunCommand
ctx := context.TODO()
id := commonids.NewKubernetesClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterValue")
payload := managedclusters.RunCommandRequest{
// ...
}
if err := client.RunCommandThenPoll(ctx, id, payload); err != nil {
// handle the error
}
Example Usage: ManagedClustersClient.Start
ctx := context.TODO()
id := commonids.NewKubernetesClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterValue")
if err := client.StartThenPoll(ctx, id); err != nil {
// handle the error
}
Example Usage: ManagedClustersClient.Stop
ctx := context.TODO()
id := commonids.NewKubernetesClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterValue")
if err := client.StopThenPoll(ctx, id); err != nil {
// handle the error
}
Example Usage: ManagedClustersClient.UpdateTags
ctx := context.TODO()
id := commonids.NewKubernetesClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterValue")
payload := managedclusters.TagsObject{
// ...
}
if err := client.UpdateTagsThenPoll(ctx, id, payload); err != nil {
// handle the error
}