-
Notifications
You must be signed in to change notification settings - Fork 13
/
get.go
113 lines (110 loc) · 4.49 KB
/
get.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
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/v3"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/aafb0944f7ab936e8cfbad8969bd5eb32263fb4f/specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/Job/CommandJob/get.json
func ExampleJobsClient_Get_getCommandJob() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armmachinelearning.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
res, err := clientFactory.NewJobsClient().Get(ctx, "test-rg", "my-aml-workspace", "string", nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
// You could use response here. We use blank identifier for just demo purposes.
_ = res
// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// res.JobBase = armmachinelearning.JobBase{
// Name: to.Ptr("string"),
// Type: to.Ptr("string"),
// ID: to.Ptr("string"),
// SystemData: &armmachinelearning.SystemData{
// CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-01T12:34:56.999Z"); return t}()),
// CreatedBy: to.Ptr("string"),
// CreatedByType: to.Ptr(armmachinelearning.CreatedByTypeUser),
// LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-01T12:34:56.999Z"); return t}()),
// LastModifiedBy: to.Ptr("string"),
// LastModifiedByType: to.Ptr(armmachinelearning.CreatedByTypeUser),
// },
// 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": &armmachinelearning.JobService{
// Endpoint: to.Ptr("string"),
// ErrorMessage: to.Ptr("string"),
// JobServiceType: to.Ptr("string"),
// Port: to.Ptr[int32](1),
// Properties: map[string]*string{
// "string": to.Ptr("string"),
// },
// Status: to.Ptr("string"),
// },
// },
// Status: to.Ptr(armmachinelearning.JobStatusNotStarted),
// 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),
// },
// },
// Parameters: map[string]any{
// "string": "string",
// },
// Resources: &armmachinelearning.JobResourceConfiguration{
// InstanceCount: to.Ptr[int32](1),
// InstanceType: to.Ptr("string"),
// Properties: map[string]any{
// "string": map[string]any{
// "8385cf05-78c0-41ef-b31d-36796a678e19": nil,
// },
// },
// },
// },
// }
}