-
Notifications
You must be signed in to change notification settings - Fork 12
/
OperationList.go
198 lines (195 loc) · 8.02 KB
/
OperationList.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
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
package armpostgresql_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/postgresql/armpostgresql"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2017-12-01/examples/OperationList.json
func ExampleOperationsClient_List() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armpostgresql.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
res, err := clientFactory.NewOperationsClient().List(ctx, 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.OperationListResult = armpostgresql.OperationListResult{
// Value: []*armpostgresql.Operation{
// {
// Name: to.Ptr("Microsoft.DBforPostgreSQL/locations/performanceTiers/read"),
// Display: &armpostgresql.OperationDisplay{
// Description: to.Ptr("Returns the list of Performance Tiers available."),
// Operation: to.Ptr("List Performance Tiers"),
// Provider: to.Ptr("Microsoft DB for PostgreSQL"),
// Resource: to.Ptr("Performance Tiers"),
// },
// },
// {
// Name: to.Ptr("Microsoft.DBforPostgreSQL/servers/read"),
// Display: &armpostgresql.OperationDisplay{
// Description: to.Ptr("Return the list of servers or gets the properties for the specified server."),
// Operation: to.Ptr("List/Get PostgreSQL Servers"),
// Provider: to.Ptr("Microsoft DB for PostgreSQL"),
// Resource: to.Ptr("PostgreSQL Server"),
// },
// },
// {
// Name: to.Ptr("Microsoft.DBforPostgreSQL/servers/write"),
// Display: &armpostgresql.OperationDisplay{
// Description: to.Ptr("Creates a server with the specified parameters or update the properties or tags for the specified server."),
// Operation: to.Ptr("Create/Update PostgreSQL Server"),
// Provider: to.Ptr("Microsoft DB for PostgreSQL"),
// Resource: to.Ptr("PostgreSQL Server"),
// },
// },
// {
// Name: to.Ptr("Microsoft.DBforPostgreSQL/servers/delete"),
// Display: &armpostgresql.OperationDisplay{
// Description: to.Ptr("Deletes an existing server."),
// Operation: to.Ptr("Delete PostgreSQL Server"),
// Provider: to.Ptr("Microsoft DB for PostgreSQL"),
// Resource: to.Ptr("PostgreSQL Server"),
// },
// },
// {
// Name: to.Ptr("Microsoft.DBforPostgreSQL/performanceTiers/read"),
// Display: &armpostgresql.OperationDisplay{
// Description: to.Ptr("Returns the list of Performance Tiers available."),
// Operation: to.Ptr("List Performance Tiers"),
// Provider: to.Ptr("Microsoft DB for PostgreSQL"),
// Resource: to.Ptr("Performance Tiers"),
// },
// },
// {
// Name: to.Ptr("Microsoft.DBforPostgreSQL/servers/firewallRules/read"),
// Display: &armpostgresql.OperationDisplay{
// Description: to.Ptr("Return the list of firewall rules for a server or gets the properties for the specified firewall rule."),
// Operation: to.Ptr("List/Get Firewall Rules"),
// Provider: to.Ptr("Microsoft DB for PostgreSQL"),
// Resource: to.Ptr("Firewall Rules"),
// },
// },
// {
// Name: to.Ptr("Microsoft.DBforPostgreSQL/servers/firewallRules/write"),
// Display: &armpostgresql.OperationDisplay{
// Description: to.Ptr("Creates a firewall rule with the specified parameters or update an existing rule."),
// Operation: to.Ptr("Create/Update Firewall Rule"),
// Provider: to.Ptr("Microsoft DB for PostgreSQL"),
// Resource: to.Ptr("Firewall Rules"),
// },
// },
// {
// Name: to.Ptr("Microsoft.DBforPostgreSQL/servers/firewallRules/delete"),
// Display: &armpostgresql.OperationDisplay{
// Description: to.Ptr("Deletes an existing firewall rule."),
// Operation: to.Ptr("Delete Firewall Rule"),
// Provider: to.Ptr("Microsoft DB for PostgreSQL"),
// Resource: to.Ptr("Firewall Rules"),
// },
// },
// {
// Name: to.Ptr("Microsoft.DBforPostgreSQL/servers/providers/Microsoft.Insights/metricDefinitions/read"),
// Display: &armpostgresql.OperationDisplay{
// Description: to.Ptr("Return types of metrics that are available for databases"),
// Operation: to.Ptr("Get database metric definitions"),
// Provider: to.Ptr("Microsoft DB for PostgreSQL"),
// Resource: to.Ptr("Database Metric Definition"),
// },
// Properties: map[string]any{
// "serviceSpecification": map[string]any{
// "metricSpecifications":[]any{
// map[string]any{
// "name": "cpu_percent",
// "aggregationType": "Average",
// "displayDescription": "CPU percent",
// "displayName": "CPU percent",
// "fillGapWithZero": true,
// "unit": "Percent",
// },
// map[string]any{
// "name": "memory_percent",
// "aggregationType": "Average",
// "displayDescription": "Memory percent",
// "displayName": "Memory percent",
// "fillGapWithZero": true,
// "unit": "Percent",
// },
// map[string]any{
// "name": "io_consumption_percent",
// "aggregationType": "Average",
// "displayDescription": "IO percent",
// "displayName": "IO percent",
// "fillGapWithZero": true,
// "unit": "Percent",
// },
// map[string]any{
// "name": "storage_percent",
// "aggregationType": "Average",
// "displayDescription": "Storage percentage",
// "displayName": "Storage percentage",
// "unit": "Percent",
// },
// map[string]any{
// "name": "storage_used",
// "aggregationType": "Average",
// "displayDescription": "Storage used",
// "displayName": "Storage used",
// "unit": "Bytes",
// },
// map[string]any{
// "name": "storage_limit",
// "aggregationType": "Average",
// "displayDescription": "Storage limit",
// "displayName": "Storage limit",
// "unit": "Bytes",
// },
// map[string]any{
// "name": "active_connections",
// "aggregationType": "Average",
// "displayDescription": "Total active connections",
// "displayName": "Total active connections",
// "fillGapWithZero": true,
// "unit": "Count",
// },
// map[string]any{
// "name": "connections_failed",
// "aggregationType": "Average",
// "displayDescription": "Total failed connections",
// "displayName": "Total failed connections",
// "fillGapWithZero": true,
// "unit": "Count",
// },
// },
// },
// },
// },
// {
// Name: to.Ptr("Microsoft.DBforPostgreSQL/servers/providers/Microsoft.Insights/diagnosticSettings/read"),
// Display: &armpostgresql.OperationDisplay{
// Description: to.Ptr("Gets the disagnostic setting for the resource"),
// Operation: to.Ptr("Read diagnostic setting"),
// Provider: to.Ptr("Microsoft DB for PostgreSQL"),
// Resource: to.Ptr("Database Metric Definition"),
// },
// },
// {
// Name: to.Ptr("Microsoft.DBforPostgreSQL/servers/providers/Microsoft.Insights/diagnosticSettings/write"),
// Display: &armpostgresql.OperationDisplay{
// Description: to.Ptr("Creates or updates the diagnostic setting for the resource"),
// Operation: to.Ptr("Write diagnostic setting"),
// Provider: to.Ptr("Microsoft DB for PostgreSQL"),
// Resource: to.Ptr("Database Metric Definition"),
// },
// }},
// }
}