[Automation] Collect examples from azure-sdk-for-go#sdk/resourcemanager/machinelearning/armmachinelearning/v2.0.0

Co-authored-by: azure-sdk <azuresdk@microsoft.com>
This commit is contained in:
Azure-Fluent 2022-06-12 08:02:40 +08:00 коммит произвёл GitHub
Родитель 202a92b0ac
Коммит 11ce841f79
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
114 изменённых файлов: 4940 добавлений и 0 удалений

Просмотреть файл

@ -0,0 +1,98 @@
```go
package armmachinelearning_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/machinelearning/armmachinelearning/v2"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-05-01/examples/BatchDeployment/createOrUpdate.json
func ExampleBatchDeploymentsClient_BeginCreateOrUpdate() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
client, err := armmachinelearning.NewBatchDeploymentsClient("00000000-1111-2222-3333-444444444444", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
poller, err := client.BeginCreateOrUpdate(ctx,
"test-rg",
"my-aml-workspace",
"testEndpointName",
"testDeploymentName",
armmachinelearning.BatchDeployment{
Location: to.Ptr("string"),
Tags: map[string]*string{},
Identity: &armmachinelearning.ManagedServiceIdentity{
Type: to.Ptr(armmachinelearning.ManagedServiceIdentityTypeSystemAssigned),
UserAssignedIdentities: map[string]*armmachinelearning.UserAssignedIdentity{
"string": {},
},
},
Kind: to.Ptr("string"),
Properties: &armmachinelearning.BatchDeploymentProperties{
Description: to.Ptr("string"),
CodeConfiguration: &armmachinelearning.CodeConfiguration{
CodeID: to.Ptr("string"),
ScoringScript: to.Ptr("string"),
},
EnvironmentID: to.Ptr("string"),
EnvironmentVariables: map[string]*string{
"string": to.Ptr("string"),
},
Properties: map[string]*string{
"string": to.Ptr("string"),
},
Compute: to.Ptr("string"),
ErrorThreshold: to.Ptr[int32](1),
LoggingLevel: to.Ptr(armmachinelearning.BatchLoggingLevelInfo),
MaxConcurrencyPerInstance: to.Ptr[int32](1),
MiniBatchSize: to.Ptr[int64](1),
Model: &armmachinelearning.IDAssetReference{
ReferenceType: to.Ptr(armmachinelearning.ReferenceTypeID),
AssetID: to.Ptr("string"),
},
OutputAction: to.Ptr(armmachinelearning.BatchOutputActionSummaryOnly),
OutputFileName: to.Ptr("string"),
Resources: &armmachinelearning.ResourceConfiguration{
InstanceCount: to.Ptr[int32](1),
InstanceType: to.Ptr("string"),
Properties: map[string]interface{}{
"string": map[string]interface{}{
"cd3c37dc-2876-4ca4-8a54-21bd7619724a": nil,
},
},
},
RetrySettings: &armmachinelearning.BatchRetrySettings{
MaxRetries: to.Ptr[int32](1),
Timeout: to.Ptr("PT5M"),
},
},
SKU: &armmachinelearning.SKU{
Name: to.Ptr("string"),
Capacity: to.Ptr[int32](1),
Family: to.Ptr("string"),
Size: to.Ptr("string"),
Tier: to.Ptr(armmachinelearning.SKUTierFree),
},
},
nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
res, err := poller.PollUntilDone(ctx, nil)
if err != nil {
log.Fatalf("failed to pull the result: %v", err)
}
// TODO: use response item
_ = res
}
```
Read the [SDK documentation](https://github.com/Azure/azure-sdk-for-go/blob/sdk%2Fresourcemanager%2Fmachinelearning%2Farmmachinelearning%2Fv2.0.0/sdk/resourcemanager/machinelearning/armmachinelearning/README.md) on how to add the SDK to your project and authenticate.

Просмотреть файл

@ -0,0 +1,39 @@
```go
package armmachinelearning_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/machinelearning/armmachinelearning/v2"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-05-01/examples/BatchDeployment/delete.json
func ExampleBatchDeploymentsClient_BeginDelete() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
client, err := armmachinelearning.NewBatchDeploymentsClient("00000000-1111-2222-3333-444444444444", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
poller, err := client.BeginDelete(ctx,
"test-rg",
"my-aml-workspace",
"testEndpointName",
"testDeploymentName",
nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
_, err = poller.PollUntilDone(ctx, nil)
if err != nil {
log.Fatalf("failed to pull the result: %v", err)
}
}
```
Read the [SDK documentation](https://github.com/Azure/azure-sdk-for-go/blob/sdk%2Fresourcemanager%2Fmachinelearning%2Farmmachinelearning%2Fv2.0.0/sdk/resourcemanager/machinelearning/armmachinelearning/README.md) on how to add the SDK to your project and authenticate.

Просмотреть файл

@ -0,0 +1,37 @@
```go
package armmachinelearning_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/machinelearning/armmachinelearning/v2"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-05-01/examples/BatchDeployment/get.json
func ExampleBatchDeploymentsClient_Get() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
client, err := armmachinelearning.NewBatchDeploymentsClient("00000000-1111-2222-3333-444444444444", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
res, err := client.Get(ctx,
"test-rg",
"my-aml-workspace",
"testEndpointName",
"testDeploymentName",
nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
// TODO: use response item
_ = res
}
```
Read the [SDK documentation](https://github.com/Azure/azure-sdk-for-go/blob/sdk%2Fresourcemanager%2Fmachinelearning%2Farmmachinelearning%2Fv2.0.0/sdk/resourcemanager/machinelearning/armmachinelearning/README.md) on how to add the SDK to your project and authenticate.

Просмотреть файл

@ -0,0 +1,44 @@
```go
package armmachinelearning_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/machinelearning/armmachinelearning/v2"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-05-01/examples/BatchDeployment/list.json
func ExampleBatchDeploymentsClient_NewListPager() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
client, err := armmachinelearning.NewBatchDeploymentsClient("00000000-1111-2222-3333-444444444444", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
pager := client.NewListPager("test-rg",
"my-aml-workspace",
"testEndpointName",
&armmachinelearning.BatchDeploymentsClientListOptions{OrderBy: to.Ptr("string"),
Top: to.Ptr[int32](1),
Skip: nil,
})
for pager.More() {
nextResult, err := pager.NextPage(ctx)
if err != nil {
log.Fatalf("failed to advance page: %v", err)
}
for _, v := range nextResult.Value {
// TODO: use page item
_ = v
}
}
}
```
Read the [SDK documentation](https://github.com/Azure/azure-sdk-for-go/blob/sdk%2Fresourcemanager%2Fmachinelearning%2Farmmachinelearning%2Fv2.0.0/sdk/resourcemanager/machinelearning/armmachinelearning/README.md) on how to add the SDK to your project and authenticate.

Просмотреть файл

@ -0,0 +1,48 @@
```go
package armmachinelearning_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/machinelearning/armmachinelearning/v2"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-05-01/examples/BatchDeployment/update.json
func ExampleBatchDeploymentsClient_BeginUpdate() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
client, err := armmachinelearning.NewBatchDeploymentsClient("00000000-1111-2222-3333-444444444444", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
poller, err := client.BeginUpdate(ctx,
"test-rg",
"my-aml-workspace",
"testEndpointName",
"testDeploymentName",
armmachinelearning.PartialBatchDeploymentPartialMinimalTrackedResourceWithProperties{
Properties: &armmachinelearning.PartialBatchDeployment{
Description: to.Ptr("string"),
},
Tags: map[string]*string{},
},
nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
res, err := poller.PollUntilDone(ctx, nil)
if err != nil {
log.Fatalf("failed to pull the result: %v", err)
}
// TODO: use response item
_ = res
}
```
Read the [SDK documentation](https://github.com/Azure/azure-sdk-for-go/blob/sdk%2Fresourcemanager%2Fmachinelearning%2Farmmachinelearning%2Fv2.0.0/sdk/resourcemanager/machinelearning/armmachinelearning/README.md) on how to add the SDK to your project and authenticate.

Просмотреть файл

@ -0,0 +1,69 @@
```go
package armmachinelearning_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/machinelearning/armmachinelearning/v2"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-05-01/examples/BatchEndpoint/createOrUpdate.json
func ExampleBatchEndpointsClient_BeginCreateOrUpdate() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
client, err := armmachinelearning.NewBatchEndpointsClient("00000000-1111-2222-3333-444444444444", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
poller, err := client.BeginCreateOrUpdate(ctx,
"test-rg",
"my-aml-workspace",
"testEndpointName",
armmachinelearning.BatchEndpoint{
Location: to.Ptr("string"),
Tags: map[string]*string{},
Identity: &armmachinelearning.ManagedServiceIdentity{
Type: to.Ptr(armmachinelearning.ManagedServiceIdentityTypeSystemAssigned),
UserAssignedIdentities: map[string]*armmachinelearning.UserAssignedIdentity{
"string": {},
},
},
Kind: to.Ptr("string"),
Properties: &armmachinelearning.BatchEndpointProperties{
Description: to.Ptr("string"),
AuthMode: to.Ptr(armmachinelearning.EndpointAuthModeAMLToken),
Properties: map[string]*string{
"string": to.Ptr("string"),
},
Defaults: &armmachinelearning.BatchEndpointDefaults{
DeploymentName: to.Ptr("string"),
},
},
SKU: &armmachinelearning.SKU{
Name: to.Ptr("string"),
Capacity: to.Ptr[int32](1),
Family: to.Ptr("string"),
Size: to.Ptr("string"),
Tier: to.Ptr(armmachinelearning.SKUTierFree),
},
},
nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
res, err := poller.PollUntilDone(ctx, nil)
if err != nil {
log.Fatalf("failed to pull the result: %v", err)
}
// TODO: use response item
_ = res
}
```
Read the [SDK documentation](https://github.com/Azure/azure-sdk-for-go/blob/sdk%2Fresourcemanager%2Fmachinelearning%2Farmmachinelearning%2Fv2.0.0/sdk/resourcemanager/machinelearning/armmachinelearning/README.md) on how to add the SDK to your project and authenticate.

Просмотреть файл

@ -0,0 +1,38 @@
```go
package armmachinelearning_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/machinelearning/armmachinelearning/v2"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-05-01/examples/BatchEndpoint/delete.json
func ExampleBatchEndpointsClient_BeginDelete() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
client, err := armmachinelearning.NewBatchEndpointsClient("00000000-1111-2222-3333-444444444444", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
poller, err := client.BeginDelete(ctx,
"resourceGroup-1234",
"testworkspace",
"testBatchEndpoint",
nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
_, err = poller.PollUntilDone(ctx, nil)
if err != nil {
log.Fatalf("failed to pull the result: %v", err)
}
}
```
Read the [SDK documentation](https://github.com/Azure/azure-sdk-for-go/blob/sdk%2Fresourcemanager%2Fmachinelearning%2Farmmachinelearning%2Fv2.0.0/sdk/resourcemanager/machinelearning/armmachinelearning/README.md) on how to add the SDK to your project and authenticate.

Просмотреть файл

@ -0,0 +1,36 @@
```go
package armmachinelearning_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/machinelearning/armmachinelearning/v2"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-05-01/examples/BatchEndpoint/get.json
func ExampleBatchEndpointsClient_Get() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
client, err := armmachinelearning.NewBatchEndpointsClient("00000000-1111-2222-3333-444444444444", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
res, err := client.Get(ctx,
"test-rg",
"my-aml-workspace",
"testEndpointName",
nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
// TODO: use response item
_ = res
}
```
Read the [SDK documentation](https://github.com/Azure/azure-sdk-for-go/blob/sdk%2Fresourcemanager%2Fmachinelearning%2Farmmachinelearning%2Fv2.0.0/sdk/resourcemanager/machinelearning/armmachinelearning/README.md) on how to add the SDK to your project and authenticate.

Просмотреть файл

@ -0,0 +1,42 @@
```go
package armmachinelearning_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/machinelearning/armmachinelearning/v2"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-05-01/examples/BatchEndpoint/list.json
func ExampleBatchEndpointsClient_NewListPager() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
client, err := armmachinelearning.NewBatchEndpointsClient("00000000-1111-2222-3333-444444444444", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
pager := client.NewListPager("test-rg",
"my-aml-workspace",
&armmachinelearning.BatchEndpointsClientListOptions{Count: to.Ptr[int32](1),
Skip: nil,
})
for pager.More() {
nextResult, err := pager.NextPage(ctx)
if err != nil {
log.Fatalf("failed to advance page: %v", err)
}
for _, v := range nextResult.Value {
// TODO: use page item
_ = v
}
}
}
```
Read the [SDK documentation](https://github.com/Azure/azure-sdk-for-go/blob/sdk%2Fresourcemanager%2Fmachinelearning%2Farmmachinelearning%2Fv2.0.0/sdk/resourcemanager/machinelearning/armmachinelearning/README.md) on how to add the SDK to your project and authenticate.

Просмотреть файл

@ -0,0 +1,36 @@
```go
package armmachinelearning_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/machinelearning/armmachinelearning/v2"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-05-01/examples/BatchEndpoint/listKeys.json
func ExampleBatchEndpointsClient_ListKeys() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
client, err := armmachinelearning.NewBatchEndpointsClient("00000000-1111-2222-3333-444444444444", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
res, err := client.ListKeys(ctx,
"test-rg",
"my-aml-workspace",
"testEndpointName",
nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
// TODO: use response item
_ = res
}
```
Read the [SDK documentation](https://github.com/Azure/azure-sdk-for-go/blob/sdk%2Fresourcemanager%2Fmachinelearning%2Farmmachinelearning%2Fv2.0.0/sdk/resourcemanager/machinelearning/armmachinelearning/README.md) on how to add the SDK to your project and authenticate.

Просмотреть файл

@ -0,0 +1,50 @@
```go
package armmachinelearning_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/machinelearning/armmachinelearning/v2"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-05-01/examples/BatchEndpoint/update.json
func ExampleBatchEndpointsClient_BeginUpdate() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
client, err := armmachinelearning.NewBatchEndpointsClient("00000000-1111-2222-3333-444444444444", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
poller, err := client.BeginUpdate(ctx,
"test-rg",
"my-aml-workspace",
"testEndpointName",
armmachinelearning.PartialMinimalTrackedResourceWithIdentity{
Tags: map[string]*string{},
Identity: &armmachinelearning.PartialManagedServiceIdentity{
Type: to.Ptr(armmachinelearning.ManagedServiceIdentityTypeSystemAssigned),
UserAssignedIdentities: map[string]interface{}{
"string": map[string]interface{}{},
},
},
},
nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
res, err := poller.PollUntilDone(ctx, nil)
if err != nil {
log.Fatalf("failed to pull the result: %v", err)
}
// TODO: use response item
_ = res
}
```
Read the [SDK documentation](https://github.com/Azure/azure-sdk-for-go/blob/sdk%2Fresourcemanager%2Fmachinelearning%2Farmmachinelearning%2Fv2.0.0/sdk/resourcemanager/machinelearning/armmachinelearning/README.md) on how to add the SDK to your project and authenticate.

Просмотреть файл

@ -0,0 +1,46 @@
```go
package armmachinelearning_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/machinelearning/armmachinelearning/v2"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-05-01/examples/CodeContainer/createOrUpdate.json
func ExampleCodeContainersClient_CreateOrUpdate() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
client, err := armmachinelearning.NewCodeContainersClient("00000000-1111-2222-3333-444444444444", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
res, err := client.CreateOrUpdate(ctx,
"testrg123",
"testworkspace",
"testContainer",
armmachinelearning.CodeContainer{
Properties: &armmachinelearning.CodeContainerProperties{
Description: to.Ptr("string"),
Tags: map[string]*string{
"tag1": to.Ptr("value1"),
"tag2": to.Ptr("value2"),
},
},
},
nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
// TODO: use response item
_ = res
}
```
Read the [SDK documentation](https://github.com/Azure/azure-sdk-for-go/blob/sdk%2Fresourcemanager%2Fmachinelearning%2Farmmachinelearning%2Fv2.0.0/sdk/resourcemanager/machinelearning/armmachinelearning/README.md) on how to add the SDK to your project and authenticate.

Просмотреть файл

@ -0,0 +1,34 @@
```go
package armmachinelearning_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/machinelearning/armmachinelearning/v2"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-05-01/examples/CodeContainer/delete.json
func ExampleCodeContainersClient_Delete() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
client, err := armmachinelearning.NewCodeContainersClient("00000000-1111-2222-3333-444444444444", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
_, err = client.Delete(ctx,
"testrg123",
"testworkspace",
"testContainer",
nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
}
```
Read the [SDK documentation](https://github.com/Azure/azure-sdk-for-go/blob/sdk%2Fresourcemanager%2Fmachinelearning%2Farmmachinelearning%2Fv2.0.0/sdk/resourcemanager/machinelearning/armmachinelearning/README.md) on how to add the SDK to your project and authenticate.

Просмотреть файл

@ -0,0 +1,36 @@
```go
package armmachinelearning_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/machinelearning/armmachinelearning/v2"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-05-01/examples/CodeContainer/get.json
func ExampleCodeContainersClient_Get() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
client, err := armmachinelearning.NewCodeContainersClient("00000000-1111-2222-3333-444444444444", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
res, err := client.Get(ctx,
"testrg123",
"testworkspace",
"testContainer",
nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
// TODO: use response item
_ = res
}
```
Read the [SDK documentation](https://github.com/Azure/azure-sdk-for-go/blob/sdk%2Fresourcemanager%2Fmachinelearning%2Farmmachinelearning%2Fv2.0.0/sdk/resourcemanager/machinelearning/armmachinelearning/README.md) on how to add the SDK to your project and authenticate.

Просмотреть файл

@ -0,0 +1,39 @@
```go
package armmachinelearning_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/machinelearning/armmachinelearning/v2"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-05-01/examples/CodeContainer/list.json
func ExampleCodeContainersClient_NewListPager() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
client, err := armmachinelearning.NewCodeContainersClient("00000000-1111-2222-3333-444444444444", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
pager := client.NewListPager("testrg123",
"testworkspace",
&armmachinelearning.CodeContainersClientListOptions{Skip: nil})
for pager.More() {
nextResult, err := pager.NextPage(ctx)
if err != nil {
log.Fatalf("failed to advance page: %v", err)
}
for _, v := range nextResult.Value {
// TODO: use page item
_ = v
}
}
}
```
Read the [SDK documentation](https://github.com/Azure/azure-sdk-for-go/blob/sdk%2Fresourcemanager%2Fmachinelearning%2Farmmachinelearning%2Fv2.0.0/sdk/resourcemanager/machinelearning/armmachinelearning/README.md) on how to add the SDK to your project and authenticate.

Просмотреть файл

@ -0,0 +1,51 @@
```go
package armmachinelearning_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/machinelearning/armmachinelearning/v2"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-05-01/examples/CodeVersion/createOrUpdate.json
func ExampleCodeVersionsClient_CreateOrUpdate() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
client, err := armmachinelearning.NewCodeVersionsClient("00000000-1111-2222-3333-444444444444", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
res, err := client.CreateOrUpdate(ctx,
"test-rg",
"my-aml-workspace",
"string",
"string",
armmachinelearning.CodeVersion{
Properties: &armmachinelearning.CodeVersionProperties{
Description: to.Ptr("string"),
Properties: map[string]*string{
"string": to.Ptr("string"),
},
Tags: map[string]*string{
"string": to.Ptr("string"),
},
IsAnonymous: to.Ptr(false),
CodeURI: to.Ptr("https://blobStorage/folderName"),
},
},
nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
// TODO: use response item
_ = res
}
```
Read the [SDK documentation](https://github.com/Azure/azure-sdk-for-go/blob/sdk%2Fresourcemanager%2Fmachinelearning%2Farmmachinelearning%2Fv2.0.0/sdk/resourcemanager/machinelearning/armmachinelearning/README.md) on how to add the SDK to your project and authenticate.

Просмотреть файл

@ -0,0 +1,35 @@
```go
package armmachinelearning_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/machinelearning/armmachinelearning/v2"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-05-01/examples/CodeVersion/delete.json
func ExampleCodeVersionsClient_Delete() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
client, err := armmachinelearning.NewCodeVersionsClient("00000000-1111-2222-3333-444444444444", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
_, err = client.Delete(ctx,
"test-rg",
"my-aml-workspace",
"string",
"string",
nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
}
```
Read the [SDK documentation](https://github.com/Azure/azure-sdk-for-go/blob/sdk%2Fresourcemanager%2Fmachinelearning%2Farmmachinelearning%2Fv2.0.0/sdk/resourcemanager/machinelearning/armmachinelearning/README.md) on how to add the SDK to your project and authenticate.

Просмотреть файл

@ -0,0 +1,37 @@
```go
package armmachinelearning_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/machinelearning/armmachinelearning/v2"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-05-01/examples/CodeVersion/get.json
func ExampleCodeVersionsClient_Get() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
client, err := armmachinelearning.NewCodeVersionsClient("00000000-1111-2222-3333-444444444444", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
res, err := client.Get(ctx,
"test-rg",
"my-aml-workspace",
"string",
"string",
nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
// TODO: use response item
_ = res
}
```
Read the [SDK documentation](https://github.com/Azure/azure-sdk-for-go/blob/sdk%2Fresourcemanager%2Fmachinelearning%2Farmmachinelearning%2Fv2.0.0/sdk/resourcemanager/machinelearning/armmachinelearning/README.md) on how to add the SDK to your project and authenticate.

Просмотреть файл

@ -0,0 +1,44 @@
```go
package armmachinelearning_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/machinelearning/armmachinelearning/v2"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-05-01/examples/CodeVersion/list.json
func ExampleCodeVersionsClient_NewListPager() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
client, err := armmachinelearning.NewCodeVersionsClient("00000000-1111-2222-3333-444444444444", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
pager := client.NewListPager("test-rg",
"my-aml-workspace",
"string",
&armmachinelearning.CodeVersionsClientListOptions{OrderBy: to.Ptr("string"),
Top: to.Ptr[int32](1),
Skip: nil,
})
for pager.More() {
nextResult, err := pager.NextPage(ctx)
if err != nil {
log.Fatalf("failed to advance page: %v", err)
}
for _, v := range nextResult.Value {
// TODO: use page item
_ = v
}
}
}
```
Read the [SDK documentation](https://github.com/Azure/azure-sdk-for-go/blob/sdk%2Fresourcemanager%2Fmachinelearning%2Farmmachinelearning%2Fv2.0.0/sdk/resourcemanager/machinelearning/armmachinelearning/README.md) on how to add the SDK to your project and authenticate.

Просмотреть файл

@ -0,0 +1,48 @@
```go
package armmachinelearning_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/machinelearning/armmachinelearning/v2"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-05-01/examples/ComponentContainer/createOrUpdate.json
func ExampleComponentContainersClient_CreateOrUpdate() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
client, err := armmachinelearning.NewComponentContainersClient("00000000-1111-2222-3333-444444444444", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
res, err := client.CreateOrUpdate(ctx,
"test-rg",
"my-aml-workspace",
"string",
armmachinelearning.ComponentContainer{
Properties: &armmachinelearning.ComponentContainerProperties{
Description: to.Ptr("string"),
Properties: map[string]*string{
"string": to.Ptr("string"),
},
Tags: map[string]*string{
"string": to.Ptr("string"),
},
},
},
nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
// TODO: use response item
_ = res
}
```
Read the [SDK documentation](https://github.com/Azure/azure-sdk-for-go/blob/sdk%2Fresourcemanager%2Fmachinelearning%2Farmmachinelearning%2Fv2.0.0/sdk/resourcemanager/machinelearning/armmachinelearning/README.md) on how to add the SDK to your project and authenticate.

Просмотреть файл

@ -0,0 +1,34 @@
```go
package armmachinelearning_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/machinelearning/armmachinelearning/v2"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-05-01/examples/ComponentContainer/delete.json
func ExampleComponentContainersClient_Delete() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
client, err := armmachinelearning.NewComponentContainersClient("00000000-1111-2222-3333-444444444444", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
_, err = client.Delete(ctx,
"test-rg",
"my-aml-workspace",
"string",
nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
}
```
Read the [SDK documentation](https://github.com/Azure/azure-sdk-for-go/blob/sdk%2Fresourcemanager%2Fmachinelearning%2Farmmachinelearning%2Fv2.0.0/sdk/resourcemanager/machinelearning/armmachinelearning/README.md) on how to add the SDK to your project and authenticate.

Просмотреть файл

@ -0,0 +1,36 @@
```go
package armmachinelearning_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/machinelearning/armmachinelearning/v2"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-05-01/examples/ComponentContainer/get.json
func ExampleComponentContainersClient_Get() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
client, err := armmachinelearning.NewComponentContainersClient("00000000-1111-2222-3333-444444444444", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
res, err := client.Get(ctx,
"test-rg",
"my-aml-workspace",
"string",
nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
// TODO: use response item
_ = res
}
```
Read the [SDK documentation](https://github.com/Azure/azure-sdk-for-go/blob/sdk%2Fresourcemanager%2Fmachinelearning%2Farmmachinelearning%2Fv2.0.0/sdk/resourcemanager/machinelearning/armmachinelearning/README.md) on how to add the SDK to your project and authenticate.

Просмотреть файл

@ -0,0 +1,41 @@
```go
package armmachinelearning_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/machinelearning/armmachinelearning/v2"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-05-01/examples/ComponentContainer/list.json
func ExampleComponentContainersClient_NewListPager() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
client, err := armmachinelearning.NewComponentContainersClient("00000000-1111-2222-3333-444444444444", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
pager := client.NewListPager("test-rg",
"my-aml-workspace",
&armmachinelearning.ComponentContainersClientListOptions{Skip: nil,
ListViewType: nil,
})
for pager.More() {
nextResult, err := pager.NextPage(ctx)
if err != nil {
log.Fatalf("failed to advance page: %v", err)
}
for _, v := range nextResult.Value {
// TODO: use page item
_ = v
}
}
}
```
Read the [SDK documentation](https://github.com/Azure/azure-sdk-for-go/blob/sdk%2Fresourcemanager%2Fmachinelearning%2Farmmachinelearning%2Fv2.0.0/sdk/resourcemanager/machinelearning/armmachinelearning/README.md) on how to add the SDK to your project and authenticate.

Просмотреть файл

@ -0,0 +1,53 @@
```go
package armmachinelearning_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/machinelearning/armmachinelearning/v2"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-05-01/examples/ComponentVersion/createOrUpdate.json
func ExampleComponentVersionsClient_CreateOrUpdate() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
client, err := armmachinelearning.NewComponentVersionsClient("00000000-1111-2222-3333-444444444444", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
res, err := client.CreateOrUpdate(ctx,
"test-rg",
"my-aml-workspace",
"string",
"string",
armmachinelearning.ComponentVersion{
Properties: &armmachinelearning.ComponentVersionProperties{
Description: to.Ptr("string"),
Properties: map[string]*string{
"string": to.Ptr("string"),
},
Tags: map[string]*string{
"string": to.Ptr("string"),
},
IsAnonymous: to.Ptr(false),
ComponentSpec: map[string]interface{}{
"8ced901b-d826-477d-bfef-329da9672513": nil,
},
},
},
nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
// TODO: use response item
_ = res
}
```
Read the [SDK documentation](https://github.com/Azure/azure-sdk-for-go/blob/sdk%2Fresourcemanager%2Fmachinelearning%2Farmmachinelearning%2Fv2.0.0/sdk/resourcemanager/machinelearning/armmachinelearning/README.md) on how to add the SDK to your project and authenticate.

Просмотреть файл

@ -0,0 +1,35 @@
```go
package armmachinelearning_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/machinelearning/armmachinelearning/v2"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-05-01/examples/ComponentVersion/delete.json
func ExampleComponentVersionsClient_Delete() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
client, err := armmachinelearning.NewComponentVersionsClient("00000000-1111-2222-3333-444444444444", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
_, err = client.Delete(ctx,
"test-rg",
"my-aml-workspace",
"string",
"string",
nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
}
```
Read the [SDK documentation](https://github.com/Azure/azure-sdk-for-go/blob/sdk%2Fresourcemanager%2Fmachinelearning%2Farmmachinelearning%2Fv2.0.0/sdk/resourcemanager/machinelearning/armmachinelearning/README.md) on how to add the SDK to your project and authenticate.

Просмотреть файл

@ -0,0 +1,37 @@
```go
package armmachinelearning_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/machinelearning/armmachinelearning/v2"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-05-01/examples/ComponentVersion/get.json
func ExampleComponentVersionsClient_Get() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
client, err := armmachinelearning.NewComponentVersionsClient("00000000-1111-2222-3333-444444444444", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
res, err := client.Get(ctx,
"test-rg",
"my-aml-workspace",
"string",
"string",
nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
// TODO: use response item
_ = res
}
```
Read the [SDK documentation](https://github.com/Azure/azure-sdk-for-go/blob/sdk%2Fresourcemanager%2Fmachinelearning%2Farmmachinelearning%2Fv2.0.0/sdk/resourcemanager/machinelearning/armmachinelearning/README.md) on how to add the SDK to your project and authenticate.

Просмотреть файл

@ -0,0 +1,45 @@
```go
package armmachinelearning_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/machinelearning/armmachinelearning/v2"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-05-01/examples/ComponentVersion/list.json
func ExampleComponentVersionsClient_NewListPager() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
client, err := armmachinelearning.NewComponentVersionsClient("00000000-1111-2222-3333-444444444444", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
pager := client.NewListPager("test-rg",
"my-aml-workspace",
"string",
&armmachinelearning.ComponentVersionsClientListOptions{OrderBy: to.Ptr("string"),
Top: to.Ptr[int32](1),
Skip: nil,
ListViewType: nil,
})
for pager.More() {
nextResult, err := pager.NextPage(ctx)
if err != nil {
log.Fatalf("failed to advance page: %v", err)
}
for _, v := range nextResult.Value {
// TODO: use page item
_ = v
}
}
}
```
Read the [SDK documentation](https://github.com/Azure/azure-sdk-for-go/blob/sdk%2Fresourcemanager%2Fmachinelearning%2Farmmachinelearning%2Fv2.0.0/sdk/resourcemanager/machinelearning/armmachinelearning/README.md) on how to add the SDK to your project and authenticate.

Просмотреть файл

@ -0,0 +1,69 @@
```go
package armmachinelearning_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/machinelearning/armmachinelearning/v2"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-05-01/examples/Compute/createOrUpdate/KubernetesCompute.json
func ExampleComputeClient_BeginCreateOrUpdate() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
client, err := armmachinelearning.NewComputeClient("34adfa4f-cedf-4dc0-ba29-b6d1a69ab345", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
poller, err := client.BeginCreateOrUpdate(ctx,
"testrg123",
"workspaces123",
"compute123",
armmachinelearning.ComputeResource{
Properties: &armmachinelearning.Kubernetes{
Description: to.Ptr("some compute"),
ComputeType: to.Ptr(armmachinelearning.ComputeTypeKubernetes),
ResourceID: to.Ptr("/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourcegroups/testrg123/providers/Microsoft.ContainerService/managedClusters/compute123-56826-c9b00420020b2"),
Properties: &armmachinelearning.KubernetesProperties{
DefaultInstanceType: to.Ptr("defaultInstanceType"),
InstanceTypes: map[string]*armmachinelearning.InstanceTypeSchema{
"defaultInstanceType": {
Resources: &armmachinelearning.InstanceTypeSchemaResources{
Limits: map[string]*string{
"cpu": to.Ptr("1"),
"memory": to.Ptr("4Gi"),
"nvidia.com/gpu": nil,
},
Requests: map[string]*string{
"cpu": to.Ptr("1"),
"memory": to.Ptr("4Gi"),
"nvidia.com/gpu": nil,
},
},
},
},
Namespace: to.Ptr("default"),
},
},
Location: to.Ptr("eastus"),
},
nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
res, err := poller.PollUntilDone(ctx, nil)
if err != nil {
log.Fatalf("failed to pull the result: %v", err)
}
// TODO: use response item
_ = res
}
```
Read the [SDK documentation](https://github.com/Azure/azure-sdk-for-go/blob/sdk%2Fresourcemanager%2Fmachinelearning%2Farmmachinelearning%2Fv2.0.0/sdk/resourcemanager/machinelearning/armmachinelearning/README.md) on how to add the SDK to your project and authenticate.

Просмотреть файл

@ -0,0 +1,39 @@
```go
package armmachinelearning_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/machinelearning/armmachinelearning/v2"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-05-01/examples/Compute/delete.json
func ExampleComputeClient_BeginDelete() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
client, err := armmachinelearning.NewComputeClient("34adfa4f-cedf-4dc0-ba29-b6d1a69ab345", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
poller, err := client.BeginDelete(ctx,
"testrg123",
"workspaces123",
"compute123",
armmachinelearning.UnderlyingResourceActionDelete,
nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
_, err = poller.PollUntilDone(ctx, nil)
if err != nil {
log.Fatalf("failed to pull the result: %v", err)
}
}
```
Read the [SDK documentation](https://github.com/Azure/azure-sdk-for-go/blob/sdk%2Fresourcemanager%2Fmachinelearning%2Farmmachinelearning%2Fv2.0.0/sdk/resourcemanager/machinelearning/armmachinelearning/README.md) on how to add the SDK to your project and authenticate.

Просмотреть файл

@ -0,0 +1,36 @@
```go
package armmachinelearning_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/machinelearning/armmachinelearning/v2"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-05-01/examples/Compute/get/AKSCompute.json
func ExampleComputeClient_Get() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
client, err := armmachinelearning.NewComputeClient("34adfa4f-cedf-4dc0-ba29-b6d1a69ab345", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
res, err := client.Get(ctx,
"testrg123",
"workspaces123",
"compute123",
nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
// TODO: use response item
_ = res
}
```
Read the [SDK documentation](https://github.com/Azure/azure-sdk-for-go/blob/sdk%2Fresourcemanager%2Fmachinelearning%2Farmmachinelearning%2Fv2.0.0/sdk/resourcemanager/machinelearning/armmachinelearning/README.md) on how to add the SDK to your project and authenticate.

Просмотреть файл

@ -0,0 +1,39 @@
```go
package armmachinelearning_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/machinelearning/armmachinelearning/v2"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-05-01/examples/Compute/list.json
func ExampleComputeClient_NewListPager() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
client, err := armmachinelearning.NewComputeClient("34adfa4f-cedf-4dc0-ba29-b6d1a69ab345", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
pager := client.NewListPager("testrg123",
"workspaces123",
&armmachinelearning.ComputeClientListOptions{Skip: nil})
for pager.More() {
nextResult, err := pager.NextPage(ctx)
if err != nil {
log.Fatalf("failed to advance page: %v", err)
}
for _, v := range nextResult.Value {
// TODO: use page item
_ = v
}
}
}
```
Read the [SDK documentation](https://github.com/Azure/azure-sdk-for-go/blob/sdk%2Fresourcemanager%2Fmachinelearning%2Farmmachinelearning%2Fv2.0.0/sdk/resourcemanager/machinelearning/armmachinelearning/README.md) on how to add the SDK to your project and authenticate.

Просмотреть файл

@ -0,0 +1,36 @@
```go
package armmachinelearning_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/machinelearning/armmachinelearning/v2"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-05-01/examples/Compute/listKeys.json
func ExampleComputeClient_ListKeys() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
client, err := armmachinelearning.NewComputeClient("34adfa4f-cedf-4dc0-ba29-b6d1a69ab345", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
res, err := client.ListKeys(ctx,
"testrg123",
"workspaces123",
"compute123",
nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
// TODO: use response item
_ = res
}
```
Read the [SDK documentation](https://github.com/Azure/azure-sdk-for-go/blob/sdk%2Fresourcemanager%2Fmachinelearning%2Farmmachinelearning%2Fv2.0.0/sdk/resourcemanager/machinelearning/armmachinelearning/README.md) on how to add the SDK to your project and authenticate.

Просмотреть файл

@ -0,0 +1,40 @@
```go
package armmachinelearning_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/machinelearning/armmachinelearning/v2"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-05-01/examples/Compute/listNodes.json
func ExampleComputeClient_NewListNodesPager() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
client, err := armmachinelearning.NewComputeClient("34adfa4f-cedf-4dc0-ba29-b6d1a69ab345", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
pager := client.NewListNodesPager("testrg123",
"workspaces123",
"compute123",
nil)
for pager.More() {
nextResult, err := pager.NextPage(ctx)
if err != nil {
log.Fatalf("failed to advance page: %v", err)
}
for _, v := range nextResult.Nodes {
// TODO: use page item
_ = v
}
}
}
```
Read the [SDK documentation](https://github.com/Azure/azure-sdk-for-go/blob/sdk%2Fresourcemanager%2Fmachinelearning%2Farmmachinelearning%2Fv2.0.0/sdk/resourcemanager/machinelearning/armmachinelearning/README.md) on how to add the SDK to your project and authenticate.

Просмотреть файл

@ -0,0 +1,52 @@
```go
package armmachinelearning_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/machinelearning/armmachinelearning/v2"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-05-01/examples/Compute/patch.json
func ExampleComputeClient_BeginUpdate() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
client, err := armmachinelearning.NewComputeClient("34adfa4f-cedf-4dc0-ba29-b6d1a69ab345", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
poller, err := client.BeginUpdate(ctx,
"testrg123",
"workspaces123",
"compute123",
armmachinelearning.ClusterUpdateParameters{
Properties: &armmachinelearning.ClusterUpdateProperties{
Properties: &armmachinelearning.ScaleSettingsInformation{
ScaleSettings: &armmachinelearning.ScaleSettings{
MaxNodeCount: to.Ptr[int32](4),
MinNodeCount: to.Ptr[int32](4),
NodeIdleTimeBeforeScaleDown: to.Ptr("PT5M"),
},
},
},
},
nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
res, err := poller.PollUntilDone(ctx, nil)
if err != nil {
log.Fatalf("failed to pull the result: %v", err)
}
// TODO: use response item
_ = res
}
```
Read the [SDK documentation](https://github.com/Azure/azure-sdk-for-go/blob/sdk%2Fresourcemanager%2Fmachinelearning%2Farmmachinelearning%2Fv2.0.0/sdk/resourcemanager/machinelearning/armmachinelearning/README.md) on how to add the SDK to your project and authenticate.

Просмотреть файл

@ -0,0 +1,38 @@
```go
package armmachinelearning_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/machinelearning/armmachinelearning/v2"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-05-01/examples/Compute/restart.json
func ExampleComputeClient_BeginRestart() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
client, err := armmachinelearning.NewComputeClient("34adfa4f-cedf-4dc0-ba29-b6d1a69ab345", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
poller, err := client.BeginRestart(ctx,
"testrg123",
"workspaces123",
"compute123",
nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
_, err = poller.PollUntilDone(ctx, nil)
if err != nil {
log.Fatalf("failed to pull the result: %v", err)
}
}
```
Read the [SDK documentation](https://github.com/Azure/azure-sdk-for-go/blob/sdk%2Fresourcemanager%2Fmachinelearning%2Farmmachinelearning%2Fv2.0.0/sdk/resourcemanager/machinelearning/armmachinelearning/README.md) on how to add the SDK to your project and authenticate.

Просмотреть файл

@ -0,0 +1,38 @@
```go
package armmachinelearning_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/machinelearning/armmachinelearning/v2"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-05-01/examples/Compute/start.json
func ExampleComputeClient_BeginStart() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
client, err := armmachinelearning.NewComputeClient("34adfa4f-cedf-4dc0-ba29-b6d1a69ab345", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
poller, err := client.BeginStart(ctx,
"testrg123",
"workspaces123",
"compute123",
nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
_, err = poller.PollUntilDone(ctx, nil)
if err != nil {
log.Fatalf("failed to pull the result: %v", err)
}
}
```
Read the [SDK documentation](https://github.com/Azure/azure-sdk-for-go/blob/sdk%2Fresourcemanager%2Fmachinelearning%2Farmmachinelearning%2Fv2.0.0/sdk/resourcemanager/machinelearning/armmachinelearning/README.md) on how to add the SDK to your project and authenticate.

Просмотреть файл

@ -0,0 +1,38 @@
```go
package armmachinelearning_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/machinelearning/armmachinelearning/v2"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-05-01/examples/Compute/stop.json
func ExampleComputeClient_BeginStop() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
client, err := armmachinelearning.NewComputeClient("34adfa4f-cedf-4dc0-ba29-b6d1a69ab345", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
poller, err := client.BeginStop(ctx,
"testrg123",
"workspaces123",
"compute123",
nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
_, err = poller.PollUntilDone(ctx, nil)
if err != nil {
log.Fatalf("failed to pull the result: %v", err)
}
}
```
Read the [SDK documentation](https://github.com/Azure/azure-sdk-for-go/blob/sdk%2Fresourcemanager%2Fmachinelearning%2Farmmachinelearning%2Fv2.0.0/sdk/resourcemanager/machinelearning/armmachinelearning/README.md) on how to add the SDK to your project and authenticate.

Просмотреть файл

@ -0,0 +1,51 @@
```go
package armmachinelearning_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/machinelearning/armmachinelearning/v2"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-05-01/examples/DataContainer/createOrUpdate.json
func ExampleDataContainersClient_CreateOrUpdate() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
client, err := armmachinelearning.NewDataContainersClient("00000000-1111-2222-3333-444444444444", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
res, err := client.CreateOrUpdate(ctx,
"testrg123",
"workspace123",
"datacontainer123",
armmachinelearning.DataContainer{
Properties: &armmachinelearning.DataContainerProperties{
Description: to.Ptr("string"),
Properties: map[string]*string{
"properties1": to.Ptr("value1"),
"properties2": to.Ptr("value2"),
},
Tags: map[string]*string{
"tag1": to.Ptr("value1"),
"tag2": to.Ptr("value2"),
},
DataType: to.Ptr(armmachinelearning.DataType("UriFile")),
},
},
nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
// TODO: use response item
_ = res
}
```
Read the [SDK documentation](https://github.com/Azure/azure-sdk-for-go/blob/sdk%2Fresourcemanager%2Fmachinelearning%2Farmmachinelearning%2Fv2.0.0/sdk/resourcemanager/machinelearning/armmachinelearning/README.md) on how to add the SDK to your project and authenticate.

Просмотреть файл

@ -0,0 +1,34 @@
```go
package armmachinelearning_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/machinelearning/armmachinelearning/v2"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-05-01/examples/DataContainer/delete.json
func ExampleDataContainersClient_Delete() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
client, err := armmachinelearning.NewDataContainersClient("00000000-1111-2222-3333-444444444444", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
_, err = client.Delete(ctx,
"testrg123",
"workspace123",
"datacontainer123",
nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
}
```
Read the [SDK documentation](https://github.com/Azure/azure-sdk-for-go/blob/sdk%2Fresourcemanager%2Fmachinelearning%2Farmmachinelearning%2Fv2.0.0/sdk/resourcemanager/machinelearning/armmachinelearning/README.md) on how to add the SDK to your project and authenticate.

Просмотреть файл

@ -0,0 +1,36 @@
```go
package armmachinelearning_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/machinelearning/armmachinelearning/v2"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-05-01/examples/DataContainer/get.json
func ExampleDataContainersClient_Get() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
client, err := armmachinelearning.NewDataContainersClient("00000000-1111-2222-3333-444444444444", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
res, err := client.Get(ctx,
"testrg123",
"workspace123",
"datacontainer123",
nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
// TODO: use response item
_ = res
}
```
Read the [SDK documentation](https://github.com/Azure/azure-sdk-for-go/blob/sdk%2Fresourcemanager%2Fmachinelearning%2Farmmachinelearning%2Fv2.0.0/sdk/resourcemanager/machinelearning/armmachinelearning/README.md) on how to add the SDK to your project and authenticate.

Просмотреть файл

@ -0,0 +1,41 @@
```go
package armmachinelearning_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/machinelearning/armmachinelearning/v2"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-05-01/examples/DataContainer/list.json
func ExampleDataContainersClient_NewListPager() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
client, err := armmachinelearning.NewDataContainersClient("00000000-1111-2222-3333-444444444444", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
pager := client.NewListPager("testrg123",
"workspace123",
&armmachinelearning.DataContainersClientListOptions{Skip: nil,
ListViewType: nil,
})
for pager.More() {
nextResult, err := pager.NextPage(ctx)
if err != nil {
log.Fatalf("failed to advance page: %v", err)
}
for _, v := range nextResult.Value {
// TODO: use page item
_ = v
}
}
}
```
Read the [SDK documentation](https://github.com/Azure/azure-sdk-for-go/blob/sdk%2Fresourcemanager%2Fmachinelearning%2Farmmachinelearning%2Fv2.0.0/sdk/resourcemanager/machinelearning/armmachinelearning/README.md) on how to add the SDK to your project and authenticate.

Просмотреть файл

@ -0,0 +1,52 @@
```go
package armmachinelearning_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/machinelearning/armmachinelearning/v2"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-05-01/examples/DataVersionBase/createOrUpdate.json
func ExampleDataVersionsClient_CreateOrUpdate() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
client, err := armmachinelearning.NewDataVersionsClient("00000000-1111-2222-3333-444444444444", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
res, err := client.CreateOrUpdate(ctx,
"test-rg",
"my-aml-workspace",
"string",
"string",
armmachinelearning.DataVersionBase{
Properties: &armmachinelearning.URIFileDataVersion{
Description: to.Ptr("string"),
Properties: map[string]*string{
"string": to.Ptr("string"),
},
Tags: map[string]*string{
"string": to.Ptr("string"),
},
IsAnonymous: to.Ptr(false),
DataType: to.Ptr(armmachinelearning.DataTypeURIFile),
DataURI: to.Ptr("string"),
},
},
nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
// TODO: use response item
_ = res
}
```
Read the [SDK documentation](https://github.com/Azure/azure-sdk-for-go/blob/sdk%2Fresourcemanager%2Fmachinelearning%2Farmmachinelearning%2Fv2.0.0/sdk/resourcemanager/machinelearning/armmachinelearning/README.md) on how to add the SDK to your project and authenticate.

Просмотреть файл

@ -0,0 +1,35 @@
```go
package armmachinelearning_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/machinelearning/armmachinelearning/v2"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-05-01/examples/DataVersionBase/delete.json
func ExampleDataVersionsClient_Delete() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
client, err := armmachinelearning.NewDataVersionsClient("00000000-1111-2222-3333-444444444444", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
_, err = client.Delete(ctx,
"test-rg",
"my-aml-workspace",
"string",
"string",
nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
}
```
Read the [SDK documentation](https://github.com/Azure/azure-sdk-for-go/blob/sdk%2Fresourcemanager%2Fmachinelearning%2Farmmachinelearning%2Fv2.0.0/sdk/resourcemanager/machinelearning/armmachinelearning/README.md) on how to add the SDK to your project and authenticate.

Просмотреть файл

@ -0,0 +1,37 @@
```go
package armmachinelearning_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/machinelearning/armmachinelearning/v2"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-05-01/examples/DataVersionBase/get.json
func ExampleDataVersionsClient_Get() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
client, err := armmachinelearning.NewDataVersionsClient("00000000-1111-2222-3333-444444444444", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
res, err := client.Get(ctx,
"test-rg",
"my-aml-workspace",
"string",
"string",
nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
// TODO: use response item
_ = res
}
```
Read the [SDK documentation](https://github.com/Azure/azure-sdk-for-go/blob/sdk%2Fresourcemanager%2Fmachinelearning%2Farmmachinelearning%2Fv2.0.0/sdk/resourcemanager/machinelearning/armmachinelearning/README.md) on how to add the SDK to your project and authenticate.

Просмотреть файл

@ -0,0 +1,46 @@
```go
package armmachinelearning_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/machinelearning/armmachinelearning/v2"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-05-01/examples/DataVersionBase/list.json
func ExampleDataVersionsClient_NewListPager() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
client, err := armmachinelearning.NewDataVersionsClient("00000000-1111-2222-3333-444444444444", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
pager := client.NewListPager("test-rg",
"my-aml-workspace",
"string",
&armmachinelearning.DataVersionsClientListOptions{OrderBy: to.Ptr("string"),
Top: to.Ptr[int32](1),
Skip: nil,
Tags: to.Ptr("string"),
ListViewType: nil,
})
for pager.More() {
nextResult, err := pager.NextPage(ctx)
if err != nil {
log.Fatalf("failed to advance page: %v", err)
}
for _, v := range nextResult.Value {
// TODO: use page item
_ = v
}
}
}
```
Read the [SDK documentation](https://github.com/Azure/azure-sdk-for-go/blob/sdk%2Fresourcemanager%2Fmachinelearning%2Farmmachinelearning%2Fv2.0.0/sdk/resourcemanager/machinelearning/armmachinelearning/README.md) on how to add the SDK to your project and authenticate.

Просмотреть файл

@ -0,0 +1,58 @@
```go
package armmachinelearning_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/machinelearning/armmachinelearning/v2"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-05-01/examples/Datastore/AzureDataLakeGen1WServicePrincipal/createOrUpdate.json
func ExampleDatastoresClient_CreateOrUpdate() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
client, err := armmachinelearning.NewDatastoresClient("00000000-1111-2222-3333-444444444444", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
res, err := client.CreateOrUpdate(ctx,
"test-rg",
"my-aml-workspace",
"string",
armmachinelearning.Datastore{
Properties: &armmachinelearning.AzureDataLakeGen1Datastore{
Description: to.Ptr("string"),
Tags: map[string]*string{
"string": to.Ptr("string"),
},
Credentials: &armmachinelearning.ServicePrincipalDatastoreCredentials{
CredentialsType: to.Ptr(armmachinelearning.CredentialsTypeServicePrincipal),
AuthorityURL: to.Ptr("string"),
ClientID: to.Ptr("00000000-1111-2222-3333-444444444444"),
ResourceURL: to.Ptr("string"),
Secrets: &armmachinelearning.ServicePrincipalDatastoreSecrets{
SecretsType: to.Ptr(armmachinelearning.SecretsTypeServicePrincipal),
ClientSecret: to.Ptr("string"),
},
TenantID: to.Ptr("00000000-1111-2222-3333-444444444444"),
},
DatastoreType: to.Ptr(armmachinelearning.DatastoreTypeAzureDataLakeGen1),
StoreName: to.Ptr("string"),
},
},
&armmachinelearning.DatastoresClientCreateOrUpdateOptions{SkipValidation: to.Ptr(false)})
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
// TODO: use response item
_ = res
}
```
Read the [SDK documentation](https://github.com/Azure/azure-sdk-for-go/blob/sdk%2Fresourcemanager%2Fmachinelearning%2Farmmachinelearning%2Fv2.0.0/sdk/resourcemanager/machinelearning/armmachinelearning/README.md) on how to add the SDK to your project and authenticate.

Просмотреть файл

@ -0,0 +1,34 @@
```go
package armmachinelearning_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/machinelearning/armmachinelearning/v2"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-05-01/examples/Datastore/delete.json
func ExampleDatastoresClient_Delete() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
client, err := armmachinelearning.NewDatastoresClient("00000000-1111-2222-3333-444444444444", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
_, err = client.Delete(ctx,
"test-rg",
"my-aml-workspace",
"string",
nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
}
```
Read the [SDK documentation](https://github.com/Azure/azure-sdk-for-go/blob/sdk%2Fresourcemanager%2Fmachinelearning%2Farmmachinelearning%2Fv2.0.0/sdk/resourcemanager/machinelearning/armmachinelearning/README.md) on how to add the SDK to your project and authenticate.

Просмотреть файл

@ -0,0 +1,36 @@
```go
package armmachinelearning_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/machinelearning/armmachinelearning/v2"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-05-01/examples/Datastore/get.json
func ExampleDatastoresClient_Get() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
client, err := armmachinelearning.NewDatastoresClient("00000000-1111-2222-3333-444444444444", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
res, err := client.Get(ctx,
"test-rg",
"my-aml-workspace",
"string",
nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
// TODO: use response item
_ = res
}
```
Read the [SDK documentation](https://github.com/Azure/azure-sdk-for-go/blob/sdk%2Fresourcemanager%2Fmachinelearning%2Farmmachinelearning%2Fv2.0.0/sdk/resourcemanager/machinelearning/armmachinelearning/README.md) on how to add the SDK to your project and authenticate.

Просмотреть файл

@ -0,0 +1,48 @@
```go
package armmachinelearning_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/machinelearning/armmachinelearning/v2"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-05-01/examples/Datastore/list.json
func ExampleDatastoresClient_NewListPager() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
client, err := armmachinelearning.NewDatastoresClient("00000000-1111-2222-3333-444444444444", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
pager := client.NewListPager("test-rg",
"my-aml-workspace",
&armmachinelearning.DatastoresClientListOptions{Skip: nil,
Count: to.Ptr[int32](1),
IsDefault: to.Ptr(false),
Names: []string{
"string"},
SearchText: to.Ptr("string"),
OrderBy: to.Ptr("string"),
OrderByAsc: to.Ptr(false),
})
for pager.More() {
nextResult, err := pager.NextPage(ctx)
if err != nil {
log.Fatalf("failed to advance page: %v", err)
}
for _, v := range nextResult.Value {
// TODO: use page item
_ = v
}
}
}
```
Read the [SDK documentation](https://github.com/Azure/azure-sdk-for-go/blob/sdk%2Fresourcemanager%2Fmachinelearning%2Farmmachinelearning%2Fv2.0.0/sdk/resourcemanager/machinelearning/armmachinelearning/README.md) on how to add the SDK to your project and authenticate.

Просмотреть файл

@ -0,0 +1,36 @@
```go
package armmachinelearning_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/machinelearning/armmachinelearning/v2"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-05-01/examples/Datastore/listSecrets.json
func ExampleDatastoresClient_ListSecrets() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
client, err := armmachinelearning.NewDatastoresClient("00000000-1111-2222-3333-444444444444", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
res, err := client.ListSecrets(ctx,
"test-rg",
"my-aml-workspace",
"string",
nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
// TODO: use response item
_ = res
}
```
Read the [SDK documentation](https://github.com/Azure/azure-sdk-for-go/blob/sdk%2Fresourcemanager%2Fmachinelearning%2Farmmachinelearning%2Fv2.0.0/sdk/resourcemanager/machinelearning/armmachinelearning/README.md) on how to add the SDK to your project and authenticate.

Просмотреть файл

@ -0,0 +1,52 @@
```go
package armmachinelearning_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/machinelearning/armmachinelearning/v2"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-05-01/examples/EnvironmentContainer/createOrUpdate.json
func ExampleEnvironmentContainersClient_CreateOrUpdate() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
client, err := armmachinelearning.NewEnvironmentContainersClient("00000000-1111-2222-3333-444444444444", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
res, err := client.CreateOrUpdate(ctx,
"testrg123",
"testworkspace",
"testEnvironment",
armmachinelearning.EnvironmentContainer{
Properties: &armmachinelearning.EnvironmentContainerProperties{
Description: to.Ptr("string"),
Properties: map[string]*string{
"additionalProp1": to.Ptr("string"),
"additionalProp2": to.Ptr("string"),
"additionalProp3": to.Ptr("string"),
},
Tags: map[string]*string{
"additionalProp1": to.Ptr("string"),
"additionalProp2": to.Ptr("string"),
"additionalProp3": to.Ptr("string"),
},
},
},
nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
// TODO: use response item
_ = res
}
```
Read the [SDK documentation](https://github.com/Azure/azure-sdk-for-go/blob/sdk%2Fresourcemanager%2Fmachinelearning%2Farmmachinelearning%2Fv2.0.0/sdk/resourcemanager/machinelearning/armmachinelearning/README.md) on how to add the SDK to your project and authenticate.

Просмотреть файл

@ -0,0 +1,34 @@
```go
package armmachinelearning_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/machinelearning/armmachinelearning/v2"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-05-01/examples/EnvironmentContainer/delete.json
func ExampleEnvironmentContainersClient_Delete() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
client, err := armmachinelearning.NewEnvironmentContainersClient("00000000-1111-2222-3333-444444444444", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
_, err = client.Delete(ctx,
"testrg123",
"testworkspace",
"testContainer",
nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
}
```
Read the [SDK documentation](https://github.com/Azure/azure-sdk-for-go/blob/sdk%2Fresourcemanager%2Fmachinelearning%2Farmmachinelearning%2Fv2.0.0/sdk/resourcemanager/machinelearning/armmachinelearning/README.md) on how to add the SDK to your project and authenticate.

Просмотреть файл

@ -0,0 +1,36 @@
```go
package armmachinelearning_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/machinelearning/armmachinelearning/v2"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-05-01/examples/EnvironmentContainer/get.json
func ExampleEnvironmentContainersClient_Get() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
client, err := armmachinelearning.NewEnvironmentContainersClient("00000000-1111-2222-3333-444444444444", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
res, err := client.Get(ctx,
"testrg123",
"testworkspace",
"testEnvironment",
nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
// TODO: use response item
_ = res
}
```
Read the [SDK documentation](https://github.com/Azure/azure-sdk-for-go/blob/sdk%2Fresourcemanager%2Fmachinelearning%2Farmmachinelearning%2Fv2.0.0/sdk/resourcemanager/machinelearning/armmachinelearning/README.md) on how to add the SDK to your project and authenticate.

Просмотреть файл

@ -0,0 +1,41 @@
```go
package armmachinelearning_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/machinelearning/armmachinelearning/v2"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-05-01/examples/EnvironmentContainer/list.json
func ExampleEnvironmentContainersClient_NewListPager() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
client, err := armmachinelearning.NewEnvironmentContainersClient("00000000-1111-2222-3333-444444444444", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
pager := client.NewListPager("testrg123",
"testworkspace",
&armmachinelearning.EnvironmentContainersClientListOptions{Skip: nil,
ListViewType: nil,
})
for pager.More() {
nextResult, err := pager.NextPage(ctx)
if err != nil {
log.Fatalf("failed to advance page: %v", err)
}
for _, v := range nextResult.Value {
// TODO: use page item
_ = v
}
}
}
```
Read the [SDK documentation](https://github.com/Azure/azure-sdk-for-go/blob/sdk%2Fresourcemanager%2Fmachinelearning%2Farmmachinelearning%2Fv2.0.0/sdk/resourcemanager/machinelearning/armmachinelearning/README.md) on how to add the SDK to your project and authenticate.

Просмотреть файл

@ -0,0 +1,70 @@
```go
package armmachinelearning_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/machinelearning/armmachinelearning/v2"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-05-01/examples/EnvironmentVersion/createOrUpdate.json
func ExampleEnvironmentVersionsClient_CreateOrUpdate() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
client, err := armmachinelearning.NewEnvironmentVersionsClient("00000000-1111-2222-3333-444444444444", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
res, err := client.CreateOrUpdate(ctx,
"test-rg",
"my-aml-workspace",
"string",
"string",
armmachinelearning.EnvironmentVersion{
Properties: &armmachinelearning.EnvironmentVersionProperties{
Description: to.Ptr("string"),
Properties: map[string]*string{
"string": to.Ptr("string"),
},
Tags: map[string]*string{
"string": to.Ptr("string"),
},
IsAnonymous: to.Ptr(false),
Build: &armmachinelearning.BuildContext{
ContextURI: to.Ptr("https://storage-account.blob.core.windows.net/azureml/DockerBuildContext/95ddede6b9b8c4e90472db3acd0a8d28/"),
DockerfilePath: to.Ptr("prod/Dockerfile"),
},
CondaFile: to.Ptr("string"),
Image: to.Ptr("docker.io/tensorflow/serving:latest"),
InferenceConfig: &armmachinelearning.InferenceContainerProperties{
LivenessRoute: &armmachinelearning.Route{
Path: to.Ptr("string"),
Port: to.Ptr[int32](1),
},
ReadinessRoute: &armmachinelearning.Route{
Path: to.Ptr("string"),
Port: to.Ptr[int32](1),
},
ScoringRoute: &armmachinelearning.Route{
Path: to.Ptr("string"),
Port: to.Ptr[int32](1),
},
},
},
},
nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
// TODO: use response item
_ = res
}
```
Read the [SDK documentation](https://github.com/Azure/azure-sdk-for-go/blob/sdk%2Fresourcemanager%2Fmachinelearning%2Farmmachinelearning%2Fv2.0.0/sdk/resourcemanager/machinelearning/armmachinelearning/README.md) on how to add the SDK to your project and authenticate.

Просмотреть файл

@ -0,0 +1,35 @@
```go
package armmachinelearning_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/machinelearning/armmachinelearning/v2"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-05-01/examples/EnvironmentVersion/delete.json
func ExampleEnvironmentVersionsClient_Delete() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
client, err := armmachinelearning.NewEnvironmentVersionsClient("00000000-1111-2222-3333-444444444444", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
_, err = client.Delete(ctx,
"test-rg",
"my-aml-workspace",
"string",
"string",
nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
}
```
Read the [SDK documentation](https://github.com/Azure/azure-sdk-for-go/blob/sdk%2Fresourcemanager%2Fmachinelearning%2Farmmachinelearning%2Fv2.0.0/sdk/resourcemanager/machinelearning/armmachinelearning/README.md) on how to add the SDK to your project and authenticate.

Просмотреть файл

@ -0,0 +1,37 @@
```go
package armmachinelearning_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/machinelearning/armmachinelearning/v2"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-05-01/examples/EnvironmentVersion/get.json
func ExampleEnvironmentVersionsClient_Get() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
client, err := armmachinelearning.NewEnvironmentVersionsClient("00000000-1111-2222-3333-444444444444", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
res, err := client.Get(ctx,
"test-rg",
"my-aml-workspace",
"string",
"string",
nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
// TODO: use response item
_ = res
}
```
Read the [SDK documentation](https://github.com/Azure/azure-sdk-for-go/blob/sdk%2Fresourcemanager%2Fmachinelearning%2Farmmachinelearning%2Fv2.0.0/sdk/resourcemanager/machinelearning/armmachinelearning/README.md) on how to add the SDK to your project and authenticate.

Просмотреть файл

@ -0,0 +1,45 @@
```go
package armmachinelearning_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/machinelearning/armmachinelearning/v2"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-05-01/examples/EnvironmentVersion/list.json
func ExampleEnvironmentVersionsClient_NewListPager() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
client, err := armmachinelearning.NewEnvironmentVersionsClient("00000000-1111-2222-3333-444444444444", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
pager := client.NewListPager("test-rg",
"my-aml-workspace",
"string",
&armmachinelearning.EnvironmentVersionsClientListOptions{OrderBy: to.Ptr("string"),
Top: to.Ptr[int32](1),
Skip: nil,
ListViewType: nil,
})
for pager.More() {
nextResult, err := pager.NextPage(ctx)
if err != nil {
log.Fatalf("failed to advance page: %v", err)
}
for _, v := range nextResult.Value {
// TODO: use page item
_ = v
}
}
}
```
Read the [SDK documentation](https://github.com/Azure/azure-sdk-for-go/blob/sdk%2Fresourcemanager%2Fmachinelearning%2Farmmachinelearning%2Fv2.0.0/sdk/resourcemanager/machinelearning/armmachinelearning/README.md) on how to add the SDK to your project and authenticate.

Просмотреть файл

@ -0,0 +1,35 @@
```go
package armmachinelearning_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/machinelearning/armmachinelearning/v2"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-05-01/examples/ExternalFQDN/get.json
func ExampleWorkspacesClient_ListOutboundNetworkDependenciesEndpoints() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
client, err := armmachinelearning.NewWorkspacesClient("00000000-1111-2222-3333-444444444444", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
res, err := client.ListOutboundNetworkDependenciesEndpoints(ctx,
"workspace-1234",
"testworkspace",
nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
// TODO: use response item
_ = res
}
```
Read the [SDK documentation](https://github.com/Azure/azure-sdk-for-go/blob/sdk%2Fresourcemanager%2Fmachinelearning%2Farmmachinelearning%2Fv2.0.0/sdk/resourcemanager/machinelearning/armmachinelearning/README.md) on how to add the SDK to your project and authenticate.

Просмотреть файл

@ -0,0 +1,104 @@
```go
package armmachinelearning_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/machinelearning/armmachinelearning/v2"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-05-01/examples/Job/CommandJob/createOrUpdate.json
func ExampleJobsClient_CreateOrUpdate() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
client, err := armmachinelearning.NewJobsClient("00000000-1111-2222-3333-444444444444", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
res, err := client.CreateOrUpdate(ctx,
"test-rg",
"my-aml-workspace",
"string",
armmachinelearning.JobBase{
Properties: &armmachinelearning.CommandJob{
Description: to.Ptr("string"),
Properties: map[string]*string{
"string": to.Ptr("string"),
},
Tags: map[string]*string{
"string": to.Ptr("string"),
},
ComputeID: to.Ptr("string"),
DisplayName: to.Ptr("string"),
ExperimentName: to.Ptr("string"),
Identity: &armmachinelearning.AmlToken{
IdentityType: to.Ptr(armmachinelearning.IdentityConfigurationTypeAMLToken),
},
JobType: to.Ptr(armmachinelearning.JobTypeCommand),
Services: map[string]*armmachinelearning.JobService{
"string": {
Endpoint: to.Ptr("string"),
JobServiceType: to.Ptr("string"),
Port: to.Ptr[int32](1),
Properties: map[string]*string{
"string": to.Ptr("string"),
},
},
},
CodeID: to.Ptr("string"),
Command: to.Ptr("string"),
Distribution: &armmachinelearning.TensorFlow{
DistributionType: to.Ptr(armmachinelearning.DistributionTypeTensorFlow),
ParameterServerCount: to.Ptr[int32](1),
WorkerCount: to.Ptr[int32](1),
},
EnvironmentID: to.Ptr("string"),
EnvironmentVariables: map[string]*string{
"string": to.Ptr("string"),
},
Inputs: map[string]armmachinelearning.JobInputClassification{
"string": &armmachinelearning.LiteralJobInput{
Description: to.Ptr("string"),
JobInputType: to.Ptr(armmachinelearning.JobInputTypeLiteral),
Value: to.Ptr("string"),
},
},
Limits: &armmachinelearning.CommandJobLimits{
JobLimitsType: to.Ptr(armmachinelearning.JobLimitsTypeCommand),
Timeout: to.Ptr("PT5M"),
},
Outputs: map[string]armmachinelearning.JobOutputClassification{
"string": &armmachinelearning.URIFileJobOutput{
Mode: to.Ptr(armmachinelearning.OutputDeliveryModeReadWriteMount),
URI: to.Ptr("string"),
Description: to.Ptr("string"),
JobOutputType: to.Ptr(armmachinelearning.JobOutputTypeURIFile),
},
},
Resources: &armmachinelearning.ResourceConfiguration{
InstanceCount: to.Ptr[int32](1),
InstanceType: to.Ptr("string"),
Properties: map[string]interface{}{
"string": map[string]interface{}{
"e6b6493e-7d5e-4db3-be1e-306ec641327e": nil,
},
},
},
},
},
nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
// TODO: use response item
_ = res
}
```
Read the [SDK documentation](https://github.com/Azure/azure-sdk-for-go/blob/sdk%2Fresourcemanager%2Fmachinelearning%2Farmmachinelearning%2Fv2.0.0/sdk/resourcemanager/machinelearning/armmachinelearning/README.md) on how to add the SDK to your project and authenticate.

Просмотреть файл

@ -0,0 +1,36 @@
```go
package armmachinelearning_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/machinelearning/armmachinelearning/v2"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-05-01/examples/Job/CommandJob/get.json
func ExampleJobsClient_Get() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
client, err := armmachinelearning.NewJobsClient("00000000-1111-2222-3333-444444444444", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
res, err := client.Get(ctx,
"test-rg",
"my-aml-workspace",
"string",
nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
// TODO: use response item
_ = res
}
```
Read the [SDK documentation](https://github.com/Azure/azure-sdk-for-go/blob/sdk%2Fresourcemanager%2Fmachinelearning%2Farmmachinelearning%2Fv2.0.0/sdk/resourcemanager/machinelearning/armmachinelearning/README.md) on how to add the SDK to your project and authenticate.

Просмотреть файл

@ -0,0 +1,44 @@
```go
package armmachinelearning_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/machinelearning/armmachinelearning/v2"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-05-01/examples/Job/CommandJob/list.json
func ExampleJobsClient_NewListPager() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
client, err := armmachinelearning.NewJobsClient("00000000-1111-2222-3333-444444444444", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
pager := client.NewListPager("test-rg",
"my-aml-workspace",
&armmachinelearning.JobsClientListOptions{Skip: nil,
JobType: to.Ptr("string"),
Tag: to.Ptr("string"),
ListViewType: nil,
})
for pager.More() {
nextResult, err := pager.NextPage(ctx)
if err != nil {
log.Fatalf("failed to advance page: %v", err)
}
for _, v := range nextResult.Value {
// TODO: use page item
_ = v
}
}
}
```
Read the [SDK documentation](https://github.com/Azure/azure-sdk-for-go/blob/sdk%2Fresourcemanager%2Fmachinelearning%2Farmmachinelearning%2Fv2.0.0/sdk/resourcemanager/machinelearning/armmachinelearning/README.md) on how to add the SDK to your project and authenticate.

Просмотреть файл

@ -0,0 +1,38 @@
```go
package armmachinelearning_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/machinelearning/armmachinelearning/v2"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-05-01/examples/Job/cancel.json
func ExampleJobsClient_BeginCancel() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
client, err := armmachinelearning.NewJobsClient("00000000-1111-2222-3333-444444444444", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
poller, err := client.BeginCancel(ctx,
"test-rg",
"my-aml-workspace",
"string",
nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
_, err = poller.PollUntilDone(ctx, nil)
if err != nil {
log.Fatalf("failed to pull the result: %v", err)
}
}
```
Read the [SDK documentation](https://github.com/Azure/azure-sdk-for-go/blob/sdk%2Fresourcemanager%2Fmachinelearning%2Farmmachinelearning%2Fv2.0.0/sdk/resourcemanager/machinelearning/armmachinelearning/README.md) on how to add the SDK to your project and authenticate.

Просмотреть файл

@ -0,0 +1,38 @@
```go
package armmachinelearning_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/machinelearning/armmachinelearning/v2"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-05-01/examples/Job/delete.json
func ExampleJobsClient_BeginDelete() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
client, err := armmachinelearning.NewJobsClient("00000000-1111-2222-3333-444444444444", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
poller, err := client.BeginDelete(ctx,
"test-rg",
"my-aml-workspace",
"string",
nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
_, err = poller.PollUntilDone(ctx, nil)
if err != nil {
log.Fatalf("failed to pull the result: %v", err)
}
}
```
Read the [SDK documentation](https://github.com/Azure/azure-sdk-for-go/blob/sdk%2Fresourcemanager%2Fmachinelearning%2Farmmachinelearning%2Fv2.0.0/sdk/resourcemanager/machinelearning/armmachinelearning/README.md) on how to add the SDK to your project and authenticate.

Просмотреть файл

@ -0,0 +1,46 @@
```go
package armmachinelearning_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/machinelearning/armmachinelearning/v2"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-05-01/examples/ModelContainer/createOrUpdate.json
func ExampleModelContainersClient_CreateOrUpdate() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
client, err := armmachinelearning.NewModelContainersClient("00000000-1111-2222-3333-444444444444", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
res, err := client.CreateOrUpdate(ctx,
"testrg123",
"workspace123",
"testContainer",
armmachinelearning.ModelContainer{
Properties: &armmachinelearning.ModelContainerProperties{
Description: to.Ptr("Model container description"),
Tags: map[string]*string{
"tag1": to.Ptr("value1"),
"tag2": to.Ptr("value2"),
},
},
},
nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
// TODO: use response item
_ = res
}
```
Read the [SDK documentation](https://github.com/Azure/azure-sdk-for-go/blob/sdk%2Fresourcemanager%2Fmachinelearning%2Farmmachinelearning%2Fv2.0.0/sdk/resourcemanager/machinelearning/armmachinelearning/README.md) on how to add the SDK to your project and authenticate.

Просмотреть файл

@ -0,0 +1,34 @@
```go
package armmachinelearning_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/machinelearning/armmachinelearning/v2"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-05-01/examples/ModelContainer/delete.json
func ExampleModelContainersClient_Delete() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
client, err := armmachinelearning.NewModelContainersClient("00000000-1111-2222-3333-444444444444", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
_, err = client.Delete(ctx,
"testrg123",
"workspace123",
"testContainer",
nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
}
```
Read the [SDK documentation](https://github.com/Azure/azure-sdk-for-go/blob/sdk%2Fresourcemanager%2Fmachinelearning%2Farmmachinelearning%2Fv2.0.0/sdk/resourcemanager/machinelearning/armmachinelearning/README.md) on how to add the SDK to your project and authenticate.

Просмотреть файл

@ -0,0 +1,36 @@
```go
package armmachinelearning_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/machinelearning/armmachinelearning/v2"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-05-01/examples/ModelContainer/get.json
func ExampleModelContainersClient_Get() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
client, err := armmachinelearning.NewModelContainersClient("00000000-1111-2222-3333-444444444444", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
res, err := client.Get(ctx,
"testrg123",
"workspace123",
"testContainer",
nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
// TODO: use response item
_ = res
}
```
Read the [SDK documentation](https://github.com/Azure/azure-sdk-for-go/blob/sdk%2Fresourcemanager%2Fmachinelearning%2Farmmachinelearning%2Fv2.0.0/sdk/resourcemanager/machinelearning/armmachinelearning/README.md) on how to add the SDK to your project and authenticate.

Просмотреть файл

@ -0,0 +1,42 @@
```go
package armmachinelearning_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/machinelearning/armmachinelearning/v2"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-05-01/examples/ModelContainer/list.json
func ExampleModelContainersClient_NewListPager() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
client, err := armmachinelearning.NewModelContainersClient("00000000-1111-2222-3333-444444444444", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
pager := client.NewListPager("testrg123",
"workspace123",
&armmachinelearning.ModelContainersClientListOptions{Skip: nil,
Count: nil,
ListViewType: nil,
})
for pager.More() {
nextResult, err := pager.NextPage(ctx)
if err != nil {
log.Fatalf("failed to advance page: %v", err)
}
for _, v := range nextResult.Value {
// TODO: use page item
_ = v
}
}
}
```
Read the [SDK documentation](https://github.com/Azure/azure-sdk-for-go/blob/sdk%2Fresourcemanager%2Fmachinelearning%2Farmmachinelearning%2Fv2.0.0/sdk/resourcemanager/machinelearning/armmachinelearning/README.md) on how to add the SDK to your project and authenticate.

Просмотреть файл

@ -0,0 +1,59 @@
```go
package armmachinelearning_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/machinelearning/armmachinelearning/v2"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-05-01/examples/ModelVersion/createOrUpdate.json
func ExampleModelVersionsClient_CreateOrUpdate() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
client, err := armmachinelearning.NewModelVersionsClient("00000000-1111-2222-3333-444444444444", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
res, err := client.CreateOrUpdate(ctx,
"test-rg",
"my-aml-workspace",
"string",
"string",
armmachinelearning.ModelVersion{
Properties: &armmachinelearning.ModelVersionProperties{
Description: to.Ptr("string"),
Properties: map[string]*string{
"string": to.Ptr("string"),
},
Tags: map[string]*string{
"string": to.Ptr("string"),
},
IsAnonymous: to.Ptr(false),
Flavors: map[string]*armmachinelearning.FlavorData{
"string": {
Data: map[string]*string{
"string": to.Ptr("string"),
},
},
},
ModelType: to.Ptr("CustomModel"),
ModelURI: to.Ptr("string"),
},
},
nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
// TODO: use response item
_ = res
}
```
Read the [SDK documentation](https://github.com/Azure/azure-sdk-for-go/blob/sdk%2Fresourcemanager%2Fmachinelearning%2Farmmachinelearning%2Fv2.0.0/sdk/resourcemanager/machinelearning/armmachinelearning/README.md) on how to add the SDK to your project and authenticate.

Просмотреть файл

@ -0,0 +1,35 @@
```go
package armmachinelearning_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/machinelearning/armmachinelearning/v2"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-05-01/examples/ModelVersion/delete.json
func ExampleModelVersionsClient_Delete() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
client, err := armmachinelearning.NewModelVersionsClient("00000000-1111-2222-3333-444444444444", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
_, err = client.Delete(ctx,
"test-rg",
"my-aml-workspace",
"string",
"string",
nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
}
```
Read the [SDK documentation](https://github.com/Azure/azure-sdk-for-go/blob/sdk%2Fresourcemanager%2Fmachinelearning%2Farmmachinelearning%2Fv2.0.0/sdk/resourcemanager/machinelearning/armmachinelearning/README.md) on how to add the SDK to your project and authenticate.

Просмотреть файл

@ -0,0 +1,37 @@
```go
package armmachinelearning_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/machinelearning/armmachinelearning/v2"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-05-01/examples/ModelVersion/get.json
func ExampleModelVersionsClient_Get() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
client, err := armmachinelearning.NewModelVersionsClient("00000000-1111-2222-3333-444444444444", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
res, err := client.Get(ctx,
"test-rg",
"my-aml-workspace",
"string",
"string",
nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
// TODO: use response item
_ = res
}
```
Read the [SDK documentation](https://github.com/Azure/azure-sdk-for-go/blob/sdk%2Fresourcemanager%2Fmachinelearning%2Farmmachinelearning%2Fv2.0.0/sdk/resourcemanager/machinelearning/armmachinelearning/README.md) on how to add the SDK to your project and authenticate.

Просмотреть файл

@ -0,0 +1,51 @@
```go
package armmachinelearning_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/machinelearning/armmachinelearning/v2"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-05-01/examples/ModelVersion/list.json
func ExampleModelVersionsClient_NewListPager() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
client, err := armmachinelearning.NewModelVersionsClient("00000000-1111-2222-3333-444444444444", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
pager := client.NewListPager("test-rg",
"my-aml-workspace",
"string",
&armmachinelearning.ModelVersionsClientListOptions{Skip: nil,
OrderBy: to.Ptr("string"),
Top: to.Ptr[int32](1),
Version: to.Ptr("string"),
Description: to.Ptr("string"),
Offset: to.Ptr[int32](1),
Tags: to.Ptr("string"),
Properties: to.Ptr("string"),
Feed: nil,
ListViewType: nil,
})
for pager.More() {
nextResult, err := pager.NextPage(ctx)
if err != nil {
log.Fatalf("failed to advance page: %v", err)
}
for _, v := range nextResult.Value {
// TODO: use page item
_ = v
}
}
}
```
Read the [SDK documentation](https://github.com/Azure/azure-sdk-for-go/blob/sdk%2Fresourcemanager%2Fmachinelearning%2Farmmachinelearning%2Fv2.0.0/sdk/resourcemanager/machinelearning/armmachinelearning/README.md) on how to add the SDK to your project and authenticate.

Просмотреть файл

@ -0,0 +1,35 @@
```go
package armmachinelearning_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/machinelearning/armmachinelearning/v2"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-05-01/examples/Notebook/listKeys.json
func ExampleWorkspacesClient_ListNotebookKeys() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
client, err := armmachinelearning.NewWorkspacesClient("aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
res, err := client.ListNotebookKeys(ctx,
"testrg123",
"workspaces123",
nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
// TODO: use response item
_ = res
}
```
Read the [SDK documentation](https://github.com/Azure/azure-sdk-for-go/blob/sdk%2Fresourcemanager%2Fmachinelearning%2Farmmachinelearning%2Fv2.0.0/sdk/resourcemanager/machinelearning/armmachinelearning/README.md) on how to add the SDK to your project and authenticate.

Просмотреть файл

@ -0,0 +1,39 @@
```go
package armmachinelearning_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/machinelearning/armmachinelearning/v2"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-05-01/examples/Notebook/prepare.json
func ExampleWorkspacesClient_BeginPrepareNotebook() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
client, err := armmachinelearning.NewWorkspacesClient("aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
poller, err := client.BeginPrepareNotebook(ctx,
"testrg123",
"workspaces123",
nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
res, err := poller.PollUntilDone(ctx, nil)
if err != nil {
log.Fatalf("failed to pull the result: %v", err)
}
// TODO: use response item
_ = res
}
```
Read the [SDK documentation](https://github.com/Azure/azure-sdk-for-go/blob/sdk%2Fresourcemanager%2Fmachinelearning%2Farmmachinelearning%2Fv2.0.0/sdk/resourcemanager/machinelearning/armmachinelearning/README.md) on how to add the SDK to your project and authenticate.

Просмотреть файл

@ -0,0 +1,106 @@
```go
package armmachinelearning_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/machinelearning/armmachinelearning/v2"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-05-01/examples/OnlineDeployment/KubernetesOnlineDeployment/createOrUpdate.json
func ExampleOnlineDeploymentsClient_BeginCreateOrUpdate() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
client, err := armmachinelearning.NewOnlineDeploymentsClient("00000000-1111-2222-3333-444444444444", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
poller, err := client.BeginCreateOrUpdate(ctx,
"test-rg",
"my-aml-workspace",
"testEndpointName",
"testDeploymentName",
armmachinelearning.OnlineDeployment{
Location: to.Ptr("string"),
Tags: map[string]*string{},
Identity: &armmachinelearning.ManagedServiceIdentity{
Type: to.Ptr(armmachinelearning.ManagedServiceIdentityTypeSystemAssigned),
UserAssignedIdentities: map[string]*armmachinelearning.UserAssignedIdentity{
"string": {},
},
},
Kind: to.Ptr("string"),
Properties: &armmachinelearning.KubernetesOnlineDeployment{
Description: to.Ptr("string"),
CodeConfiguration: &armmachinelearning.CodeConfiguration{
CodeID: to.Ptr("string"),
ScoringScript: to.Ptr("string"),
},
EnvironmentID: to.Ptr("string"),
EnvironmentVariables: map[string]*string{
"string": to.Ptr("string"),
},
Properties: map[string]*string{
"string": to.Ptr("string"),
},
AppInsightsEnabled: to.Ptr(false),
EndpointComputeType: to.Ptr(armmachinelearning.EndpointComputeTypeKubernetes),
InstanceType: to.Ptr("string"),
LivenessProbe: &armmachinelearning.ProbeSettings{
FailureThreshold: to.Ptr[int32](1),
InitialDelay: to.Ptr("PT5M"),
Period: to.Ptr("PT5M"),
SuccessThreshold: to.Ptr[int32](1),
Timeout: to.Ptr("PT5M"),
},
Model: to.Ptr("string"),
ModelMountPath: to.Ptr("string"),
RequestSettings: &armmachinelearning.OnlineRequestSettings{
MaxConcurrentRequestsPerInstance: to.Ptr[int32](1),
MaxQueueWait: to.Ptr("PT5M"),
RequestTimeout: to.Ptr("PT5M"),
},
ScaleSettings: &armmachinelearning.DefaultScaleSettings{
ScaleType: to.Ptr(armmachinelearning.ScaleTypeDefault),
},
ContainerResourceRequirements: &armmachinelearning.ContainerResourceRequirements{
ContainerResourceLimits: &armmachinelearning.ContainerResourceSettings{
CPU: to.Ptr("\"1\""),
Gpu: to.Ptr("\"1\""),
Memory: to.Ptr("\"2Gi\""),
},
ContainerResourceRequests: &armmachinelearning.ContainerResourceSettings{
CPU: to.Ptr("\"1\""),
Gpu: to.Ptr("\"1\""),
Memory: to.Ptr("\"2Gi\""),
},
},
},
SKU: &armmachinelearning.SKU{
Name: to.Ptr("string"),
Capacity: to.Ptr[int32](1),
Family: to.Ptr("string"),
Size: to.Ptr("string"),
Tier: to.Ptr(armmachinelearning.SKUTierFree),
},
},
nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
res, err := poller.PollUntilDone(ctx, nil)
if err != nil {
log.Fatalf("failed to pull the result: %v", err)
}
// TODO: use response item
_ = res
}
```
Read the [SDK documentation](https://github.com/Azure/azure-sdk-for-go/blob/sdk%2Fresourcemanager%2Fmachinelearning%2Farmmachinelearning%2Fv2.0.0/sdk/resourcemanager/machinelearning/armmachinelearning/README.md) on how to add the SDK to your project and authenticate.

Просмотреть файл

@ -0,0 +1,37 @@
```go
package armmachinelearning_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/machinelearning/armmachinelearning/v2"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-05-01/examples/OnlineDeployment/KubernetesOnlineDeployment/get.json
func ExampleOnlineDeploymentsClient_Get() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
client, err := armmachinelearning.NewOnlineDeploymentsClient("00000000-1111-2222-3333-444444444444", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
res, err := client.Get(ctx,
"test-rg",
"my-aml-workspace",
"testEndpointName",
"testDeploymentName",
nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
// TODO: use response item
_ = res
}
```
Read the [SDK documentation](https://github.com/Azure/azure-sdk-for-go/blob/sdk%2Fresourcemanager%2Fmachinelearning%2Farmmachinelearning%2Fv2.0.0/sdk/resourcemanager/machinelearning/armmachinelearning/README.md) on how to add the SDK to your project and authenticate.

Просмотреть файл

@ -0,0 +1,52 @@
```go
package armmachinelearning_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/machinelearning/armmachinelearning/v2"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-05-01/examples/OnlineDeployment/KubernetesOnlineDeployment/update.json
func ExampleOnlineDeploymentsClient_BeginUpdate() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
client, err := armmachinelearning.NewOnlineDeploymentsClient("00000000-1111-2222-3333-444444444444", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
poller, err := client.BeginUpdate(ctx,
"test-rg",
"my-aml-workspace",
"testEndpointName",
"testDeploymentName",
armmachinelearning.PartialMinimalTrackedResourceWithSKU{
Tags: map[string]*string{},
SKU: &armmachinelearning.PartialSKU{
Name: to.Ptr("string"),
Capacity: to.Ptr[int32](1),
Family: to.Ptr("string"),
Size: to.Ptr("string"),
Tier: to.Ptr(armmachinelearning.SKUTierFree),
},
},
nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
res, err := poller.PollUntilDone(ctx, nil)
if err != nil {
log.Fatalf("failed to pull the result: %v", err)
}
// TODO: use response item
_ = res
}
```
Read the [SDK documentation](https://github.com/Azure/azure-sdk-for-go/blob/sdk%2Fresourcemanager%2Fmachinelearning%2Farmmachinelearning%2Fv2.0.0/sdk/resourcemanager/machinelearning/armmachinelearning/README.md) on how to add the SDK to your project and authenticate.

Просмотреть файл

@ -0,0 +1,39 @@
```go
package armmachinelearning_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/machinelearning/armmachinelearning/v2"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-05-01/examples/OnlineDeployment/delete.json
func ExampleOnlineDeploymentsClient_BeginDelete() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
client, err := armmachinelearning.NewOnlineDeploymentsClient("00000000-1111-2222-3333-444444444444", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
poller, err := client.BeginDelete(ctx,
"testrg123",
"workspace123",
"testEndpoint",
"testDeployment",
nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
_, err = poller.PollUntilDone(ctx, nil)
if err != nil {
log.Fatalf("failed to pull the result: %v", err)
}
}
```
Read the [SDK documentation](https://github.com/Azure/azure-sdk-for-go/blob/sdk%2Fresourcemanager%2Fmachinelearning%2Farmmachinelearning%2Fv2.0.0/sdk/resourcemanager/machinelearning/armmachinelearning/README.md) on how to add the SDK to your project and authenticate.

Просмотреть файл

@ -0,0 +1,42 @@
```go
package armmachinelearning_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/machinelearning/armmachinelearning/v2"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-05-01/examples/OnlineDeployment/getLogs.json
func ExampleOnlineDeploymentsClient_GetLogs() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
client, err := armmachinelearning.NewOnlineDeploymentsClient("00000000-1111-2222-3333-444444444444", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
res, err := client.GetLogs(ctx,
"testrg123",
"workspace123",
"testEndpoint",
"testDeployment",
armmachinelearning.DeploymentLogsRequest{
ContainerType: to.Ptr(armmachinelearning.ContainerTypeStorageInitializer),
Tail: to.Ptr[int32](0),
},
nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
// TODO: use response item
_ = res
}
```
Read the [SDK documentation](https://github.com/Azure/azure-sdk-for-go/blob/sdk%2Fresourcemanager%2Fmachinelearning%2Farmmachinelearning%2Fv2.0.0/sdk/resourcemanager/machinelearning/armmachinelearning/README.md) on how to add the SDK to your project and authenticate.

Просмотреть файл

@ -0,0 +1,44 @@
```go
package armmachinelearning_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/machinelearning/armmachinelearning/v2"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-05-01/examples/OnlineDeployment/list.json
func ExampleOnlineDeploymentsClient_NewListPager() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
client, err := armmachinelearning.NewOnlineDeploymentsClient("00000000-1111-2222-3333-444444444444", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
pager := client.NewListPager("test-rg",
"my-aml-workspace",
"testEndpointName",
&armmachinelearning.OnlineDeploymentsClientListOptions{OrderBy: to.Ptr("string"),
Top: to.Ptr[int32](1),
Skip: nil,
})
for pager.More() {
nextResult, err := pager.NextPage(ctx)
if err != nil {
log.Fatalf("failed to advance page: %v", err)
}
for _, v := range nextResult.Value {
// TODO: use page item
_ = v
}
}
}
```
Read the [SDK documentation](https://github.com/Azure/azure-sdk-for-go/blob/sdk%2Fresourcemanager%2Fmachinelearning%2Farmmachinelearning%2Fv2.0.0/sdk/resourcemanager/machinelearning/armmachinelearning/README.md) on how to add the SDK to your project and authenticate.

Просмотреть файл

@ -0,0 +1,70 @@
```go
package armmachinelearning_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/machinelearning/armmachinelearning/v2"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-05-01/examples/OnlineEndpoint/createOrUpdate.json
func ExampleOnlineEndpointsClient_BeginCreateOrUpdate() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
client, err := armmachinelearning.NewOnlineEndpointsClient("00000000-1111-2222-3333-444444444444", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
poller, err := client.BeginCreateOrUpdate(ctx,
"test-rg",
"my-aml-workspace",
"testEndpointName",
armmachinelearning.OnlineEndpoint{
Location: to.Ptr("string"),
Tags: map[string]*string{},
Identity: &armmachinelearning.ManagedServiceIdentity{
Type: to.Ptr(armmachinelearning.ManagedServiceIdentityTypeSystemAssigned),
UserAssignedIdentities: map[string]*armmachinelearning.UserAssignedIdentity{
"string": {},
},
},
Kind: to.Ptr("string"),
Properties: &armmachinelearning.OnlineEndpointProperties{
Description: to.Ptr("string"),
AuthMode: to.Ptr(armmachinelearning.EndpointAuthModeAMLToken),
Properties: map[string]*string{
"string": to.Ptr("string"),
},
Compute: to.Ptr("string"),
Traffic: map[string]*int32{
"string": to.Ptr[int32](1),
},
},
SKU: &armmachinelearning.SKU{
Name: to.Ptr("string"),
Capacity: to.Ptr[int32](1),
Family: to.Ptr("string"),
Size: to.Ptr("string"),
Tier: to.Ptr(armmachinelearning.SKUTierFree),
},
},
nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
res, err := poller.PollUntilDone(ctx, nil)
if err != nil {
log.Fatalf("failed to pull the result: %v", err)
}
// TODO: use response item
_ = res
}
```
Read the [SDK documentation](https://github.com/Azure/azure-sdk-for-go/blob/sdk%2Fresourcemanager%2Fmachinelearning%2Farmmachinelearning%2Fv2.0.0/sdk/resourcemanager/machinelearning/armmachinelearning/README.md) on how to add the SDK to your project and authenticate.

Просмотреть файл

@ -0,0 +1,38 @@
```go
package armmachinelearning_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/machinelearning/armmachinelearning/v2"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-05-01/examples/OnlineEndpoint/delete.json
func ExampleOnlineEndpointsClient_BeginDelete() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
client, err := armmachinelearning.NewOnlineEndpointsClient("00000000-1111-2222-3333-444444444444", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
poller, err := client.BeginDelete(ctx,
"test-rg",
"my-aml-workspace",
"testEndpointName",
nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
_, err = poller.PollUntilDone(ctx, nil)
if err != nil {
log.Fatalf("failed to pull the result: %v", err)
}
}
```
Read the [SDK documentation](https://github.com/Azure/azure-sdk-for-go/blob/sdk%2Fresourcemanager%2Fmachinelearning%2Farmmachinelearning%2Fv2.0.0/sdk/resourcemanager/machinelearning/armmachinelearning/README.md) on how to add the SDK to your project and authenticate.

Просмотреть файл

@ -0,0 +1,36 @@
```go
package armmachinelearning_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/machinelearning/armmachinelearning/v2"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-05-01/examples/OnlineEndpoint/get.json
func ExampleOnlineEndpointsClient_Get() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
client, err := armmachinelearning.NewOnlineEndpointsClient("00000000-1111-2222-3333-444444444444", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
res, err := client.Get(ctx,
"test-rg",
"my-aml-workspace",
"testEndpointName",
nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
// TODO: use response item
_ = res
}
```
Read the [SDK documentation](https://github.com/Azure/azure-sdk-for-go/blob/sdk%2Fresourcemanager%2Fmachinelearning%2Farmmachinelearning%2Fv2.0.0/sdk/resourcemanager/machinelearning/armmachinelearning/README.md) on how to add the SDK to your project and authenticate.

Просмотреть файл

@ -0,0 +1,36 @@
```go
package armmachinelearning_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/machinelearning/armmachinelearning/v2"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-05-01/examples/OnlineEndpoint/getToken.json
func ExampleOnlineEndpointsClient_GetToken() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
client, err := armmachinelearning.NewOnlineEndpointsClient("00000000-1111-2222-3333-444444444444", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
res, err := client.GetToken(ctx,
"test-rg",
"my-aml-workspace",
"testEndpointName",
nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
// TODO: use response item
_ = res
}
```
Read the [SDK documentation](https://github.com/Azure/azure-sdk-for-go/blob/sdk%2Fresourcemanager%2Fmachinelearning%2Farmmachinelearning%2Fv2.0.0/sdk/resourcemanager/machinelearning/armmachinelearning/README.md) on how to add the SDK to your project and authenticate.

Просмотреть файл

@ -0,0 +1,47 @@
```go
package armmachinelearning_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/machinelearning/armmachinelearning/v2"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-05-01/examples/OnlineEndpoint/list.json
func ExampleOnlineEndpointsClient_NewListPager() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
client, err := armmachinelearning.NewOnlineEndpointsClient("00000000-1111-2222-3333-444444444444", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
pager := client.NewListPager("test-rg",
"my-aml-workspace",
&armmachinelearning.OnlineEndpointsClientListOptions{Name: to.Ptr("string"),
Count: to.Ptr[int32](1),
ComputeType: to.Ptr(armmachinelearning.EndpointComputeTypeManaged),
Skip: nil,
Tags: to.Ptr("string"),
Properties: to.Ptr("string"),
OrderBy: to.Ptr(armmachinelearning.OrderStringCreatedAtDesc),
})
for pager.More() {
nextResult, err := pager.NextPage(ctx)
if err != nil {
log.Fatalf("failed to advance page: %v", err)
}
for _, v := range nextResult.Value {
// TODO: use page item
_ = v
}
}
}
```
Read the [SDK documentation](https://github.com/Azure/azure-sdk-for-go/blob/sdk%2Fresourcemanager%2Fmachinelearning%2Farmmachinelearning%2Fv2.0.0/sdk/resourcemanager/machinelearning/armmachinelearning/README.md) on how to add the SDK to your project and authenticate.

Просмотреть файл

@ -0,0 +1,36 @@
```go
package armmachinelearning_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/machinelearning/armmachinelearning/v2"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-05-01/examples/OnlineEndpoint/listKeys.json
func ExampleOnlineEndpointsClient_ListKeys() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
client, err := armmachinelearning.NewOnlineEndpointsClient("00000000-1111-2222-3333-444444444444", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
res, err := client.ListKeys(ctx,
"test-rg",
"my-aml-workspace",
"testEndpointName",
nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
// TODO: use response item
_ = res
}
```
Read the [SDK documentation](https://github.com/Azure/azure-sdk-for-go/blob/sdk%2Fresourcemanager%2Fmachinelearning%2Farmmachinelearning%2Fv2.0.0/sdk/resourcemanager/machinelearning/armmachinelearning/README.md) on how to add the SDK to your project and authenticate.

Просмотреть файл

@ -0,0 +1,43 @@
```go
package armmachinelearning_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/machinelearning/armmachinelearning/v2"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-05-01/examples/OnlineEndpoint/regenerateKeys.json
func ExampleOnlineEndpointsClient_BeginRegenerateKeys() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
client, err := armmachinelearning.NewOnlineEndpointsClient("00000000-1111-2222-3333-444444444444", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
poller, err := client.BeginRegenerateKeys(ctx,
"test-rg",
"my-aml-workspace",
"testEndpointName",
armmachinelearning.RegenerateEndpointKeysRequest{
KeyType: to.Ptr(armmachinelearning.KeyTypePrimary),
KeyValue: to.Ptr("string"),
},
nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
_, err = poller.PollUntilDone(ctx, nil)
if err != nil {
log.Fatalf("failed to pull the result: %v", err)
}
}
```
Read the [SDK documentation](https://github.com/Azure/azure-sdk-for-go/blob/sdk%2Fresourcemanager%2Fmachinelearning%2Farmmachinelearning%2Fv2.0.0/sdk/resourcemanager/machinelearning/armmachinelearning/README.md) on how to add the SDK to your project and authenticate.

Просмотреть файл

@ -0,0 +1,50 @@
```go
package armmachinelearning_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/machinelearning/armmachinelearning/v2"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-05-01/examples/OnlineEndpoint/update.json
func ExampleOnlineEndpointsClient_BeginUpdate() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
client, err := armmachinelearning.NewOnlineEndpointsClient("00000000-1111-2222-3333-444444444444", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
poller, err := client.BeginUpdate(ctx,
"test-rg",
"my-aml-workspace",
"testEndpointName",
armmachinelearning.PartialMinimalTrackedResourceWithIdentity{
Tags: map[string]*string{},
Identity: &armmachinelearning.PartialManagedServiceIdentity{
Type: to.Ptr(armmachinelearning.ManagedServiceIdentityTypeSystemAssigned),
UserAssignedIdentities: map[string]interface{}{
"string": map[string]interface{}{},
},
},
},
nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
res, err := poller.PollUntilDone(ctx, nil)
if err != nil {
log.Fatalf("failed to pull the result: %v", err)
}
// TODO: use response item
_ = res
}
```
Read the [SDK documentation](https://github.com/Azure/azure-sdk-for-go/blob/sdk%2Fresourcemanager%2Fmachinelearning%2Farmmachinelearning%2Fv2.0.0/sdk/resourcemanager/machinelearning/armmachinelearning/README.md) on how to add the SDK to your project and authenticate.

Просмотреть файл

@ -0,0 +1,45 @@
```go
package armmachinelearning_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/machinelearning/armmachinelearning/v2"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-05-01/examples/PrivateEndpointConnection/createOrUpdate.json
func ExamplePrivateEndpointConnectionsClient_CreateOrUpdate() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
client, err := armmachinelearning.NewPrivateEndpointConnectionsClient("00000000-1111-2222-3333-444444444444", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
res, err := client.CreateOrUpdate(ctx,
"rg-1234",
"testworkspace",
"{privateEndpointConnectionName}",
armmachinelearning.PrivateEndpointConnection{
Properties: &armmachinelearning.PrivateEndpointConnectionProperties{
PrivateLinkServiceConnectionState: &armmachinelearning.PrivateLinkServiceConnectionState{
Description: to.Ptr("Auto-Approved"),
Status: to.Ptr(armmachinelearning.PrivateEndpointServiceConnectionStatusApproved),
},
},
},
nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
// TODO: use response item
_ = res
}
```
Read the [SDK documentation](https://github.com/Azure/azure-sdk-for-go/blob/sdk%2Fresourcemanager%2Fmachinelearning%2Farmmachinelearning%2Fv2.0.0/sdk/resourcemanager/machinelearning/armmachinelearning/README.md) on how to add the SDK to your project and authenticate.

Просмотреть файл

@ -0,0 +1,34 @@
```go
package armmachinelearning_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/machinelearning/armmachinelearning/v2"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-05-01/examples/PrivateEndpointConnection/delete.json
func ExamplePrivateEndpointConnectionsClient_Delete() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
client, err := armmachinelearning.NewPrivateEndpointConnectionsClient("00000000-1111-2222-3333-444444444444", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
_, err = client.Delete(ctx,
"rg-1234",
"testworkspace",
"{privateEndpointConnectionName}",
nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
}
```
Read the [SDK documentation](https://github.com/Azure/azure-sdk-for-go/blob/sdk%2Fresourcemanager%2Fmachinelearning%2Farmmachinelearning%2Fv2.0.0/sdk/resourcemanager/machinelearning/armmachinelearning/README.md) on how to add the SDK to your project and authenticate.

Просмотреть файл

@ -0,0 +1,36 @@
```go
package armmachinelearning_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/machinelearning/armmachinelearning/v2"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-05-01/examples/PrivateEndpointConnection/get.json
func ExamplePrivateEndpointConnectionsClient_Get() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
client, err := armmachinelearning.NewPrivateEndpointConnectionsClient("00000000-1111-2222-3333-444444444444", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
res, err := client.Get(ctx,
"rg-1234",
"testworkspace",
"{privateEndpointConnectionName}",
nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
// TODO: use response item
_ = res
}
```
Read the [SDK documentation](https://github.com/Azure/azure-sdk-for-go/blob/sdk%2Fresourcemanager%2Fmachinelearning%2Farmmachinelearning%2Fv2.0.0/sdk/resourcemanager/machinelearning/armmachinelearning/README.md) on how to add the SDK to your project and authenticate.

Просмотреть файл

@ -0,0 +1,39 @@
```go
package armmachinelearning_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/machinelearning/armmachinelearning/v2"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-05-01/examples/PrivateEndpointConnection/list.json
func ExamplePrivateEndpointConnectionsClient_NewListPager() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
client, err := armmachinelearning.NewPrivateEndpointConnectionsClient("00000000-1111-2222-3333-444444444444", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
pager := client.NewListPager("rg-1234",
"testworkspace",
nil)
for pager.More() {
nextResult, err := pager.NextPage(ctx)
if err != nil {
log.Fatalf("failed to advance page: %v", err)
}
for _, v := range nextResult.Value {
// TODO: use page item
_ = v
}
}
}
```
Read the [SDK documentation](https://github.com/Azure/azure-sdk-for-go/blob/sdk%2Fresourcemanager%2Fmachinelearning%2Farmmachinelearning%2Fv2.0.0/sdk/resourcemanager/machinelearning/armmachinelearning/README.md) on how to add the SDK to your project and authenticate.

Просмотреть файл

@ -0,0 +1,35 @@
```go
package armmachinelearning_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/machinelearning/armmachinelearning/v2"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-05-01/examples/PrivateLinkResource/list.json
func ExamplePrivateLinkResourcesClient_List() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
client, err := armmachinelearning.NewPrivateLinkResourcesClient("00000000-1111-2222-3333-444444444444", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
res, err := client.List(ctx,
"rg-1234",
"testworkspace",
nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
// TODO: use response item
_ = res
}
```
Read the [SDK documentation](https://github.com/Azure/azure-sdk-for-go/blob/sdk%2Fresourcemanager%2Fmachinelearning%2Farmmachinelearning%2Fv2.0.0/sdk/resourcemanager/machinelearning/armmachinelearning/README.md) on how to add the SDK to your project and authenticate.

Просмотреть файл

@ -0,0 +1,38 @@
```go
package armmachinelearning_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/machinelearning/armmachinelearning/v2"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-05-01/examples/Quota/list.json
func ExampleQuotasClient_NewListPager() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
client, err := armmachinelearning.NewQuotasClient("00000000-0000-0000-0000-000000000000", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
pager := client.NewListPager("eastus",
nil)
for pager.More() {
nextResult, err := pager.NextPage(ctx)
if err != nil {
log.Fatalf("failed to advance page: %v", err)
}
for _, v := range nextResult.Value {
// TODO: use page item
_ = v
}
}
}
```
Read the [SDK documentation](https://github.com/Azure/azure-sdk-for-go/blob/sdk%2Fresourcemanager%2Fmachinelearning%2Farmmachinelearning%2Fv2.0.0/sdk/resourcemanager/machinelearning/armmachinelearning/README.md) on how to add the SDK to your project and authenticate.

Просмотреть файл

@ -0,0 +1,50 @@
```go
package armmachinelearning_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/machinelearning/armmachinelearning/v2"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-05-01/examples/Quota/update.json
func ExampleQuotasClient_Update() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
client, err := armmachinelearning.NewQuotasClient("00000000-0000-0000-0000-000000000000", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
res, err := client.Update(ctx,
"eastus",
armmachinelearning.QuotaUpdateParameters{
Value: []*armmachinelearning.QuotaBaseProperties{
{
Type: to.Ptr("Microsoft.MachineLearningServices/workspaces/quotas"),
ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg/providers/Microsoft.MachineLearningServices/workspaces/demo_workspace1/quotas/Standard_DSv2_Family_Cluster_Dedicated_vCPUs"),
Limit: to.Ptr[int64](100),
Unit: to.Ptr(armmachinelearning.QuotaUnitCount),
},
{
Type: to.Ptr("Microsoft.MachineLearningServices/workspaces/quotas"),
ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg/providers/Microsoft.MachineLearningServices/workspaces/demo_workspace2/quotas/Standard_DSv2_Family_Cluster_Dedicated_vCPUs"),
Limit: to.Ptr[int64](200),
Unit: to.Ptr(armmachinelearning.QuotaUnitCount),
}},
},
nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
// TODO: use response item
_ = res
}
```
Read the [SDK documentation](https://github.com/Azure/azure-sdk-for-go/blob/sdk%2Fresourcemanager%2Fmachinelearning%2Farmmachinelearning%2Fv2.0.0/sdk/resourcemanager/machinelearning/armmachinelearning/README.md) on how to add the SDK to your project and authenticate.

Просмотреть файл

@ -0,0 +1,38 @@
```go
package armmachinelearning_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/machinelearning/armmachinelearning/v2"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-05-01/examples/Usage/list.json
func ExampleUsagesClient_NewListPager() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
client, err := armmachinelearning.NewUsagesClient("00000000-0000-0000-0000-000000000000", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
pager := client.NewListPager("eastus",
nil)
for pager.More() {
nextResult, err := pager.NextPage(ctx)
if err != nil {
log.Fatalf("failed to advance page: %v", err)
}
for _, v := range nextResult.Value {
// TODO: use page item
_ = v
}
}
}
```
Read the [SDK documentation](https://github.com/Azure/azure-sdk-for-go/blob/sdk%2Fresourcemanager%2Fmachinelearning%2Farmmachinelearning%2Fv2.0.0/sdk/resourcemanager/machinelearning/armmachinelearning/README.md) on how to add the SDK to your project and authenticate.

Просмотреть файл

@ -0,0 +1,34 @@
```go
package armmachinelearning_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/machinelearning/armmachinelearning/v2"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-05-01/examples/VirtualMachineSize/list.json
func ExampleVirtualMachineSizesClient_List() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
client, err := armmachinelearning.NewVirtualMachineSizesClient("34adfa4f-cedf-4dc0-ba29-b6d1a69ab345", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
res, err := client.List(ctx,
"eastus",
nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
// TODO: use response item
_ = res
}
```
Read the [SDK documentation](https://github.com/Azure/azure-sdk-for-go/blob/sdk%2Fresourcemanager%2Fmachinelearning%2Farmmachinelearning%2Fv2.0.0/sdk/resourcemanager/machinelearning/armmachinelearning/README.md) on how to add the SDK to your project and authenticate.

Просмотреть файл

@ -0,0 +1,79 @@
```go
package armmachinelearning_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/machinelearning/armmachinelearning/v2"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-05-01/examples/Workspace/create.json
func ExampleWorkspacesClient_BeginCreateOrUpdate() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
client, err := armmachinelearning.NewWorkspacesClient("00000000-1111-2222-3333-444444444444", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
poller, err := client.BeginCreateOrUpdate(ctx,
"workspace-1234",
"testworkspace",
armmachinelearning.Workspace{
Identity: &armmachinelearning.ManagedServiceIdentity{
Type: to.Ptr(armmachinelearning.ManagedServiceIdentityTypeSystemAssignedUserAssigned),
UserAssignedIdentities: map[string]*armmachinelearning.UserAssignedIdentity{
"/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/workspace-1234/providers/Microsoft.ManagedIdentity/userAssignedIdentities/testuai": {},
},
},
Location: to.Ptr("eastus2euap"),
Properties: &armmachinelearning.WorkspaceProperties{
Description: to.Ptr("test description"),
ApplicationInsights: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/workspace-1234/providers/microsoft.insights/components/testinsights"),
ContainerRegistry: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/workspace-1234/providers/Microsoft.ContainerRegistry/registries/testRegistry"),
Encryption: &armmachinelearning.EncryptionProperty{
Identity: &armmachinelearning.IdentityForCmk{
UserAssignedIdentity: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/workspace-1234/providers/Microsoft.ManagedIdentity/userAssignedIdentities/testuai"),
},
KeyVaultProperties: &armmachinelearning.EncryptionKeyVaultProperties{
IdentityClientID: to.Ptr(""),
KeyIdentifier: to.Ptr("https://testkv.vault.azure.net/keys/testkey/aabbccddee112233445566778899aabb"),
KeyVaultArmID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/workspace-1234/providers/Microsoft.KeyVault/vaults/testkv"),
},
Status: to.Ptr(armmachinelearning.EncryptionStatusEnabled),
},
FriendlyName: to.Ptr("HelloName"),
HbiWorkspace: to.Ptr(false),
KeyVault: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/workspace-1234/providers/Microsoft.KeyVault/vaults/testkv"),
SharedPrivateLinkResources: []*armmachinelearning.SharedPrivateLinkResource{
{
Name: to.Ptr("testdbresource"),
Properties: &armmachinelearning.SharedPrivateLinkResourceProperty{
GroupID: to.Ptr("Sql"),
PrivateLinkResourceID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/workspace-1234/providers/Microsoft.DocumentDB/databaseAccounts/testdbresource/privateLinkResources/Sql"),
RequestMessage: to.Ptr("Please approve"),
Status: to.Ptr(armmachinelearning.PrivateEndpointServiceConnectionStatusApproved),
},
}},
StorageAccount: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/accountcrud-1234/providers/Microsoft.Storage/storageAccounts/testStorageAccount"),
},
},
nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
res, err := poller.PollUntilDone(ctx, nil)
if err != nil {
log.Fatalf("failed to pull the result: %v", err)
}
// TODO: use response item
_ = res
}
```
Read the [SDK documentation](https://github.com/Azure/azure-sdk-for-go/blob/sdk%2Fresourcemanager%2Fmachinelearning%2Farmmachinelearning%2Fv2.0.0/sdk/resourcemanager/machinelearning/armmachinelearning/README.md) on how to add the SDK to your project and authenticate.

Просмотреть файл

@ -0,0 +1,37 @@
```go
package armmachinelearning_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/machinelearning/armmachinelearning/v2"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-05-01/examples/Workspace/delete.json
func ExampleWorkspacesClient_BeginDelete() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
client, err := armmachinelearning.NewWorkspacesClient("00000000-1111-2222-3333-444444444444", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
poller, err := client.BeginDelete(ctx,
"workspace-1234",
"testworkspace",
nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
_, err = poller.PollUntilDone(ctx, nil)
if err != nil {
log.Fatalf("failed to pull the result: %v", err)
}
}
```
Read the [SDK documentation](https://github.com/Azure/azure-sdk-for-go/blob/sdk%2Fresourcemanager%2Fmachinelearning%2Farmmachinelearning%2Fv2.0.0/sdk/resourcemanager/machinelearning/armmachinelearning/README.md) on how to add the SDK to your project and authenticate.

Просмотреть файл

@ -0,0 +1,52 @@
```go
package armmachinelearning_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/machinelearning/armmachinelearning/v2"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-05-01/examples/Workspace/diagnose.json
func ExampleWorkspacesClient_BeginDiagnose() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
client, err := armmachinelearning.NewWorkspacesClient("00000000-1111-2222-3333-444444444444", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
poller, err := client.BeginDiagnose(ctx,
"workspace-1234",
"testworkspace",
&armmachinelearning.WorkspacesClientBeginDiagnoseOptions{Parameters: &armmachinelearning.DiagnoseWorkspaceParameters{
Value: &armmachinelearning.DiagnoseRequestProperties{
ApplicationInsights: map[string]interface{}{},
ContainerRegistry: map[string]interface{}{},
DNSResolution: map[string]interface{}{},
KeyVault: map[string]interface{}{},
Nsg: map[string]interface{}{},
Others: map[string]interface{}{},
ResourceLock: map[string]interface{}{},
StorageAccount: map[string]interface{}{},
Udr: map[string]interface{}{},
},
},
})
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
res, err := poller.PollUntilDone(ctx, nil)
if err != nil {
log.Fatalf("failed to pull the result: %v", err)
}
// TODO: use response item
_ = res
}
```
Read the [SDK documentation](https://github.com/Azure/azure-sdk-for-go/blob/sdk%2Fresourcemanager%2Fmachinelearning%2Farmmachinelearning%2Fv2.0.0/sdk/resourcemanager/machinelearning/armmachinelearning/README.md) on how to add the SDK to your project and authenticate.

Некоторые файлы не были показаны из-за слишком большого количества измененных файлов Показать больше