-
Notifications
You must be signed in to change notification settings - Fork 1.1k
/
logging-gen.go
4090 lines (3683 loc) · 158 KB
/
logging-gen.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
// Copyright 2020 Google LLC.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
// Code generated file. DO NOT EDIT.
// Package logging provides access to the Stackdriver Logging API.
//
// This package is DEPRECATED. Use package cloud.google.com/go/logging instead.
//
// For product documentation, see: https://cloud.google.com/logging/docs/
//
// Creating a client
//
// Usage example:
//
// import "google.golang.org/api/logging/v2beta1"
// ...
// ctx := context.Background()
// loggingService, err := logging.NewService(ctx)
//
// In this example, Google Application Default Credentials are used for authentication.
//
// For information on how to create and obtain Application Default Credentials, see https://developers.google.com/identity/protocols/application-default-credentials.
//
// Other authentication options
//
// By default, all available scopes (see "Constants") are used to authenticate. To restrict scopes, use option.WithScopes:
//
// loggingService, err := logging.NewService(ctx, option.WithScopes(logging.LoggingWriteScope))
//
// To use an API key for authentication (note: some APIs do not support API keys), use option.WithAPIKey:
//
// loggingService, err := logging.NewService(ctx, option.WithAPIKey("AIza..."))
//
// To use an OAuth token (e.g., a user token obtained via a three-legged OAuth flow), use option.WithTokenSource:
//
// config := &oauth2.Config{...}
// // ...
// token, err := config.Exchange(ctx, ...)
// loggingService, err := logging.NewService(ctx, option.WithTokenSource(config.TokenSource(ctx, token)))
//
// See https://godoc.org/google.golang.org/api/option/ for details on options.
package logging // import "google.golang.org/api/logging/v2beta1"
import (
"bytes"
"context"
"encoding/json"
"errors"
"fmt"
"io"
"net/http"
"net/url"
"strconv"
"strings"
googleapi "google.golang.org/api/googleapi"
gensupport "google.golang.org/api/internal/gensupport"
option "google.golang.org/api/option"
htransport "google.golang.org/api/transport/http"
)
// Always reference these packages, just in case the auto-generated code
// below doesn't.
var _ = bytes.NewBuffer
var _ = strconv.Itoa
var _ = fmt.Sprintf
var _ = json.NewDecoder
var _ = io.Copy
var _ = url.Parse
var _ = gensupport.MarshalJSON
var _ = googleapi.Version
var _ = errors.New
var _ = strings.Replace
var _ = context.Canceled
const apiId = "logging:v2beta1"
const apiName = "logging"
const apiVersion = "v2beta1"
const basePath = "https://logging.googleapis.com/"
// OAuth2 scopes used by this API.
const (
// View and manage your data across Google Cloud Platform services
CloudPlatformScope = "https://www.googleapis.com/auth/cloud-platform"
// View your data across Google Cloud Platform services
CloudPlatformReadOnlyScope = "https://www.googleapis.com/auth/cloud-platform.read-only"
// Administrate log data for your projects
LoggingAdminScope = "https://www.googleapis.com/auth/logging.admin"
// View log data for your projects
LoggingReadScope = "https://www.googleapis.com/auth/logging.read"
// Submit log data for your projects
LoggingWriteScope = "https://www.googleapis.com/auth/logging.write"
)
// NewService creates a new Service.
func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, error) {
scopesOption := option.WithScopes(
"https://www.googleapis.com/auth/cloud-platform",
"https://www.googleapis.com/auth/cloud-platform.read-only",
"https://www.googleapis.com/auth/logging.admin",
"https://www.googleapis.com/auth/logging.read",
"https://www.googleapis.com/auth/logging.write",
)
// NOTE: prepend, so we don't override user-specified scopes.
opts = append([]option.ClientOption{scopesOption}, opts...)
client, endpoint, err := htransport.NewClient(ctx, opts...)
if err != nil {
return nil, err
}
s, err := New(client)
if err != nil {
return nil, err
}
if endpoint != "" {
s.BasePath = endpoint
}
return s, nil
}
// New creates a new Service. It uses the provided http.Client for requests.
//
// Deprecated: please use NewService instead.
// To provide a custom HTTP client, use option.WithHTTPClient.
// If you are using google.golang.org/api/googleapis/transport.APIKey, use option.WithAPIKey with NewService instead.
func New(client *http.Client) (*Service, error) {
if client == nil {
return nil, errors.New("client is nil")
}
s := &Service{client: client, BasePath: basePath}
s.Entries = NewEntriesService(s)
s.MonitoredResourceDescriptors = NewMonitoredResourceDescriptorsService(s)
s.Projects = NewProjectsService(s)
return s, nil
}
type Service struct {
client *http.Client
BasePath string // API endpoint base URL
UserAgent string // optional additional User-Agent fragment
Entries *EntriesService
MonitoredResourceDescriptors *MonitoredResourceDescriptorsService
Projects *ProjectsService
}
func (s *Service) userAgent() string {
if s.UserAgent == "" {
return googleapi.UserAgent
}
return googleapi.UserAgent + " " + s.UserAgent
}
func NewEntriesService(s *Service) *EntriesService {
rs := &EntriesService{s: s}
return rs
}
type EntriesService struct {
s *Service
}
func NewMonitoredResourceDescriptorsService(s *Service) *MonitoredResourceDescriptorsService {
rs := &MonitoredResourceDescriptorsService{s: s}
return rs
}
type MonitoredResourceDescriptorsService struct {
s *Service
}
func NewProjectsService(s *Service) *ProjectsService {
rs := &ProjectsService{s: s}
rs.Metrics = NewProjectsMetricsService(s)
rs.Sinks = NewProjectsSinksService(s)
return rs
}
type ProjectsService struct {
s *Service
Metrics *ProjectsMetricsService
Sinks *ProjectsSinksService
}
func NewProjectsMetricsService(s *Service) *ProjectsMetricsService {
rs := &ProjectsMetricsService{s: s}
return rs
}
type ProjectsMetricsService struct {
s *Service
}
func NewProjectsSinksService(s *Service) *ProjectsSinksService {
rs := &ProjectsSinksService{s: s}
return rs
}
type ProjectsSinksService struct {
s *Service
}
// BucketOptions: BucketOptions describes the bucket boundaries used to
// create a histogram for the distribution. The buckets can be in a
// linear sequence, an exponential sequence, or each bucket can be
// specified explicitly. BucketOptions does not include the number of
// values in each bucket.A bucket has an inclusive lower bound and
// exclusive upper bound for the values that are counted for that
// bucket. The upper bound of a bucket must be strictly greater than the
// lower bound. The sequence of N buckets for a distribution consists of
// an underflow bucket (number 0), zero or more finite buckets (number 1
// through N - 2) and an overflow bucket (number N - 1). The buckets are
// contiguous: the lower bound of bucket i (i > 0) is the same as the
// upper bound of bucket i - 1. The buckets span the whole range of
// finite values: lower bound of the underflow bucket is -infinity and
// the upper bound of the overflow bucket is +infinity. The finite
// buckets are so-called because both bounds are finite.
type BucketOptions struct {
// ExplicitBuckets: The explicit buckets.
ExplicitBuckets *Explicit `json:"explicitBuckets,omitempty"`
// ExponentialBuckets: The exponential buckets.
ExponentialBuckets *Exponential `json:"exponentialBuckets,omitempty"`
// LinearBuckets: The linear bucket.
LinearBuckets *Linear `json:"linearBuckets,omitempty"`
// ForceSendFields is a list of field names (e.g. "ExplicitBuckets") to
// unconditionally include in API requests. By default, fields with
// empty values are omitted from API requests. However, any non-pointer,
// non-interface field appearing in ForceSendFields will be sent to the
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "ExplicitBuckets") to
// include in API requests with the JSON null value. By default, fields
// with empty values are omitted from API requests. However, any field
// with an empty value appearing in NullFields will be sent to the
// server as null. It is an error if a field in this list has a
// non-empty value. This may be used to include null fields in Patch
// requests.
NullFields []string `json:"-"`
}
func (s *BucketOptions) MarshalJSON() ([]byte, error) {
type NoMethod BucketOptions
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// Empty: A generic empty message that you can re-use to avoid defining
// duplicated empty messages in your APIs. A typical example is to use
// it as the request or the response type of an API method. For
// instance:
// service Foo {
// rpc Bar(google.protobuf.Empty) returns
// (google.protobuf.Empty);
// }
// The JSON representation for Empty is empty JSON object {}.
type Empty struct {
// ServerResponse contains the HTTP response code and headers from the
// server.
googleapi.ServerResponse `json:"-"`
}
// Explicit: Specifies a set of buckets with arbitrary widths.There are
// size(bounds) + 1 (= N) buckets. Bucket i has the following
// boundaries:Upper bound (0 <= i < N-1): boundsi Lower bound (1 <= i <
// N); boundsi - 1The bounds field must contain at least one element. If
// bounds has only one element, then there are no finite buckets, and
// that single element is the common boundary of the overflow and
// underflow buckets.
type Explicit struct {
// Bounds: The values must be monotonically increasing.
Bounds []float64 `json:"bounds,omitempty"`
// ForceSendFields is a list of field names (e.g. "Bounds") to
// unconditionally include in API requests. By default, fields with
// empty values are omitted from API requests. However, any non-pointer,
// non-interface field appearing in ForceSendFields will be sent to the
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "Bounds") to include in API
// requests with the JSON null value. By default, fields with empty
// values are omitted from API requests. However, any field with an
// empty value appearing in NullFields will be sent to the server as
// null. It is an error if a field in this list has a non-empty value.
// This may be used to include null fields in Patch requests.
NullFields []string `json:"-"`
}
func (s *Explicit) MarshalJSON() ([]byte, error) {
type NoMethod Explicit
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// Exponential: Specifies an exponential sequence of buckets that have a
// width that is proportional to the value of the lower bound. Each
// bucket represents a constant relative uncertainty on a specific value
// in the bucket.There are num_finite_buckets + 2 (= N) buckets. Bucket
// i has the following boundaries:Upper bound (0 <= i < N-1): scale *
// (growth_factor ^ i). Lower bound (1 <= i < N): scale *
// (growth_factor ^ (i - 1)).
type Exponential struct {
// GrowthFactor: Must be greater than 1.
GrowthFactor float64 `json:"growthFactor,omitempty"`
// NumFiniteBuckets: Must be greater than 0.
NumFiniteBuckets int64 `json:"numFiniteBuckets,omitempty"`
// Scale: Must be greater than 0.
Scale float64 `json:"scale,omitempty"`
// ForceSendFields is a list of field names (e.g. "GrowthFactor") to
// unconditionally include in API requests. By default, fields with
// empty values are omitted from API requests. However, any non-pointer,
// non-interface field appearing in ForceSendFields will be sent to the
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "GrowthFactor") to include
// in API requests with the JSON null value. By default, fields with
// empty values are omitted from API requests. However, any field with
// an empty value appearing in NullFields will be sent to the server as
// null. It is an error if a field in this list has a non-empty value.
// This may be used to include null fields in Patch requests.
NullFields []string `json:"-"`
}
func (s *Exponential) MarshalJSON() ([]byte, error) {
type NoMethod Exponential
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
func (s *Exponential) UnmarshalJSON(data []byte) error {
type NoMethod Exponential
var s1 struct {
GrowthFactor gensupport.JSONFloat64 `json:"growthFactor"`
Scale gensupport.JSONFloat64 `json:"scale"`
*NoMethod
}
s1.NoMethod = (*NoMethod)(s)
if err := json.Unmarshal(data, &s1); err != nil {
return err
}
s.GrowthFactor = float64(s1.GrowthFactor)
s.Scale = float64(s1.Scale)
return nil
}
// HttpRequest: A common proto for logging HTTP requests. Only contains
// semantics defined by the HTTP specification. Product-specific logging
// information MUST be defined in a separate message.
type HttpRequest struct {
// CacheFillBytes: The number of HTTP response bytes inserted into
// cache. Set only when a cache fill was attempted.
CacheFillBytes int64 `json:"cacheFillBytes,omitempty,string"`
// CacheHit: Whether or not an entity was served from cache (with or
// without validation).
CacheHit bool `json:"cacheHit,omitempty"`
// CacheLookup: Whether or not a cache lookup was attempted.
CacheLookup bool `json:"cacheLookup,omitempty"`
// CacheValidatedWithOriginServer: Whether or not the response was
// validated with the origin server before being served from cache. This
// field is only meaningful if cache_hit is True.
CacheValidatedWithOriginServer bool `json:"cacheValidatedWithOriginServer,omitempty"`
// Latency: The request processing latency on the server, from the time
// the request was received until the response was sent.
Latency string `json:"latency,omitempty"`
// Protocol: Protocol used for the request. Examples: "HTTP/1.1",
// "HTTP/2", "websocket"
Protocol string `json:"protocol,omitempty"`
// Referer: The referer URL of the request, as defined in HTTP/1.1
// Header Field Definitions
// (http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html).
Referer string `json:"referer,omitempty"`
// RemoteIp: The IP address (IPv4 or IPv6) of the client that issued the
// HTTP request. Examples: "192.168.1.1", "FE80::0202:B3FF:FE1E:8329".
RemoteIp string `json:"remoteIp,omitempty"`
// RequestMethod: The request method. Examples: "GET", "HEAD", "PUT",
// "POST".
RequestMethod string `json:"requestMethod,omitempty"`
// RequestSize: The size of the HTTP request message in bytes, including
// the request headers and the request body.
RequestSize int64 `json:"requestSize,omitempty,string"`
// RequestUrl: The scheme (http, https), the host name, the path and the
// query portion of the URL that was requested. Example:
// "http://example.com/some/info?color=red".
RequestUrl string `json:"requestUrl,omitempty"`
// ResponseSize: The size of the HTTP response message sent back to the
// client, in bytes, including the response headers and the response
// body.
ResponseSize int64 `json:"responseSize,omitempty,string"`
// ServerIp: The IP address (IPv4 or IPv6) of the origin server that the
// request was sent to.
ServerIp string `json:"serverIp,omitempty"`
// Status: The response code indicating the status of response.
// Examples: 200, 404.
Status int64 `json:"status,omitempty"`
// UserAgent: The user agent sent by the client. Example: "Mozilla/4.0
// (compatible; MSIE 6.0; Windows 98; Q312461; .NET
// CLR 1.0.3705)".
UserAgent string `json:"userAgent,omitempty"`
// ForceSendFields is a list of field names (e.g. "CacheFillBytes") to
// unconditionally include in API requests. By default, fields with
// empty values are omitted from API requests. However, any non-pointer,
// non-interface field appearing in ForceSendFields will be sent to the
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "CacheFillBytes") to
// include in API requests with the JSON null value. By default, fields
// with empty values are omitted from API requests. However, any field
// with an empty value appearing in NullFields will be sent to the
// server as null. It is an error if a field in this list has a
// non-empty value. This may be used to include null fields in Patch
// requests.
NullFields []string `json:"-"`
}
func (s *HttpRequest) MarshalJSON() ([]byte, error) {
type NoMethod HttpRequest
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// LabelDescriptor: A description of a label.
type LabelDescriptor struct {
// Description: A human-readable description for the label.
Description string `json:"description,omitempty"`
// Key: The label key.
Key string `json:"key,omitempty"`
// ValueType: The type of data that can be assigned to the label.
//
// Possible values:
// "STRING" - A variable-length string. This is the default.
// "BOOL" - Boolean; true or false.
// "INT64" - A 64-bit signed integer.
ValueType string `json:"valueType,omitempty"`
// ForceSendFields is a list of field names (e.g. "Description") to
// unconditionally include in API requests. By default, fields with
// empty values are omitted from API requests. However, any non-pointer,
// non-interface field appearing in ForceSendFields will be sent to the
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "Description") to include
// in API requests with the JSON null value. By default, fields with
// empty values are omitted from API requests. However, any field with
// an empty value appearing in NullFields will be sent to the server as
// null. It is an error if a field in this list has a non-empty value.
// This may be used to include null fields in Patch requests.
NullFields []string `json:"-"`
}
func (s *LabelDescriptor) MarshalJSON() ([]byte, error) {
type NoMethod LabelDescriptor
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// Linear: Specifies a linear sequence of buckets that all have the same
// width (except overflow and underflow). Each bucket represents a
// constant absolute uncertainty on the specific value in the
// bucket.There are num_finite_buckets + 2 (= N) buckets. Bucket i has
// the following boundaries:Upper bound (0 <= i < N-1): offset + (width
// * i). Lower bound (1 <= i < N): offset + (width * (i - 1)).
type Linear struct {
// NumFiniteBuckets: Must be greater than 0.
NumFiniteBuckets int64 `json:"numFiniteBuckets,omitempty"`
// Offset: Lower bound of the first bucket.
Offset float64 `json:"offset,omitempty"`
// Width: Must be greater than 0.
Width float64 `json:"width,omitempty"`
// ForceSendFields is a list of field names (e.g. "NumFiniteBuckets") to
// unconditionally include in API requests. By default, fields with
// empty values are omitted from API requests. However, any non-pointer,
// non-interface field appearing in ForceSendFields will be sent to the
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "NumFiniteBuckets") to
// include in API requests with the JSON null value. By default, fields
// with empty values are omitted from API requests. However, any field
// with an empty value appearing in NullFields will be sent to the
// server as null. It is an error if a field in this list has a
// non-empty value. This may be used to include null fields in Patch
// requests.
NullFields []string `json:"-"`
}
func (s *Linear) MarshalJSON() ([]byte, error) {
type NoMethod Linear
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
func (s *Linear) UnmarshalJSON(data []byte) error {
type NoMethod Linear
var s1 struct {
Offset gensupport.JSONFloat64 `json:"offset"`
Width gensupport.JSONFloat64 `json:"width"`
*NoMethod
}
s1.NoMethod = (*NoMethod)(s)
if err := json.Unmarshal(data, &s1); err != nil {
return err
}
s.Offset = float64(s1.Offset)
s.Width = float64(s1.Width)
return nil
}
// ListLogEntriesRequest: The parameters to ListLogEntries.
type ListLogEntriesRequest struct {
// Filter: Optional. A filter that chooses which log entries to return.
// See Advanced Logs Filters. Only log entries that match the filter are
// returned. An empty filter matches all log entries in the resources
// listed in resource_names. Referencing a parent resource that is not
// listed in resource_names will cause the filter to return no results.
// The maximum length of the filter is 20000 characters.
Filter string `json:"filter,omitempty"`
// OrderBy: Optional. How the results should be sorted. Presently, the
// only permitted values are "timestamp asc" (default) and "timestamp
// desc". The first option returns entries in order of increasing values
// of LogEntry.timestamp (oldest first), and the second option returns
// entries in order of decreasing timestamps (newest first). Entries
// with equal timestamps are returned in order of their insert_id
// values.
OrderBy string `json:"orderBy,omitempty"`
// PageSize: Optional. The maximum number of results to return from this
// request. Non-positive values are ignored. The presence of
// next_page_token in the response indicates that more results might be
// available.
PageSize int64 `json:"pageSize,omitempty"`
// PageToken: Optional. If present, then retrieve the next batch of
// results from the preceding call to this method. page_token must be
// the value of next_page_token from the previous response. The values
// of other method parameters should be identical to those in the
// previous call.
PageToken string `json:"pageToken,omitempty"`
// ProjectIds: Deprecated. Use resource_names instead. One or more
// project identifiers or project numbers from which to retrieve log
// entries. Example: "my-project-1A".
ProjectIds []string `json:"projectIds,omitempty"`
// ResourceNames: Required. Names of one or more parent resources from
// which to retrieve log
// entries:
// "projects/[PROJECT_ID]"
// "organizations/[ORGANIZATION_ID]"
// "bi
// llingAccounts/[BILLING_ACCOUNT_ID]"
// "folders/[FOLDER_ID]"
// Projects listed in the project_ids field are added to this list.
ResourceNames []string `json:"resourceNames,omitempty"`
// ForceSendFields is a list of field names (e.g. "Filter") to
// unconditionally include in API requests. By default, fields with
// empty values are omitted from API requests. However, any non-pointer,
// non-interface field appearing in ForceSendFields will be sent to the
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "Filter") to include in API
// requests with the JSON null value. By default, fields with empty
// values are omitted from API requests. However, any field with an
// empty value appearing in NullFields will be sent to the server as
// null. It is an error if a field in this list has a non-empty value.
// This may be used to include null fields in Patch requests.
NullFields []string `json:"-"`
}
func (s *ListLogEntriesRequest) MarshalJSON() ([]byte, error) {
type NoMethod ListLogEntriesRequest
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// ListLogEntriesResponse: Result returned from ListLogEntries.
type ListLogEntriesResponse struct {
// Entries: A list of log entries. If entries is empty, nextPageToken
// may still be returned, indicating that more entries may exist. See
// nextPageToken for more information.
Entries []*LogEntry `json:"entries,omitempty"`
// NextPageToken: If there might be more results than those appearing in
// this response, then nextPageToken is included. To get the next set of
// results, call this method again using the value of nextPageToken as
// pageToken.If a value for next_page_token appears and the entries
// field is empty, it means that the search found no log entries so far
// but it did not have time to search all the possible log entries.
// Retry the method with this value for page_token to continue the
// search. Alternatively, consider speeding up the search by changing
// your filter to specify a single log name or resource type, or to
// narrow the time range of the search.
NextPageToken string `json:"nextPageToken,omitempty"`
// ServerResponse contains the HTTP response code and headers from the
// server.
googleapi.ServerResponse `json:"-"`
// ForceSendFields is a list of field names (e.g. "Entries") to
// unconditionally include in API requests. By default, fields with
// empty values are omitted from API requests. However, any non-pointer,
// non-interface field appearing in ForceSendFields will be sent to the
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "Entries") to include in
// API requests with the JSON null value. By default, fields with empty
// values are omitted from API requests. However, any field with an
// empty value appearing in NullFields will be sent to the server as
// null. It is an error if a field in this list has a non-empty value.
// This may be used to include null fields in Patch requests.
NullFields []string `json:"-"`
}
func (s *ListLogEntriesResponse) MarshalJSON() ([]byte, error) {
type NoMethod ListLogEntriesResponse
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// ListLogMetricsResponse: Result returned from ListLogMetrics.
type ListLogMetricsResponse struct {
// Metrics: A list of logs-based metrics.
Metrics []*LogMetric `json:"metrics,omitempty"`
// NextPageToken: If there might be more results than appear in this
// response, then nextPageToken is included. To get the next set of
// results, call this method again using the value of nextPageToken as
// pageToken.
NextPageToken string `json:"nextPageToken,omitempty"`
// ServerResponse contains the HTTP response code and headers from the
// server.
googleapi.ServerResponse `json:"-"`
// ForceSendFields is a list of field names (e.g. "Metrics") to
// unconditionally include in API requests. By default, fields with
// empty values are omitted from API requests. However, any non-pointer,
// non-interface field appearing in ForceSendFields will be sent to the
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "Metrics") to include in
// API requests with the JSON null value. By default, fields with empty
// values are omitted from API requests. However, any field with an
// empty value appearing in NullFields will be sent to the server as
// null. It is an error if a field in this list has a non-empty value.
// This may be used to include null fields in Patch requests.
NullFields []string `json:"-"`
}
func (s *ListLogMetricsResponse) MarshalJSON() ([]byte, error) {
type NoMethod ListLogMetricsResponse
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// ListMonitoredResourceDescriptorsResponse: Result returned from
// ListMonitoredResourceDescriptors.
type ListMonitoredResourceDescriptorsResponse struct {
// NextPageToken: If there might be more results than those appearing in
// this response, then nextPageToken is included. To get the next set of
// results, call this method again using the value of nextPageToken as
// pageToken.
NextPageToken string `json:"nextPageToken,omitempty"`
// ResourceDescriptors: A list of resource descriptors.
ResourceDescriptors []*MonitoredResourceDescriptor `json:"resourceDescriptors,omitempty"`
// ServerResponse contains the HTTP response code and headers from the
// server.
googleapi.ServerResponse `json:"-"`
// ForceSendFields is a list of field names (e.g. "NextPageToken") to
// unconditionally include in API requests. By default, fields with
// empty values are omitted from API requests. However, any non-pointer,
// non-interface field appearing in ForceSendFields will be sent to the
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "NextPageToken") to include
// in API requests with the JSON null value. By default, fields with
// empty values are omitted from API requests. However, any field with
// an empty value appearing in NullFields will be sent to the server as
// null. It is an error if a field in this list has a non-empty value.
// This may be used to include null fields in Patch requests.
NullFields []string `json:"-"`
}
func (s *ListMonitoredResourceDescriptorsResponse) MarshalJSON() ([]byte, error) {
type NoMethod ListMonitoredResourceDescriptorsResponse
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// ListSinksResponse: Result returned from ListSinks.
type ListSinksResponse struct {
// NextPageToken: If there might be more results than appear in this
// response, then nextPageToken is included. To get the next set of
// results, call the same method again using the value of nextPageToken
// as pageToken.
NextPageToken string `json:"nextPageToken,omitempty"`
// Sinks: A list of sinks.
Sinks []*LogSink `json:"sinks,omitempty"`
// ServerResponse contains the HTTP response code and headers from the
// server.
googleapi.ServerResponse `json:"-"`
// ForceSendFields is a list of field names (e.g. "NextPageToken") to
// unconditionally include in API requests. By default, fields with
// empty values are omitted from API requests. However, any non-pointer,
// non-interface field appearing in ForceSendFields will be sent to the
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "NextPageToken") to include
// in API requests with the JSON null value. By default, fields with
// empty values are omitted from API requests. However, any field with
// an empty value appearing in NullFields will be sent to the server as
// null. It is an error if a field in this list has a non-empty value.
// This may be used to include null fields in Patch requests.
NullFields []string `json:"-"`
}
func (s *ListSinksResponse) MarshalJSON() ([]byte, error) {
type NoMethod ListSinksResponse
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// LogEntry: An individual entry in a log.
type LogEntry struct {
// HttpRequest: Optional. Information about the HTTP request associated
// with this log entry, if applicable.
HttpRequest *HttpRequest `json:"httpRequest,omitempty"`
// InsertId: Optional. A unique identifier for the log entry. If you
// provide a value, then Logging considers other log entries in the same
// project, with the same timestamp, and with the same insert_id to be
// duplicates which can be removed. If omitted in new log entries, then
// Logging assigns its own unique identifier. The insert_id is also used
// to order log entries that have the same timestamp value.
InsertId string `json:"insertId,omitempty"`
// JsonPayload: The log entry payload, represented as a structure that
// is expressed as a JSON object.
JsonPayload googleapi.RawMessage `json:"jsonPayload,omitempty"`
// Labels: Optional. A set of user-defined (key, value) data that
// provides additional information about the log entry.
Labels map[string]string `json:"labels,omitempty"`
// LogName: Required. The resource name of the log to which this log
// entry
// belongs:
// "projects/[PROJECT_ID]/logs/[LOG_ID]"
// "organizations/[ORGANIZ
// ATION_ID]/logs/[LOG_ID]"
// "billingAccounts/[BILLING_ACCOUNT_ID]/logs/[L
// OG_ID]"
// "folders/[FOLDER_ID]/logs/[LOG_ID]"
// A project number may optionally be used in place of PROJECT_ID. The
// project number is translated to its corresponding PROJECT_ID
// internally and the log_name field will contain PROJECT_ID in queries
// and exports.[LOG_ID] must be URL-encoded within log_name. Example:
// "organizations/1234567890/logs/cloudresourcemanager.googleapis.com%2Fa
// ctivity". [LOG_ID] must be less than 512 characters long and can only
// include the following characters: upper and lower case alphanumeric
// characters, forward-slash, underscore, hyphen, and period.For
// backward compatibility, if log_name begins with a forward-slash, such
// as /projects/..., then the log entry is ingested as usual but the
// forward-slash is removed. Listing the log entry will not show the
// leading slash and filtering for a log name with a leading slash will
// never return any results.
LogName string `json:"logName,omitempty"`
// Metadata: Deprecated. Output only. Additional metadata about the
// monitored resource.Only k8s_container, k8s_pod, and k8s_node
// MonitoredResources have this field populated for GKE versions older
// than 1.12.6. For GKE versions 1.12.6 and above, the metadata field
// has been deprecated. The Kubernetes pod labels that used to be in
// metadata.userLabels will now be present in the labels field with a
// key prefix of k8s-pod/. The Stackdriver system labels that were
// present in the metadata.systemLabels field will no longer be
// available in the LogEntry.
Metadata *MonitoredResourceMetadata `json:"metadata,omitempty"`
// Operation: Optional. Information about an operation associated with
// the log entry, if applicable.
Operation *LogEntryOperation `json:"operation,omitempty"`
// ProtoPayload: The log entry payload, represented as a protocol
// buffer. Some Google Cloud Platform services use this field for their
// log entry payloads.
ProtoPayload googleapi.RawMessage `json:"protoPayload,omitempty"`
// ReceiveTimestamp: Output only. The time the log entry was received by
// Logging.
ReceiveTimestamp string `json:"receiveTimestamp,omitempty"`
// Resource: Required. The primary monitored resource associated with
// this log entry.Example: a log entry that reports a database error
// would be associated with the monitored resource designating the
// particular database that reported the error.
Resource *MonitoredResource `json:"resource,omitempty"`
// Severity: Optional. The severity of the log entry. The default value
// is LogSeverity.DEFAULT.
//
// Possible values:
// "DEFAULT" - (0) The log entry has no assigned severity level.
// "DEBUG" - (100) Debug or trace information.
// "INFO" - (200) Routine information, such as ongoing status or
// performance.
// "NOTICE" - (300) Normal but significant events, such as start up,
// shut down, or a configuration change.
// "WARNING" - (400) Warning events might cause problems.
// "ERROR" - (500) Error events are likely to cause problems.
// "CRITICAL" - (600) Critical events cause more severe problems or
// outages.
// "ALERT" - (700) A person must take an action immediately.
// "EMERGENCY" - (800) One or more systems are unusable.
Severity string `json:"severity,omitempty"`
// SourceLocation: Optional. Source code location information associated
// with the log entry, if any.
SourceLocation *LogEntrySourceLocation `json:"sourceLocation,omitempty"`
// SpanId: Optional. The span ID within the trace associated with the
// log entry.For Trace spans, this is the same format that the Trace API
// v2 uses: a 16-character hexadecimal encoding of an 8-byte array, such
// as <code>"000000000000004a"</code>.
SpanId string `json:"spanId,omitempty"`
// TextPayload: The log entry payload, represented as a Unicode string
// (UTF-8).
TextPayload string `json:"textPayload,omitempty"`
// Timestamp: Optional. The time the event described by the log entry
// occurred. This time is used to compute the log entry's age and to
// enforce the logs retention period. If this field is omitted in a new
// log entry, then Logging assigns it the current time. Timestamps have
// nanosecond accuracy, but trailing zeros in the fractional seconds
// might be omitted when the timestamp is displayed.Incoming log entries
// should have timestamps that are no more than the logs retention
// period in the past, and no more than 24 hours in the future. Log
// entries outside those time boundaries will not be available when
// calling entries.list, but those log entries can still be exported
// with LogSinks.
Timestamp string `json:"timestamp,omitempty"`
// Trace: Optional. Resource name of the trace associated with the log
// entry, if any. If it contains a relative resource name, the name is
// assumed to be relative to //tracing.googleapis.com. Example:
// projects/my-projectid/traces/06796866738c859f2f19b7cfb3214824
Trace string `json:"trace,omitempty"`
// TraceSampled: Optional. The sampling decision of the trace associated
// with the log entry.True means that the trace resource name in the
// trace field was sampled for storage in a trace backend. False means
// that the trace was not sampled for storage when this log entry was
// written, or the sampling decision was unknown at the time. A
// non-sampled trace value is still useful as a request correlation
// identifier. The default is False.
TraceSampled bool `json:"traceSampled,omitempty"`
// ForceSendFields is a list of field names (e.g. "HttpRequest") to
// unconditionally include in API requests. By default, fields with
// empty values are omitted from API requests. However, any non-pointer,
// non-interface field appearing in ForceSendFields will be sent to the
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "HttpRequest") to include
// in API requests with the JSON null value. By default, fields with
// empty values are omitted from API requests. However, any field with
// an empty value appearing in NullFields will be sent to the server as
// null. It is an error if a field in this list has a non-empty value.
// This may be used to include null fields in Patch requests.
NullFields []string `json:"-"`
}
func (s *LogEntry) MarshalJSON() ([]byte, error) {
type NoMethod LogEntry
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// LogEntryOperation: Additional information about a potentially
// long-running operation with which a log entry is associated.
type LogEntryOperation struct {
// First: Optional. Set this to True if this is the first log entry in
// the operation.
First bool `json:"first,omitempty"`
// Id: Optional. An arbitrary operation identifier. Log entries with the
// same identifier are assumed to be part of the same operation.
Id string `json:"id,omitempty"`
// Last: Optional. Set this to True if this is the last log entry in the
// operation.
Last bool `json:"last,omitempty"`
// Producer: Optional. An arbitrary producer identifier. The combination
// of id and producer must be globally unique. Examples for producer:
// "MyDivision.MyBigCompany.com", "github.com/MyProject/MyApplication".
Producer string `json:"producer,omitempty"`
// ForceSendFields is a list of field names (e.g. "First") to
// unconditionally include in API requests. By default, fields with
// empty values are omitted from API requests. However, any non-pointer,
// non-interface field appearing in ForceSendFields will be sent to the
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "First") to include in API
// requests with the JSON null value. By default, fields with empty
// values are omitted from API requests. However, any field with an
// empty value appearing in NullFields will be sent to the server as
// null. It is an error if a field in this list has a non-empty value.
// This may be used to include null fields in Patch requests.
NullFields []string `json:"-"`
}
func (s *LogEntryOperation) MarshalJSON() ([]byte, error) {
type NoMethod LogEntryOperation
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// LogEntrySourceLocation: Additional information about the source code
// location that produced the log entry.
type LogEntrySourceLocation struct {
// File: Optional. Source file name. Depending on the runtime
// environment, this might be a simple name or a fully-qualified name.
File string `json:"file,omitempty"`
// Function: Optional. Human-readable name of the function or method
// being invoked, with optional context such as the class or package
// name. This information may be used in contexts such as the logs
// viewer, where a file and line number are less meaningful. The format
// can vary by language. For example: qual.if.ied.Class.method (Java),
// dir/package.func (Go), function (Python).
Function string `json:"function,omitempty"`