forked from cPu1/aws-sdk-go
-
Notifications
You must be signed in to change notification settings - Fork 0
/
api.go
2216 lines (1838 loc) · 66.8 KB
/
api.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
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT.
package xray
import (
"time"
"github.com/aws/aws-sdk-go/aws"
"github.com/aws/aws-sdk-go/aws/awsutil"
"github.com/aws/aws-sdk-go/aws/request"
)
const opBatchGetTraces = "BatchGetTraces"
// BatchGetTracesRequest generates a "aws/request.Request" representing the
// client's request for the BatchGetTraces operation. The "output" return
// value will be populated with the request's response once the request complets
// successfuly.
//
// Use "Send" method on the returned Request to send the API call to the service.
// the "output" return value is not valid until after Send returns without error.
//
// See BatchGetTraces for more information on using the BatchGetTraces
// API call, and error handling.
//
// This method is useful when you want to inject custom logic or configuration
// into the SDK's request lifecycle. Such as custom headers, or retry logic.
//
//
// // Example sending a request using the BatchGetTracesRequest method.
// req, resp := client.BatchGetTracesRequest(params)
//
// err := req.Send()
// if err == nil { // resp is now filled
// fmt.Println(resp)
// }
//
// Please also see https://docs.aws.amazon.com/goto/WebAPI/xray-2016-04-12/BatchGetTraces
func (c *XRay) BatchGetTracesRequest(input *BatchGetTracesInput) (req *request.Request, output *BatchGetTracesOutput) {
op := &request.Operation{
Name: opBatchGetTraces,
HTTPMethod: "POST",
HTTPPath: "/Traces",
}
if input == nil {
input = &BatchGetTracesInput{}
}
output = &BatchGetTracesOutput{}
req = c.newRequest(op, input, output)
return
}
// BatchGetTraces API operation for AWS X-Ray.
//
// Retrieves a list of traces specified by ID. Each trace is a collection of
// segment documents that originates from a single request. Use GetTraceSummaries
// to get a list of trace IDs.
//
// Returns awserr.Error for service API and SDK errors. Use runtime type assertions
// with awserr.Error's Code and Message methods to get detailed information about
// the error.
//
// See the AWS API reference guide for AWS X-Ray's
// API operation BatchGetTraces for usage and error information.
//
// Returned Error Codes:
// * ErrCodeInvalidRequestException "InvalidRequestException"
// The request is missing required parameters or has invalid parameters.
//
// * ErrCodeThrottledException "ThrottledException"
// The request exceeds the maximum number of requests per second.
//
// Please also see https://docs.aws.amazon.com/goto/WebAPI/xray-2016-04-12/BatchGetTraces
func (c *XRay) BatchGetTraces(input *BatchGetTracesInput) (*BatchGetTracesOutput, error) {
req, out := c.BatchGetTracesRequest(input)
return out, req.Send()
}
// BatchGetTracesWithContext is the same as BatchGetTraces with the addition of
// the ability to pass a context and additional request options.
//
// See BatchGetTraces for details on how to use this API operation.
//
// The context must be non-nil and will be used for request cancellation. If
// the context is nil a panic will occur. In the future the SDK may create
// sub-contexts for http.Requests. See https://golang.org/pkg/context/
// for more information on using Contexts.
func (c *XRay) BatchGetTracesWithContext(ctx aws.Context, input *BatchGetTracesInput, opts ...request.Option) (*BatchGetTracesOutput, error) {
req, out := c.BatchGetTracesRequest(input)
req.SetContext(ctx)
req.ApplyOptions(opts...)
return out, req.Send()
}
const opGetServiceGraph = "GetServiceGraph"
// GetServiceGraphRequest generates a "aws/request.Request" representing the
// client's request for the GetServiceGraph operation. The "output" return
// value will be populated with the request's response once the request complets
// successfuly.
//
// Use "Send" method on the returned Request to send the API call to the service.
// the "output" return value is not valid until after Send returns without error.
//
// See GetServiceGraph for more information on using the GetServiceGraph
// API call, and error handling.
//
// This method is useful when you want to inject custom logic or configuration
// into the SDK's request lifecycle. Such as custom headers, or retry logic.
//
//
// // Example sending a request using the GetServiceGraphRequest method.
// req, resp := client.GetServiceGraphRequest(params)
//
// err := req.Send()
// if err == nil { // resp is now filled
// fmt.Println(resp)
// }
//
// Please also see https://docs.aws.amazon.com/goto/WebAPI/xray-2016-04-12/GetServiceGraph
func (c *XRay) GetServiceGraphRequest(input *GetServiceGraphInput) (req *request.Request, output *GetServiceGraphOutput) {
op := &request.Operation{
Name: opGetServiceGraph,
HTTPMethod: "POST",
HTTPPath: "/ServiceGraph",
}
if input == nil {
input = &GetServiceGraphInput{}
}
output = &GetServiceGraphOutput{}
req = c.newRequest(op, input, output)
return
}
// GetServiceGraph API operation for AWS X-Ray.
//
// Retrieves a document that describes services that process incoming requests,
// and downstream services that they call as a result. Root services process
// incoming requests and make calls to downstream services. Root services are
// applications that use the AWS X-Ray SDK. Downstream services can be other
// applications, AWS resources, HTTP web APIs, or SQL databases.
//
// Returns awserr.Error for service API and SDK errors. Use runtime type assertions
// with awserr.Error's Code and Message methods to get detailed information about
// the error.
//
// See the AWS API reference guide for AWS X-Ray's
// API operation GetServiceGraph for usage and error information.
//
// Returned Error Codes:
// * ErrCodeInvalidRequestException "InvalidRequestException"
// The request is missing required parameters or has invalid parameters.
//
// * ErrCodeThrottledException "ThrottledException"
// The request exceeds the maximum number of requests per second.
//
// Please also see https://docs.aws.amazon.com/goto/WebAPI/xray-2016-04-12/GetServiceGraph
func (c *XRay) GetServiceGraph(input *GetServiceGraphInput) (*GetServiceGraphOutput, error) {
req, out := c.GetServiceGraphRequest(input)
return out, req.Send()
}
// GetServiceGraphWithContext is the same as GetServiceGraph with the addition of
// the ability to pass a context and additional request options.
//
// See GetServiceGraph for details on how to use this API operation.
//
// The context must be non-nil and will be used for request cancellation. If
// the context is nil a panic will occur. In the future the SDK may create
// sub-contexts for http.Requests. See https://golang.org/pkg/context/
// for more information on using Contexts.
func (c *XRay) GetServiceGraphWithContext(ctx aws.Context, input *GetServiceGraphInput, opts ...request.Option) (*GetServiceGraphOutput, error) {
req, out := c.GetServiceGraphRequest(input)
req.SetContext(ctx)
req.ApplyOptions(opts...)
return out, req.Send()
}
const opGetTraceGraph = "GetTraceGraph"
// GetTraceGraphRequest generates a "aws/request.Request" representing the
// client's request for the GetTraceGraph operation. The "output" return
// value will be populated with the request's response once the request complets
// successfuly.
//
// Use "Send" method on the returned Request to send the API call to the service.
// the "output" return value is not valid until after Send returns without error.
//
// See GetTraceGraph for more information on using the GetTraceGraph
// API call, and error handling.
//
// This method is useful when you want to inject custom logic or configuration
// into the SDK's request lifecycle. Such as custom headers, or retry logic.
//
//
// // Example sending a request using the GetTraceGraphRequest method.
// req, resp := client.GetTraceGraphRequest(params)
//
// err := req.Send()
// if err == nil { // resp is now filled
// fmt.Println(resp)
// }
//
// Please also see https://docs.aws.amazon.com/goto/WebAPI/xray-2016-04-12/GetTraceGraph
func (c *XRay) GetTraceGraphRequest(input *GetTraceGraphInput) (req *request.Request, output *GetTraceGraphOutput) {
op := &request.Operation{
Name: opGetTraceGraph,
HTTPMethod: "POST",
HTTPPath: "/TraceGraph",
}
if input == nil {
input = &GetTraceGraphInput{}
}
output = &GetTraceGraphOutput{}
req = c.newRequest(op, input, output)
return
}
// GetTraceGraph API operation for AWS X-Ray.
//
// Retrieves a service graph for one or more specific trace IDs.
//
// Returns awserr.Error for service API and SDK errors. Use runtime type assertions
// with awserr.Error's Code and Message methods to get detailed information about
// the error.
//
// See the AWS API reference guide for AWS X-Ray's
// API operation GetTraceGraph for usage and error information.
//
// Returned Error Codes:
// * ErrCodeInvalidRequestException "InvalidRequestException"
// The request is missing required parameters or has invalid parameters.
//
// * ErrCodeThrottledException "ThrottledException"
// The request exceeds the maximum number of requests per second.
//
// Please also see https://docs.aws.amazon.com/goto/WebAPI/xray-2016-04-12/GetTraceGraph
func (c *XRay) GetTraceGraph(input *GetTraceGraphInput) (*GetTraceGraphOutput, error) {
req, out := c.GetTraceGraphRequest(input)
return out, req.Send()
}
// GetTraceGraphWithContext is the same as GetTraceGraph with the addition of
// the ability to pass a context and additional request options.
//
// See GetTraceGraph for details on how to use this API operation.
//
// The context must be non-nil and will be used for request cancellation. If
// the context is nil a panic will occur. In the future the SDK may create
// sub-contexts for http.Requests. See https://golang.org/pkg/context/
// for more information on using Contexts.
func (c *XRay) GetTraceGraphWithContext(ctx aws.Context, input *GetTraceGraphInput, opts ...request.Option) (*GetTraceGraphOutput, error) {
req, out := c.GetTraceGraphRequest(input)
req.SetContext(ctx)
req.ApplyOptions(opts...)
return out, req.Send()
}
const opGetTraceSummaries = "GetTraceSummaries"
// GetTraceSummariesRequest generates a "aws/request.Request" representing the
// client's request for the GetTraceSummaries operation. The "output" return
// value will be populated with the request's response once the request complets
// successfuly.
//
// Use "Send" method on the returned Request to send the API call to the service.
// the "output" return value is not valid until after Send returns without error.
//
// See GetTraceSummaries for more information on using the GetTraceSummaries
// API call, and error handling.
//
// This method is useful when you want to inject custom logic or configuration
// into the SDK's request lifecycle. Such as custom headers, or retry logic.
//
//
// // Example sending a request using the GetTraceSummariesRequest method.
// req, resp := client.GetTraceSummariesRequest(params)
//
// err := req.Send()
// if err == nil { // resp is now filled
// fmt.Println(resp)
// }
//
// Please also see https://docs.aws.amazon.com/goto/WebAPI/xray-2016-04-12/GetTraceSummaries
func (c *XRay) GetTraceSummariesRequest(input *GetTraceSummariesInput) (req *request.Request, output *GetTraceSummariesOutput) {
op := &request.Operation{
Name: opGetTraceSummaries,
HTTPMethod: "POST",
HTTPPath: "/TraceSummaries",
}
if input == nil {
input = &GetTraceSummariesInput{}
}
output = &GetTraceSummariesOutput{}
req = c.newRequest(op, input, output)
return
}
// GetTraceSummaries API operation for AWS X-Ray.
//
// Retrieves IDs and metadata for traces available for a specified time frame
// using an optional filter. To get the full traces, pass the trace IDs to BatchGetTraces.
//
// A filter expression can target traced requests that hit specific service
// nodes or edges, have errors, or come from a known user. For example, the
// following filter expression targets traces that pass through api.example.com:
//
// service("api.example.com")
//
// This filter expression finds traces that have an annotation named account
// with the value 12345:
//
// annotation.account = "12345"
//
// For a full list of indexed fields and keywords that you can use in filter
// expressions, see Using Filter Expressions (http://docs.aws.amazon.com/xray/latest/devguide/xray-console-filters.html)
// in the AWS X-Ray Developer Guide.
//
// Returns awserr.Error for service API and SDK errors. Use runtime type assertions
// with awserr.Error's Code and Message methods to get detailed information about
// the error.
//
// See the AWS API reference guide for AWS X-Ray's
// API operation GetTraceSummaries for usage and error information.
//
// Returned Error Codes:
// * ErrCodeInvalidRequestException "InvalidRequestException"
// The request is missing required parameters or has invalid parameters.
//
// * ErrCodeThrottledException "ThrottledException"
// The request exceeds the maximum number of requests per second.
//
// Please also see https://docs.aws.amazon.com/goto/WebAPI/xray-2016-04-12/GetTraceSummaries
func (c *XRay) GetTraceSummaries(input *GetTraceSummariesInput) (*GetTraceSummariesOutput, error) {
req, out := c.GetTraceSummariesRequest(input)
return out, req.Send()
}
// GetTraceSummariesWithContext is the same as GetTraceSummaries with the addition of
// the ability to pass a context and additional request options.
//
// See GetTraceSummaries for details on how to use this API operation.
//
// The context must be non-nil and will be used for request cancellation. If
// the context is nil a panic will occur. In the future the SDK may create
// sub-contexts for http.Requests. See https://golang.org/pkg/context/
// for more information on using Contexts.
func (c *XRay) GetTraceSummariesWithContext(ctx aws.Context, input *GetTraceSummariesInput, opts ...request.Option) (*GetTraceSummariesOutput, error) {
req, out := c.GetTraceSummariesRequest(input)
req.SetContext(ctx)
req.ApplyOptions(opts...)
return out, req.Send()
}
const opPutTelemetryRecords = "PutTelemetryRecords"
// PutTelemetryRecordsRequest generates a "aws/request.Request" representing the
// client's request for the PutTelemetryRecords operation. The "output" return
// value will be populated with the request's response once the request complets
// successfuly.
//
// Use "Send" method on the returned Request to send the API call to the service.
// the "output" return value is not valid until after Send returns without error.
//
// See PutTelemetryRecords for more information on using the PutTelemetryRecords
// API call, and error handling.
//
// This method is useful when you want to inject custom logic or configuration
// into the SDK's request lifecycle. Such as custom headers, or retry logic.
//
//
// // Example sending a request using the PutTelemetryRecordsRequest method.
// req, resp := client.PutTelemetryRecordsRequest(params)
//
// err := req.Send()
// if err == nil { // resp is now filled
// fmt.Println(resp)
// }
//
// Please also see https://docs.aws.amazon.com/goto/WebAPI/xray-2016-04-12/PutTelemetryRecords
func (c *XRay) PutTelemetryRecordsRequest(input *PutTelemetryRecordsInput) (req *request.Request, output *PutTelemetryRecordsOutput) {
op := &request.Operation{
Name: opPutTelemetryRecords,
HTTPMethod: "POST",
HTTPPath: "/TelemetryRecords",
}
if input == nil {
input = &PutTelemetryRecordsInput{}
}
output = &PutTelemetryRecordsOutput{}
req = c.newRequest(op, input, output)
return
}
// PutTelemetryRecords API operation for AWS X-Ray.
//
// Used by the AWS X-Ray daemon to upload telemetry.
//
// Returns awserr.Error for service API and SDK errors. Use runtime type assertions
// with awserr.Error's Code and Message methods to get detailed information about
// the error.
//
// See the AWS API reference guide for AWS X-Ray's
// API operation PutTelemetryRecords for usage and error information.
//
// Returned Error Codes:
// * ErrCodeInvalidRequestException "InvalidRequestException"
// The request is missing required parameters or has invalid parameters.
//
// * ErrCodeThrottledException "ThrottledException"
// The request exceeds the maximum number of requests per second.
//
// Please also see https://docs.aws.amazon.com/goto/WebAPI/xray-2016-04-12/PutTelemetryRecords
func (c *XRay) PutTelemetryRecords(input *PutTelemetryRecordsInput) (*PutTelemetryRecordsOutput, error) {
req, out := c.PutTelemetryRecordsRequest(input)
return out, req.Send()
}
// PutTelemetryRecordsWithContext is the same as PutTelemetryRecords with the addition of
// the ability to pass a context and additional request options.
//
// See PutTelemetryRecords for details on how to use this API operation.
//
// The context must be non-nil and will be used for request cancellation. If
// the context is nil a panic will occur. In the future the SDK may create
// sub-contexts for http.Requests. See https://golang.org/pkg/context/
// for more information on using Contexts.
func (c *XRay) PutTelemetryRecordsWithContext(ctx aws.Context, input *PutTelemetryRecordsInput, opts ...request.Option) (*PutTelemetryRecordsOutput, error) {
req, out := c.PutTelemetryRecordsRequest(input)
req.SetContext(ctx)
req.ApplyOptions(opts...)
return out, req.Send()
}
const opPutTraceSegments = "PutTraceSegments"
// PutTraceSegmentsRequest generates a "aws/request.Request" representing the
// client's request for the PutTraceSegments operation. The "output" return
// value will be populated with the request's response once the request complets
// successfuly.
//
// Use "Send" method on the returned Request to send the API call to the service.
// the "output" return value is not valid until after Send returns without error.
//
// See PutTraceSegments for more information on using the PutTraceSegments
// API call, and error handling.
//
// This method is useful when you want to inject custom logic or configuration
// into the SDK's request lifecycle. Such as custom headers, or retry logic.
//
//
// // Example sending a request using the PutTraceSegmentsRequest method.
// req, resp := client.PutTraceSegmentsRequest(params)
//
// err := req.Send()
// if err == nil { // resp is now filled
// fmt.Println(resp)
// }
//
// Please also see https://docs.aws.amazon.com/goto/WebAPI/xray-2016-04-12/PutTraceSegments
func (c *XRay) PutTraceSegmentsRequest(input *PutTraceSegmentsInput) (req *request.Request, output *PutTraceSegmentsOutput) {
op := &request.Operation{
Name: opPutTraceSegments,
HTTPMethod: "POST",
HTTPPath: "/TraceSegments",
}
if input == nil {
input = &PutTraceSegmentsInput{}
}
output = &PutTraceSegmentsOutput{}
req = c.newRequest(op, input, output)
return
}
// PutTraceSegments API operation for AWS X-Ray.
//
// Uploads segment documents to AWS X-Ray. The X-Ray SDK generates segment documents
// and sends them to the X-Ray daemon, which uploads them in batches. A segment
// document can be a completed segment, an in-progress segment, or an array
// of subsegments.
//
// Segments must include the following fields. For the full segment document
// schema, see AWS X-Ray Segment Documents (http://docs.aws.amazon.com/xray/latest/devguide/xray-api-segmentdocuments.html)
// in the AWS X-Ray Developer Guide.
//
// Required Segment Document Fields
//
// * name - The name of the service that handled the request.
//
// * id - A 64-bit identifier for the segment, unique among segments in the
// same trace, in 16 hexadecimal digits.
//
// * trace_id - A unique identifier that connects all segments and subsegments
// originating from a single client request.
//
// * start_time - Time the segment or subsegment was created, in floating
// point seconds in epoch time, accurate to milliseconds. For example, 1480615200.010
// or 1.480615200010E9.
//
// * end_time - Time the segment or subsegment was closed. For example, 1480615200.090
// or 1.480615200090E9. Specify either an end_time or in_progress.
//
// * in_progress - Set to true instead of specifying an end_time to record
// that a segment has been started, but is not complete. Send an in progress
// segment when your application receives a request that will take a long
// time to serve, to trace the fact that the request was received. When the
// response is sent, send the complete segment to overwrite the in-progress
// segment.
//
// A trace_id consists of three numbers separated by hyphens. For example, 1-58406520-a006649127e371903a2de979.
// This includes:
//
// Trace ID Format
//
// * The version number, i.e. 1.
//
// * The time of the original request, in Unix epoch time, in 8 hexadecimal
// digits. For example, 10:00AM December 2nd, 2016 PST in epoch time is 1480615200
// seconds, or 58406520 in hexadecimal.
//
// * A 96-bit identifier for the trace, globally unique, in 24 hexadecimal
// digits.
//
// Returns awserr.Error for service API and SDK errors. Use runtime type assertions
// with awserr.Error's Code and Message methods to get detailed information about
// the error.
//
// See the AWS API reference guide for AWS X-Ray's
// API operation PutTraceSegments for usage and error information.
//
// Returned Error Codes:
// * ErrCodeInvalidRequestException "InvalidRequestException"
// The request is missing required parameters or has invalid parameters.
//
// * ErrCodeThrottledException "ThrottledException"
// The request exceeds the maximum number of requests per second.
//
// Please also see https://docs.aws.amazon.com/goto/WebAPI/xray-2016-04-12/PutTraceSegments
func (c *XRay) PutTraceSegments(input *PutTraceSegmentsInput) (*PutTraceSegmentsOutput, error) {
req, out := c.PutTraceSegmentsRequest(input)
return out, req.Send()
}
// PutTraceSegmentsWithContext is the same as PutTraceSegments with the addition of
// the ability to pass a context and additional request options.
//
// See PutTraceSegments for details on how to use this API operation.
//
// The context must be non-nil and will be used for request cancellation. If
// the context is nil a panic will occur. In the future the SDK may create
// sub-contexts for http.Requests. See https://golang.org/pkg/context/
// for more information on using Contexts.
func (c *XRay) PutTraceSegmentsWithContext(ctx aws.Context, input *PutTraceSegmentsInput, opts ...request.Option) (*PutTraceSegmentsOutput, error) {
req, out := c.PutTraceSegmentsRequest(input)
req.SetContext(ctx)
req.ApplyOptions(opts...)
return out, req.Send()
}
// An alias for an edge.
// Please also see https://docs.aws.amazon.com/goto/WebAPI/xray-2016-04-12/Alias
type Alias struct {
_ struct{} `type:"structure"`
// The canonical name of the alias.
Name *string `type:"string"`
// A list of names for the alias, including the canonical name.
Names []*string `type:"list"`
// The type of the alias.
Type *string `type:"string"`
}
// String returns the string representation
func (s Alias) String() string {
return awsutil.Prettify(s)
}
// GoString returns the string representation
func (s Alias) GoString() string {
return s.String()
}
// SetName sets the Name field's value.
func (s *Alias) SetName(v string) *Alias {
s.Name = &v
return s
}
// SetNames sets the Names field's value.
func (s *Alias) SetNames(v []*string) *Alias {
s.Names = v
return s
}
// SetType sets the Type field's value.
func (s *Alias) SetType(v string) *Alias {
s.Type = &v
return s
}
// Value of a segment annotation. Has one of three value types: Number, Boolean
// or String.
// Please also see https://docs.aws.amazon.com/goto/WebAPI/xray-2016-04-12/AnnotationValue
type AnnotationValue struct {
_ struct{} `type:"structure"`
// Value for a Boolean annotation.
BooleanValue *bool `type:"boolean"`
// Value for a Number annotation.
NumberValue *float64 `type:"double"`
// Value for a String annotation.
StringValue *string `type:"string"`
}
// String returns the string representation
func (s AnnotationValue) String() string {
return awsutil.Prettify(s)
}
// GoString returns the string representation
func (s AnnotationValue) GoString() string {
return s.String()
}
// SetBooleanValue sets the BooleanValue field's value.
func (s *AnnotationValue) SetBooleanValue(v bool) *AnnotationValue {
s.BooleanValue = &v
return s
}
// SetNumberValue sets the NumberValue field's value.
func (s *AnnotationValue) SetNumberValue(v float64) *AnnotationValue {
s.NumberValue = &v
return s
}
// SetStringValue sets the StringValue field's value.
func (s *AnnotationValue) SetStringValue(v string) *AnnotationValue {
s.StringValue = &v
return s
}
// Please also see https://docs.aws.amazon.com/goto/WebAPI/xray-2016-04-12/BackendConnectionErrors
type BackendConnectionErrors struct {
_ struct{} `type:"structure"`
ConnectionRefusedCount *int64 `type:"integer"`
HTTPCode4XXCount *int64 `type:"integer"`
HTTPCode5XXCount *int64 `type:"integer"`
OtherCount *int64 `type:"integer"`
TimeoutCount *int64 `type:"integer"`
UnknownHostCount *int64 `type:"integer"`
}
// String returns the string representation
func (s BackendConnectionErrors) String() string {
return awsutil.Prettify(s)
}
// GoString returns the string representation
func (s BackendConnectionErrors) GoString() string {
return s.String()
}
// SetConnectionRefusedCount sets the ConnectionRefusedCount field's value.
func (s *BackendConnectionErrors) SetConnectionRefusedCount(v int64) *BackendConnectionErrors {
s.ConnectionRefusedCount = &v
return s
}
// SetHTTPCode4XXCount sets the HTTPCode4XXCount field's value.
func (s *BackendConnectionErrors) SetHTTPCode4XXCount(v int64) *BackendConnectionErrors {
s.HTTPCode4XXCount = &v
return s
}
// SetHTTPCode5XXCount sets the HTTPCode5XXCount field's value.
func (s *BackendConnectionErrors) SetHTTPCode5XXCount(v int64) *BackendConnectionErrors {
s.HTTPCode5XXCount = &v
return s
}
// SetOtherCount sets the OtherCount field's value.
func (s *BackendConnectionErrors) SetOtherCount(v int64) *BackendConnectionErrors {
s.OtherCount = &v
return s
}
// SetTimeoutCount sets the TimeoutCount field's value.
func (s *BackendConnectionErrors) SetTimeoutCount(v int64) *BackendConnectionErrors {
s.TimeoutCount = &v
return s
}
// SetUnknownHostCount sets the UnknownHostCount field's value.
func (s *BackendConnectionErrors) SetUnknownHostCount(v int64) *BackendConnectionErrors {
s.UnknownHostCount = &v
return s
}
// Please also see https://docs.aws.amazon.com/goto/WebAPI/xray-2016-04-12/BatchGetTracesRequest
type BatchGetTracesInput struct {
_ struct{} `type:"structure"`
// Pagination token. Not used.
NextToken *string `type:"string"`
// Specify the trace IDs of requests for which to retrieve segments.
//
// TraceIds is a required field
TraceIds []*string `type:"list" required:"true"`
}
// String returns the string representation
func (s BatchGetTracesInput) String() string {
return awsutil.Prettify(s)
}
// GoString returns the string representation
func (s BatchGetTracesInput) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *BatchGetTracesInput) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "BatchGetTracesInput"}
if s.TraceIds == nil {
invalidParams.Add(request.NewErrParamRequired("TraceIds"))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
// SetNextToken sets the NextToken field's value.
func (s *BatchGetTracesInput) SetNextToken(v string) *BatchGetTracesInput {
s.NextToken = &v
return s
}
// SetTraceIds sets the TraceIds field's value.
func (s *BatchGetTracesInput) SetTraceIds(v []*string) *BatchGetTracesInput {
s.TraceIds = v
return s
}
// Please also see https://docs.aws.amazon.com/goto/WebAPI/xray-2016-04-12/BatchGetTracesResult
type BatchGetTracesOutput struct {
_ struct{} `type:"structure"`
// Pagination token. Not used.
NextToken *string `type:"string"`
// Full traces for the specified requests.
Traces []*Trace `type:"list"`
// Trace IDs of requests that haven't been processed.
UnprocessedTraceIds []*string `type:"list"`
}
// String returns the string representation
func (s BatchGetTracesOutput) String() string {
return awsutil.Prettify(s)
}
// GoString returns the string representation
func (s BatchGetTracesOutput) GoString() string {
return s.String()
}
// SetNextToken sets the NextToken field's value.
func (s *BatchGetTracesOutput) SetNextToken(v string) *BatchGetTracesOutput {
s.NextToken = &v
return s
}
// SetTraces sets the Traces field's value.
func (s *BatchGetTracesOutput) SetTraces(v []*Trace) *BatchGetTracesOutput {
s.Traces = v
return s
}
// SetUnprocessedTraceIds sets the UnprocessedTraceIds field's value.
func (s *BatchGetTracesOutput) SetUnprocessedTraceIds(v []*string) *BatchGetTracesOutput {
s.UnprocessedTraceIds = v
return s
}
// Information about a connection between two services.
// Please also see https://docs.aws.amazon.com/goto/WebAPI/xray-2016-04-12/Edge
type Edge struct {
_ struct{} `type:"structure"`
// Aliases for the edge.
Aliases []*Alias `type:"list"`
// The end time of the last segment on the edge.
EndTime *time.Time `type:"timestamp" timestampFormat:"unix"`
// Identifier of the edge. Unique within a service map.
ReferenceId *int64 `type:"integer"`
// A histogram that maps the spread of client response times on an edge.
ResponseTimeHistogram []*HistogramEntry `type:"list"`
// The start time of the first segment on the edge.
StartTime *time.Time `type:"timestamp" timestampFormat:"unix"`
// Response statistics for segments on the edge.
SummaryStatistics *EdgeStatistics `type:"structure"`
}
// String returns the string representation
func (s Edge) String() string {
return awsutil.Prettify(s)
}
// GoString returns the string representation
func (s Edge) GoString() string {
return s.String()
}
// SetAliases sets the Aliases field's value.
func (s *Edge) SetAliases(v []*Alias) *Edge {
s.Aliases = v
return s
}
// SetEndTime sets the EndTime field's value.
func (s *Edge) SetEndTime(v time.Time) *Edge {
s.EndTime = &v
return s
}
// SetReferenceId sets the ReferenceId field's value.
func (s *Edge) SetReferenceId(v int64) *Edge {
s.ReferenceId = &v
return s
}
// SetResponseTimeHistogram sets the ResponseTimeHistogram field's value.
func (s *Edge) SetResponseTimeHistogram(v []*HistogramEntry) *Edge {
s.ResponseTimeHistogram = v
return s
}
// SetStartTime sets the StartTime field's value.
func (s *Edge) SetStartTime(v time.Time) *Edge {
s.StartTime = &v
return s
}
// SetSummaryStatistics sets the SummaryStatistics field's value.
func (s *Edge) SetSummaryStatistics(v *EdgeStatistics) *Edge {
s.SummaryStatistics = v
return s
}
// Response statistics for an edge.
// Please also see https://docs.aws.amazon.com/goto/WebAPI/xray-2016-04-12/EdgeStatistics
type EdgeStatistics struct {
_ struct{} `type:"structure"`
// Information about requests that failed with a 4xx Client Error status code.
ErrorStatistics *ErrorStatistics `type:"structure"`
// Information about requests that failed with a 5xx Server Error status code.
FaultStatistics *FaultStatistics `type:"structure"`
// The number of requests that completed with a 2xx Success status code.
OkCount *int64 `type:"long"`
// The total number of completed requests.
TotalCount *int64 `type:"long"`
// The aggregate response time of completed requests.
TotalResponseTime *float64 `type:"double"`
}
// String returns the string representation
func (s EdgeStatistics) String() string {
return awsutil.Prettify(s)
}
// GoString returns the string representation
func (s EdgeStatistics) GoString() string {
return s.String()
}
// SetErrorStatistics sets the ErrorStatistics field's value.
func (s *EdgeStatistics) SetErrorStatistics(v *ErrorStatistics) *EdgeStatistics {
s.ErrorStatistics = v
return s
}
// SetFaultStatistics sets the FaultStatistics field's value.
func (s *EdgeStatistics) SetFaultStatistics(v *FaultStatistics) *EdgeStatistics {
s.FaultStatistics = v
return s
}
// SetOkCount sets the OkCount field's value.
func (s *EdgeStatistics) SetOkCount(v int64) *EdgeStatistics {
s.OkCount = &v
return s
}
// SetTotalCount sets the TotalCount field's value.
func (s *EdgeStatistics) SetTotalCount(v int64) *EdgeStatistics {
s.TotalCount = &v
return s
}
// SetTotalResponseTime sets the TotalResponseTime field's value.
func (s *EdgeStatistics) SetTotalResponseTime(v float64) *EdgeStatistics {
s.TotalResponseTime = &v
return s
}
// Information about requests that failed with a 4xx Client Error status code.
// Please also see https://docs.aws.amazon.com/goto/WebAPI/xray-2016-04-12/ErrorStatistics
type ErrorStatistics struct {
_ struct{} `type:"structure"`
// The number of requests that failed with untracked 4xx Client Error status
// codes.
OtherCount *int64 `type:"long"`
// The number of requests that failed with a 419 throttling status code.
ThrottleCount *int64 `type:"long"`
// The total number of requests that failed with a 4xx Client Error status code.
TotalCount *int64 `type:"long"`
}
// String returns the string representation
func (s ErrorStatistics) String() string {
return awsutil.Prettify(s)
}
// GoString returns the string representation
func (s ErrorStatistics) GoString() string {
return s.String()
}
// SetOtherCount sets the OtherCount field's value.
func (s *ErrorStatistics) SetOtherCount(v int64) *ErrorStatistics {
s.OtherCount = &v
return s
}
// SetThrottleCount sets the ThrottleCount field's value.
func (s *ErrorStatistics) SetThrottleCount(v int64) *ErrorStatistics {
s.ThrottleCount = &v
return s
}
// SetTotalCount sets the TotalCount field's value.
func (s *ErrorStatistics) SetTotalCount(v int64) *ErrorStatistics {
s.TotalCount = &v
return s
}
// Information about requests that failed with a 5xx Server Error status code.
// Please also see https://docs.aws.amazon.com/goto/WebAPI/xray-2016-04-12/FaultStatistics
type FaultStatistics struct {
_ struct{} `type:"structure"`
// The number of requests that failed with untracked 5xx Server Error status
// codes.
OtherCount *int64 `type:"long"`
// The total number of requests that failed with a 5xx Server Error status code.
TotalCount *int64 `type:"long"`
}
// String returns the string representation