-
Notifications
You must be signed in to change notification settings - Fork 11
/
SapLandscapeMonitor_List.go
108 lines (105 loc) · 4.84 KB
/
SapLandscapeMonitor_List.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
package armworkloads_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/workloads/armworkloads"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/630ec444f8dd7c09b9cdd5fa99951f8a0d1ad41f/specification/workloads/resource-manager/Microsoft.Workloads/preview/2022-11-01-preview/examples/workloadmonitor/SapLandscapeMonitor_List.json
func ExampleSapLandscapeMonitorClient_List() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
client, err := armworkloads.NewSapLandscapeMonitorClient("00000000-0000-0000-0000-000000000000", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
res, err := client.List(ctx, "myResourceGroup", "mySapMonitor", 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.SapLandscapeMonitorListResult = armworkloads.SapLandscapeMonitorListResult{
// Value: []*armworkloads.SapLandscapeMonitor{
// {
// Name: to.Ptr("default"),
// Type: to.Ptr("Microsoft.Workloads/monitors/sapLandscapeMonitor"),
// ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.Workloads/monitors/myMonitor/sapLandscapeMonitor/default"),
// SystemData: &armworkloads.SystemData{
// CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-19T15:10:46.196Z"); return t}()),
// CreatedBy: to.Ptr("user@xyz.com"),
// CreatedByType: to.Ptr(armworkloads.CreatedByTypeUser),
// LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-19T15:10:46.196Z"); return t}()),
// LastModifiedBy: to.Ptr("user@xyz.com"),
// LastModifiedByType: to.Ptr(armworkloads.CreatedByTypeUser),
// },
// Properties: &armworkloads.SapLandscapeMonitorProperties{
// Grouping: &armworkloads.SapLandscapeMonitorPropertiesGrouping{
// Landscape: []*armworkloads.SapLandscapeMonitorSidMapping{
// {
// Name: to.Ptr("Prod"),
// TopSid: []*string{
// to.Ptr("SID1"),
// to.Ptr("SID2")},
// }},
// SapApplication: []*armworkloads.SapLandscapeMonitorSidMapping{
// {
// Name: to.Ptr("ERP1"),
// TopSid: []*string{
// to.Ptr("SID1"),
// to.Ptr("SID2")},
// }},
// },
// TopMetricsThresholds: []*armworkloads.SapLandscapeMonitorMetricThresholds{
// {
// Name: to.Ptr("Instance Availability"),
// Green: to.Ptr[float32](90),
// Red: to.Ptr[float32](50),
// Yellow: to.Ptr[float32](75),
// }},
// },
// },
// {
// Name: to.Ptr("default"),
// Type: to.Ptr("Microsoft.Workloads/monitors/sapLandscapeMonitor"),
// ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.Workloads/monitors/myMonitor/sapLandscapeMonitor/default"),
// SystemData: &armworkloads.SystemData{
// CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-19T15:10:46.196Z"); return t}()),
// CreatedBy: to.Ptr("user@xyz.com"),
// CreatedByType: to.Ptr(armworkloads.CreatedByTypeUser),
// LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-19T15:10:46.196Z"); return t}()),
// LastModifiedBy: to.Ptr("user@xyz.com"),
// LastModifiedByType: to.Ptr(armworkloads.CreatedByTypeUser),
// },
// Properties: &armworkloads.SapLandscapeMonitorProperties{
// Grouping: &armworkloads.SapLandscapeMonitorPropertiesGrouping{
// Landscape: []*armworkloads.SapLandscapeMonitorSidMapping{
// {
// Name: to.Ptr("Prod"),
// TopSid: []*string{
// to.Ptr("SID1"),
// to.Ptr("SID2")},
// }},
// SapApplication: []*armworkloads.SapLandscapeMonitorSidMapping{
// {
// Name: to.Ptr("ERP1"),
// TopSid: []*string{
// to.Ptr("SID1"),
// to.Ptr("SID2")},
// }},
// },
// TopMetricsThresholds: []*armworkloads.SapLandscapeMonitorMetricThresholds{
// {
// Name: to.Ptr("Instance Availability"),
// Green: to.Ptr[float32](90),
// Red: to.Ptr[float32](50),
// Yellow: to.Ptr[float32](75),
// }},
// },
// }},
// }
}