-
Notifications
You must be signed in to change notification settings - Fork 50
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
hc-github-team-tf-azure
committed
Oct 20, 2023
1 parent
7163e42
commit 8197fde
Showing
1,191 changed files
with
95,194 additions
and
0 deletions.
There are no files selected for viewing
99 changes: 99 additions & 0 deletions
99
resource-manager/machinelearningservices/2023-10-01/batchdeployment/README.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,99 @@ | ||
|
||
## `github.com/hashicorp/go-azure-sdk/resource-manager/machinelearningservices/2023-10-01/batchdeployment` Documentation | ||
|
||
The `batchdeployment` SDK allows for interaction with the Azure Resource Manager Service `machinelearningservices` (API Version `2023-10-01`). | ||
|
||
This readme covers example usages, but further information on [using this SDK can be found in the project root](https://github.com/hashicorp/go-azure-sdk/tree/main/docs). | ||
|
||
### Import Path | ||
|
||
```go | ||
import "github.com/hashicorp/go-azure-sdk/resource-manager/machinelearningservices/2023-10-01/batchdeployment" | ||
``` | ||
|
||
|
||
### Client Initialization | ||
|
||
```go | ||
client := batchdeployment.NewBatchDeploymentClientWithBaseURI("https://management.azure.com") | ||
client.Client.Authorizer = authorizer | ||
``` | ||
|
||
|
||
### Example Usage: `BatchDeploymentClient.CreateOrUpdate` | ||
|
||
```go | ||
ctx := context.TODO() | ||
id := batchdeployment.NewDeploymentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue", "batchEndpointValue", "deploymentValue") | ||
|
||
payload := batchdeployment.BatchDeploymentTrackedResource{ | ||
// ... | ||
} | ||
|
||
|
||
if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { | ||
// handle the error | ||
} | ||
``` | ||
|
||
|
||
### Example Usage: `BatchDeploymentClient.Delete` | ||
|
||
```go | ||
ctx := context.TODO() | ||
id := batchdeployment.NewDeploymentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue", "batchEndpointValue", "deploymentValue") | ||
|
||
if err := client.DeleteThenPoll(ctx, id); err != nil { | ||
// handle the error | ||
} | ||
``` | ||
|
||
|
||
### Example Usage: `BatchDeploymentClient.Get` | ||
|
||
```go | ||
ctx := context.TODO() | ||
id := batchdeployment.NewDeploymentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue", "batchEndpointValue", "deploymentValue") | ||
|
||
read, err := client.Get(ctx, id) | ||
if err != nil { | ||
// handle the error | ||
} | ||
if model := read.Model; model != nil { | ||
// do something with the model/response object | ||
} | ||
``` | ||
|
||
|
||
### Example Usage: `BatchDeploymentClient.List` | ||
|
||
```go | ||
ctx := context.TODO() | ||
id := batchdeployment.NewBatchEndpointID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue", "batchEndpointValue") | ||
|
||
// alternatively `client.List(ctx, id, batchdeployment.DefaultListOperationOptions())` can be used to do batched pagination | ||
items, err := client.ListComplete(ctx, id, batchdeployment.DefaultListOperationOptions()) | ||
if err != nil { | ||
// handle the error | ||
} | ||
for _, item := range items { | ||
// do something | ||
} | ||
``` | ||
|
||
|
||
### Example Usage: `BatchDeploymentClient.Update` | ||
|
||
```go | ||
ctx := context.TODO() | ||
id := batchdeployment.NewDeploymentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue", "batchEndpointValue", "deploymentValue") | ||
|
||
payload := batchdeployment.PartialBatchDeploymentPartialMinimalTrackedResourceWithProperties{ | ||
// ... | ||
} | ||
|
||
|
||
if err := client.UpdateThenPoll(ctx, id, payload); err != nil { | ||
// handle the error | ||
} | ||
``` |
26 changes: 26 additions & 0 deletions
26
resource-manager/machinelearningservices/2023-10-01/batchdeployment/client.go
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
package batchdeployment | ||
|
||
import ( | ||
"fmt" | ||
|
||
"github.com/hashicorp/go-azure-sdk/sdk/client/resourcemanager" | ||
sdkEnv "github.com/hashicorp/go-azure-sdk/sdk/environments" | ||
) | ||
|
||
// Copyright (c) Microsoft Corporation. All rights reserved. | ||
// Licensed under the MIT License. See NOTICE.txt in the project root for license information. | ||
|
||
type BatchDeploymentClient struct { | ||
Client *resourcemanager.Client | ||
} | ||
|
||
func NewBatchDeploymentClientWithBaseURI(sdkApi sdkEnv.Api) (*BatchDeploymentClient, error) { | ||
client, err := resourcemanager.NewResourceManagerClient(sdkApi, "batchdeployment", defaultApiVersion) | ||
if err != nil { | ||
return nil, fmt.Errorf("instantiating BatchDeploymentClient: %+v", err) | ||
} | ||
|
||
return &BatchDeploymentClient{ | ||
Client: client, | ||
}, nil | ||
} |
242 changes: 242 additions & 0 deletions
242
resource-manager/machinelearningservices/2023-10-01/batchdeployment/constants.go
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,242 @@ | ||
package batchdeployment | ||
|
||
import ( | ||
"encoding/json" | ||
"fmt" | ||
"strings" | ||
) | ||
|
||
// Copyright (c) Microsoft Corporation. All rights reserved. | ||
// Licensed under the MIT License. See NOTICE.txt in the project root for license information. | ||
|
||
type BatchLoggingLevel string | ||
|
||
const ( | ||
BatchLoggingLevelDebug BatchLoggingLevel = "Debug" | ||
BatchLoggingLevelInfo BatchLoggingLevel = "Info" | ||
BatchLoggingLevelWarning BatchLoggingLevel = "Warning" | ||
) | ||
|
||
func PossibleValuesForBatchLoggingLevel() []string { | ||
return []string{ | ||
string(BatchLoggingLevelDebug), | ||
string(BatchLoggingLevelInfo), | ||
string(BatchLoggingLevelWarning), | ||
} | ||
} | ||
|
||
func (s *BatchLoggingLevel) UnmarshalJSON(bytes []byte) error { | ||
var decoded string | ||
if err := json.Unmarshal(bytes, &decoded); err != nil { | ||
return fmt.Errorf("unmarshaling: %+v", err) | ||
} | ||
out, err := parseBatchLoggingLevel(decoded) | ||
if err != nil { | ||
return fmt.Errorf("parsing %q: %+v", decoded, err) | ||
} | ||
*s = *out | ||
return nil | ||
} | ||
|
||
func parseBatchLoggingLevel(input string) (*BatchLoggingLevel, error) { | ||
vals := map[string]BatchLoggingLevel{ | ||
"debug": BatchLoggingLevelDebug, | ||
"info": BatchLoggingLevelInfo, | ||
"warning": BatchLoggingLevelWarning, | ||
} | ||
if v, ok := vals[strings.ToLower(input)]; ok { | ||
return &v, nil | ||
} | ||
|
||
// otherwise presume it's an undefined value and best-effort it | ||
out := BatchLoggingLevel(input) | ||
return &out, nil | ||
} | ||
|
||
type BatchOutputAction string | ||
|
||
const ( | ||
BatchOutputActionAppendRow BatchOutputAction = "AppendRow" | ||
BatchOutputActionSummaryOnly BatchOutputAction = "SummaryOnly" | ||
) | ||
|
||
func PossibleValuesForBatchOutputAction() []string { | ||
return []string{ | ||
string(BatchOutputActionAppendRow), | ||
string(BatchOutputActionSummaryOnly), | ||
} | ||
} | ||
|
||
func (s *BatchOutputAction) UnmarshalJSON(bytes []byte) error { | ||
var decoded string | ||
if err := json.Unmarshal(bytes, &decoded); err != nil { | ||
return fmt.Errorf("unmarshaling: %+v", err) | ||
} | ||
out, err := parseBatchOutputAction(decoded) | ||
if err != nil { | ||
return fmt.Errorf("parsing %q: %+v", decoded, err) | ||
} | ||
*s = *out | ||
return nil | ||
} | ||
|
||
func parseBatchOutputAction(input string) (*BatchOutputAction, error) { | ||
vals := map[string]BatchOutputAction{ | ||
"appendrow": BatchOutputActionAppendRow, | ||
"summaryonly": BatchOutputActionSummaryOnly, | ||
} | ||
if v, ok := vals[strings.ToLower(input)]; ok { | ||
return &v, nil | ||
} | ||
|
||
// otherwise presume it's an undefined value and best-effort it | ||
out := BatchOutputAction(input) | ||
return &out, nil | ||
} | ||
|
||
type DeploymentProvisioningState string | ||
|
||
const ( | ||
DeploymentProvisioningStateCanceled DeploymentProvisioningState = "Canceled" | ||
DeploymentProvisioningStateCreating DeploymentProvisioningState = "Creating" | ||
DeploymentProvisioningStateDeleting DeploymentProvisioningState = "Deleting" | ||
DeploymentProvisioningStateFailed DeploymentProvisioningState = "Failed" | ||
DeploymentProvisioningStateScaling DeploymentProvisioningState = "Scaling" | ||
DeploymentProvisioningStateSucceeded DeploymentProvisioningState = "Succeeded" | ||
DeploymentProvisioningStateUpdating DeploymentProvisioningState = "Updating" | ||
) | ||
|
||
func PossibleValuesForDeploymentProvisioningState() []string { | ||
return []string{ | ||
string(DeploymentProvisioningStateCanceled), | ||
string(DeploymentProvisioningStateCreating), | ||
string(DeploymentProvisioningStateDeleting), | ||
string(DeploymentProvisioningStateFailed), | ||
string(DeploymentProvisioningStateScaling), | ||
string(DeploymentProvisioningStateSucceeded), | ||
string(DeploymentProvisioningStateUpdating), | ||
} | ||
} | ||
|
||
func (s *DeploymentProvisioningState) UnmarshalJSON(bytes []byte) error { | ||
var decoded string | ||
if err := json.Unmarshal(bytes, &decoded); err != nil { | ||
return fmt.Errorf("unmarshaling: %+v", err) | ||
} | ||
out, err := parseDeploymentProvisioningState(decoded) | ||
if err != nil { | ||
return fmt.Errorf("parsing %q: %+v", decoded, err) | ||
} | ||
*s = *out | ||
return nil | ||
} | ||
|
||
func parseDeploymentProvisioningState(input string) (*DeploymentProvisioningState, error) { | ||
vals := map[string]DeploymentProvisioningState{ | ||
"canceled": DeploymentProvisioningStateCanceled, | ||
"creating": DeploymentProvisioningStateCreating, | ||
"deleting": DeploymentProvisioningStateDeleting, | ||
"failed": DeploymentProvisioningStateFailed, | ||
"scaling": DeploymentProvisioningStateScaling, | ||
"succeeded": DeploymentProvisioningStateSucceeded, | ||
"updating": DeploymentProvisioningStateUpdating, | ||
} | ||
if v, ok := vals[strings.ToLower(input)]; ok { | ||
return &v, nil | ||
} | ||
|
||
// otherwise presume it's an undefined value and best-effort it | ||
out := DeploymentProvisioningState(input) | ||
return &out, nil | ||
} | ||
|
||
type ReferenceType string | ||
|
||
const ( | ||
ReferenceTypeDataPath ReferenceType = "DataPath" | ||
ReferenceTypeId ReferenceType = "Id" | ||
ReferenceTypeOutputPath ReferenceType = "OutputPath" | ||
) | ||
|
||
func PossibleValuesForReferenceType() []string { | ||
return []string{ | ||
string(ReferenceTypeDataPath), | ||
string(ReferenceTypeId), | ||
string(ReferenceTypeOutputPath), | ||
} | ||
} | ||
|
||
func (s *ReferenceType) UnmarshalJSON(bytes []byte) error { | ||
var decoded string | ||
if err := json.Unmarshal(bytes, &decoded); err != nil { | ||
return fmt.Errorf("unmarshaling: %+v", err) | ||
} | ||
out, err := parseReferenceType(decoded) | ||
if err != nil { | ||
return fmt.Errorf("parsing %q: %+v", decoded, err) | ||
} | ||
*s = *out | ||
return nil | ||
} | ||
|
||
func parseReferenceType(input string) (*ReferenceType, error) { | ||
vals := map[string]ReferenceType{ | ||
"datapath": ReferenceTypeDataPath, | ||
"id": ReferenceTypeId, | ||
"outputpath": ReferenceTypeOutputPath, | ||
} | ||
if v, ok := vals[strings.ToLower(input)]; ok { | ||
return &v, nil | ||
} | ||
|
||
// otherwise presume it's an undefined value and best-effort it | ||
out := ReferenceType(input) | ||
return &out, nil | ||
} | ||
|
||
type SkuTier string | ||
|
||
const ( | ||
SkuTierBasic SkuTier = "Basic" | ||
SkuTierFree SkuTier = "Free" | ||
SkuTierPremium SkuTier = "Premium" | ||
SkuTierStandard SkuTier = "Standard" | ||
) | ||
|
||
func PossibleValuesForSkuTier() []string { | ||
return []string{ | ||
string(SkuTierBasic), | ||
string(SkuTierFree), | ||
string(SkuTierPremium), | ||
string(SkuTierStandard), | ||
} | ||
} | ||
|
||
func (s *SkuTier) UnmarshalJSON(bytes []byte) error { | ||
var decoded string | ||
if err := json.Unmarshal(bytes, &decoded); err != nil { | ||
return fmt.Errorf("unmarshaling: %+v", err) | ||
} | ||
out, err := parseSkuTier(decoded) | ||
if err != nil { | ||
return fmt.Errorf("parsing %q: %+v", decoded, err) | ||
} | ||
*s = *out | ||
return nil | ||
} | ||
|
||
func parseSkuTier(input string) (*SkuTier, error) { | ||
vals := map[string]SkuTier{ | ||
"basic": SkuTierBasic, | ||
"free": SkuTierFree, | ||
"premium": SkuTierPremium, | ||
"standard": SkuTierStandard, | ||
} | ||
if v, ok := vals[strings.ToLower(input)]; ok { | ||
return &v, nil | ||
} | ||
|
||
// otherwise presume it's an undefined value and best-effort it | ||
out := SkuTier(input) | ||
return &out, nil | ||
} |
Oops, something went wrong.