-
Notifications
You must be signed in to change notification settings - Fork 46
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
hc-github-team-tf-azure
committed
Apr 17, 2024
1 parent
244cc26
commit a9c9053
Showing
320 changed files
with
18,727 additions
and
0 deletions.
There are no files selected for viewing
139 changes: 139 additions & 0 deletions
139
resource-manager/containerservice/2023-09-02-preview/agentpools/README.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,139 @@ | ||
|
||
## `github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-09-02-preview/agentpools` Documentation | ||
|
||
The `agentpools` SDK allows for interaction with the Azure Resource Manager Service `containerservice` (API Version `2023-09-02-preview`). | ||
|
||
This readme covers example usages, but further information on [using this SDK can be found in the project root](https://github.com/hashicorp/go-azure-sdk/tree/main/docs). | ||
|
||
### Import Path | ||
|
||
```go | ||
import "github.com/hashicorp/go-azure-helpers/resourcemanager/commonids" | ||
import "github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-09-02-preview/agentpools" | ||
``` | ||
|
||
|
||
### Client Initialization | ||
|
||
```go | ||
client := agentpools.NewAgentPoolsClientWithBaseURI("https://management.azure.com") | ||
client.Client.Authorizer = authorizer | ||
``` | ||
|
||
|
||
### Example Usage: `AgentPoolsClient.AbortLatestOperation` | ||
|
||
```go | ||
ctx := context.TODO() | ||
id := agentpools.NewAgentPoolID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterValue", "agentPoolValue") | ||
|
||
if err := client.AbortLatestOperationThenPoll(ctx, id); err != nil { | ||
// handle the error | ||
} | ||
``` | ||
|
||
|
||
### Example Usage: `AgentPoolsClient.CreateOrUpdate` | ||
|
||
```go | ||
ctx := context.TODO() | ||
id := agentpools.NewAgentPoolID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterValue", "agentPoolValue") | ||
|
||
payload := agentpools.AgentPool{ | ||
// ... | ||
} | ||
|
||
|
||
if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { | ||
// handle the error | ||
} | ||
``` | ||
|
||
|
||
### Example Usage: `AgentPoolsClient.Delete` | ||
|
||
```go | ||
ctx := context.TODO() | ||
id := agentpools.NewAgentPoolID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterValue", "agentPoolValue") | ||
|
||
if err := client.DeleteThenPoll(ctx, id, agentpools.DefaultDeleteOperationOptions()); err != nil { | ||
// handle the error | ||
} | ||
``` | ||
|
||
|
||
### Example Usage: `AgentPoolsClient.Get` | ||
|
||
```go | ||
ctx := context.TODO() | ||
id := agentpools.NewAgentPoolID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterValue", "agentPoolValue") | ||
|
||
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: `AgentPoolsClient.GetAvailableAgentPoolVersions` | ||
|
||
```go | ||
ctx := context.TODO() | ||
id := commonids.NewKubernetesClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterValue") | ||
|
||
read, err := client.GetAvailableAgentPoolVersions(ctx, id) | ||
if err != nil { | ||
// handle the error | ||
} | ||
if model := read.Model; model != nil { | ||
// do something with the model/response object | ||
} | ||
``` | ||
|
||
|
||
### Example Usage: `AgentPoolsClient.GetUpgradeProfile` | ||
|
||
```go | ||
ctx := context.TODO() | ||
id := agentpools.NewAgentPoolID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterValue", "agentPoolValue") | ||
|
||
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: `AgentPoolsClient.List` | ||
|
||
```go | ||
ctx := context.TODO() | ||
id := commonids.NewKubernetesClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterValue") | ||
|
||
// 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: `AgentPoolsClient.UpgradeNodeImageVersion` | ||
|
||
```go | ||
ctx := context.TODO() | ||
id := agentpools.NewAgentPoolID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterValue", "agentPoolValue") | ||
|
||
if err := client.UpgradeNodeImageVersionThenPoll(ctx, id); err != nil { | ||
// handle the error | ||
} | ||
``` |
26 changes: 26 additions & 0 deletions
26
resource-manager/containerservice/2023-09-02-preview/agentpools/client.go
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
package agentpools | ||
|
||
import ( | ||
"fmt" | ||
|
||
"github.com/hashicorp/go-azure-sdk/sdk/client/resourcemanager" | ||
sdkEnv "github.com/hashicorp/go-azure-sdk/sdk/environments" | ||
) | ||
|
||
// Copyright (c) Microsoft Corporation. All rights reserved. | ||
// Licensed under the MIT License. See NOTICE.txt in the project root for license information. | ||
|
||
type AgentPoolsClient struct { | ||
Client *resourcemanager.Client | ||
} | ||
|
||
func NewAgentPoolsClientWithBaseURI(sdkApi sdkEnv.Api) (*AgentPoolsClient, error) { | ||
client, err := resourcemanager.NewResourceManagerClient(sdkApi, "agentpools", defaultApiVersion) | ||
if err != nil { | ||
return nil, fmt.Errorf("instantiating AgentPoolsClient: %+v", err) | ||
} | ||
|
||
return &AgentPoolsClient{ | ||
Client: client, | ||
}, nil | ||
} |
Oops, something went wrong.