-
Notifications
You must be signed in to change notification settings - Fork 13
/
get.go
111 lines (108 loc) · 4.4 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
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/SweepJob/get.json
func ExampleJobsClient_Get_getSweepJob() {
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.SweepJob{
// 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"),
// JobType: to.Ptr(armmachinelearning.JobTypeSweep),
// 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),
// EarlyTermination: &armmachinelearning.MedianStoppingPolicy{
// DelayEvaluation: to.Ptr[int32](1),
// EvaluationInterval: to.Ptr[int32](1),
// PolicyType: to.Ptr(armmachinelearning.EarlyTerminationPolicyTypeMedianStopping),
// },
// Limits: &armmachinelearning.SweepJobLimits{
// JobLimitsType: to.Ptr(armmachinelearning.JobLimitsTypeSweep),
// MaxConcurrentTrials: to.Ptr[int32](1),
// MaxTotalTrials: to.Ptr[int32](1),
// TrialTimeout: to.Ptr("PT1S"),
// },
// Objective: &armmachinelearning.Objective{
// Goal: to.Ptr(armmachinelearning.GoalMinimize),
// PrimaryMetric: to.Ptr("string"),
// },
// SamplingAlgorithm: &armmachinelearning.GridSamplingAlgorithm{
// SamplingAlgorithmType: to.Ptr(armmachinelearning.SamplingAlgorithmTypeGrid),
// },
// SearchSpace: map[string]any{
// "string":map[string]any{
// },
// },
// Trial: &armmachinelearning.TrialComponent{
// CodeID: to.Ptr("string"),
// Command: to.Ptr("string"),
// Distribution: &armmachinelearning.Mpi{
// DistributionType: to.Ptr(armmachinelearning.DistributionTypeMpi),
// ProcessCountPerInstance: to.Ptr[int32](1),
// },
// EnvironmentID: to.Ptr("string"),
// EnvironmentVariables: map[string]*string{
// "string": to.Ptr("string"),
// },
// Resources: &armmachinelearning.JobResourceConfiguration{
// InstanceCount: to.Ptr[int32](1),
// InstanceType: to.Ptr("string"),
// Properties: map[string]any{
// "string": map[string]any{
// "e6b6493e-7d5e-4db3-be1e-306ec641327e": nil,
// },
// },
// },
// },
// },
// }
}