...
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17 package monitoring_test
18
19 import (
20 "context"
21
22 monitoring "cloud.google.com/go/monitoring/apiv3"
23 "cloud.google.com/go/monitoring/apiv3/v2/monitoringpb"
24 "google.golang.org/api/iterator"
25 )
26
27 func ExampleNewServiceMonitoringClient() {
28 ctx := context.Background()
29 c, err := monitoring.NewServiceMonitoringClient(ctx)
30 if err != nil {
31
32 }
33
34 _ = c
35 }
36
37 func ExampleServiceMonitoringClient_CreateService() {
38
39
40 ctx := context.Background()
41 c, err := monitoring.NewServiceMonitoringClient(ctx)
42 if err != nil {
43
44 }
45
46 req := &monitoringpb.CreateServiceRequest{
47
48 }
49 resp, err := c.CreateService(ctx, req)
50 if err != nil {
51
52 }
53
54 _ = resp
55 }
56
57 func ExampleServiceMonitoringClient_GetService() {
58
59
60 ctx := context.Background()
61 c, err := monitoring.NewServiceMonitoringClient(ctx)
62 if err != nil {
63
64 }
65
66 req := &monitoringpb.GetServiceRequest{
67
68 }
69 resp, err := c.GetService(ctx, req)
70 if err != nil {
71
72 }
73
74 _ = resp
75 }
76
77 func ExampleServiceMonitoringClient_ListServices() {
78
79
80
81 ctx := context.Background()
82 c, err := monitoring.NewServiceMonitoringClient(ctx)
83 if err != nil {
84
85 }
86
87 req := &monitoringpb.ListServicesRequest{
88
89 }
90 it := c.ListServices(ctx, req)
91 for {
92 resp, err := it.Next()
93 if err == iterator.Done {
94 break
95 }
96 if err != nil {
97
98 }
99
100 _ = resp
101 }
102 }
103
104 func ExampleServiceMonitoringClient_UpdateService() {
105
106
107 ctx := context.Background()
108 c, err := monitoring.NewServiceMonitoringClient(ctx)
109 if err != nil {
110
111 }
112
113 req := &monitoringpb.UpdateServiceRequest{
114
115 }
116 resp, err := c.UpdateService(ctx, req)
117 if err != nil {
118
119 }
120
121 _ = resp
122 }
123
124 func ExampleServiceMonitoringClient_DeleteService() {
125 ctx := context.Background()
126 c, err := monitoring.NewServiceMonitoringClient(ctx)
127 if err != nil {
128
129 }
130
131 req := &monitoringpb.DeleteServiceRequest{
132
133 }
134 err = c.DeleteService(ctx, req)
135 if err != nil {
136
137 }
138 }
139
140 func ExampleServiceMonitoringClient_CreateServiceLevelObjective() {
141
142
143 ctx := context.Background()
144 c, err := monitoring.NewServiceMonitoringClient(ctx)
145 if err != nil {
146
147 }
148
149 req := &monitoringpb.CreateServiceLevelObjectiveRequest{
150
151 }
152 resp, err := c.CreateServiceLevelObjective(ctx, req)
153 if err != nil {
154
155 }
156
157 _ = resp
158 }
159
160 func ExampleServiceMonitoringClient_GetServiceLevelObjective() {
161
162
163 ctx := context.Background()
164 c, err := monitoring.NewServiceMonitoringClient(ctx)
165 if err != nil {
166
167 }
168
169 req := &monitoringpb.GetServiceLevelObjectiveRequest{
170
171 }
172 resp, err := c.GetServiceLevelObjective(ctx, req)
173 if err != nil {
174
175 }
176
177 _ = resp
178 }
179
180 func ExampleServiceMonitoringClient_ListServiceLevelObjectives() {
181
182
183
184 ctx := context.Background()
185 c, err := monitoring.NewServiceMonitoringClient(ctx)
186 if err != nil {
187
188 }
189
190 req := &monitoringpb.ListServiceLevelObjectivesRequest{
191
192 }
193 it := c.ListServiceLevelObjectives(ctx, req)
194 for {
195 resp, err := it.Next()
196 if err == iterator.Done {
197 break
198 }
199 if err != nil {
200
201 }
202
203 _ = resp
204 }
205 }
206
207 func ExampleServiceMonitoringClient_UpdateServiceLevelObjective() {
208
209
210 ctx := context.Background()
211 c, err := monitoring.NewServiceMonitoringClient(ctx)
212 if err != nil {
213
214 }
215
216 req := &monitoringpb.UpdateServiceLevelObjectiveRequest{
217
218 }
219 resp, err := c.UpdateServiceLevelObjective(ctx, req)
220 if err != nil {
221
222 }
223
224 _ = resp
225 }
226
227 func ExampleServiceMonitoringClient_DeleteServiceLevelObjective() {
228 ctx := context.Background()
229 c, err := monitoring.NewServiceMonitoringClient(ctx)
230 if err != nil {
231
232 }
233
234 req := &monitoringpb.DeleteServiceLevelObjectiveRequest{
235
236 }
237 err = c.DeleteServiceLevelObjective(ctx, req)
238 if err != nil {
239
240 }
241 }
242
View as plain text