This repository has been archived by the owner on Oct 3, 2019. It is now read-only.
forked from googleapis/google-api-go-client
/
logging-gen.go
1989 lines (1816 loc) · 64.4 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
// Package logging provides access to the Google Cloud Logging API.
//
// Usage example:
//
// import "google.golang.org/api/logging/v1beta3"
// ...
// loggingService, err := logging.New(oauthHttpClient)
package logging
import (
"bytes"
"encoding/json"
"errors"
"fmt"
"golang.org/x/net/context"
"google.golang.org/api/googleapi"
"io"
"net/http"
"net/url"
"strconv"
"strings"
)
// 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 _ = googleapi.Version
var _ = errors.New
var _ = strings.Replace
var _ = context.Background
const apiId = "logging:v1beta3"
const apiName = "logging"
const apiVersion = "v1beta3"
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"
)
func New(client *http.Client) (*Service, error) {
if client == nil {
return nil, errors.New("client is nil")
}
s := &Service{client: client, BasePath: basePath}
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
Projects *ProjectsService
}
func (s *Service) userAgent() string {
if s.UserAgent == "" {
return googleapi.UserAgent
}
return googleapi.UserAgent + " " + s.UserAgent
}
func NewProjectsService(s *Service) *ProjectsService {
rs := &ProjectsService{s: s}
rs.LogServices = NewProjectsLogServicesService(s)
rs.Logs = NewProjectsLogsService(s)
return rs
}
type ProjectsService struct {
s *Service
LogServices *ProjectsLogServicesService
Logs *ProjectsLogsService
}
func NewProjectsLogServicesService(s *Service) *ProjectsLogServicesService {
rs := &ProjectsLogServicesService{s: s}
rs.Indexes = NewProjectsLogServicesIndexesService(s)
rs.Sinks = NewProjectsLogServicesSinksService(s)
return rs
}
type ProjectsLogServicesService struct {
s *Service
Indexes *ProjectsLogServicesIndexesService
Sinks *ProjectsLogServicesSinksService
}
func NewProjectsLogServicesIndexesService(s *Service) *ProjectsLogServicesIndexesService {
rs := &ProjectsLogServicesIndexesService{s: s}
return rs
}
type ProjectsLogServicesIndexesService struct {
s *Service
}
func NewProjectsLogServicesSinksService(s *Service) *ProjectsLogServicesSinksService {
rs := &ProjectsLogServicesSinksService{s: s}
return rs
}
type ProjectsLogServicesSinksService struct {
s *Service
}
func NewProjectsLogsService(s *Service) *ProjectsLogsService {
rs := &ProjectsLogsService{s: s}
rs.Entries = NewProjectsLogsEntriesService(s)
rs.Sinks = NewProjectsLogsSinksService(s)
return rs
}
type ProjectsLogsService struct {
s *Service
Entries *ProjectsLogsEntriesService
Sinks *ProjectsLogsSinksService
}
func NewProjectsLogsEntriesService(s *Service) *ProjectsLogsEntriesService {
rs := &ProjectsLogsEntriesService{s: s}
return rs
}
type ProjectsLogsEntriesService struct {
s *Service
}
func NewProjectsLogsSinksService(s *Service) *ProjectsLogsSinksService {
rs := &ProjectsLogsSinksService{s: s}
return rs
}
type ProjectsLogsSinksService struct {
s *Service
}
type Empty struct {
}
type ListLogServiceIndexesResponse struct {
// NextPageToken: If there are more results, then `nextPageToken` is
// returned in the response. To get the next batch of indexes, use the
// value of `nextPageToken` as `pageToken` in the next call of
// `ListLogServiceIndexess`. If `nextPageToken` is empty, then there are
// no more results.
NextPageToken string `json:"nextPageToken,omitempty"`
// ServiceIndexPrefixes: A list of log service index prefixes.
ServiceIndexPrefixes []string `json:"serviceIndexPrefixes,omitempty"`
}
type ListLogServiceSinksResponse struct {
// Sinks: The requested log service sinks. If any of the returned
// `LogSink` objects have an empty `destination` field, then call
// `logServices.sinks.get` to retrieve the complete `LogSink` object.
Sinks []*LogSink `json:"sinks,omitempty"`
}
type ListLogServicesResponse struct {
// LogServices: A list of log services.
LogServices []*LogService `json:"logServices,omitempty"`
// NextPageToken: If there are more results, then `nextPageToken` is
// returned in the response. To get the next batch of services, use the
// value of `nextPageToken` as `pageToken` in the next call of
// `ListLogServices`. If `nextPageToken` is empty, then there are no
// more results.
NextPageToken string `json:"nextPageToken,omitempty"`
}
type ListLogSinksResponse struct {
// Sinks: The requested log sinks. If any of the returned `LogSink`
// objects have an empty `destination` field, then call
// `logServices.sinks.get` to retrieve the complete `LogSink` object.
Sinks []*LogSink `json:"sinks,omitempty"`
}
type ListLogsResponse struct {
// Logs: A list of log resources.
Logs []*Log `json:"logs,omitempty"`
// NextPageToken: If there are more results, then `nextPageToken` is
// returned in the response. To get the next batch of logs, use the
// value of `nextPageToken` as `pageToken` in the next call of
// `ListLogs`. If `nextPageToken` is empty, then there are no more
// results.
NextPageToken string `json:"nextPageToken,omitempty"`
}
type Log struct {
// DisplayName: Name used when displaying the log to the user (for
// example, in a UI). Example: "activity_log"
DisplayName string `json:"displayName,omitempty"`
// Name: REQUIRED: The log's name name. Example:
// "compute.googleapis.com/activity_log".
Name string `json:"name,omitempty"`
// PayloadType: Type URL describing the expected payload type for the
// log.
PayloadType string `json:"payloadType,omitempty"`
}
type LogEntry struct {
// InsertId: A unique ID for the log entry. If you provide this field,
// the logging service considers other log entries in the same log with
// the same ID as duplicates which can be removed.
InsertId string `json:"insertId,omitempty"`
// Log: The log to which this entry belongs. When a log entry is
// ingested, the value of this field is set by the logging system.
Log string `json:"log,omitempty"`
// Metadata: Information about the log entry.
Metadata *LogEntryMetadata `json:"metadata,omitempty"`
// ProtoPayload: The log entry payload, represented as a protocol buffer
// that is expressed as a JSON object. You can only pass `protoPayload`
// values that belong to a set of approved types.
ProtoPayload LogEntryProtoPayload `json:"protoPayload,omitempty"`
// StructPayload: The log entry payload, represented as a structure that
// is expressed as a JSON object.
StructPayload LogEntryStructPayload `json:"structPayload,omitempty"`
// TextPayload: The log entry payload, represented as a text string.
TextPayload string `json:"textPayload,omitempty"`
}
type LogEntryProtoPayload interface{}
type LogEntryStructPayload interface{}
type LogEntryMetadata struct {
// Labels: A set of (key, value) data that provides additional
// information about the log entry. If the log entry is from one of the
// Google Cloud Platform sources listed below, the indicated (key,
// value) information must be provided: Google App Engine, service_name
// `appengine.googleapis.com`: "appengine.googleapis.com/module_id",
// "appengine.googleapis.com/version_id", and one of:
// "appengine.googleapis.com/replica_index",
// "appengine.googleapis.com/clone_id", or else provide the following
// Compute Engine labels: Google Compute Engine, service_name
// `compute.googleapis.com`: "compute.googleapis.com/resource_type",
// "instance" "compute.googleapis.com/resource_id",
Labels map[string]string `json:"labels,omitempty"`
// ProjectId: The project ID of the Google Cloud Platform service that
// created the log entry.
ProjectId string `json:"projectId,omitempty"`
// Region: The region name of the Google Cloud Platform service that
// created the log entry. For example, "us-central1".
Region string `json:"region,omitempty"`
// ServiceName: The API name of the Google Cloud Platform service that
// created the log entry. For example, "compute.googleapis.com".
ServiceName string `json:"serviceName,omitempty"`
// Severity: The severity of the log entry.
//
// Possible values:
// "DEFAULT"
// "DEBUG"
// "INFO"
// "NOTICE"
// "WARNING"
// "ERROR"
// "CRITICAL"
// "ALERT"
// "EMERGENCY"
Severity string `json:"severity,omitempty"`
// Timestamp: The time the event described by the log entry occurred.
// Timestamps must be later than January 1, 1970.
Timestamp string `json:"timestamp,omitempty"`
// UserId: The fully-qualified email address of the authenticated user
// that performed or requested the action represented by the log entry.
// If the log entry does not apply to an action taken by an
// authenticated user, then the field should be empty.
UserId string `json:"userId,omitempty"`
// Zone: The zone of the Google Cloud Platform service that created the
// log entry. For example, "us-central1-a".
Zone string `json:"zone,omitempty"`
}
type LogError struct {
// Resource: The resource associated with the error. It may be different
// from the sink destination. For example, the sink may point to a
// BigQuery dataset, but the error may refer to a table resource inside
// the dataset.
Resource string `json:"resource,omitempty"`
// Status: The description of the last error observed.
Status *Status `json:"status,omitempty"`
// TimeNanos: The last time the error was observed, in nanoseconds since
// the Unix epoch.
TimeNanos int64 `json:"timeNanos,omitempty,string"`
}
type LogService struct {
// IndexKeys: Label keys used when labeling log entries for this
// service. The order of the keys is significant, with higher priority
// keys coming earlier in the list.
IndexKeys []string `json:"indexKeys,omitempty"`
// Name: The service's name.
Name string `json:"name,omitempty"`
}
type LogSink struct {
// Destination: The resource to send log entries to. The supported sink
// resource types are: + Google Cloud Storage:
// `storage.googleapis.com/BUCKET` or `BUCKET.storage.googleapis.com/` +
// Google BigQuery:
// `bigquery.googleapis.com/projects/PROJECT/datasets/DATASET` Currently
// the Cloud Logging API supports at most one sink for each resource
// type per log or log service resource.
Destination string `json:"destination,omitempty"`
// Errors: _Output only._ All active errors found for this sink.
Errors []*LogError `json:"errors,omitempty"`
// Name: The name of this sink. This is a client-assigned identifier for
// the resource. This is ignored by UpdateLogSink and
// UpdateLogServicesSink.
Name string `json:"name,omitempty"`
}
type Status struct {
// Code: The status code, which should be an enum value of
// [google.rpc.Code][].
Code int64 `json:"code,omitempty"`
// Details: A list of messages that carry the error details. There will
// be a common set of message types for APIs to use.
Details []StatusDetails `json:"details,omitempty"`
// Message: A developer-facing error message, which should be in
// English. The user-facing error message should be localized and stored
// in the [google.rpc.Status.details][google.rpc.Status.details] field.
Message string `json:"message,omitempty"`
}
type StatusDetails interface{}
type WriteLogEntriesRequest struct {
// CommonLabels: Metadata labels that apply to all entries in this
// request. If one of the log entries contains a (key, value) with the
// same key that is in `commonLabels`, then the entry's (key, value)
// overrides the one in `commonLabels`.
CommonLabels map[string]string `json:"commonLabels,omitempty"`
// Entries: Log entries to insert.
Entries []*LogEntry `json:"entries,omitempty"`
}
type WriteLogEntriesResponse struct {
}
// method id "logging.projects.logServices.list":
type ProjectsLogServicesListCall struct {
s *Service
projectsId string
opt_ map[string]interface{}
}
// List: Lists log services associated with log entries ingested for a
// project.
func (r *ProjectsLogServicesService) List(projectsId string) *ProjectsLogServicesListCall {
c := &ProjectsLogServicesListCall{s: r.s, opt_: make(map[string]interface{})}
c.projectsId = projectsId
return c
}
// Log sets the optional parameter "log": The name of the log resource
// whose services are to be listed. log for which to list services. When
// empty, all services are listed.
func (c *ProjectsLogServicesListCall) Log(log string) *ProjectsLogServicesListCall {
c.opt_["log"] = log
return c
}
// PageSize sets the optional parameter "pageSize": The maximum number
// of `LogService` objects to return in one operation.
func (c *ProjectsLogServicesListCall) PageSize(pageSize int64) *ProjectsLogServicesListCall {
c.opt_["pageSize"] = pageSize
return c
}
// PageToken sets the optional parameter "pageToken": An opaque token,
// returned as `nextPageToken` by a prior `ListLogServices` operation.
// If `pageToken` is supplied, then the other fields of this request are
// ignored, and instead the previous `ListLogServices` operation is
// continued.
func (c *ProjectsLogServicesListCall) PageToken(pageToken string) *ProjectsLogServicesListCall {
c.opt_["pageToken"] = pageToken
return c
}
// Fields allows partial responses to be retrieved.
// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
// for more information.
func (c *ProjectsLogServicesListCall) Fields(s ...googleapi.Field) *ProjectsLogServicesListCall {
c.opt_["fields"] = googleapi.CombineFields(s)
return c
}
func (c *ProjectsLogServicesListCall) Do() (*ListLogServicesResponse, error) {
var body io.Reader = nil
params := make(url.Values)
params.Set("alt", "json")
if v, ok := c.opt_["log"]; ok {
params.Set("log", fmt.Sprintf("%v", v))
}
if v, ok := c.opt_["pageSize"]; ok {
params.Set("pageSize", fmt.Sprintf("%v", v))
}
if v, ok := c.opt_["pageToken"]; ok {
params.Set("pageToken", fmt.Sprintf("%v", v))
}
if v, ok := c.opt_["fields"]; ok {
params.Set("fields", fmt.Sprintf("%v", v))
}
urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta3/projects/{projectsId}/logServices")
urls += "?" + params.Encode()
req, _ := http.NewRequest("GET", urls, body)
googleapi.Expand(req.URL, map[string]string{
"projectsId": c.projectsId,
})
req.Header.Set("User-Agent", c.s.userAgent())
res, err := c.s.client.Do(req)
if err != nil {
return nil, err
}
defer googleapi.CloseBody(res)
if err := googleapi.CheckResponse(res); err != nil {
return nil, err
}
var ret *ListLogServicesResponse
if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
return nil, err
}
return ret, nil
// {
// "description": "Lists log services associated with log entries ingested for a project.",
// "httpMethod": "GET",
// "id": "logging.projects.logServices.list",
// "parameterOrder": [
// "projectsId"
// ],
// "parameters": {
// "log": {
// "description": "The name of the log resource whose services are to be listed. log for which to list services. When empty, all services are listed.",
// "location": "query",
// "type": "string"
// },
// "pageSize": {
// "description": "The maximum number of `LogService` objects to return in one operation.",
// "format": "int32",
// "location": "query",
// "type": "integer"
// },
// "pageToken": {
// "description": "An opaque token, returned as `nextPageToken` by a prior `ListLogServices` operation. If `pageToken` is supplied, then the other fields of this request are ignored, and instead the previous `ListLogServices` operation is continued.",
// "location": "query",
// "type": "string"
// },
// "projectsId": {
// "description": "Part of `projectName`. The project resource whose services are to be listed.",
// "location": "path",
// "required": true,
// "type": "string"
// }
// },
// "path": "v1beta3/projects/{projectsId}/logServices",
// "response": {
// "$ref": "ListLogServicesResponse"
// },
// "scopes": [
// "https://www.googleapis.com/auth/cloud-platform"
// ]
// }
}
// method id "logging.projects.logServices.indexes.list":
type ProjectsLogServicesIndexesListCall struct {
s *Service
projectsId string
logServicesId string
opt_ map[string]interface{}
}
// List: Lists log service indexes associated with a log service.
func (r *ProjectsLogServicesIndexesService) List(projectsId string, logServicesId string) *ProjectsLogServicesIndexesListCall {
c := &ProjectsLogServicesIndexesListCall{s: r.s, opt_: make(map[string]interface{})}
c.projectsId = projectsId
c.logServicesId = logServicesId
return c
}
// Depth sets the optional parameter "depth": A limit to the number of
// levels of the index hierarchy that are expanded. If `depth` is 0, it
// defaults to the level specified by the prefix field (the number of
// slash separators). The default empty prefix implies a `depth` of 1.
// It is an error for `depth` to be any non-zero value less than the
// number of components in `indexPrefix`.
func (c *ProjectsLogServicesIndexesListCall) Depth(depth int64) *ProjectsLogServicesIndexesListCall {
c.opt_["depth"] = depth
return c
}
// IndexPrefix sets the optional parameter "indexPrefix": Restricts the
// indexes returned to be those with a specified prefix. The prefix has
// the form "/label_value/label_value/...", in order corresponding to
// the [`LogService
// indexKeys`][google.logging.v1.LogService.index_keys]. Non-empty
// prefixes must begin with `/` . Example prefixes: + "/myModule/"
// retrieves App Engine versions associated with `myModule`. The
// trailing slash terminates the value. + "/myModule" retrieves App
// Engine modules with names beginning with `myModule`. + "" retrieves
// all indexes.
func (c *ProjectsLogServicesIndexesListCall) IndexPrefix(indexPrefix string) *ProjectsLogServicesIndexesListCall {
c.opt_["indexPrefix"] = indexPrefix
return c
}
// Log sets the optional parameter "log": A log resource like
// `/projects/project_id/logs/log_name`, identifying the log for which
// to list service indexes.
func (c *ProjectsLogServicesIndexesListCall) Log(log string) *ProjectsLogServicesIndexesListCall {
c.opt_["log"] = log
return c
}
// PageSize sets the optional parameter "pageSize": The maximum number
// of log service index resources to return in one operation.
func (c *ProjectsLogServicesIndexesListCall) PageSize(pageSize int64) *ProjectsLogServicesIndexesListCall {
c.opt_["pageSize"] = pageSize
return c
}
// PageToken sets the optional parameter "pageToken": An opaque token,
// returned as `nextPageToken` by a prior `ListLogServiceIndexes`
// operation. If `pageToken` is supplied, then the other fields of this
// request are ignored, and instead the previous `ListLogServiceIndexes`
// operation is continued.
func (c *ProjectsLogServicesIndexesListCall) PageToken(pageToken string) *ProjectsLogServicesIndexesListCall {
c.opt_["pageToken"] = pageToken
return c
}
// Fields allows partial responses to be retrieved.
// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
// for more information.
func (c *ProjectsLogServicesIndexesListCall) Fields(s ...googleapi.Field) *ProjectsLogServicesIndexesListCall {
c.opt_["fields"] = googleapi.CombineFields(s)
return c
}
func (c *ProjectsLogServicesIndexesListCall) Do() (*ListLogServiceIndexesResponse, error) {
var body io.Reader = nil
params := make(url.Values)
params.Set("alt", "json")
if v, ok := c.opt_["depth"]; ok {
params.Set("depth", fmt.Sprintf("%v", v))
}
if v, ok := c.opt_["indexPrefix"]; ok {
params.Set("indexPrefix", fmt.Sprintf("%v", v))
}
if v, ok := c.opt_["log"]; ok {
params.Set("log", fmt.Sprintf("%v", v))
}
if v, ok := c.opt_["pageSize"]; ok {
params.Set("pageSize", fmt.Sprintf("%v", v))
}
if v, ok := c.opt_["pageToken"]; ok {
params.Set("pageToken", fmt.Sprintf("%v", v))
}
if v, ok := c.opt_["fields"]; ok {
params.Set("fields", fmt.Sprintf("%v", v))
}
urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta3/projects/{projectsId}/logServices/{logServicesId}/indexes")
urls += "?" + params.Encode()
req, _ := http.NewRequest("GET", urls, body)
googleapi.Expand(req.URL, map[string]string{
"projectsId": c.projectsId,
"logServicesId": c.logServicesId,
})
req.Header.Set("User-Agent", c.s.userAgent())
res, err := c.s.client.Do(req)
if err != nil {
return nil, err
}
defer googleapi.CloseBody(res)
if err := googleapi.CheckResponse(res); err != nil {
return nil, err
}
var ret *ListLogServiceIndexesResponse
if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
return nil, err
}
return ret, nil
// {
// "description": "Lists log service indexes associated with a log service.",
// "httpMethod": "GET",
// "id": "logging.projects.logServices.indexes.list",
// "parameterOrder": [
// "projectsId",
// "logServicesId"
// ],
// "parameters": {
// "depth": {
// "description": "A limit to the number of levels of the index hierarchy that are expanded. If `depth` is 0, it defaults to the level specified by the prefix field (the number of slash separators). The default empty prefix implies a `depth` of 1. It is an error for `depth` to be any non-zero value less than the number of components in `indexPrefix`.",
// "format": "int32",
// "location": "query",
// "type": "integer"
// },
// "indexPrefix": {
// "description": "Restricts the indexes returned to be those with a specified prefix. The prefix has the form `\"/label_value/label_value/...\"`, in order corresponding to the [`LogService indexKeys`][google.logging.v1.LogService.index_keys]. Non-empty prefixes must begin with `/` . Example prefixes: + `\"/myModule/\"` retrieves App Engine versions associated with `myModule`. The trailing slash terminates the value. + `\"/myModule\"` retrieves App Engine modules with names beginning with `myModule`. + `\"\"` retrieves all indexes.",
// "location": "query",
// "type": "string"
// },
// "log": {
// "description": "A log resource like `/projects/project_id/logs/log_name`, identifying the log for which to list service indexes.",
// "location": "query",
// "type": "string"
// },
// "logServicesId": {
// "description": "Part of `serviceName`. See documentation of `projectsId`.",
// "location": "path",
// "required": true,
// "type": "string"
// },
// "pageSize": {
// "description": "The maximum number of log service index resources to return in one operation.",
// "format": "int32",
// "location": "query",
// "type": "integer"
// },
// "pageToken": {
// "description": "An opaque token, returned as `nextPageToken` by a prior `ListLogServiceIndexes` operation. If `pageToken` is supplied, then the other fields of this request are ignored, and instead the previous `ListLogServiceIndexes` operation is continued.",
// "location": "query",
// "type": "string"
// },
// "projectsId": {
// "description": "Part of `serviceName`. A log service resource of the form `/projects/*/logServices/*`. The service indexes of the log service are returned. Example: `\"/projects/myProj/logServices/appengine.googleapis.com\"`.",
// "location": "path",
// "required": true,
// "type": "string"
// }
// },
// "path": "v1beta3/projects/{projectsId}/logServices/{logServicesId}/indexes",
// "response": {
// "$ref": "ListLogServiceIndexesResponse"
// },
// "scopes": [
// "https://www.googleapis.com/auth/cloud-platform"
// ]
// }
}
// method id "logging.projects.logServices.sinks.create":
type ProjectsLogServicesSinksCreateCall struct {
s *Service
projectsId string
logServicesId string
logsink *LogSink
opt_ map[string]interface{}
}
// Create: Creates the specified log service sink resource.
func (r *ProjectsLogServicesSinksService) Create(projectsId string, logServicesId string, logsink *LogSink) *ProjectsLogServicesSinksCreateCall {
c := &ProjectsLogServicesSinksCreateCall{s: r.s, opt_: make(map[string]interface{})}
c.projectsId = projectsId
c.logServicesId = logServicesId
c.logsink = logsink
return c
}
// Fields allows partial responses to be retrieved.
// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
// for more information.
func (c *ProjectsLogServicesSinksCreateCall) Fields(s ...googleapi.Field) *ProjectsLogServicesSinksCreateCall {
c.opt_["fields"] = googleapi.CombineFields(s)
return c
}
func (c *ProjectsLogServicesSinksCreateCall) Do() (*LogSink, error) {
var body io.Reader = nil
body, err := googleapi.WithoutDataWrapper.JSONReader(c.logsink)
if err != nil {
return nil, err
}
ctype := "application/json"
params := make(url.Values)
params.Set("alt", "json")
if v, ok := c.opt_["fields"]; ok {
params.Set("fields", fmt.Sprintf("%v", v))
}
urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta3/projects/{projectsId}/logServices/{logServicesId}/sinks")
urls += "?" + params.Encode()
req, _ := http.NewRequest("POST", urls, body)
googleapi.Expand(req.URL, map[string]string{
"projectsId": c.projectsId,
"logServicesId": c.logServicesId,
})
req.Header.Set("Content-Type", ctype)
req.Header.Set("User-Agent", c.s.userAgent())
res, err := c.s.client.Do(req)
if err != nil {
return nil, err
}
defer googleapi.CloseBody(res)
if err := googleapi.CheckResponse(res); err != nil {
return nil, err
}
var ret *LogSink
if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
return nil, err
}
return ret, nil
// {
// "description": "Creates the specified log service sink resource.",
// "httpMethod": "POST",
// "id": "logging.projects.logServices.sinks.create",
// "parameterOrder": [
// "projectsId",
// "logServicesId"
// ],
// "parameters": {
// "logServicesId": {
// "description": "Part of `serviceName`. See documentation of `projectsId`.",
// "location": "path",
// "required": true,
// "type": "string"
// },
// "projectsId": {
// "description": "Part of `serviceName`. The name of the service in which to create a sink.",
// "location": "path",
// "required": true,
// "type": "string"
// }
// },
// "path": "v1beta3/projects/{projectsId}/logServices/{logServicesId}/sinks",
// "request": {
// "$ref": "LogSink"
// },
// "response": {
// "$ref": "LogSink"
// },
// "scopes": [
// "https://www.googleapis.com/auth/cloud-platform"
// ]
// }
}
// method id "logging.projects.logServices.sinks.delete":
type ProjectsLogServicesSinksDeleteCall struct {
s *Service
projectsId string
logServicesId string
sinksId string
opt_ map[string]interface{}
}
// Delete: Deletes the specified log service sink.
func (r *ProjectsLogServicesSinksService) Delete(projectsId string, logServicesId string, sinksId string) *ProjectsLogServicesSinksDeleteCall {
c := &ProjectsLogServicesSinksDeleteCall{s: r.s, opt_: make(map[string]interface{})}
c.projectsId = projectsId
c.logServicesId = logServicesId
c.sinksId = sinksId
return c
}
// Fields allows partial responses to be retrieved.
// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
// for more information.
func (c *ProjectsLogServicesSinksDeleteCall) Fields(s ...googleapi.Field) *ProjectsLogServicesSinksDeleteCall {
c.opt_["fields"] = googleapi.CombineFields(s)
return c
}
func (c *ProjectsLogServicesSinksDeleteCall) Do() (*Empty, error) {
var body io.Reader = nil
params := make(url.Values)
params.Set("alt", "json")
if v, ok := c.opt_["fields"]; ok {
params.Set("fields", fmt.Sprintf("%v", v))
}
urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta3/projects/{projectsId}/logServices/{logServicesId}/sinks/{sinksId}")
urls += "?" + params.Encode()
req, _ := http.NewRequest("DELETE", urls, body)
googleapi.Expand(req.URL, map[string]string{
"projectsId": c.projectsId,
"logServicesId": c.logServicesId,
"sinksId": c.sinksId,
})
req.Header.Set("User-Agent", c.s.userAgent())
res, err := c.s.client.Do(req)
if err != nil {
return nil, err
}
defer googleapi.CloseBody(res)
if err := googleapi.CheckResponse(res); err != nil {
return nil, err
}
var ret *Empty
if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
return nil, err
}
return ret, nil
// {
// "description": "Deletes the specified log service sink.",
// "httpMethod": "DELETE",
// "id": "logging.projects.logServices.sinks.delete",
// "parameterOrder": [
// "projectsId",
// "logServicesId",
// "sinksId"
// ],
// "parameters": {
// "logServicesId": {
// "description": "Part of `sinkName`. See documentation of `projectsId`.",
// "location": "path",
// "required": true,
// "type": "string"
// },
// "projectsId": {
// "description": "Part of `sinkName`. The name of the sink to delete.",
// "location": "path",
// "required": true,
// "type": "string"
// },
// "sinksId": {
// "description": "Part of `sinkName`. See documentation of `projectsId`.",
// "location": "path",
// "required": true,
// "type": "string"
// }
// },
// "path": "v1beta3/projects/{projectsId}/logServices/{logServicesId}/sinks/{sinksId}",
// "response": {
// "$ref": "Empty"
// },
// "scopes": [
// "https://www.googleapis.com/auth/cloud-platform"
// ]
// }
}
// method id "logging.projects.logServices.sinks.get":
type ProjectsLogServicesSinksGetCall struct {
s *Service
projectsId string
logServicesId string
sinksId string
opt_ map[string]interface{}
}
// Get: Gets the specified log service sink resource.
func (r *ProjectsLogServicesSinksService) Get(projectsId string, logServicesId string, sinksId string) *ProjectsLogServicesSinksGetCall {
c := &ProjectsLogServicesSinksGetCall{s: r.s, opt_: make(map[string]interface{})}
c.projectsId = projectsId
c.logServicesId = logServicesId
c.sinksId = sinksId
return c
}
// Fields allows partial responses to be retrieved.
// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
// for more information.
func (c *ProjectsLogServicesSinksGetCall) Fields(s ...googleapi.Field) *ProjectsLogServicesSinksGetCall {
c.opt_["fields"] = googleapi.CombineFields(s)
return c
}
func (c *ProjectsLogServicesSinksGetCall) Do() (*LogSink, error) {
var body io.Reader = nil
params := make(url.Values)
params.Set("alt", "json")
if v, ok := c.opt_["fields"]; ok {
params.Set("fields", fmt.Sprintf("%v", v))
}
urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta3/projects/{projectsId}/logServices/{logServicesId}/sinks/{sinksId}")
urls += "?" + params.Encode()
req, _ := http.NewRequest("GET", urls, body)
googleapi.Expand(req.URL, map[string]string{
"projectsId": c.projectsId,
"logServicesId": c.logServicesId,
"sinksId": c.sinksId,
})
req.Header.Set("User-Agent", c.s.userAgent())
res, err := c.s.client.Do(req)
if err != nil {
return nil, err
}
defer googleapi.CloseBody(res)
if err := googleapi.CheckResponse(res); err != nil {
return nil, err
}
var ret *LogSink
if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
return nil, err
}
return ret, nil
// {
// "description": "Gets the specified log service sink resource.",
// "httpMethod": "GET",
// "id": "logging.projects.logServices.sinks.get",
// "parameterOrder": [
// "projectsId",
// "logServicesId",
// "sinksId"
// ],
// "parameters": {
// "logServicesId": {
// "description": "Part of `sinkName`. See documentation of `projectsId`.",
// "location": "path",
// "required": true,
// "type": "string"
// },
// "projectsId": {
// "description": "Part of `sinkName`. The name of the sink to return.",
// "location": "path",
// "required": true,
// "type": "string"
// },
// "sinksId": {
// "description": "Part of `sinkName`. See documentation of `projectsId`.",
// "location": "path",
// "required": true,
// "type": "string"
// }
// },
// "path": "v1beta3/projects/{projectsId}/logServices/{logServicesId}/sinks/{sinksId}",
// "response": {
// "$ref": "LogSink"
// },
// "scopes": [
// "https://www.googleapis.com/auth/cloud-platform"
// ]
// }
}
// method id "logging.projects.logServices.sinks.list":
type ProjectsLogServicesSinksListCall struct {
s *Service
projectsId string
logServicesId string
opt_ map[string]interface{}
}
// List: Lists log service sinks associated with the specified service.
func (r *ProjectsLogServicesSinksService) List(projectsId string, logServicesId string) *ProjectsLogServicesSinksListCall {
c := &ProjectsLogServicesSinksListCall{s: r.s, opt_: make(map[string]interface{})}
c.projectsId = projectsId
c.logServicesId = logServicesId
return c
}
// Fields allows partial responses to be retrieved.
// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
// for more information.
func (c *ProjectsLogServicesSinksListCall) Fields(s ...googleapi.Field) *ProjectsLogServicesSinksListCall {
c.opt_["fields"] = googleapi.CombineFields(s)
return c
}
func (c *ProjectsLogServicesSinksListCall) Do() (*ListLogServiceSinksResponse, error) {