Skip to content

Commit 224da9a

Browse files
author
hc-github-team-tf-azure
committed
Updating based on aad95ace1
1 parent 1e84839 commit 224da9a

File tree

1,276 files changed

+107761
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,276 files changed

+107761
-0
lines changed
Lines changed: 99 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,99 @@
1+
2+
## `github.com/hashicorp/go-azure-sdk/resource-manager/machinelearningservices/2024-10-01/batchdeployment` Documentation
3+
4+
The `batchdeployment` SDK allows for interaction with Azure Resource Manager `machinelearningservices` (API Version `2024-10-01`).
5+
6+
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).
7+
8+
### Import Path
9+
10+
```go
11+
import "github.com/hashicorp/go-azure-sdk/resource-manager/machinelearningservices/2024-10-01/batchdeployment"
12+
```
13+
14+
15+
### Client Initialization
16+
17+
```go
18+
client := batchdeployment.NewBatchDeploymentClientWithBaseURI("https://management.azure.com")
19+
client.Client.Authorizer = authorizer
20+
```
21+
22+
23+
### Example Usage: `BatchDeploymentClient.CreateOrUpdate`
24+
25+
```go
26+
ctx := context.TODO()
27+
id := batchdeployment.NewDeploymentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "batchEndpointName", "deploymentName")
28+
29+
payload := batchdeployment.BatchDeploymentTrackedResource{
30+
// ...
31+
}
32+
33+
34+
if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil {
35+
// handle the error
36+
}
37+
```
38+
39+
40+
### Example Usage: `BatchDeploymentClient.Delete`
41+
42+
```go
43+
ctx := context.TODO()
44+
id := batchdeployment.NewDeploymentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "batchEndpointName", "deploymentName")
45+
46+
if err := client.DeleteThenPoll(ctx, id); err != nil {
47+
// handle the error
48+
}
49+
```
50+
51+
52+
### Example Usage: `BatchDeploymentClient.Get`
53+
54+
```go
55+
ctx := context.TODO()
56+
id := batchdeployment.NewDeploymentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "batchEndpointName", "deploymentName")
57+
58+
read, err := client.Get(ctx, id)
59+
if err != nil {
60+
// handle the error
61+
}
62+
if model := read.Model; model != nil {
63+
// do something with the model/response object
64+
}
65+
```
66+
67+
68+
### Example Usage: `BatchDeploymentClient.List`
69+
70+
```go
71+
ctx := context.TODO()
72+
id := batchdeployment.NewBatchEndpointID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "batchEndpointName")
73+
74+
// alternatively `client.List(ctx, id, batchdeployment.DefaultListOperationOptions())` can be used to do batched pagination
75+
items, err := client.ListComplete(ctx, id, batchdeployment.DefaultListOperationOptions())
76+
if err != nil {
77+
// handle the error
78+
}
79+
for _, item := range items {
80+
// do something
81+
}
82+
```
83+
84+
85+
### Example Usage: `BatchDeploymentClient.Update`
86+
87+
```go
88+
ctx := context.TODO()
89+
id := batchdeployment.NewDeploymentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "batchEndpointName", "deploymentName")
90+
91+
payload := batchdeployment.PartialBatchDeploymentPartialMinimalTrackedResourceWithProperties{
92+
// ...
93+
}
94+
95+
96+
if err := client.UpdateThenPoll(ctx, id, payload); err != nil {
97+
// handle the error
98+
}
99+
```
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
package batchdeployment
2+
3+
import (
4+
"fmt"
5+
6+
"github.com/hashicorp/go-azure-sdk/sdk/client/resourcemanager"
7+
sdkEnv "github.com/hashicorp/go-azure-sdk/sdk/environments"
8+
)
9+
10+
// Copyright (c) Microsoft Corporation. All rights reserved.
11+
// Licensed under the MIT License. See NOTICE.txt in the project root for license information.
12+
13+
type BatchDeploymentClient struct {
14+
Client *resourcemanager.Client
15+
}
16+
17+
func NewBatchDeploymentClientWithBaseURI(sdkApi sdkEnv.Api) (*BatchDeploymentClient, error) {
18+
client, err := resourcemanager.NewClient(sdkApi, "batchdeployment", defaultApiVersion)
19+
if err != nil {
20+
return nil, fmt.Errorf("instantiating BatchDeploymentClient: %+v", err)
21+
}
22+
23+
return &BatchDeploymentClient{
24+
Client: client,
25+
}, nil
26+
}

0 commit comments

Comments
 (0)