diff --git a/test/e2e/instrumentation/logging/BUILD b/test/e2e/instrumentation/logging/BUILD
index bda535982b4..97cf77d9411 100644
--- a/test/e2e/instrumentation/logging/BUILD
+++ b/test/e2e/instrumentation/logging/BUILD
@@ -19,7 +19,6 @@ go_library(
"//test/e2e/framework/node:go_default_library",
"//test/e2e/instrumentation/common:go_default_library",
"//test/e2e/instrumentation/logging/elasticsearch:go_default_library",
- "//test/e2e/instrumentation/logging/stackdriver:go_default_library",
"//test/utils/image:go_default_library",
"//vendor/github.com/onsi/ginkgo:go_default_library",
],
@@ -37,7 +36,6 @@ filegroup(
srcs = [
":package-srcs",
"//test/e2e/instrumentation/logging/elasticsearch:all-srcs",
- "//test/e2e/instrumentation/logging/stackdriver:all-srcs",
"//test/e2e/instrumentation/logging/utils:all-srcs",
],
tags = ["automanaged"],
diff --git a/test/e2e/instrumentation/logging/imports.go b/test/e2e/instrumentation/logging/imports.go
index 5dd66717db1..e66db4f3994 100644
--- a/test/e2e/instrumentation/logging/imports.go
+++ b/test/e2e/instrumentation/logging/imports.go
@@ -18,5 +18,4 @@ package logging
import (
_ "k8s.io/kubernetes/test/e2e/instrumentation/logging/elasticsearch" // for elasticsearch provider
- _ "k8s.io/kubernetes/test/e2e/instrumentation/logging/stackdriver" // for stackdriver provider
)
diff --git a/test/e2e/instrumentation/logging/stackdriver/BUILD b/test/e2e/instrumentation/logging/stackdriver/BUILD
deleted file mode 100644
index b88a71bf7ec..00000000000
--- a/test/e2e/instrumentation/logging/stackdriver/BUILD
+++ /dev/null
@@ -1,44 +0,0 @@
-package(default_visibility = ["//visibility:public"])
-
-load(
- "@io_bazel_rules_go//go:def.bzl",
- "go_library",
-)
-
-go_library(
- name = "go_default_library",
- srcs = [
- "basic.go",
- "soak.go",
- "utils.go",
- ],
- importpath = "k8s.io/kubernetes/test/e2e/instrumentation/logging/stackdriver",
- deps = [
- "//staging/src/k8s.io/apimachinery/pkg/util/json:go_default_library",
- "//staging/src/k8s.io/apimachinery/pkg/util/uuid:go_default_library",
- "//staging/src/k8s.io/apimachinery/pkg/util/wait:go_default_library",
- "//test/e2e/framework:go_default_library",
- "//test/e2e/framework/node:go_default_library",
- "//test/e2e/framework/skipper:go_default_library",
- "//test/e2e/instrumentation/common:go_default_library",
- "//test/e2e/instrumentation/logging/utils:go_default_library",
- "//vendor/github.com/onsi/ginkgo:go_default_library",
- "//vendor/golang.org/x/oauth2/google:go_default_library",
- "//vendor/google.golang.org/api/logging/v2beta1:go_default_library",
- "//vendor/google.golang.org/api/option:go_default_library",
- "//vendor/google.golang.org/api/pubsub/v1:go_default_library",
- ],
-)
-
-filegroup(
- name = "package-srcs",
- srcs = glob(["**"]),
- tags = ["automanaged"],
- visibility = ["//visibility:private"],
-)
-
-filegroup(
- name = "all-srcs",
- srcs = [":package-srcs"],
- tags = ["automanaged"],
-)
diff --git a/test/e2e/instrumentation/logging/stackdriver/basic.go b/test/e2e/instrumentation/logging/stackdriver/basic.go
deleted file mode 100644
index 563aa8cb5fd..00000000000
--- a/test/e2e/instrumentation/logging/stackdriver/basic.go
+++ /dev/null
@@ -1,195 +0,0 @@
-/*
-Copyright 2017 The Kubernetes Authors.
-
-Licensed under the Apache License, Version 2.0 (the "License");
-you may not use this file except in compliance with the License.
-You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing, software
-distributed under the License is distributed on an "AS IS" BASIS,
-WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-See the License for the specific language governing permissions and
-limitations under the License.
-*/
-
-package stackdriver
-
-import (
- "fmt"
- "time"
-
- "k8s.io/apimachinery/pkg/util/json"
- "k8s.io/apimachinery/pkg/util/uuid"
- "k8s.io/apimachinery/pkg/util/wait"
- "k8s.io/kubernetes/test/e2e/framework"
- e2eskipper "k8s.io/kubernetes/test/e2e/framework/skipper"
- instrumentation "k8s.io/kubernetes/test/e2e/instrumentation/common"
- "k8s.io/kubernetes/test/e2e/instrumentation/logging/utils"
-
- "github.com/onsi/ginkgo"
-)
-
-const (
- ingestionInterval = 10 * time.Second
- ingestionTimeout = 10 * time.Minute
-)
-
-var _ = instrumentation.SIGDescribe("Cluster level logging implemented by Stackdriver", func() {
- f := framework.NewDefaultFramework("sd-logging")
-
- ginkgo.BeforeEach(func() {
- e2eskipper.SkipUnlessProviderIs("gce", "gke")
- })
-
- ginkgo.It("should ingest logs [Feature:StackdriverLogging]", func() {
- withLogProviderForScope(f, podsScope, func(p *sdLogProvider) {
- ginkgo.By("Checking ingesting text logs", func() {
- pod, err := utils.StartAndReturnSelf(utils.NewRepeatingLoggingPod("synthlogger-1", "hey"), f)
- framework.ExpectNoError(err, "Failed to start a pod")
-
- ginkgo.By("Waiting for logs to ingest")
- c := utils.NewLogChecker(p, utils.UntilFirstEntry, utils.JustTimeout, pod.Name())
- err = utils.WaitForLogs(c, ingestionInterval, ingestionTimeout)
- framework.ExpectNoError(err)
- })
-
- ginkgo.By("Checking ingesting json logs", func() {
- logRaw := "{\"a\":\"b\"}"
- pod, err := utils.StartAndReturnSelf(utils.NewRepeatingLoggingPod("synthlogger-2", logRaw), f)
- framework.ExpectNoError(err, "Failed to start a pod")
-
- ginkgo.By("Waiting for logs to ingest")
- c := utils.NewLogChecker(p, func(_ string, logEntries []utils.LogEntry) (bool, error) {
- if len(logEntries) == 0 {
- return false, nil
- }
- log := logEntries[0]
- if log.JSONPayload == nil {
- return false, fmt.Errorf("log entry unexpectedly is not json: %s", log.TextPayload)
- }
- if log.JSONPayload["a"] != "b" {
- bytes, err := json.Marshal(log.JSONPayload)
- if err != nil {
- return false, fmt.Errorf("log entry ingested incorrectly, failed to marshal: %v", err)
- }
- return false, fmt.Errorf("log entry ingested incorrectly, got %v, want %s",
- string(bytes), logRaw)
- }
- return true, nil
- }, utils.JustTimeout, pod.Name())
- err = utils.WaitForLogs(c, ingestionInterval, ingestionTimeout)
- framework.ExpectNoError(err)
- })
-
- ginkgo.By("Checking ingesting logs in glog format", func() {
- logUnformatted := "Text"
- logRaw := fmt.Sprintf("I0101 00:00:00.000000 1 main.go:1] %s", logUnformatted)
- pod, err := utils.StartAndReturnSelf(utils.NewRepeatingLoggingPod("synthlogger-3", logRaw), f)
- framework.ExpectNoError(err, "Failed to start a pod")
-
- ginkgo.By("Waiting for logs to ingest")
- c := utils.NewLogChecker(p, func(_ string, logEntries []utils.LogEntry) (bool, error) {
- if len(logEntries) == 0 {
- return false, nil
- }
- log := logEntries[0]
- if log.TextPayload == "" {
- return false, fmt.Errorf("log entry is unexpectedly json: %v", log.JSONPayload)
- }
- if log.TextPayload != logUnformatted {
- return false, fmt.Errorf("log entry ingested incorrectly, got %s, want %s",
- log.TextPayload, logUnformatted)
- }
- return true, nil
- }, utils.JustTimeout, pod.Name())
- err = utils.WaitForLogs(c, ingestionInterval, ingestionTimeout)
- framework.ExpectNoError(err)
- })
-
- ginkgo.By("Checking that too long lines are trimmed", func() {
- maxLength := 100 * 1024
- cmd := []string{
- "/bin/sh",
- "-c",
- fmt.Sprintf("while :; do printf '%%*s' %d | tr ' ' 'A'; echo; sleep 60; done", maxLength+1),
- }
-
- pod, err := utils.StartAndReturnSelf(utils.NewExecLoggingPod("synthlogger-4", cmd), f)
- framework.ExpectNoError(err, "Failed to start a pod")
-
- ginkgo.By("Waiting for logs to ingest")
- c := utils.NewLogChecker(p, func(_ string, logEntries []utils.LogEntry) (bool, error) {
- if len(logEntries) == 0 {
- return false, nil
- }
- log := logEntries[0]
- if log.JSONPayload != nil {
- return false, fmt.Errorf("got json log entry %v, wanted plain text", log.JSONPayload)
- }
- if len(log.TextPayload) > maxLength {
- return false, fmt.Errorf("got too long entry of length %d", len(log.TextPayload))
- }
- return true, nil
- }, utils.JustTimeout, pod.Name())
- err = utils.WaitForLogs(c, ingestionInterval, ingestionTimeout)
- framework.ExpectNoError(err)
- })
- })
- })
-
- ginkgo.It("should ingest events [Feature:StackdriverLogging]", func() {
- eventCreationInterval := 10 * time.Second
-
- withLogProviderForScope(f, eventsScope, func(p *sdLogProvider) {
- ginkgo.By("Running pods to generate events while waiting for some of them to be ingested")
- stopCh := make(chan struct{})
- cleanupCh := make(chan struct{})
- defer func() { <-cleanupCh }()
- defer close(stopCh)
- go func() {
- defer ginkgo.GinkgoRecover()
- defer close(cleanupCh)
-
- wait.PollUntil(eventCreationInterval, func() (bool, error) {
- podName := fmt.Sprintf("synthlogger-%s", string(uuid.NewUUID()))
- err := utils.NewLoadLoggingPod(podName, "", 1, 1*time.Second).Start(f)
- if err != nil {
- framework.Logf("Failed to create a logging pod: %v", err)
- }
- return false, nil
- }, stopCh)
- }()
-
- ginkgo.By("Waiting for events to ingest")
- location := framework.TestContext.CloudConfig.Zone
- if framework.TestContext.CloudConfig.MultiMaster {
- location = framework.TestContext.CloudConfig.Region
- }
- c := utils.NewLogChecker(p, utils.UntilFirstEntryFromLocation(location), utils.JustTimeout, "")
- err := utils.WaitForLogs(c, ingestionInterval, ingestionTimeout)
- framework.ExpectNoError(err)
- })
- })
-
- ginkgo.It("should ingest system logs from all nodes [Feature:StackdriverLogging]", func() {
- withLogProviderForScope(f, systemScope, func(p *sdLogProvider) {
- ginkgo.By("Waiting for some kubelet logs to be ingested from each node", func() {
- nodeIds := utils.GetNodeIds(f.ClientSet)
- log := fmt.Sprintf("projects/%s/logs/kubelet", framework.TestContext.CloudConfig.ProjectID)
- c := utils.NewLogChecker(p, utils.UntilFirstEntryFromLog(log), utils.JustTimeout, nodeIds...)
- err := utils.WaitForLogs(c, ingestionInterval, ingestionTimeout)
- framework.ExpectNoError(err)
- })
-
- ginkgo.By("Waiting for some container runtime logs to be ingested from each node", func() {
- nodeIds := utils.GetNodeIds(f.ClientSet)
- log := fmt.Sprintf("projects/%s/logs/container-runtime", framework.TestContext.CloudConfig.ProjectID)
- c := utils.NewLogChecker(p, utils.UntilFirstEntryFromLog(log), utils.JustTimeout, nodeIds...)
- err := utils.WaitForLogs(c, ingestionInterval, ingestionTimeout)
- framework.ExpectNoError(err)
- })
- })
- })
-})
diff --git a/test/e2e/instrumentation/logging/stackdriver/soak.go b/test/e2e/instrumentation/logging/stackdriver/soak.go
deleted file mode 100644
index bdb2960ca9d..00000000000
--- a/test/e2e/instrumentation/logging/stackdriver/soak.go
+++ /dev/null
@@ -1,101 +0,0 @@
-/*
-Copyright 2017 The Kubernetes Authors.
-
-Licensed under the Apache License, Version 2.0 (the "License");
-you may not use this file except in compliance with the License.
-You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing, software
-distributed under the License is distributed on an "AS IS" BASIS,
-WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-See the License for the specific language governing permissions and
-limitations under the License.
-*/
-
-package stackdriver
-
-import (
- "fmt"
- "math"
- "time"
-
- "k8s.io/kubernetes/test/e2e/framework"
- e2enode "k8s.io/kubernetes/test/e2e/framework/node"
- instrumentation "k8s.io/kubernetes/test/e2e/instrumentation/common"
- "k8s.io/kubernetes/test/e2e/instrumentation/logging/utils"
-
- "github.com/onsi/ginkgo"
-)
-
-const (
- // maxAllowedLostFraction is the fraction of lost logs considered acceptable.
- maxAllowedLostFraction = 0.01
- // maxAllowedRestartsPerHour is the number of fluentd container restarts
- // considered acceptable. Once per hour is fine for now, as long as it
- // doesn't loose too much logs.
- maxAllowedRestartsPerHour = 1.0
-)
-
-var _ = instrumentation.SIGDescribe("Cluster level logging implemented by Stackdriver [Feature:StackdriverLogging] [Soak]", func() {
- f := framework.NewDefaultFramework("sd-logging-load")
-
- ginkgo.It("should ingest logs from applications running for a prolonged amount of time", func() {
- withLogProviderForScope(f, podsScope, func(p *sdLogProvider) {
- nodes, err := e2enode.GetReadySchedulableNodes(f.ClientSet)
- framework.ExpectNoError(err)
- maxPodCount := 10
- jobDuration := 30 * time.Minute
- linesPerPodPerSecond := 100
- // TODO(instrumentation): Increase to 21 hrs
- testDuration := 3 * time.Hour
- ingestionInterval := 1 * time.Minute
- ingestionTimeout := testDuration + 30*time.Minute
- allowedRestarts := int(math.Ceil(float64(testDuration) /
- float64(time.Hour) * maxAllowedRestartsPerHour))
-
- podRunDelay := time.Duration(int64(jobDuration) / int64(maxPodCount))
- podRunCount := maxPodCount*(int(testDuration/jobDuration)-1) + 1
- linesPerPod := linesPerPodPerSecond * int(jobDuration.Seconds())
-
- // pods is a flat array of all pods to be run and to expect in Stackdriver.
- pods := []utils.FiniteLoggingPod{}
- // podsByRun is a two-dimensional array of pods, first dimension is the run
- // index, the second dimension is the node index. Since we want to create
- // an equal load on all nodes, for the same run we have one pod per node.
- podsByRun := [][]utils.FiniteLoggingPod{}
- for runIdx := 0; runIdx < podRunCount; runIdx++ {
- podsInRun := []utils.FiniteLoggingPod{}
- for nodeIdx, node := range nodes.Items {
- podName := fmt.Sprintf("job-logs-generator-%d-%d-%d-%d", maxPodCount, linesPerPod, runIdx, nodeIdx)
- pod := utils.NewLoadLoggingPod(podName, node.Name, linesPerPod, jobDuration)
- pods = append(pods, pod)
- podsInRun = append(podsInRun, pod)
- }
- podsByRun = append(podsByRun, podsInRun)
- }
-
- ginkgo.By("Running short-living pods")
- go func() {
- t := time.NewTicker(podRunDelay)
- defer t.Stop()
- for runIdx := 0; runIdx < podRunCount; runIdx++ {
- // Starting one pod on each node.
- for _, pod := range podsByRun[runIdx] {
- if err := pod.Start(f); err != nil {
- framework.Logf("Failed to start pod: %v", err)
- }
- }
- <-t.C
- }
- }()
-
- checker := utils.NewFullIngestionPodLogChecker(p, maxAllowedLostFraction, pods...)
- err = utils.WaitForLogs(checker, ingestionInterval, ingestionTimeout)
- framework.ExpectNoError(err)
-
- utils.EnsureLoggingAgentRestartsCount(f, p.LoggingAgentName(), allowedRestarts)
- })
- })
-})
diff --git a/test/e2e/instrumentation/logging/stackdriver/utils.go b/test/e2e/instrumentation/logging/stackdriver/utils.go
deleted file mode 100644
index 81ad806538e..00000000000
--- a/test/e2e/instrumentation/logging/stackdriver/utils.go
+++ /dev/null
@@ -1,444 +0,0 @@
-/*
-Copyright 2017 The Kubernetes Authors.
-
-Licensed under the Apache License, Version 2.0 (the "License");
-you may not use this file except in compliance with the License.
-You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing, software
-distributed under the License is distributed on an "AS IS" BASIS,
-WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-See the License for the specific language governing permissions and
-limitations under the License.
-*/
-
-package stackdriver
-
-import (
- "context"
- "encoding/base64"
- "encoding/json"
- "fmt"
- "sync"
- "time"
-
- "k8s.io/apimachinery/pkg/util/wait"
- "k8s.io/kubernetes/test/e2e/framework"
- "k8s.io/kubernetes/test/e2e/instrumentation/logging/utils"
-
- "golang.org/x/oauth2/google"
- sd "google.golang.org/api/logging/v2beta1"
- "google.golang.org/api/option"
- pubsub "google.golang.org/api/pubsub/v1"
-)
-
-const (
- // The amount of time to wait for Stackdriver Logging
- // sink to become operational
- sinkStartupTimeout = 10 * time.Minute
-
- // The limit on the number of messages to pull from PubSub
- maxPullLogMessages = 100 * 1000
-
- // maxQueueSize is the limit on the number of messages in the single queue.
- maxQueueSize = 10 * 1000
-
- // PubSub topic with log entries polling interval
- sdLoggingPollInterval = 100 * time.Millisecond
-
- // The parallelism level of polling logs process.
- sdLoggingPollParallelism = 10
-
- // The limit on the number of stackdriver sinks that can be created within one project.
- stackdriverSinkCountLimit = 90
-)
-
-type logProviderScope int
-
-const (
- podsScope logProviderScope = iota
- eventsScope
- systemScope
-)
-
-var _ utils.LogProvider = &sdLogProvider{}
-
-type sdLogProvider struct {
- sdService *sd.Service
- pubsubService *pubsub.Service
-
- framework *framework.Framework
-
- topic *pubsub.Topic
- subscription *pubsub.Subscription
- logSink *sd.LogSink
-
- pollingStopChannel chan struct{}
- pollingWG *sync.WaitGroup
-
- queueCollection utils.LogsQueueCollection
-
- scope logProviderScope
-}
-
-func newSdLogProvider(f *framework.Framework, scope logProviderScope) (*sdLogProvider, error) {
- ctx := context.Background()
- hc, err := google.DefaultClient(ctx, sd.CloudPlatformScope)
- framework.ExpectNoError(err)
- sdService, err := sd.NewService(ctx, option.WithHTTPClient(hc))
- if err != nil {
- return nil, err
- }
- err = ensureProjectHasSinkCapacity(sdService.Projects.Sinks, framework.TestContext.CloudConfig.ProjectID)
- if err != nil {
- return nil, err
- }
-
- pubsubService, err := pubsub.NewService(ctx, option.WithHTTPClient(hc))
- if err != nil {
- return nil, err
- }
-
- provider := &sdLogProvider{
- scope: scope,
- sdService: sdService,
- pubsubService: pubsubService,
- framework: f,
- pollingStopChannel: make(chan struct{}),
- pollingWG: &sync.WaitGroup{},
- queueCollection: utils.NewLogsQueueCollection(maxQueueSize),
- }
- return provider, nil
-}
-
-func ensureProjectHasSinkCapacity(sinksService *sd.ProjectsSinksService, projectID string) error {
- listResponse, err := listSinks(sinksService, projectID)
- if err != nil {
- return err
- }
- if len(listResponse.Sinks) >= stackdriverSinkCountLimit {
- framework.Logf("Reached Stackdriver sink limit. Deleting all sinks")
- deleteSinks(sinksService, projectID, listResponse.Sinks)
- }
- return nil
-}
-
-func listSinks(sinksService *sd.ProjectsSinksService, projectID string) (*sd.ListSinksResponse, error) {
- projectDst := fmt.Sprintf("projects/%s", projectID)
- listResponse, err := sinksService.List(projectDst).PageSize(stackdriverSinkCountLimit).Do()
- if err != nil {
- return nil, fmt.Errorf("failed to list Stackdriver Logging sinks: %v", err)
- }
- return listResponse, nil
-}
-
-func deleteSinks(sinksService *sd.ProjectsSinksService, projectID string, sinks []*sd.LogSink) {
- for _, sink := range sinks {
- sinkNameID := fmt.Sprintf("projects/%s/sinks/%s", projectID, sink.Name)
- if _, err := sinksService.Delete(sinkNameID).Do(); err != nil {
- framework.Logf("Failed to delete LogSink: %v", err)
- }
- }
-}
-
-func (p *sdLogProvider) Init() error {
- projectID := framework.TestContext.CloudConfig.ProjectID
- nsName := p.framework.Namespace.Name
-
- topic, err := p.createPubSubTopic(projectID, nsName)
- if err != nil {
- return fmt.Errorf("failed to create PubSub topic: %v", err)
- }
- p.topic = topic
-
- subs, err := p.createPubSubSubscription(projectID, nsName, topic.Name)
- if err != nil {
- return fmt.Errorf("failed to create PubSub subscription: %v", err)
- }
- p.subscription = subs
-
- logSink, err := p.createSink(projectID, nsName, topic.Name)
- if err != nil {
- return fmt.Errorf("failed to create Stackdriver Logging sink: %v", err)
- }
- p.logSink = logSink
-
- if err = p.authorizeSink(); err != nil {
- return fmt.Errorf("failed to authorize log sink: %v", err)
- }
-
- if err = p.waitSinkInit(); err != nil {
- return fmt.Errorf("failed to wait for sink to become operational: %v", err)
- }
-
- p.startPollingLogs()
-
- return nil
-}
-
-func (p *sdLogProvider) Cleanup() {
- close(p.pollingStopChannel)
- p.pollingWG.Wait()
-
- if p.logSink != nil {
- projectID := framework.TestContext.CloudConfig.ProjectID
- sinkNameID := fmt.Sprintf("projects/%s/sinks/%s", projectID, p.logSink.Name)
- sinksService := p.sdService.Projects.Sinks
- if _, err := sinksService.Delete(sinkNameID).Do(); err != nil {
- framework.Logf("Failed to delete LogSink: %v", err)
- }
- }
-
- if p.subscription != nil {
- subsService := p.pubsubService.Projects.Subscriptions
- if _, err := subsService.Delete(p.subscription.Name).Do(); err != nil {
- framework.Logf("Failed to delete PubSub subscription: %v", err)
- }
- }
-
- if p.topic != nil {
- topicsService := p.pubsubService.Projects.Topics
- if _, err := topicsService.Delete(p.topic.Name).Do(); err != nil {
- framework.Logf("Failed to delete PubSub topic: %v", err)
- }
- }
-}
-
-func (p *sdLogProvider) ReadEntries(name string) []utils.LogEntry {
- return p.queueCollection.Pop(name)
-}
-
-func (p *sdLogProvider) LoggingAgentName() string {
- return "fluentd-gcp"
-}
-
-func (p *sdLogProvider) createPubSubTopic(projectID, topicName string) (*pubsub.Topic, error) {
- topicFullName := fmt.Sprintf("projects/%s/topics/%s", projectID, topicName)
- topic := &pubsub.Topic{
- Name: topicFullName,
- }
- return p.pubsubService.Projects.Topics.Create(topicFullName, topic).Do()
-}
-
-func (p *sdLogProvider) createPubSubSubscription(projectID, subsName, topicName string) (*pubsub.Subscription, error) {
- subsFullName := fmt.Sprintf("projects/%s/subscriptions/%s", projectID, subsName)
- subs := &pubsub.Subscription{
- Name: subsFullName,
- Topic: topicName,
- }
- return p.pubsubService.Projects.Subscriptions.Create(subsFullName, subs).Do()
-}
-
-func (p *sdLogProvider) createSink(projectID, sinkName, topicName string) (*sd.LogSink, error) {
- filter, err := p.buildFilter()
- if err != nil {
- return nil, err
- }
- framework.Logf("Using the following filter for log entries: %s", filter)
- sink := &sd.LogSink{
- Name: sinkName,
- Destination: fmt.Sprintf("pubsub.googleapis.com/%s", topicName),
- Filter: filter,
- }
- projectDst := fmt.Sprintf("projects/%s", projectID)
- return p.sdService.Projects.Sinks.Create(projectDst, sink).Do()
-}
-
-func (p *sdLogProvider) buildFilter() (string, error) {
- switch p.scope {
- case podsScope:
- return fmt.Sprintf("resource.type=\"container\" AND resource.labels.namespace_id=\"%s\"",
- p.framework.Namespace.Name), nil
- case eventsScope:
- return fmt.Sprintf("resource.type=\"gke_cluster\" AND jsonPayload.metadata.namespace=\"%s\"",
- p.framework.Namespace.Name), nil
- case systemScope:
- // TODO(instrumentation): Filter logs from the current project only.
- return "resource.type=\"gce_instance\"", nil
- }
- return "", fmt.Errorf("Unknown log provider scope: %v", p.scope)
-}
-
-func (p *sdLogProvider) authorizeSink() error {
- topicsService := p.pubsubService.Projects.Topics
- policy, err := topicsService.GetIamPolicy(p.topic.Name).Do()
- if err != nil {
- return err
- }
-
- binding := &pubsub.Binding{
- Role: "roles/pubsub.publisher",
- Members: []string{p.logSink.WriterIdentity},
- }
- policy.Bindings = append(policy.Bindings, binding)
- req := &pubsub.SetIamPolicyRequest{Policy: policy}
- if _, err = topicsService.SetIamPolicy(p.topic.Name, req).Do(); err != nil {
- return err
- }
-
- return nil
-}
-
-func (p *sdLogProvider) waitSinkInit() error {
- framework.Logf("Waiting for log sink to become operational")
- return wait.Poll(1*time.Second, sinkStartupTimeout, func() (bool, error) {
- err := publish(p.pubsubService, p.topic, "embrace eternity")
- if err != nil {
- framework.Logf("Failed to push message to PubSub due to %v", err)
- }
-
- messages, err := pullAndAck(p.pubsubService, p.subscription)
- if err != nil {
- framework.Logf("Failed to pull messages from PubSub due to %v", err)
- return false, nil
- }
- if len(messages) > 0 {
- framework.Logf("Sink %s is operational", p.logSink.Name)
- return true, nil
- }
-
- return false, nil
- })
-}
-
-func (p *sdLogProvider) startPollingLogs() {
- for i := 0; i < sdLoggingPollParallelism; i++ {
- p.pollingWG.Add(1)
- go func() {
- defer p.pollingWG.Done()
-
- wait.PollUntil(sdLoggingPollInterval, func() (bool, error) {
- p.pollLogsOnce()
- return false, nil
- }, p.pollingStopChannel)
- }()
- }
-}
-
-func (p *sdLogProvider) pollLogsOnce() {
- messages, err := pullAndAck(p.pubsubService, p.subscription)
- if err != nil {
- framework.Logf("Failed to pull messages from PubSub due to %v", err)
- return
- }
-
- for _, msg := range messages {
- logEntryEncoded, err := base64.StdEncoding.DecodeString(msg.Message.Data)
- if err != nil {
- framework.Logf("Got a message from pubsub that is not base64-encoded: %s", msg.Message.Data)
- continue
- }
-
- var sdLogEntry sd.LogEntry
- if err := json.Unmarshal(logEntryEncoded, &sdLogEntry); err != nil {
- framework.Logf("Failed to decode a pubsub message '%s': %v", logEntryEncoded, err)
- continue
- }
-
- name, ok := p.tryGetName(sdLogEntry)
- if !ok {
- framework.Logf("Received LogEntry with unexpected resource type: %s", sdLogEntry.Resource.Type)
- continue
- }
-
- logEntry, err := convertLogEntry(sdLogEntry)
- if err != nil {
- framework.Logf("Failed to parse Stackdriver LogEntry: %v", err)
- continue
- }
-
- p.queueCollection.Push(name, logEntry)
- }
-}
-
-func (p *sdLogProvider) tryGetName(sdLogEntry sd.LogEntry) (string, bool) {
- switch sdLogEntry.Resource.Type {
- case "container":
- return sdLogEntry.Resource.Labels["pod_id"], true
- case "gke_cluster":
- return "", true
- case "gce_instance":
- return sdLogEntry.Resource.Labels["instance_id"], true
- }
- return "", false
-}
-
-func convertLogEntry(sdLogEntry sd.LogEntry) (entry utils.LogEntry, err error) {
- entry = utils.LogEntry{LogName: sdLogEntry.LogName}
- entry.Location = sdLogEntry.Resource.Labels["location"]
-
- if sdLogEntry.TextPayload != "" {
- entry.TextPayload = sdLogEntry.TextPayload
- return
- }
-
- bytes, err := sdLogEntry.JsonPayload.MarshalJSON()
- if err != nil {
- err = fmt.Errorf("Failed to get jsonPayload from LogEntry %v", sdLogEntry)
- return
- }
-
- var jsonObject map[string]interface{}
- err = json.Unmarshal(bytes, &jsonObject)
- if err != nil {
- err = fmt.Errorf("Failed to deserialize jsonPayload as json object %s", string(bytes[:]))
- return
- }
- entry.JSONPayload = jsonObject
- return
-}
-
-func pullAndAck(service *pubsub.Service, subs *pubsub.Subscription) ([]*pubsub.ReceivedMessage, error) {
- subsService := service.Projects.Subscriptions
- req := &pubsub.PullRequest{
- ReturnImmediately: true,
- MaxMessages: maxPullLogMessages,
- }
-
- resp, err := subsService.Pull(subs.Name, req).Do()
- if err != nil {
- return nil, err
- }
-
- var ids []string
- for _, msg := range resp.ReceivedMessages {
- ids = append(ids, msg.AckId)
- }
- if len(ids) > 0 {
- ackReq := &pubsub.AcknowledgeRequest{AckIds: ids}
- if _, err = subsService.Acknowledge(subs.Name, ackReq).Do(); err != nil {
- framework.Logf("Failed to ack poll: %v", err)
- }
- }
-
- return resp.ReceivedMessages, nil
-}
-
-func publish(service *pubsub.Service, topic *pubsub.Topic, msg string) error {
- topicsService := service.Projects.Topics
- req := &pubsub.PublishRequest{
- Messages: []*pubsub.PubsubMessage{
- {
- Data: base64.StdEncoding.EncodeToString([]byte(msg)),
- },
- },
- }
- _, err := topicsService.Publish(topic.Name, req).Do()
- return err
-}
-
-func withLogProviderForScope(f *framework.Framework, scope logProviderScope, fun func(*sdLogProvider)) {
- p, err := newSdLogProvider(f, scope)
- framework.ExpectNoError(err, "Failed to create Stackdriver logs provider")
-
- err = p.Init()
- defer p.Cleanup()
- framework.ExpectNoError(err, "Failed to init Stackdriver logs provider")
-
- err = utils.EnsureLoggingAgentDeployment(f, p.LoggingAgentName())
- framework.ExpectNoError(err, "Logging agents deployed incorrectly")
-
- fun(p)
-}
diff --git a/vendor/BUILD b/vendor/BUILD
index 7e001ae867b..f2562902511 100644
--- a/vendor/BUILD
+++ b/vendor/BUILD
@@ -409,10 +409,8 @@ filegroup(
"//vendor/google.golang.org/api/container/v1:all-srcs",
"//vendor/google.golang.org/api/googleapi:all-srcs",
"//vendor/google.golang.org/api/internal:all-srcs",
- "//vendor/google.golang.org/api/logging/v2beta1:all-srcs",
"//vendor/google.golang.org/api/monitoring/v3:all-srcs",
"//vendor/google.golang.org/api/option:all-srcs",
- "//vendor/google.golang.org/api/pubsub/v1:all-srcs",
"//vendor/google.golang.org/api/tpu/v1:all-srcs",
"//vendor/google.golang.org/api/transport/http:all-srcs",
"//vendor/google.golang.org/appengine:all-srcs",
diff --git a/vendor/google.golang.org/api/logging/v2beta1/BUILD b/vendor/google.golang.org/api/logging/v2beta1/BUILD
deleted file mode 100644
index ebb77504300..00000000000
--- a/vendor/google.golang.org/api/logging/v2beta1/BUILD
+++ /dev/null
@@ -1,29 +0,0 @@
-load("@io_bazel_rules_go//go:def.bzl", "go_library")
-
-go_library(
- name = "go_default_library",
- srcs = ["logging-gen.go"],
- importmap = "k8s.io/kubernetes/vendor/google.golang.org/api/logging/v2beta1",
- importpath = "google.golang.org/api/logging/v2beta1",
- visibility = ["//visibility:public"],
- deps = [
- "//vendor/google.golang.org/api/googleapi:go_default_library",
- "//vendor/google.golang.org/api/internal/gensupport:go_default_library",
- "//vendor/google.golang.org/api/option:go_default_library",
- "//vendor/google.golang.org/api/transport/http:go_default_library",
- ],
-)
-
-filegroup(
- name = "package-srcs",
- srcs = glob(["**"]),
- tags = ["automanaged"],
- visibility = ["//visibility:private"],
-)
-
-filegroup(
- name = "all-srcs",
- srcs = [":package-srcs"],
- tags = ["automanaged"],
- visibility = ["//visibility:public"],
-)
diff --git a/vendor/google.golang.org/api/logging/v2beta1/logging-api.json b/vendor/google.golang.org/api/logging/v2beta1/logging-api.json
deleted file mode 100644
index 5d645e1ef6a..00000000000
--- a/vendor/google.golang.org/api/logging/v2beta1/logging-api.json
+++ /dev/null
@@ -1,1560 +0,0 @@
-{
- "auth": {
- "oauth2": {
- "scopes": {
- "https://www.googleapis.com/auth/cloud-platform": {
- "description": "View and manage your data across Google Cloud Platform services"
- },
- "https://www.googleapis.com/auth/cloud-platform.read-only": {
- "description": "View your data across Google Cloud Platform services"
- },
- "https://www.googleapis.com/auth/logging.admin": {
- "description": "Administrate log data for your projects"
- },
- "https://www.googleapis.com/auth/logging.read": {
- "description": "View log data for your projects"
- },
- "https://www.googleapis.com/auth/logging.write": {
- "description": "Submit log data for your projects"
- }
- }
- }
- },
- "basePath": "",
- "baseUrl": "https://logging.googleapis.com/",
- "batchPath": "batch",
- "canonicalName": "Logging",
- "description": "Writes log entries and manages your Logging configuration.",
- "discoveryVersion": "v1",
- "documentationLink": "https://cloud.google.com/logging/docs/",
- "fullyEncodeReservedExpansion": true,
- "icons": {
- "x16": "http://www.google.com/images/icons/product/search-16.gif",
- "x32": "http://www.google.com/images/icons/product/search-32.gif"
- },
- "id": "logging:v2beta1",
- "kind": "discovery#restDescription",
- "name": "logging",
- "ownerDomain": "google.com",
- "ownerName": "Google",
- "parameters": {
- "$.xgafv": {
- "description": "V1 error format.",
- "enum": [
- "1",
- "2"
- ],
- "enumDescriptions": [
- "v1 error format",
- "v2 error format"
- ],
- "location": "query",
- "type": "string"
- },
- "access_token": {
- "description": "OAuth access token.",
- "location": "query",
- "type": "string"
- },
- "alt": {
- "default": "json",
- "description": "Data format for response.",
- "enum": [
- "json",
- "media",
- "proto"
- ],
- "enumDescriptions": [
- "Responses with Content-Type of application/json",
- "Media download with context-dependent Content-Type",
- "Responses with Content-Type of application/x-protobuf"
- ],
- "location": "query",
- "type": "string"
- },
- "callback": {
- "description": "JSONP",
- "location": "query",
- "type": "string"
- },
- "fields": {
- "description": "Selector specifying which fields to include in a partial response.",
- "location": "query",
- "type": "string"
- },
- "key": {
- "description": "API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.",
- "location": "query",
- "type": "string"
- },
- "oauth_token": {
- "description": "OAuth 2.0 token for the current user.",
- "location": "query",
- "type": "string"
- },
- "prettyPrint": {
- "default": "true",
- "description": "Returns response with indentations and line breaks.",
- "location": "query",
- "type": "boolean"
- },
- "quotaUser": {
- "description": "Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.",
- "location": "query",
- "type": "string"
- },
- "uploadType": {
- "description": "Legacy upload protocol for media (e.g. \"media\", \"multipart\").",
- "location": "query",
- "type": "string"
- },
- "upload_protocol": {
- "description": "Upload protocol for media (e.g. \"raw\", \"multipart\").",
- "location": "query",
- "type": "string"
- }
- },
- "protocol": "rest",
- "resources": {
- "entries": {
- "methods": {
- "list": {
- "description": "Lists log entries. Use this method to retrieve log entries that originated from a project/folder/organization/billing account. For ways to export log entries, see Exporting Logs.",
- "flatPath": "v2beta1/entries:list",
- "httpMethod": "POST",
- "id": "logging.entries.list",
- "parameterOrder": [],
- "parameters": {},
- "path": "v2beta1/entries:list",
- "request": {
- "$ref": "ListLogEntriesRequest"
- },
- "response": {
- "$ref": "ListLogEntriesResponse"
- },
- "scopes": [
- "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"
- ]
- },
- "write": {
- "description": "Writes log entries to Logging. This API method is the only way to send log entries to Logging. This method is used, directly or indirectly, by the Logging agent (fluentd) and all logging libraries configured to use Logging. A single request may contain log entries for a maximum of 1000 different resources (projects, organizations, billing accounts or folders)",
- "flatPath": "v2beta1/entries:write",
- "httpMethod": "POST",
- "id": "logging.entries.write",
- "parameterOrder": [],
- "parameters": {},
- "path": "v2beta1/entries:write",
- "request": {
- "$ref": "WriteLogEntriesRequest"
- },
- "response": {
- "$ref": "WriteLogEntriesResponse"
- },
- "scopes": [
- "https://www.googleapis.com/auth/cloud-platform",
- "https://www.googleapis.com/auth/logging.admin",
- "https://www.googleapis.com/auth/logging.write"
- ]
- }
- }
- },
- "monitoredResourceDescriptors": {
- "methods": {
- "list": {
- "description": "Lists the descriptors for monitored resource types used by Logging.",
- "flatPath": "v2beta1/monitoredResourceDescriptors",
- "httpMethod": "GET",
- "id": "logging.monitoredResourceDescriptors.list",
- "parameterOrder": [],
- "parameters": {
- "pageSize": {
- "description": "Optional. The maximum number of results to return from this request. Non-positive values are ignored. The presence of nextPageToken in the response indicates that more results might be available.",
- "format": "int32",
- "location": "query",
- "type": "integer"
- },
- "pageToken": {
- "description": "Optional. If present, then retrieve the next batch of results from the preceding call to this method. pageToken must be the value of nextPageToken from the previous response. The values of other method parameters should be identical to those in the previous call.",
- "location": "query",
- "type": "string"
- }
- },
- "path": "v2beta1/monitoredResourceDescriptors",
- "response": {
- "$ref": "ListMonitoredResourceDescriptorsResponse"
- },
- "scopes": [
- "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"
- ]
- }
- }
- },
- "projects": {
- "resources": {
- "metrics": {
- "methods": {
- "create": {
- "description": "Creates a logs-based metric.",
- "flatPath": "v2beta1/projects/{projectsId}/metrics",
- "httpMethod": "POST",
- "id": "logging.projects.metrics.create",
- "parameterOrder": [
- "parent"
- ],
- "parameters": {
- "parent": {
- "description": "The resource name of the project in which to create the metric:\n\"projects/[PROJECT_ID]\"\nThe new metric must be provided in the request.",
- "location": "path",
- "pattern": "^projects/[^/]+$",
- "required": true,
- "type": "string"
- }
- },
- "path": "v2beta1/{+parent}/metrics",
- "request": {
- "$ref": "LogMetric"
- },
- "response": {
- "$ref": "LogMetric"
- },
- "scopes": [
- "https://www.googleapis.com/auth/cloud-platform",
- "https://www.googleapis.com/auth/logging.admin",
- "https://www.googleapis.com/auth/logging.write"
- ]
- },
- "delete": {
- "description": "Deletes a logs-based metric.",
- "flatPath": "v2beta1/projects/{projectsId}/metrics/{metricsId}",
- "httpMethod": "DELETE",
- "id": "logging.projects.metrics.delete",
- "parameterOrder": [
- "metricName"
- ],
- "parameters": {
- "metricName": {
- "description": "The resource name of the metric to delete:\n\"projects/[PROJECT_ID]/metrics/[METRIC_ID]\"\n",
- "location": "path",
- "pattern": "^projects/[^/]+/metrics/[^/]+$",
- "required": true,
- "type": "string"
- }
- },
- "path": "v2beta1/{+metricName}",
- "response": {
- "$ref": "Empty"
- },
- "scopes": [
- "https://www.googleapis.com/auth/cloud-platform",
- "https://www.googleapis.com/auth/logging.admin",
- "https://www.googleapis.com/auth/logging.write"
- ]
- },
- "get": {
- "description": "Gets a logs-based metric.",
- "flatPath": "v2beta1/projects/{projectsId}/metrics/{metricsId}",
- "httpMethod": "GET",
- "id": "logging.projects.metrics.get",
- "parameterOrder": [
- "metricName"
- ],
- "parameters": {
- "metricName": {
- "description": "The resource name of the desired metric:\n\"projects/[PROJECT_ID]/metrics/[METRIC_ID]\"\n",
- "location": "path",
- "pattern": "^projects/[^/]+/metrics/[^/]+$",
- "required": true,
- "type": "string"
- }
- },
- "path": "v2beta1/{+metricName}",
- "response": {
- "$ref": "LogMetric"
- },
- "scopes": [
- "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"
- ]
- },
- "list": {
- "description": "Lists logs-based metrics.",
- "flatPath": "v2beta1/projects/{projectsId}/metrics",
- "httpMethod": "GET",
- "id": "logging.projects.metrics.list",
- "parameterOrder": [
- "parent"
- ],
- "parameters": {
- "pageSize": {
- "description": "Optional. The maximum number of results to return from this request. Non-positive values are ignored. The presence of nextPageToken in the response indicates that more results might be available.",
- "format": "int32",
- "location": "query",
- "type": "integer"
- },
- "pageToken": {
- "description": "Optional. If present, then retrieve the next batch of results from the preceding call to this method. pageToken must be the value of nextPageToken from the previous response. The values of other method parameters should be identical to those in the previous call.",
- "location": "query",
- "type": "string"
- },
- "parent": {
- "description": "Required. The name of the project containing the metrics:\n\"projects/[PROJECT_ID]\"\n",
- "location": "path",
- "pattern": "^projects/[^/]+$",
- "required": true,
- "type": "string"
- }
- },
- "path": "v2beta1/{+parent}/metrics",
- "response": {
- "$ref": "ListLogMetricsResponse"
- },
- "scopes": [
- "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"
- ]
- },
- "update": {
- "description": "Creates or updates a logs-based metric.",
- "flatPath": "v2beta1/projects/{projectsId}/metrics/{metricsId}",
- "httpMethod": "PUT",
- "id": "logging.projects.metrics.update",
- "parameterOrder": [
- "metricName"
- ],
- "parameters": {
- "metricName": {
- "description": "The resource name of the metric to update:\n\"projects/[PROJECT_ID]/metrics/[METRIC_ID]\"\nThe updated metric must be provided in the request and it's name field must be the same as [METRIC_ID] If the metric does not exist in [PROJECT_ID], then a new metric is created.",
- "location": "path",
- "pattern": "^projects/[^/]+/metrics/[^/]+$",
- "required": true,
- "type": "string"
- }
- },
- "path": "v2beta1/{+metricName}",
- "request": {
- "$ref": "LogMetric"
- },
- "response": {
- "$ref": "LogMetric"
- },
- "scopes": [
- "https://www.googleapis.com/auth/cloud-platform",
- "https://www.googleapis.com/auth/logging.admin",
- "https://www.googleapis.com/auth/logging.write"
- ]
- }
- }
- },
- "sinks": {
- "methods": {
- "create": {
- "description": "Creates a sink that exports specified log entries to a destination. The export of newly-ingested log entries begins immediately, unless the sink's writer_identity is not permitted to write to the destination. A sink can export log entries only from the resource owning the sink.",
- "flatPath": "v2beta1/projects/{projectsId}/sinks",
- "httpMethod": "POST",
- "id": "logging.projects.sinks.create",
- "parameterOrder": [
- "parent"
- ],
- "parameters": {
- "parent": {
- "description": "Required. The resource in which to create the sink:\n\"projects/[PROJECT_ID]\"\n\"organizations/[ORGANIZATION_ID]\"\n\"billingAccounts/[BILLING_ACCOUNT_ID]\"\n\"folders/[FOLDER_ID]\"\nExamples: \"projects/my-logging-project\", \"organizations/123456789\".",
- "location": "path",
- "pattern": "^projects/[^/]+$",
- "required": true,
- "type": "string"
- },
- "uniqueWriterIdentity": {
- "description": "Optional. Determines the kind of IAM identity returned as writer_identity in the new sink. If this value is omitted or set to false, and if the sink's parent is a project, then the value returned as writer_identity is the same group or service account used by Logging before the addition of writer identities to this API. The sink's destination must be in the same project as the sink itself.If this field is set to true, or if the sink is owned by a non-project resource such as an organization, then the value of writer_identity will be a unique service account used only for exports from the new sink. For more information, see writer_identity in LogSink.",
- "location": "query",
- "type": "boolean"
- }
- },
- "path": "v2beta1/{+parent}/sinks",
- "request": {
- "$ref": "LogSink"
- },
- "response": {
- "$ref": "LogSink"
- },
- "scopes": [
- "https://www.googleapis.com/auth/cloud-platform",
- "https://www.googleapis.com/auth/logging.admin"
- ]
- },
- "delete": {
- "description": "Deletes a sink. If the sink has a unique writer_identity, then that service account is also deleted.",
- "flatPath": "v2beta1/projects/{projectsId}/sinks/{sinksId}",
- "httpMethod": "DELETE",
- "id": "logging.projects.sinks.delete",
- "parameterOrder": [
- "sinkName"
- ],
- "parameters": {
- "sinkName": {
- "description": "Required. The full resource name of the sink to delete, including the parent resource and the sink identifier:\n\"projects/[PROJECT_ID]/sinks/[SINK_ID]\"\n\"organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]\"\n\"billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]\"\n\"folders/[FOLDER_ID]/sinks/[SINK_ID]\"\nExample: \"projects/my-project-id/sinks/my-sink-id\".",
- "location": "path",
- "pattern": "^projects/[^/]+/sinks/[^/]+$",
- "required": true,
- "type": "string"
- }
- },
- "path": "v2beta1/{+sinkName}",
- "response": {
- "$ref": "Empty"
- },
- "scopes": [
- "https://www.googleapis.com/auth/cloud-platform",
- "https://www.googleapis.com/auth/logging.admin"
- ]
- },
- "get": {
- "description": "Gets a sink.",
- "flatPath": "v2beta1/projects/{projectsId}/sinks/{sinksId}",
- "httpMethod": "GET",
- "id": "logging.projects.sinks.get",
- "parameterOrder": [
- "sinkName"
- ],
- "parameters": {
- "sinkName": {
- "description": "Required. The resource name of the sink:\n\"projects/[PROJECT_ID]/sinks/[SINK_ID]\"\n\"organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]\"\n\"billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]\"\n\"folders/[FOLDER_ID]/sinks/[SINK_ID]\"\nExample: \"projects/my-project-id/sinks/my-sink-id\".",
- "location": "path",
- "pattern": "^projects/[^/]+/sinks/[^/]+$",
- "required": true,
- "type": "string"
- }
- },
- "path": "v2beta1/{+sinkName}",
- "response": {
- "$ref": "LogSink"
- },
- "scopes": [
- "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"
- ]
- },
- "list": {
- "description": "Lists sinks.",
- "flatPath": "v2beta1/projects/{projectsId}/sinks",
- "httpMethod": "GET",
- "id": "logging.projects.sinks.list",
- "parameterOrder": [
- "parent"
- ],
- "parameters": {
- "pageSize": {
- "description": "Optional. The maximum number of results to return from this request. Non-positive values are ignored. The presence of nextPageToken in the response indicates that more results might be available.",
- "format": "int32",
- "location": "query",
- "type": "integer"
- },
- "pageToken": {
- "description": "Optional. If present, then retrieve the next batch of results from the preceding call to this method. pageToken must be the value of nextPageToken from the previous response. The values of other method parameters should be identical to those in the previous call.",
- "location": "query",
- "type": "string"
- },
- "parent": {
- "description": "Required. The parent resource whose sinks are to be listed:\n\"projects/[PROJECT_ID]\"\n\"organizations/[ORGANIZATION_ID]\"\n\"billingAccounts/[BILLING_ACCOUNT_ID]\"\n\"folders/[FOLDER_ID]\"\n",
- "location": "path",
- "pattern": "^projects/[^/]+$",
- "required": true,
- "type": "string"
- }
- },
- "path": "v2beta1/{+parent}/sinks",
- "response": {
- "$ref": "ListSinksResponse"
- },
- "scopes": [
- "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"
- ]
- },
- "update": {
- "description": "Updates a sink. This method replaces the following fields in the existing sink with values from the new sink: destination, and filter.The updated sink might also have a new writer_identity; see the unique_writer_identity field.",
- "flatPath": "v2beta1/projects/{projectsId}/sinks/{sinksId}",
- "httpMethod": "PUT",
- "id": "logging.projects.sinks.update",
- "parameterOrder": [
- "sinkName"
- ],
- "parameters": {
- "sinkName": {
- "description": "Required. The full resource name of the sink to update, including the parent resource and the sink identifier:\n\"projects/[PROJECT_ID]/sinks/[SINK_ID]\"\n\"organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]\"\n\"billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]\"\n\"folders/[FOLDER_ID]/sinks/[SINK_ID]\"\nExample: \"projects/my-project-id/sinks/my-sink-id\".",
- "location": "path",
- "pattern": "^projects/[^/]+/sinks/[^/]+$",
- "required": true,
- "type": "string"
- },
- "uniqueWriterIdentity": {
- "description": "Optional. See sinks.create for a description of this field. When updating a sink, the effect of this field on the value of writer_identity in the updated sink depends on both the old and new values of this field:\nIf the old and new values of this field are both false or both true, then there is no change to the sink's writer_identity.\nIf the old value is false and the new value is true, then writer_identity is changed to a unique service account.\nIt is an error if the old value is true and the new value is set to false or defaulted to false.",
- "location": "query",
- "type": "boolean"
- },
- "updateMask": {
- "description": "Optional. Field mask that specifies the fields in sink that need an update. A sink field will be overwritten if, and only if, it is in the update mask. name and output only fields cannot be updated.An empty updateMask is temporarily treated as using the following mask for backwards compatibility purposes: destination,filter,includeChildren At some point in the future, behavior will be removed and specifying an empty updateMask will be an error.For a detailed FieldMask definition, see https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.FieldMaskExample: updateMask=filter.",
- "format": "google-fieldmask",
- "location": "query",
- "type": "string"
- }
- },
- "path": "v2beta1/{+sinkName}",
- "request": {
- "$ref": "LogSink"
- },
- "response": {
- "$ref": "LogSink"
- },
- "scopes": [
- "https://www.googleapis.com/auth/cloud-platform",
- "https://www.googleapis.com/auth/logging.admin"
- ]
- }
- }
- }
- }
- }
- },
- "revision": "20190316",
- "rootUrl": "https://logging.googleapis.com/",
- "schemas": {
- "BucketOptions": {
- "description": "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 \u003e 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.",
- "id": "BucketOptions",
- "properties": {
- "explicitBuckets": {
- "$ref": "Explicit",
- "description": "The explicit buckets."
- },
- "exponentialBuckets": {
- "$ref": "Exponential",
- "description": "The exponential buckets."
- },
- "linearBuckets": {
- "$ref": "Linear",
- "description": "The linear bucket."
- }
- },
- "type": "object"
- },
- "Empty": {
- "description": "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:\nservice Foo {\n rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty);\n}\nThe JSON representation for Empty is empty JSON object {}.",
- "id": "Empty",
- "properties": {},
- "type": "object"
- },
- "Explicit": {
- "description": "Specifies a set of buckets with arbitrary widths.There are size(bounds) + 1 (= N) buckets. Bucket i has the following boundaries:Upper bound (0 \u003c= i \u003c N-1): boundsi Lower bound (1 \u003c= i \u003c 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.",
- "id": "Explicit",
- "properties": {
- "bounds": {
- "description": "The values must be monotonically increasing.",
- "items": {
- "format": "double",
- "type": "number"
- },
- "type": "array"
- }
- },
- "type": "object"
- },
- "Exponential": {
- "description": "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 \u003c= i \u003c N-1): scale * (growth_factor ^ i). Lower bound (1 \u003c= i \u003c N): scale * (growth_factor ^ (i - 1)).",
- "id": "Exponential",
- "properties": {
- "growthFactor": {
- "description": "Must be greater than 1.",
- "format": "double",
- "type": "number"
- },
- "numFiniteBuckets": {
- "description": "Must be greater than 0.",
- "format": "int32",
- "type": "integer"
- },
- "scale": {
- "description": "Must be greater than 0.",
- "format": "double",
- "type": "number"
- }
- },
- "type": "object"
- },
- "HttpRequest": {
- "description": "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.",
- "id": "HttpRequest",
- "properties": {
- "cacheFillBytes": {
- "description": "The number of HTTP response bytes inserted into cache. Set only when a cache fill was attempted.",
- "format": "int64",
- "type": "string"
- },
- "cacheHit": {
- "description": "Whether or not an entity was served from cache (with or without validation).",
- "type": "boolean"
- },
- "cacheLookup": {
- "description": "Whether or not a cache lookup was attempted.",
- "type": "boolean"
- },
- "cacheValidatedWithOriginServer": {
- "description": "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.",
- "type": "boolean"
- },
- "latency": {
- "description": "The request processing latency on the server, from the time the request was received until the response was sent.",
- "format": "google-duration",
- "type": "string"
- },
- "protocol": {
- "description": "Protocol used for the request. Examples: \"HTTP/1.1\", \"HTTP/2\", \"websocket\"",
- "type": "string"
- },
- "referer": {
- "description": "The referer URL of the request, as defined in HTTP/1.1 Header Field Definitions (http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html).",
- "type": "string"
- },
- "remoteIp": {
- "description": "The IP address (IPv4 or IPv6) of the client that issued the HTTP request. Examples: \"192.168.1.1\", \"FE80::0202:B3FF:FE1E:8329\".",
- "type": "string"
- },
- "requestMethod": {
- "description": "The request method. Examples: \"GET\", \"HEAD\", \"PUT\", \"POST\".",
- "type": "string"
- },
- "requestSize": {
- "description": "The size of the HTTP request message in bytes, including the request headers and the request body.",
- "format": "int64",
- "type": "string"
- },
- "requestUrl": {
- "description": "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\".",
- "type": "string"
- },
- "responseSize": {
- "description": "The size of the HTTP response message sent back to the client, in bytes, including the response headers and the response body.",
- "format": "int64",
- "type": "string"
- },
- "serverIp": {
- "description": "The IP address (IPv4 or IPv6) of the origin server that the request was sent to.",
- "type": "string"
- },
- "status": {
- "description": "The response code indicating the status of response. Examples: 200, 404.",
- "format": "int32",
- "type": "integer"
- },
- "userAgent": {
- "description": "The user agent sent by the client. Example: \"Mozilla/4.0 (compatible; MSIE 6.0; Windows 98; Q312461; .NET\nCLR 1.0.3705)\".",
- "type": "string"
- }
- },
- "type": "object"
- },
- "LabelDescriptor": {
- "description": "A description of a label.",
- "id": "LabelDescriptor",
- "properties": {
- "description": {
- "description": "A human-readable description for the label.",
- "type": "string"
- },
- "key": {
- "description": "The label key.",
- "type": "string"
- },
- "valueType": {
- "description": "The type of data that can be assigned to the label.",
- "enum": [
- "STRING",
- "BOOL",
- "INT64"
- ],
- "enumDescriptions": [
- "A variable-length string. This is the default.",
- "Boolean; true or false.",
- "A 64-bit signed integer."
- ],
- "type": "string"
- }
- },
- "type": "object"
- },
- "Linear": {
- "description": "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 \u003c= i \u003c N-1): offset + (width * i). Lower bound (1 \u003c= i \u003c N): offset + (width * (i - 1)).",
- "id": "Linear",
- "properties": {
- "numFiniteBuckets": {
- "description": "Must be greater than 0.",
- "format": "int32",
- "type": "integer"
- },
- "offset": {
- "description": "Lower bound of the first bucket.",
- "format": "double",
- "type": "number"
- },
- "width": {
- "description": "Must be greater than 0.",
- "format": "double",
- "type": "number"
- }
- },
- "type": "object"
- },
- "ListLogEntriesRequest": {
- "description": "The parameters to ListLogEntries.",
- "id": "ListLogEntriesRequest",
- "properties": {
- "filter": {
- "description": "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.",
- "type": "string"
- },
- "orderBy": {
- "description": "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.",
- "type": "string"
- },
- "pageSize": {
- "description": "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.",
- "format": "int32",
- "type": "integer"
- },
- "pageToken": {
- "description": "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.",
- "type": "string"
- },
- "projectIds": {
- "description": "Deprecated. Use resource_names instead. One or more project identifiers or project numbers from which to retrieve log entries. Example: \"my-project-1A\".",
- "items": {
- "type": "string"
- },
- "type": "array"
- },
- "resourceNames": {
- "description": "Required. Names of one or more parent resources from which to retrieve log entries:\n\"projects/[PROJECT_ID]\"\n\"organizations/[ORGANIZATION_ID]\"\n\"billingAccounts/[BILLING_ACCOUNT_ID]\"\n\"folders/[FOLDER_ID]\"\nProjects listed in the project_ids field are added to this list.",
- "items": {
- "type": "string"
- },
- "type": "array"
- }
- },
- "type": "object"
- },
- "ListLogEntriesResponse": {
- "description": "Result returned from ListLogEntries.",
- "id": "ListLogEntriesResponse",
- "properties": {
- "entries": {
- "description": "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.",
- "items": {
- "$ref": "LogEntry"
- },
- "type": "array"
- },
- "nextPageToken": {
- "description": "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.",
- "type": "string"
- }
- },
- "type": "object"
- },
- "ListLogMetricsResponse": {
- "description": "Result returned from ListLogMetrics.",
- "id": "ListLogMetricsResponse",
- "properties": {
- "metrics": {
- "description": "A list of logs-based metrics.",
- "items": {
- "$ref": "LogMetric"
- },
- "type": "array"
- },
- "nextPageToken": {
- "description": "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.",
- "type": "string"
- }
- },
- "type": "object"
- },
- "ListMonitoredResourceDescriptorsResponse": {
- "description": "Result returned from ListMonitoredResourceDescriptors.",
- "id": "ListMonitoredResourceDescriptorsResponse",
- "properties": {
- "nextPageToken": {
- "description": "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.",
- "type": "string"
- },
- "resourceDescriptors": {
- "description": "A list of resource descriptors.",
- "items": {
- "$ref": "MonitoredResourceDescriptor"
- },
- "type": "array"
- }
- },
- "type": "object"
- },
- "ListSinksResponse": {
- "description": "Result returned from ListSinks.",
- "id": "ListSinksResponse",
- "properties": {
- "nextPageToken": {
- "description": "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.",
- "type": "string"
- },
- "sinks": {
- "description": "A list of sinks.",
- "items": {
- "$ref": "LogSink"
- },
- "type": "array"
- }
- },
- "type": "object"
- },
- "LogEntry": {
- "description": "An individual entry in a log.",
- "id": "LogEntry",
- "properties": {
- "httpRequest": {
- "$ref": "HttpRequest",
- "description": "Optional. Information about the HTTP request associated with this log entry, if applicable."
- },
- "insertId": {
- "description": "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.",
- "type": "string"
- },
- "jsonPayload": {
- "additionalProperties": {
- "description": "Properties of the object.",
- "type": "any"
- },
- "description": "The log entry payload, represented as a structure that is expressed as a JSON object.",
- "type": "object"
- },
- "labels": {
- "additionalProperties": {
- "type": "string"
- },
- "description": "Optional. A set of user-defined (key, value) data that provides additional information about the log entry.",
- "type": "object"
- },
- "logName": {
- "description": "Required. The resource name of the log to which this log entry belongs:\n\"projects/[PROJECT_ID]/logs/[LOG_ID]\"\n\"organizations/[ORGANIZATION_ID]/logs/[LOG_ID]\"\n\"billingAccounts/[BILLING_ACCOUNT_ID]/logs/[LOG_ID]\"\n\"folders/[FOLDER_ID]/logs/[LOG_ID]\"\nA 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%2Factivity\". [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.",
- "type": "string"
- },
- "metadata": {
- "$ref": "MonitoredResourceMetadata",
- "description": "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."
- },
- "operation": {
- "$ref": "LogEntryOperation",
- "description": "Optional. Information about an operation associated with the log entry, if applicable."
- },
- "protoPayload": {
- "additionalProperties": {
- "description": "Properties of the object. Contains field @type with type URL.",
- "type": "any"
- },
- "description": "The log entry payload, represented as a protocol buffer. Some Google Cloud Platform services use this field for their log entry payloads.",
- "type": "object"
- },
- "receiveTimestamp": {
- "description": "Output only. The time the log entry was received by Logging.",
- "format": "google-datetime",
- "type": "string"
- },
- "resource": {
- "$ref": "MonitoredResource",
- "description": "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."
- },
- "severity": {
- "description": "Optional. The severity of the log entry. The default value is LogSeverity.DEFAULT.",
- "enum": [
- "DEFAULT",
- "DEBUG",
- "INFO",
- "NOTICE",
- "WARNING",
- "ERROR",
- "CRITICAL",
- "ALERT",
- "EMERGENCY"
- ],
- "enumDescriptions": [
- "(0) The log entry has no assigned severity level.",
- "(100) Debug or trace information.",
- "(200) Routine information, such as ongoing status or performance.",
- "(300) Normal but significant events, such as start up, shut down, or a configuration change.",
- "(400) Warning events might cause problems.",
- "(500) Error events are likely to cause problems.",
- "(600) Critical events cause more severe problems or outages.",
- "(700) A person must take an action immediately.",
- "(800) One or more systems are unusable."
- ],
- "type": "string"
- },
- "sourceLocation": {
- "$ref": "LogEntrySourceLocation",
- "description": "Optional. Source code location information associated with the log entry, if any."
- },
- "spanId": {
- "description": "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 \u003ccode\u003e\"000000000000004a\"\u003c/code\u003e.",
- "type": "string"
- },
- "textPayload": {
- "description": "The log entry payload, represented as a Unicode string (UTF-8).",
- "type": "string"
- },
- "timestamp": {
- "description": "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.",
- "format": "google-datetime",
- "type": "string"
- },
- "trace": {
- "description": "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",
- "type": "string"
- },
- "traceSampled": {
- "description": "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.",
- "type": "boolean"
- }
- },
- "type": "object"
- },
- "LogEntryOperation": {
- "description": "Additional information about a potentially long-running operation with which a log entry is associated.",
- "id": "LogEntryOperation",
- "properties": {
- "first": {
- "description": "Optional. Set this to True if this is the first log entry in the operation.",
- "type": "boolean"
- },
- "id": {
- "description": "Optional. An arbitrary operation identifier. Log entries with the same identifier are assumed to be part of the same operation.",
- "type": "string"
- },
- "last": {
- "description": "Optional. Set this to True if this is the last log entry in the operation.",
- "type": "boolean"
- },
- "producer": {
- "description": "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\".",
- "type": "string"
- }
- },
- "type": "object"
- },
- "LogEntrySourceLocation": {
- "description": "Additional information about the source code location that produced the log entry.",
- "id": "LogEntrySourceLocation",
- "properties": {
- "file": {
- "description": "Optional. Source file name. Depending on the runtime environment, this might be a simple name or a fully-qualified name.",
- "type": "string"
- },
- "function": {
- "description": "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).",
- "type": "string"
- },
- "line": {
- "description": "Optional. Line within the source file. 1-based; 0 indicates no line number available.",
- "format": "int64",
- "type": "string"
- }
- },
- "type": "object"
- },
- "LogLine": {
- "description": "Application log line emitted while processing a request.",
- "id": "LogLine",
- "properties": {
- "logMessage": {
- "description": "App-provided log message.",
- "type": "string"
- },
- "severity": {
- "description": "Severity of this log entry.",
- "enum": [
- "DEFAULT",
- "DEBUG",
- "INFO",
- "NOTICE",
- "WARNING",
- "ERROR",
- "CRITICAL",
- "ALERT",
- "EMERGENCY"
- ],
- "enumDescriptions": [
- "(0) The log entry has no assigned severity level.",
- "(100) Debug or trace information.",
- "(200) Routine information, such as ongoing status or performance.",
- "(300) Normal but significant events, such as start up, shut down, or a configuration change.",
- "(400) Warning events might cause problems.",
- "(500) Error events are likely to cause problems.",
- "(600) Critical events cause more severe problems or outages.",
- "(700) A person must take an action immediately.",
- "(800) One or more systems are unusable."
- ],
- "type": "string"
- },
- "sourceLocation": {
- "$ref": "SourceLocation",
- "description": "Where in the source code this log message was written."
- },
- "time": {
- "description": "Approximate time when this log entry was made.",
- "format": "google-datetime",
- "type": "string"
- }
- },
- "type": "object"
- },
- "LogMetric": {
- "description": "Describes a logs-based metric. The value of the metric is the number of log entries that match a logs filter in a given time interval.Logs-based metric can also be used to extract values from logs and create a a distribution of the values. The distribution records the statistics of the extracted values along with an optional histogram of the values as specified by the bucket options.",
- "id": "LogMetric",
- "properties": {
- "bucketOptions": {
- "$ref": "BucketOptions",
- "description": "Optional. The bucket_options are required when the logs-based metric is using a DISTRIBUTION value type and it describes the bucket boundaries used to create a histogram of the extracted values."
- },
- "createTime": {
- "description": "Output only. The creation timestamp of the metric.This field may not be present for older metrics.",
- "format": "google-datetime",
- "type": "string"
- },
- "description": {
- "description": "Optional. A description of this metric, which is used in documentation. The maximum length of the description is 8000 characters.",
- "type": "string"
- },
- "filter": {
- "description": "Required. An advanced logs filter which is used to match log entries. Example:\n\"resource.type=gae_app AND severity\u003e=ERROR\"\nThe maximum length of the filter is 20000 characters.",
- "type": "string"
- },
- "labelExtractors": {
- "additionalProperties": {
- "type": "string"
- },
- "description": "Optional. A map from a label key string to an extractor expression which is used to extract data from a log entry field and assign as the label value. Each label key specified in the LabelDescriptor must have an associated extractor expression in this map. The syntax of the extractor expression is the same as for the value_extractor field.The extracted value is converted to the type defined in the label descriptor. If the either the extraction or the type conversion fails, the label will have a default value. The default value for a string label is an empty string, for an integer label its 0, and for a boolean label its false.Note that there are upper bounds on the maximum number of labels and the number of active time series that are allowed in a project.",
- "type": "object"
- },
- "metricDescriptor": {
- "$ref": "MetricDescriptor",
- "description": "Optional. The metric descriptor associated with the logs-based metric. If unspecified, it uses a default metric descriptor with a DELTA metric kind, INT64 value type, with no labels and a unit of \"1\". Such a metric counts the number of log entries matching the filter expression.The name, type, and description fields in the metric_descriptor are output only, and is constructed using the name and description field in the LogMetric.To create a logs-based metric that records a distribution of log values, a DELTA metric kind with a DISTRIBUTION value type must be used along with a value_extractor expression in the LogMetric.Each label in the metric descriptor must have a matching label name as the key and an extractor expression as the value in the label_extractors map.The metric_kind and value_type fields in the metric_descriptor cannot be updated once initially configured. New labels can be added in the metric_descriptor, but existing labels cannot be modified except for their description."
- },
- "name": {
- "description": "Required. The client-assigned metric identifier. Examples: \"error_count\", \"nginx/requests\".Metric identifiers are limited to 100 characters and can include only the following characters: A-Z, a-z, 0-9, and the special characters _-.,+!*',()%/. The forward-slash character (/) denotes a hierarchy of name pieces, and it cannot be the first character of the name.The metric identifier in this field must not be URL-encoded (https://en.wikipedia.org/wiki/Percent-encoding). However, when the metric identifier appears as the [METRIC_ID] part of a metric_name API parameter, then the metric identifier must be URL-encoded. Example: \"projects/my-project/metrics/nginx%2Frequests\".",
- "type": "string"
- },
- "updateTime": {
- "description": "Output only. The last update timestamp of the metric.This field may not be present for older metrics.",
- "format": "google-datetime",
- "type": "string"
- },
- "valueExtractor": {
- "description": "Optional. A value_extractor is required when using a distribution logs-based metric to extract the values to record from a log entry. Two functions are supported for value extraction: EXTRACT(field) or REGEXP_EXTRACT(field, regex). The argument are: 1. field: The name of the log entry field from which the value is to be extracted. 2. regex: A regular expression using the Google RE2 syntax (https://github.com/google/re2/wiki/Syntax) with a single capture group to extract data from the specified log entry field. The value of the field is converted to a string before applying the regex. It is an error to specify a regex that does not include exactly one capture group.The result of the extraction must be convertible to a double type, as the distribution always records double values. If either the extraction or the conversion to double fails, then those values are not recorded in the distribution.Example: REGEXP_EXTRACT(jsonPayload.request, \".*quantity=(\\d+).*\")",
- "type": "string"
- },
- "version": {
- "description": "Deprecated. The API version that created or updated this metric. The v2 format is used by default and cannot be changed.",
- "enum": [
- "V2",
- "V1"
- ],
- "enumDescriptions": [
- "Logging API v2.",
- "Logging API v1."
- ],
- "type": "string"
- }
- },
- "type": "object"
- },
- "LogSink": {
- "description": "Describes a sink used to export log entries to one of the following destinations in any project: a Cloud Storage bucket, a BigQuery dataset, or a Cloud Pub/Sub topic. A logs filter controls which log entries are exported. The sink must be created within a project, organization, billing account, or folder.",
- "id": "LogSink",
- "properties": {
- "createTime": {
- "description": "Output only. The creation timestamp of the sink.This field may not be present for older sinks.",
- "format": "google-datetime",
- "type": "string"
- },
- "destination": {
- "description": "Required. The export destination:\n\"storage.googleapis.com/[GCS_BUCKET]\"\n\"bigquery.googleapis.com/projects/[PROJECT_ID]/datasets/[DATASET]\"\n\"pubsub.googleapis.com/projects/[PROJECT_ID]/topics/[TOPIC_ID]\"\nThe sink's writer_identity, set when the sink is created, must have permission to write to the destination or else the log entries are not exported. For more information, see Exporting Logs with Sinks.",
- "type": "string"
- },
- "filter": {
- "description": "Optional. An advanced logs filter. The only exported log entries are those that are in the resource owning the sink and that match the filter. For example:\nlogName=\"projects/[PROJECT_ID]/logs/[LOG_ID]\" AND severity\u003e=ERROR\n",
- "type": "string"
- },
- "includeChildren": {
- "description": "Optional. This field applies only to sinks owned by organizations and folders. If the field is false, the default, only the logs owned by the sink's parent resource are available for export. If the field is true, then logs from all the projects, folders, and billing accounts contained in the sink's parent resource are also available for export. Whether a particular log entry from the children is exported depends on the sink's filter expression. For example, if this field is true, then the filter resource.type=gce_instance would export all Compute Engine VM instance log entries from all projects in the sink's parent. To only export entries from certain child projects, filter on the project part of the log name:\nlogName:(\"projects/test-project1/\" OR \"projects/test-project2/\") AND\nresource.type=gce_instance\n",
- "type": "boolean"
- },
- "name": {
- "description": "Required. The client-assigned sink identifier, unique within the project. Example: \"my-syslog-errors-to-pubsub\". Sink identifiers are limited to 100 characters and can include only the following characters: upper and lower-case alphanumeric characters, underscores, hyphens, and periods.",
- "type": "string"
- },
- "outputVersionFormat": {
- "description": "Deprecated. The log entry format to use for this sink's exported log entries. The v2 format is used by default and cannot be changed.",
- "enum": [
- "VERSION_FORMAT_UNSPECIFIED",
- "V2",
- "V1"
- ],
- "enumDescriptions": [
- "An unspecified format version that will default to V2.",
- "LogEntry version 2 format.",
- "LogEntry version 1 format."
- ],
- "type": "string"
- },
- "updateTime": {
- "description": "Output only. The last update timestamp of the sink.This field may not be present for older sinks.",
- "format": "google-datetime",
- "type": "string"
- },
- "writerIdentity": {
- "description": "Output only. An IAM identity\u0026mdash;a service account or group\u0026mdash;under which Logging writes the exported log entries to the sink's destination. This field is set by sinks.create and sinks.update based on the value of unique_writer_identity in those methods.Until you grant this identity write-access to the destination, log entry exports from this sink will fail. For more information, see Granting Access for a Resource. Consult the destination service's documentation to determine the appropriate IAM roles to assign to the identity.",
- "type": "string"
- }
- },
- "type": "object"
- },
- "MetricDescriptor": {
- "description": "Defines a metric type and its schema. Once a metric descriptor is created, deleting or altering it stops data collection and makes the metric type's existing data unusable.",
- "id": "MetricDescriptor",
- "properties": {
- "description": {
- "description": "A detailed description of the metric, which can be used in documentation.",
- "type": "string"
- },
- "displayName": {
- "description": "A concise name for the metric, which can be displayed in user interfaces. Use sentence case without an ending period, for example \"Request count\". This field is optional but it is recommended to be set for any metrics associated with user-visible concepts, such as Quota.",
- "type": "string"
- },
- "labels": {
- "description": "The set of labels that can be used to describe a specific instance of this metric type. For example, the appengine.googleapis.com/http/server/response_latencies metric type has a label for the HTTP response code, response_code, so you can look at latencies for successful responses or just for responses that failed.",
- "items": {
- "$ref": "LabelDescriptor"
- },
- "type": "array"
- },
- "metadata": {
- "$ref": "MetricDescriptorMetadata",
- "description": "Optional. Metadata which can be used to guide usage of the metric."
- },
- "metricKind": {
- "description": "Whether the metric records instantaneous values, changes to a value, etc. Some combinations of metric_kind and value_type might not be supported.",
- "enum": [
- "METRIC_KIND_UNSPECIFIED",
- "GAUGE",
- "DELTA",
- "CUMULATIVE"
- ],
- "enumDescriptions": [
- "Do not use this default value.",
- "An instantaneous measurement of a value.",
- "The change in a value during a time interval.",
- "A value accumulated over a time interval. Cumulative measurements in a time series should have the same start time and increasing end times, until an event resets the cumulative value to zero and sets a new start time for the following points."
- ],
- "type": "string"
- },
- "name": {
- "description": "The resource name of the metric descriptor.",
- "type": "string"
- },
- "type": {
- "description": "The metric type, including its DNS name prefix. The type is not URL-encoded. All user-defined metric types have the DNS name custom.googleapis.com or external.googleapis.com. Metric types should use a natural hierarchical grouping. For example:\n\"custom.googleapis.com/invoice/paid/amount\"\n\"external.googleapis.com/prometheus/up\"\n\"appengine.googleapis.com/http/server/response_latencies\"\n",
- "type": "string"
- },
- "unit": {
- "description": "The unit in which the metric value is reported. It is only applicable if the value_type is INT64, DOUBLE, or DISTRIBUTION. The supported units are a subset of The Unified Code for Units of Measure (http://unitsofmeasure.org/ucum.html) standard:Basic units (UNIT)\nbit bit\nBy byte\ns second\nmin minute\nh hour\nd dayPrefixes (PREFIX)\nk kilo (10**3)\nM mega (10**6)\nG giga (10**9)\nT tera (10**12)\nP peta (10**15)\nE exa (10**18)\nZ zetta (10**21)\nY yotta (10**24)\nm milli (10**-3)\nu micro (10**-6)\nn nano (10**-9)\np pico (10**-12)\nf femto (10**-15)\na atto (10**-18)\nz zepto (10**-21)\ny yocto (10**-24)\nKi kibi (2**10)\nMi mebi (2**20)\nGi gibi (2**30)\nTi tebi (2**40)GrammarThe grammar also includes these connectors:\n/ division (as an infix operator, e.g. 1/s).\n. multiplication (as an infix operator, e.g. GBy.d)The grammar for a unit is as follows:\nExpression = Component { \".\" Component } { \"/\" Component } ;\n\nComponent = ( [ PREFIX ] UNIT | \"%\" ) [ Annotation ]\n | Annotation\n | \"1\"\n ;\n\nAnnotation = \"{\" NAME \"}\" ;\nNotes:\nAnnotation is just a comment if it follows a UNIT and is equivalent to 1 if it is used alone. For examples, {requests}/s == 1/s, By{transmitted}/s == By/s.\nNAME is a sequence of non-blank printable ASCII characters not containing '{' or '}'.\n1 represents dimensionless value 1, such as in 1/s.\n% represents dimensionless value 1/100, and annotates values giving a percentage.",
- "type": "string"
- },
- "valueType": {
- "description": "Whether the measurement is an integer, a floating-point number, etc. Some combinations of metric_kind and value_type might not be supported.",
- "enum": [
- "VALUE_TYPE_UNSPECIFIED",
- "BOOL",
- "INT64",
- "DOUBLE",
- "STRING",
- "DISTRIBUTION",
- "MONEY"
- ],
- "enumDescriptions": [
- "Do not use this default value.",
- "The value is a boolean. This value type can be used only if the metric kind is GAUGE.",
- "The value is a signed 64-bit integer.",
- "The value is a double precision floating point number.",
- "The value is a text string. This value type can be used only if the metric kind is GAUGE.",
- "The value is a Distribution.",
- "The value is money."
- ],
- "type": "string"
- }
- },
- "type": "object"
- },
- "MetricDescriptorMetadata": {
- "description": "Additional annotations that can be used to guide the usage of a metric.",
- "id": "MetricDescriptorMetadata",
- "properties": {
- "ingestDelay": {
- "description": "The delay of data points caused by ingestion. Data points older than this age are guaranteed to be ingested and available to be read, excluding data loss due to errors.",
- "format": "google-duration",
- "type": "string"
- },
- "launchStage": {
- "description": "The launch stage of the metric definition.",
- "enum": [
- "LAUNCH_STAGE_UNSPECIFIED",
- "EARLY_ACCESS",
- "ALPHA",
- "BETA",
- "GA",
- "DEPRECATED"
- ],
- "enumDescriptions": [
- "Do not use this default value.",
- "Early Access features are limited to a closed group of testers. To use these features, you must sign up in advance and sign a Trusted Tester agreement (which includes confidentiality provisions). These features may be unstable, changed in backward-incompatible ways, and are not guaranteed to be released.",
- "Alpha is a limited availability test for releases before they are cleared for widespread use. By Alpha, all significant design issues are resolved and we are in the process of verifying functionality. Alpha customers need to apply for access, agree to applicable terms, and have their projects whitelisted. Alpha releases don’t have to be feature complete, no SLAs are provided, and there are no technical support obligations, but they will be far enough along that customers can actually use them in test environments or for limited-use tests -- just like they would in normal production cases.",
- "Beta is the point at which we are ready to open a release for any customer to use. There are no SLA or technical support obligations in a Beta release. Products will be complete from a feature perspective, but may have some open outstanding issues. Beta releases are suitable for limited production use cases.",
- "GA features are open to all developers and are considered stable and fully qualified for production use.",
- "Deprecated features are scheduled to be shut down and removed. For more information, see the “Deprecation Policy” section of our Terms of Service (https://cloud.google.com/terms/) and the Google Cloud Platform Subject to the Deprecation Policy (https://cloud.google.com/terms/deprecation) documentation."
- ],
- "type": "string"
- },
- "samplePeriod": {
- "description": "The sampling period of metric data points. For metrics which are written periodically, consecutive data points are stored at this time interval, excluding data loss due to errors. Metrics with a higher granularity have a smaller sampling period.",
- "format": "google-duration",
- "type": "string"
- }
- },
- "type": "object"
- },
- "MonitoredResource": {
- "description": "An object representing a resource that can be used for monitoring, logging, billing, or other purposes. Examples include virtual machine instances, databases, and storage devices such as disks. The type field identifies a MonitoredResourceDescriptor object that describes the resource's schema. Information in the labels field identifies the actual resource and its attributes according to the schema. For example, a particular Compute Engine VM instance could be represented by the following object, because the MonitoredResourceDescriptor for \"gce_instance\" has labels \"instance_id\" and \"zone\":\n{ \"type\": \"gce_instance\",\n \"labels\": { \"instance_id\": \"12345678901234\",\n \"zone\": \"us-central1-a\" }}\n",
- "id": "MonitoredResource",
- "properties": {
- "labels": {
- "additionalProperties": {
- "type": "string"
- },
- "description": "Required. Values for all of the labels listed in the associated monitored resource descriptor. For example, Compute Engine VM instances use the labels \"project_id\", \"instance_id\", and \"zone\".",
- "type": "object"
- },
- "type": {
- "description": "Required. The monitored resource type. This field must match the type field of a MonitoredResourceDescriptor object. For example, the type of a Compute Engine VM instance is gce_instance.",
- "type": "string"
- }
- },
- "type": "object"
- },
- "MonitoredResourceDescriptor": {
- "description": "An object that describes the schema of a MonitoredResource object using a type name and a set of labels. For example, the monitored resource descriptor for Google Compute Engine VM instances has a type of \"gce_instance\" and specifies the use of the labels \"instance_id\" and \"zone\" to identify particular VM instances.Different APIs can support different monitored resource types. APIs generally provide a list method that returns the monitored resource descriptors used by the API.",
- "id": "MonitoredResourceDescriptor",
- "properties": {
- "description": {
- "description": "Optional. A detailed description of the monitored resource type that might be used in documentation.",
- "type": "string"
- },
- "displayName": {
- "description": "Optional. A concise name for the monitored resource type that might be displayed in user interfaces. It should be a Title Cased Noun Phrase, without any article or other determiners. For example, \"Google Cloud SQL Database\".",
- "type": "string"
- },
- "labels": {
- "description": "Required. A set of labels used to describe instances of this monitored resource type. For example, an individual Google Cloud SQL database is identified by values for the labels \"database_id\" and \"zone\".",
- "items": {
- "$ref": "LabelDescriptor"
- },
- "type": "array"
- },
- "name": {
- "description": "Optional. The resource name of the monitored resource descriptor: \"projects/{project_id}/monitoredResourceDescriptors/{type}\" where {type} is the value of the type field in this object and {project_id} is a project ID that provides API-specific context for accessing the type. APIs that do not use project information can use the resource name format \"monitoredResourceDescriptors/{type}\".",
- "type": "string"
- },
- "type": {
- "description": "Required. The monitored resource type. For example, the type \"cloudsql_database\" represents databases in Google Cloud SQL. The maximum length of this value is 256 characters.",
- "type": "string"
- }
- },
- "type": "object"
- },
- "MonitoredResourceMetadata": {
- "description": "Auxiliary metadata for a MonitoredResource object. MonitoredResource objects contain the minimum set of information to uniquely identify a monitored resource instance. There is some other useful auxiliary metadata. Monitoring and Logging use an ingestion pipeline to extract metadata for cloud resources of all types, and store the metadata in this message.",
- "id": "MonitoredResourceMetadata",
- "properties": {
- "systemLabels": {
- "additionalProperties": {
- "description": "Properties of the object.",
- "type": "any"
- },
- "description": "Output only. Values for predefined system metadata labels. System labels are a kind of metadata extracted by Google, including \"machine_image\", \"vpc\", \"subnet_id\", \"security_group\", \"name\", etc. System label values can be only strings, Boolean values, or a list of strings. For example:\n{ \"name\": \"my-test-instance\",\n \"security_group\": [\"a\", \"b\", \"c\"],\n \"spot_instance\": false }\n",
- "type": "object"
- },
- "userLabels": {
- "additionalProperties": {
- "type": "string"
- },
- "description": "Output only. A map of user-defined metadata labels.",
- "type": "object"
- }
- },
- "type": "object"
- },
- "RequestLog": {
- "description": "Complete log information about a single HTTP request to an App Engine application.",
- "id": "RequestLog",
- "properties": {
- "appEngineRelease": {
- "description": "App Engine release version.",
- "type": "string"
- },
- "appId": {
- "description": "Application that handled this request.",
- "type": "string"
- },
- "cost": {
- "description": "An indication of the relative cost of serving this request.",
- "format": "double",
- "type": "number"
- },
- "endTime": {
- "description": "Time when the request finished.",
- "format": "google-datetime",
- "type": "string"
- },
- "finished": {
- "description": "Whether this request is finished or active.",
- "type": "boolean"
- },
- "first": {
- "description": "Whether this is the first RequestLog entry for this request. If an active request has several RequestLog entries written to Stackdriver Logging, then this field will be set for one of them.",
- "type": "boolean"
- },
- "host": {
- "description": "Internet host and port number of the resource being requested.",
- "type": "string"
- },
- "httpVersion": {
- "description": "HTTP version of request. Example: \"HTTP/1.1\".",
- "type": "string"
- },
- "instanceId": {
- "description": "An identifier for the instance that handled the request.",
- "type": "string"
- },
- "instanceIndex": {
- "description": "If the instance processing this request belongs to a manually scaled module, then this is the 0-based index of the instance. Otherwise, this value is -1.",
- "format": "int32",
- "type": "integer"
- },
- "ip": {
- "description": "Origin IP address.",
- "type": "string"
- },
- "latency": {
- "description": "Latency of the request.",
- "format": "google-duration",
- "type": "string"
- },
- "line": {
- "description": "A list of log lines emitted by the application while serving this request.",
- "items": {
- "$ref": "LogLine"
- },
- "type": "array"
- },
- "megaCycles": {
- "description": "Number of CPU megacycles used to process request.",
- "format": "int64",
- "type": "string"
- },
- "method": {
- "description": "Request method. Example: \"GET\", \"HEAD\", \"PUT\", \"POST\", \"DELETE\".",
- "type": "string"
- },
- "moduleId": {
- "description": "Module of the application that handled this request.",
- "type": "string"
- },
- "nickname": {
- "description": "The logged-in user who made the request.Most likely, this is the part of the user's email before the @ sign. The field value is the same for different requests from the same user, but different users can have similar names. This information is also available to the application via the App Engine Users API.This field will be populated starting with App Engine 1.9.21.",
- "type": "string"
- },
- "pendingTime": {
- "description": "Time this request spent in the pending request queue.",
- "format": "google-duration",
- "type": "string"
- },
- "referrer": {
- "description": "Referrer URL of request.",
- "type": "string"
- },
- "requestId": {
- "description": "Globally unique identifier for a request, which is based on the request start time. Request IDs for requests which started later will compare greater as strings than those for requests which started earlier.",
- "type": "string"
- },
- "resource": {
- "description": "Contains the path and query portion of the URL that was requested. For example, if the URL was \"http://example.com/app?name=val\", the resource would be \"/app?name=val\". The fragment identifier, which is identified by the # character, is not included.",
- "type": "string"
- },
- "responseSize": {
- "description": "Size in bytes sent back to client by request.",
- "format": "int64",
- "type": "string"
- },
- "sourceReference": {
- "description": "Source code for the application that handled this request. There can be more than one source reference per deployed application if source code is distributed among multiple repositories.",
- "items": {
- "$ref": "SourceReference"
- },
- "type": "array"
- },
- "startTime": {
- "description": "Time when the request started.",
- "format": "google-datetime",
- "type": "string"
- },
- "status": {
- "description": "HTTP response status code. Example: 200, 404.",
- "format": "int32",
- "type": "integer"
- },
- "taskName": {
- "description": "Task name of the request, in the case of an offline request.",
- "type": "string"
- },
- "taskQueueName": {
- "description": "Queue name of the request, in the case of an offline request.",
- "type": "string"
- },
- "traceId": {
- "description": "Stackdriver Trace identifier for this request.",
- "type": "string"
- },
- "traceSampled": {
- "description": "If true, the value in the 'trace_id' field was sampled for storage in a trace backend.",
- "type": "boolean"
- },
- "urlMapEntry": {
- "description": "File or class that handled the request.",
- "type": "string"
- },
- "userAgent": {
- "description": "User agent that made the request.",
- "type": "string"
- },
- "versionId": {
- "description": "Version of the application that handled this request.",
- "type": "string"
- },
- "wasLoadingRequest": {
- "description": "Whether this was a loading request for the instance.",
- "type": "boolean"
- }
- },
- "type": "object"
- },
- "SourceLocation": {
- "description": "Specifies a location in a source code file.",
- "id": "SourceLocation",
- "properties": {
- "file": {
- "description": "Source file name. Depending on the runtime environment, this might be a simple name or a fully-qualified name.",
- "type": "string"
- },
- "functionName": {
- "description": "Human-readable name of the function or method being invoked, with optional context such as the class or package name. This information is 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).",
- "type": "string"
- },
- "line": {
- "description": "Line within the source file.",
- "format": "int64",
- "type": "string"
- }
- },
- "type": "object"
- },
- "SourceReference": {
- "description": "A reference to a particular snapshot of the source tree used to build and deploy an application.",
- "id": "SourceReference",
- "properties": {
- "repository": {
- "description": "Optional. A URI string identifying the repository. Example: \"https://github.com/GoogleCloudPlatform/kubernetes.git\"",
- "type": "string"
- },
- "revisionId": {
- "description": "The canonical and persistent identifier of the deployed revision. Example (git): \"0035781c50ec7aa23385dc841529ce8a4b70db1b\"",
- "type": "string"
- }
- },
- "type": "object"
- },
- "WriteLogEntriesRequest": {
- "description": "The parameters to WriteLogEntries.",
- "id": "WriteLogEntriesRequest",
- "properties": {
- "dryRun": {
- "description": "Optional. If true, the request should expect normal response, but the entries won't be persisted nor exported. Useful for checking whether the logging API endpoints are working properly before sending valuable data.",
- "type": "boolean"
- },
- "entries": {
- "description": "Required. The log entries to send to Logging. The order of log entries in this list does not matter. Values supplied in this method's log_name, resource, and labels fields are copied into those log entries in this list that do not include values for their corresponding fields. For more information, see the LogEntry type.If the timestamp or insert_id fields are missing in log entries, then this method supplies the current time or a unique identifier, respectively. The supplied values are chosen so that, among the log entries that did not supply their own values, the entries earlier in the list will sort before the entries later in the list. See the entries.list method.Log entries with timestamps that are more than the logs retention period in the past or more than 24 hours in the future will not be available when calling entries.list. However, those log entries can still be exported with LogSinks.To improve throughput and to avoid exceeding the quota limit for calls to entries.write, you should try to include several log entries in this list, rather than calling this method for each individual log entry.",
- "items": {
- "$ref": "LogEntry"
- },
- "type": "array"
- },
- "labels": {
- "additionalProperties": {
- "type": "string"
- },
- "description": "Optional. Default labels that are added to the labels field of all log entries in entries. If a log entry already has a label with the same key as a label in this parameter, then the log entry's label is not changed. See LogEntry.",
- "type": "object"
- },
- "logName": {
- "description": "Optional. A default log resource name that is assigned to all log entries in entries that do not specify a value for log_name:\n\"projects/[PROJECT_ID]/logs/[LOG_ID]\"\n\"organizations/[ORGANIZATION_ID]/logs/[LOG_ID]\"\n\"billingAccounts/[BILLING_ACCOUNT_ID]/logs/[LOG_ID]\"\n\"folders/[FOLDER_ID]/logs/[LOG_ID]\"\n[LOG_ID] must be URL-encoded. For example:\n\"projects/my-project-id/logs/syslog\"\n\"organizations/1234567890/logs/cloudresourcemanager.googleapis.com%2Factivity\"\nThe permission \u003ccode\u003elogging.logEntries.create\u003c/code\u003e is needed on each project, organization, billing account, or folder that is receiving new log entries, whether the resource is specified in \u003ccode\u003elogName\u003c/code\u003e or in an individual log entry.",
- "type": "string"
- },
- "partialSuccess": {
- "description": "Optional. Whether valid entries should be written even if some other entries fail due to INVALID_ARGUMENT or PERMISSION_DENIED errors. If any entry is not written, then the response status is the error associated with one of the failed entries and the response includes error details keyed by the entries' zero-based index in the entries.write method.",
- "type": "boolean"
- },
- "resource": {
- "$ref": "MonitoredResource",
- "description": "Optional. A default monitored resource object that is assigned to all log entries in entries that do not specify a value for resource. Example:\n{ \"type\": \"gce_instance\",\n \"labels\": {\n \"zone\": \"us-central1-a\", \"instance_id\": \"00000000000000000000\" }}\nSee LogEntry."
- }
- },
- "type": "object"
- },
- "WriteLogEntriesResponse": {
- "description": "Result returned from WriteLogEntries. empty",
- "id": "WriteLogEntriesResponse",
- "properties": {},
- "type": "object"
- }
- },
- "servicePath": "",
- "title": "Stackdriver Logging API",
- "version": "v2beta1",
- "version_module": true
-}
\ No newline at end of file
diff --git a/vendor/google.golang.org/api/logging/v2beta1/logging-gen.go b/vendor/google.golang.org/api/logging/v2beta1/logging-gen.go
deleted file mode 100644
index fde10428f4a..00000000000
--- a/vendor/google.golang.org/api/logging/v2beta1/logging-gen.go
+++ /dev/null
@@ -1,4077 +0,0 @@
-// Copyright 2019 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 "000000000000004a"
.
- 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"`
-
- // Line: Optional. Line within the source file. 1-based; 0 indicates no
- // line number available.
- Line int64 `json:"line,omitempty,string"`
-
- // ForceSendFields is a list of field names (e.g. "File") 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. "File") 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 *LogEntrySourceLocation) MarshalJSON() ([]byte, error) {
- type NoMethod LogEntrySourceLocation
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
-}
-
-// LogLine: Application log line emitted while processing a request.
-type LogLine struct {
- // LogMessage: App-provided log message.
- LogMessage string `json:"logMessage,omitempty"`
-
- // Severity: Severity of this log entry.
- //
- // 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: Where in the source code this log message was
- // written.
- SourceLocation *SourceLocation `json:"sourceLocation,omitempty"`
-
- // Time: Approximate time when this log entry was made.
- Time string `json:"time,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "LogMessage") 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. "LogMessage") 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 *LogLine) MarshalJSON() ([]byte, error) {
- type NoMethod LogLine
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
-}
-
-// LogMetric: Describes a logs-based metric. The value of the metric is
-// the number of log entries that match a logs filter in a given time
-// interval.Logs-based metric can also be used to extract values from
-// logs and create a a distribution of the values. The distribution
-// records the statistics of the extracted values along with an optional
-// histogram of the values as specified by the bucket options.
-type LogMetric struct {
- // BucketOptions: Optional. The bucket_options are required when the
- // logs-based metric is using a DISTRIBUTION value type and it describes
- // the bucket boundaries used to create a histogram of the extracted
- // values.
- BucketOptions *BucketOptions `json:"bucketOptions,omitempty"`
-
- // CreateTime: Output only. The creation timestamp of the metric.This
- // field may not be present for older metrics.
- CreateTime string `json:"createTime,omitempty"`
-
- // Description: Optional. A description of this metric, which is used in
- // documentation. The maximum length of the description is 8000
- // characters.
- Description string `json:"description,omitempty"`
-
- // Filter: Required. An advanced logs filter which is used to match log
- // entries. Example:
- // "resource.type=gae_app AND severity>=ERROR"
- // The maximum length of the filter is 20000 characters.
- Filter string `json:"filter,omitempty"`
-
- // LabelExtractors: Optional. A map from a label key string to an
- // extractor expression which is used to extract data from a log entry
- // field and assign as the label value. Each label key specified in the
- // LabelDescriptor must have an associated extractor expression in this
- // map. The syntax of the extractor expression is the same as for the
- // value_extractor field.The extracted value is converted to the type
- // defined in the label descriptor. If the either the extraction or the
- // type conversion fails, the label will have a default value. The
- // default value for a string label is an empty string, for an integer
- // label its 0, and for a boolean label its false.Note that there are
- // upper bounds on the maximum number of labels and the number of active
- // time series that are allowed in a project.
- LabelExtractors map[string]string `json:"labelExtractors,omitempty"`
-
- // MetricDescriptor: Optional. The metric descriptor associated with the
- // logs-based metric. If unspecified, it uses a default metric
- // descriptor with a DELTA metric kind, INT64 value type, with no labels
- // and a unit of "1". Such a metric counts the number of log entries
- // matching the filter expression.The name, type, and description fields
- // in the metric_descriptor are output only, and is constructed using
- // the name and description field in the LogMetric.To create a
- // logs-based metric that records a distribution of log values, a DELTA
- // metric kind with a DISTRIBUTION value type must be used along with a
- // value_extractor expression in the LogMetric.Each label in the metric
- // descriptor must have a matching label name as the key and an
- // extractor expression as the value in the label_extractors map.The
- // metric_kind and value_type fields in the metric_descriptor cannot be
- // updated once initially configured. New labels can be added in the
- // metric_descriptor, but existing labels cannot be modified except for
- // their description.
- MetricDescriptor *MetricDescriptor `json:"metricDescriptor,omitempty"`
-
- // Name: Required. The client-assigned metric identifier. Examples:
- // "error_count", "nginx/requests".Metric identifiers are limited to 100
- // characters and can include only the following characters: A-Z, a-z,
- // 0-9, and the special characters _-.,+!*',()%/. The forward-slash
- // character (/) denotes a hierarchy of name pieces, and it cannot be
- // the first character of the name.The metric identifier in this field
- // must not be URL-encoded
- // (https://en.wikipedia.org/wiki/Percent-encoding). However, when the
- // metric identifier appears as the [METRIC_ID] part of a metric_name
- // API parameter, then the metric identifier must be URL-encoded.
- // Example: "projects/my-project/metrics/nginx%2Frequests".
- Name string `json:"name,omitempty"`
-
- // UpdateTime: Output only. The last update timestamp of the metric.This
- // field may not be present for older metrics.
- UpdateTime string `json:"updateTime,omitempty"`
-
- // ValueExtractor: Optional. A value_extractor is required when using a
- // distribution logs-based metric to extract the values to record from a
- // log entry. Two functions are supported for value extraction:
- // EXTRACT(field) or REGEXP_EXTRACT(field, regex). The argument are: 1.
- // field: The name of the log entry field from which the value is to be
- // extracted. 2. regex: A regular expression using the Google RE2
- // syntax (https://github.com/google/re2/wiki/Syntax) with a single
- // capture group to extract data from the specified log entry field.
- // The value of the field is converted to a string before applying the
- // regex. It is an error to specify a regex that does not include
- // exactly one capture group.The result of the extraction must be
- // convertible to a double type, as the distribution always records
- // double values. If either the extraction or the conversion to double
- // fails, then those values are not recorded in the
- // distribution.Example: REGEXP_EXTRACT(jsonPayload.request,
- // ".*quantity=(\d+).*")
- ValueExtractor string `json:"valueExtractor,omitempty"`
-
- // Version: Deprecated. The API version that created or updated this
- // metric. The v2 format is used by default and cannot be changed.
- //
- // Possible values:
- // "V2" - Logging API v2.
- // "V1" - Logging API v1.
- Version string `json:"version,omitempty"`
-
- // ServerResponse contains the HTTP response code and headers from the
- // server.
- googleapi.ServerResponse `json:"-"`
-
- // ForceSendFields is a list of field names (e.g. "BucketOptions") 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. "BucketOptions") 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 *LogMetric) MarshalJSON() ([]byte, error) {
- type NoMethod LogMetric
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
-}
-
-// LogSink: Describes a sink used to export log entries to one of the
-// following destinations in any project: a Cloud Storage bucket, a
-// BigQuery dataset, or a Cloud Pub/Sub topic. A logs filter controls
-// which log entries are exported. The sink must be created within a
-// project, organization, billing account, or folder.
-type LogSink struct {
- // CreateTime: Output only. The creation timestamp of the sink.This
- // field may not be present for older sinks.
- CreateTime string `json:"createTime,omitempty"`
-
- // Destination: Required. The export
- // destination:
- // "storage.googleapis.com/[GCS_BUCKET]"
- // "bigquery.googleapi
- // s.com/projects/[PROJECT_ID]/datasets/[DATASET]"
- // "pubsub.googleapis.com
- // /projects/[PROJECT_ID]/topics/[TOPIC_ID]"
- // The sink's writer_identity, set when the sink is created, must have
- // permission to write to the destination or else the log entries are
- // not exported. For more information, see Exporting Logs with Sinks.
- Destination string `json:"destination,omitempty"`
-
- // Filter: Optional. An advanced logs filter. The only exported log
- // entries are those that are in the resource owning the sink and that
- // match the filter. For
- // example:
- // logName="projects/[PROJECT_ID]/logs/[LOG_ID]" AND severity>=ERROR
- //
- Filter string `json:"filter,omitempty"`
-
- // IncludeChildren: Optional. This field applies only to sinks owned by
- // organizations and folders. If the field is false, the default, only
- // the logs owned by the sink's parent resource are available for
- // export. If the field is true, then logs from all the projects,
- // folders, and billing accounts contained in the sink's parent resource
- // are also available for export. Whether a particular log entry from
- // the children is exported depends on the sink's filter expression. For
- // example, if this field is true, then the filter
- // resource.type=gce_instance would export all Compute Engine VM
- // instance log entries from all projects in the sink's parent. To only
- // export entries from certain child projects, filter on the project
- // part of the log name:
- // logName:("projects/test-project1/" OR "projects/test-project2/")
- // AND
- // resource.type=gce_instance
- //
- IncludeChildren bool `json:"includeChildren,omitempty"`
-
- // Name: Required. The client-assigned sink identifier, unique within
- // the project. Example: "my-syslog-errors-to-pubsub". Sink identifiers
- // are limited to 100 characters and can include only the following
- // characters: upper and lower-case alphanumeric characters,
- // underscores, hyphens, and periods.
- Name string `json:"name,omitempty"`
-
- // OutputVersionFormat: Deprecated. The log entry format to use for this
- // sink's exported log entries. The v2 format is used by default and
- // cannot be changed.
- //
- // Possible values:
- // "VERSION_FORMAT_UNSPECIFIED" - An unspecified format version that
- // will default to V2.
- // "V2" - LogEntry version 2 format.
- // "V1" - LogEntry version 1 format.
- OutputVersionFormat string `json:"outputVersionFormat,omitempty"`
-
- // UpdateTime: Output only. The last update timestamp of the sink.This
- // field may not be present for older sinks.
- UpdateTime string `json:"updateTime,omitempty"`
-
- // WriterIdentity: Output only. An IAM identity—a service account
- // or group—under which Logging writes the exported log entries to
- // the sink's destination. This field is set by sinks.create and
- // sinks.update based on the value of unique_writer_identity in those
- // methods.Until you grant this identity write-access to the
- // destination, log entry exports from this sink will fail. For more
- // information, see Granting Access for a Resource. Consult the
- // destination service's documentation to determine the appropriate IAM
- // roles to assign to the identity.
- WriterIdentity string `json:"writerIdentity,omitempty"`
-
- // ServerResponse contains the HTTP response code and headers from the
- // server.
- googleapi.ServerResponse `json:"-"`
-
- // ForceSendFields is a list of field names (e.g. "CreateTime") 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. "CreateTime") 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 *LogSink) MarshalJSON() ([]byte, error) {
- type NoMethod LogSink
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
-}
-
-// MetricDescriptor: Defines a metric type and its schema. Once a metric
-// descriptor is created, deleting or altering it stops data collection
-// and makes the metric type's existing data unusable.
-type MetricDescriptor struct {
- // Description: A detailed description of the metric, which can be used
- // in documentation.
- Description string `json:"description,omitempty"`
-
- // DisplayName: A concise name for the metric, which can be displayed in
- // user interfaces. Use sentence case without an ending period, for
- // example "Request count". This field is optional but it is recommended
- // to be set for any metrics associated with user-visible concepts, such
- // as Quota.
- DisplayName string `json:"displayName,omitempty"`
-
- // Labels: The set of labels that can be used to describe a specific
- // instance of this metric type. For example, the
- // appengine.googleapis.com/http/server/response_latencies metric type
- // has a label for the HTTP response code, response_code, so you can
- // look at latencies for successful responses or just for responses that
- // failed.
- Labels []*LabelDescriptor `json:"labels,omitempty"`
-
- // Metadata: Optional. Metadata which can be used to guide usage of the
- // metric.
- Metadata *MetricDescriptorMetadata `json:"metadata,omitempty"`
-
- // MetricKind: Whether the metric records instantaneous values, changes
- // to a value, etc. Some combinations of metric_kind and value_type
- // might not be supported.
- //
- // Possible values:
- // "METRIC_KIND_UNSPECIFIED" - Do not use this default value.
- // "GAUGE" - An instantaneous measurement of a value.
- // "DELTA" - The change in a value during a time interval.
- // "CUMULATIVE" - A value accumulated over a time interval. Cumulative
- // measurements in a time series should have the same start time and
- // increasing end times, until an event resets the cumulative value to
- // zero and sets a new start time for the following points.
- MetricKind string `json:"metricKind,omitempty"`
-
- // Name: The resource name of the metric descriptor.
- Name string `json:"name,omitempty"`
-
- // Type: The metric type, including its DNS name prefix. The type is not
- // URL-encoded. All user-defined metric types have the DNS name
- // custom.googleapis.com or external.googleapis.com. Metric types should
- // use a natural hierarchical grouping. For
- // example:
- // "custom.googleapis.com/invoice/paid/amount"
- // "external.googlea
- // pis.com/prometheus/up"
- // "appengine.googleapis.com/http/server/response_
- // latencies"
- //
- Type string `json:"type,omitempty"`
-
- // Unit: The unit in which the metric value is reported. It is only
- // applicable if the value_type is INT64, DOUBLE, or DISTRIBUTION. The
- // supported units are a subset of The Unified Code for Units of Measure
- // (http://unitsofmeasure.org/ucum.html) standard:Basic units (UNIT)
- // bit bit
- // By byte
- // s second
- // min minute
- // h hour
- // d dayPrefixes (PREFIX)
- // k kilo (10**3)
- // M mega (10**6)
- // G giga (10**9)
- // T tera (10**12)
- // P peta (10**15)
- // E exa (10**18)
- // Z zetta (10**21)
- // Y yotta (10**24)
- // m milli (10**-3)
- // u micro (10**-6)
- // n nano (10**-9)
- // p pico (10**-12)
- // f femto (10**-15)
- // a atto (10**-18)
- // z zepto (10**-21)
- // y yocto (10**-24)
- // Ki kibi (2**10)
- // Mi mebi (2**20)
- // Gi gibi (2**30)
- // Ti tebi (2**40)GrammarThe grammar also includes these connectors:
- // / division (as an infix operator, e.g. 1/s).
- // . multiplication (as an infix operator, e.g. GBy.d)The grammar for a
- // unit is as follows:
- // Expression = Component { "." Component } { "/" Component }
- // ;
- //
- // Component = ( [ PREFIX ] UNIT | "%" ) [ Annotation ]
- // | Annotation
- // | "1"
- // ;
- //
- // Annotation = "{" NAME "}" ;
- // Notes:
- // Annotation is just a comment if it follows a UNIT and is equivalent
- // to 1 if it is used alone. For examples, {requests}/s == 1/s,
- // By{transmitted}/s == By/s.
- // NAME is a sequence of non-blank printable ASCII characters not
- // containing '{' or '}'.
- // 1 represents dimensionless value 1, such as in 1/s.
- // % represents dimensionless value 1/100, and annotates values giving
- // a percentage.
- Unit string `json:"unit,omitempty"`
-
- // ValueType: Whether the measurement is an integer, a floating-point
- // number, etc. Some combinations of metric_kind and value_type might
- // not be supported.
- //
- // Possible values:
- // "VALUE_TYPE_UNSPECIFIED" - Do not use this default value.
- // "BOOL" - The value is a boolean. This value type can be used only
- // if the metric kind is GAUGE.
- // "INT64" - The value is a signed 64-bit integer.
- // "DOUBLE" - The value is a double precision floating point number.
- // "STRING" - The value is a text string. This value type can be used
- // only if the metric kind is GAUGE.
- // "DISTRIBUTION" - The value is a Distribution.
- // "MONEY" - The value is money.
- 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 *MetricDescriptor) MarshalJSON() ([]byte, error) {
- type NoMethod MetricDescriptor
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
-}
-
-// MetricDescriptorMetadata: Additional annotations that can be used to
-// guide the usage of a metric.
-type MetricDescriptorMetadata struct {
- // IngestDelay: The delay of data points caused by ingestion. Data
- // points older than this age are guaranteed to be ingested and
- // available to be read, excluding data loss due to errors.
- IngestDelay string `json:"ingestDelay,omitempty"`
-
- // LaunchStage: The launch stage of the metric definition.
- //
- // Possible values:
- // "LAUNCH_STAGE_UNSPECIFIED" - Do not use this default value.
- // "EARLY_ACCESS" - Early Access features are limited to a closed
- // group of testers. To use these features, you must sign up in advance
- // and sign a Trusted Tester agreement (which includes confidentiality
- // provisions). These features may be unstable, changed in
- // backward-incompatible ways, and are not guaranteed to be released.
- // "ALPHA" - Alpha is a limited availability test for releases before
- // they are cleared for widespread use. By Alpha, all significant design
- // issues are resolved and we are in the process of verifying
- // functionality. Alpha customers need to apply for access, agree to
- // applicable terms, and have their projects whitelisted. Alpha releases
- // don’t have to be feature complete, no SLAs are provided, and there
- // are no technical support obligations, but they will be far enough
- // along that customers can actually use them in test environments or
- // for limited-use tests -- just like they would in normal production
- // cases.
- // "BETA" - Beta is the point at which we are ready to open a release
- // for any customer to use. There are no SLA or technical support
- // obligations in a Beta release. Products will be complete from a
- // feature perspective, but may have some open outstanding issues. Beta
- // releases are suitable for limited production use cases.
- // "GA" - GA features are open to all developers and are considered
- // stable and fully qualified for production use.
- // "DEPRECATED" - Deprecated features are scheduled to be shut down
- // and removed. For more information, see the “Deprecation Policy”
- // section of our Terms of Service (https://cloud.google.com/terms/) and
- // the Google Cloud Platform Subject to the Deprecation Policy
- // (https://cloud.google.com/terms/deprecation) documentation.
- LaunchStage string `json:"launchStage,omitempty"`
-
- // SamplePeriod: The sampling period of metric data points. For metrics
- // which are written periodically, consecutive data points are stored at
- // this time interval, excluding data loss due to errors. Metrics with a
- // higher granularity have a smaller sampling period.
- SamplePeriod string `json:"samplePeriod,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "IngestDelay") 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. "IngestDelay") 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 *MetricDescriptorMetadata) MarshalJSON() ([]byte, error) {
- type NoMethod MetricDescriptorMetadata
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
-}
-
-// MonitoredResource: An object representing a resource that can be used
-// for monitoring, logging, billing, or other purposes. Examples include
-// virtual machine instances, databases, and storage devices such as
-// disks. The type field identifies a MonitoredResourceDescriptor object
-// that describes the resource's schema. Information in the labels field
-// identifies the actual resource and its attributes according to the
-// schema. For example, a particular Compute Engine VM instance could be
-// represented by the following object, because the
-// MonitoredResourceDescriptor for "gce_instance" has labels
-// "instance_id" and "zone":
-// { "type": "gce_instance",
-// "labels": { "instance_id": "12345678901234",
-// "zone": "us-central1-a" }}
-//
-type MonitoredResource struct {
- // Labels: Required. Values for all of the labels listed in the
- // associated monitored resource descriptor. For example, Compute Engine
- // VM instances use the labels "project_id", "instance_id", and "zone".
- Labels map[string]string `json:"labels,omitempty"`
-
- // Type: Required. The monitored resource type. This field must match
- // the type field of a MonitoredResourceDescriptor object. For example,
- // the type of a Compute Engine VM instance is gce_instance.
- Type string `json:"type,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "Labels") 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. "Labels") 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 *MonitoredResource) MarshalJSON() ([]byte, error) {
- type NoMethod MonitoredResource
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
-}
-
-// MonitoredResourceDescriptor: An object that describes the schema of a
-// MonitoredResource object using a type name and a set of labels. For
-// example, the monitored resource descriptor for Google Compute Engine
-// VM instances has a type of "gce_instance" and specifies the use of
-// the labels "instance_id" and "zone" to identify particular VM
-// instances.Different APIs can support different monitored resource
-// types. APIs generally provide a list method that returns the
-// monitored resource descriptors used by the API.
-type MonitoredResourceDescriptor struct {
- // Description: Optional. A detailed description of the monitored
- // resource type that might be used in documentation.
- Description string `json:"description,omitempty"`
-
- // DisplayName: Optional. A concise name for the monitored resource type
- // that might be displayed in user interfaces. It should be a Title
- // Cased Noun Phrase, without any article or other determiners. For
- // example, "Google Cloud SQL Database".
- DisplayName string `json:"displayName,omitempty"`
-
- // Labels: Required. A set of labels used to describe instances of this
- // monitored resource type. For example, an individual Google Cloud SQL
- // database is identified by values for the labels "database_id" and
- // "zone".
- Labels []*LabelDescriptor `json:"labels,omitempty"`
-
- // Name: Optional. The resource name of the monitored resource
- // descriptor:
- // "projects/{project_id}/monitoredResourceDescriptors/{type}" where
- // {type} is the value of the type field in this object and {project_id}
- // is a project ID that provides API-specific context for accessing the
- // type. APIs that do not use project information can use the resource
- // name format "monitoredResourceDescriptors/{type}".
- Name string `json:"name,omitempty"`
-
- // Type: Required. The monitored resource type. For example, the type
- // "cloudsql_database" represents databases in Google Cloud SQL. The
- // maximum length of this value is 256 characters.
- Type string `json:"type,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 *MonitoredResourceDescriptor) MarshalJSON() ([]byte, error) {
- type NoMethod MonitoredResourceDescriptor
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
-}
-
-// MonitoredResourceMetadata: Auxiliary metadata for a MonitoredResource
-// object. MonitoredResource objects contain the minimum set of
-// information to uniquely identify a monitored resource instance. There
-// is some other useful auxiliary metadata. Monitoring and Logging use
-// an ingestion pipeline to extract metadata for cloud resources of all
-// types, and store the metadata in this message.
-type MonitoredResourceMetadata struct {
- // SystemLabels: Output only. Values for predefined system metadata
- // labels. System labels are a kind of metadata extracted by Google,
- // including "machine_image", "vpc", "subnet_id", "security_group",
- // "name", etc. System label values can be only strings, Boolean values,
- // or a list of strings. For example:
- // { "name": "my-test-instance",
- // "security_group": ["a", "b", "c"],
- // "spot_instance": false }
- //
- SystemLabels googleapi.RawMessage `json:"systemLabels,omitempty"`
-
- // UserLabels: Output only. A map of user-defined metadata labels.
- UserLabels map[string]string `json:"userLabels,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "SystemLabels") 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. "SystemLabels") 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 *MonitoredResourceMetadata) MarshalJSON() ([]byte, error) {
- type NoMethod MonitoredResourceMetadata
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
-}
-
-// RequestLog: Complete log information about a single HTTP request to
-// an App Engine application.
-type RequestLog struct {
- // AppEngineRelease: App Engine release version.
- AppEngineRelease string `json:"appEngineRelease,omitempty"`
-
- // AppId: Application that handled this request.
- AppId string `json:"appId,omitempty"`
-
- // Cost: An indication of the relative cost of serving this request.
- Cost float64 `json:"cost,omitempty"`
-
- // EndTime: Time when the request finished.
- EndTime string `json:"endTime,omitempty"`
-
- // Finished: Whether this request is finished or active.
- Finished bool `json:"finished,omitempty"`
-
- // First: Whether this is the first RequestLog entry for this request.
- // If an active request has several RequestLog entries written to
- // Stackdriver Logging, then this field will be set for one of them.
- First bool `json:"first,omitempty"`
-
- // Host: Internet host and port number of the resource being requested.
- Host string `json:"host,omitempty"`
-
- // HttpVersion: HTTP version of request. Example: "HTTP/1.1".
- HttpVersion string `json:"httpVersion,omitempty"`
-
- // InstanceId: An identifier for the instance that handled the request.
- InstanceId string `json:"instanceId,omitempty"`
-
- // InstanceIndex: If the instance processing this request belongs to a
- // manually scaled module, then this is the 0-based index of the
- // instance. Otherwise, this value is -1.
- InstanceIndex int64 `json:"instanceIndex,omitempty"`
-
- // Ip: Origin IP address.
- Ip string `json:"ip,omitempty"`
-
- // Latency: Latency of the request.
- Latency string `json:"latency,omitempty"`
-
- // Line: A list of log lines emitted by the application while serving
- // this request.
- Line []*LogLine `json:"line,omitempty"`
-
- // MegaCycles: Number of CPU megacycles used to process request.
- MegaCycles int64 `json:"megaCycles,omitempty,string"`
-
- // Method: Request method. Example: "GET", "HEAD", "PUT", "POST",
- // "DELETE".
- Method string `json:"method,omitempty"`
-
- // ModuleId: Module of the application that handled this request.
- ModuleId string `json:"moduleId,omitempty"`
-
- // Nickname: The logged-in user who made the request.Most likely, this
- // is the part of the user's email before the @ sign. The field value is
- // the same for different requests from the same user, but different
- // users can have similar names. This information is also available to
- // the application via the App Engine Users API.This field will be
- // populated starting with App Engine 1.9.21.
- Nickname string `json:"nickname,omitempty"`
-
- // PendingTime: Time this request spent in the pending request queue.
- PendingTime string `json:"pendingTime,omitempty"`
-
- // Referrer: Referrer URL of request.
- Referrer string `json:"referrer,omitempty"`
-
- // RequestId: Globally unique identifier for a request, which is based
- // on the request start time. Request IDs for requests which started
- // later will compare greater as strings than those for requests which
- // started earlier.
- RequestId string `json:"requestId,omitempty"`
-
- // Resource: Contains the path and query portion of the URL that was
- // requested. For example, if the URL was
- // "http://example.com/app?name=val", the resource would be
- // "/app?name=val". The fragment identifier, which is identified by the
- // # character, is not included.
- Resource string `json:"resource,omitempty"`
-
- // ResponseSize: Size in bytes sent back to client by request.
- ResponseSize int64 `json:"responseSize,omitempty,string"`
-
- // SourceReference: Source code for the application that handled this
- // request. There can be more than one source reference per deployed
- // application if source code is distributed among multiple
- // repositories.
- SourceReference []*SourceReference `json:"sourceReference,omitempty"`
-
- // StartTime: Time when the request started.
- StartTime string `json:"startTime,omitempty"`
-
- // Status: HTTP response status code. Example: 200, 404.
- Status int64 `json:"status,omitempty"`
-
- // TaskName: Task name of the request, in the case of an offline
- // request.
- TaskName string `json:"taskName,omitempty"`
-
- // TaskQueueName: Queue name of the request, in the case of an offline
- // request.
- TaskQueueName string `json:"taskQueueName,omitempty"`
-
- // TraceId: Stackdriver Trace identifier for this request.
- TraceId string `json:"traceId,omitempty"`
-
- // TraceSampled: If true, the value in the 'trace_id' field was sampled
- // for storage in a trace backend.
- TraceSampled bool `json:"traceSampled,omitempty"`
-
- // UrlMapEntry: File or class that handled the request.
- UrlMapEntry string `json:"urlMapEntry,omitempty"`
-
- // UserAgent: User agent that made the request.
- UserAgent string `json:"userAgent,omitempty"`
-
- // VersionId: Version of the application that handled this request.
- VersionId string `json:"versionId,omitempty"`
-
- // WasLoadingRequest: Whether this was a loading request for the
- // instance.
- WasLoadingRequest bool `json:"wasLoadingRequest,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "AppEngineRelease") 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. "AppEngineRelease") 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 *RequestLog) MarshalJSON() ([]byte, error) {
- type NoMethod RequestLog
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
-}
-
-func (s *RequestLog) UnmarshalJSON(data []byte) error {
- type NoMethod RequestLog
- var s1 struct {
- Cost gensupport.JSONFloat64 `json:"cost"`
- *NoMethod
- }
- s1.NoMethod = (*NoMethod)(s)
- if err := json.Unmarshal(data, &s1); err != nil {
- return err
- }
- s.Cost = float64(s1.Cost)
- return nil
-}
-
-// SourceLocation: Specifies a location in a source code file.
-type SourceLocation struct {
- // File: Source file name. Depending on the runtime environment, this
- // might be a simple name or a fully-qualified name.
- File string `json:"file,omitempty"`
-
- // FunctionName: Human-readable name of the function or method being
- // invoked, with optional context such as the class or package name.
- // This information is 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).
- FunctionName string `json:"functionName,omitempty"`
-
- // Line: Line within the source file.
- Line int64 `json:"line,omitempty,string"`
-
- // ForceSendFields is a list of field names (e.g. "File") 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. "File") 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 *SourceLocation) MarshalJSON() ([]byte, error) {
- type NoMethod SourceLocation
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
-}
-
-// SourceReference: A reference to a particular snapshot of the source
-// tree used to build and deploy an application.
-type SourceReference struct {
- // Repository: Optional. A URI string identifying the repository.
- // Example: "https://github.com/GoogleCloudPlatform/kubernetes.git"
- Repository string `json:"repository,omitempty"`
-
- // RevisionId: The canonical and persistent identifier of the deployed
- // revision. Example (git): "0035781c50ec7aa23385dc841529ce8a4b70db1b"
- RevisionId string `json:"revisionId,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "Repository") 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. "Repository") 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 *SourceReference) MarshalJSON() ([]byte, error) {
- type NoMethod SourceReference
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
-}
-
-// WriteLogEntriesRequest: The parameters to WriteLogEntries.
-type WriteLogEntriesRequest struct {
- // DryRun: Optional. If true, the request should expect normal response,
- // but the entries won't be persisted nor exported. Useful for checking
- // whether the logging API endpoints are working properly before sending
- // valuable data.
- DryRun bool `json:"dryRun,omitempty"`
-
- // Entries: Required. The log entries to send to Logging. The order of
- // log entries in this list does not matter. Values supplied in this
- // method's log_name, resource, and labels fields are copied into those
- // log entries in this list that do not include values for their
- // corresponding fields. For more information, see the LogEntry type.If
- // the timestamp or insert_id fields are missing in log entries, then
- // this method supplies the current time or a unique identifier,
- // respectively. The supplied values are chosen so that, among the log
- // entries that did not supply their own values, the entries earlier in
- // the list will sort before the entries later in the list. See the
- // entries.list method.Log entries with timestamps that are more than
- // the logs retention period in the past or more than 24 hours in the
- // future will not be available when calling entries.list. However,
- // those log entries can still be exported with LogSinks.To improve
- // throughput and to avoid exceeding the quota limit for calls to
- // entries.write, you should try to include several log entries in this
- // list, rather than calling this method for each individual log entry.
- Entries []*LogEntry `json:"entries,omitempty"`
-
- // Labels: Optional. Default labels that are added to the labels field
- // of all log entries in entries. If a log entry already has a label
- // with the same key as a label in this parameter, then the log entry's
- // label is not changed. See LogEntry.
- Labels map[string]string `json:"labels,omitempty"`
-
- // LogName: Optional. A default log resource name that is assigned to
- // all log entries in entries that do not specify a value for
- // log_name:
- // "projects/[PROJECT_ID]/logs/[LOG_ID]"
- // "organizations/[ORGANI
- // ZATION_ID]/logs/[LOG_ID]"
- // "billingAccounts/[BILLING_ACCOUNT_ID]/logs/[
- // LOG_ID]"
- // "folders/[FOLDER_ID]/logs/[LOG_ID]"
- // [LOG_ID] must be URL-encoded. For
- // example:
- // "projects/my-project-id/logs/syslog"
- // "organizations/123456789
- // 0/logs/cloudresourcemanager.googleapis.com%2Factivity"
- // The permission logging.logEntries.create
is needed on
- // each project, organization, billing account, or folder that is
- // receiving new log entries, whether the resource is specified in
- // logName
or in an individual log entry.
- LogName string `json:"logName,omitempty"`
-
- // PartialSuccess: Optional. Whether valid entries should be written
- // even if some other entries fail due to INVALID_ARGUMENT or
- // PERMISSION_DENIED errors. If any entry is not written, then the
- // response status is the error associated with one of the failed
- // entries and the response includes error details keyed by the entries'
- // zero-based index in the entries.write method.
- PartialSuccess bool `json:"partialSuccess,omitempty"`
-
- // Resource: Optional. A default monitored resource object that is
- // assigned to all log entries in entries that do not specify a value
- // for resource. Example:
- // { "type": "gce_instance",
- // "labels": {
- // "zone": "us-central1-a", "instance_id": "00000000000000000000"
- // }}
- // See LogEntry.
- Resource *MonitoredResource `json:"resource,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "DryRun") 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. "DryRun") 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 *WriteLogEntriesRequest) MarshalJSON() ([]byte, error) {
- type NoMethod WriteLogEntriesRequest
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
-}
-
-// WriteLogEntriesResponse: Result returned from WriteLogEntries. empty
-type WriteLogEntriesResponse struct {
- // ServerResponse contains the HTTP response code and headers from the
- // server.
- googleapi.ServerResponse `json:"-"`
-}
-
-// method id "logging.entries.list":
-
-type EntriesListCall struct {
- s *Service
- listlogentriesrequest *ListLogEntriesRequest
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// List: Lists log entries. Use this method to retrieve log entries that
-// originated from a project/folder/organization/billing account. For
-// ways to export log entries, see Exporting Logs.
-func (r *EntriesService) List(listlogentriesrequest *ListLogEntriesRequest) *EntriesListCall {
- c := &EntriesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.listlogentriesrequest = listlogentriesrequest
- 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 *EntriesListCall) Fields(s ...googleapi.Field) *EntriesListCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- return c
-}
-
-// Context sets the context to be used in this call's Do method. Any
-// pending HTTP request will be aborted if the provided context is
-// canceled.
-func (c *EntriesListCall) Context(ctx context.Context) *EntriesListCall {
- c.ctx_ = ctx
- return c
-}
-
-// Header returns an http.Header that can be modified by the caller to
-// add HTTP headers to the request.
-func (c *EntriesListCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *EntriesListCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- body, err := googleapi.WithoutDataWrapper.JSONReader(c.listlogentriesrequest)
- if err != nil {
- return nil, err
- }
- reqHeaders.Set("Content-Type", "application/json")
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta1/entries:list")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("POST", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "logging.entries.list" call.
-// Exactly one of *ListLogEntriesResponse or error will be non-nil. Any
-// non-2xx status code is an error. Response headers are in either
-// *ListLogEntriesResponse.ServerResponse.Header or (if a response was
-// returned at all) in error.(*googleapi.Error).Header. Use
-// googleapi.IsNotModified to check whether the returned error was
-// because http.StatusNotModified was returned.
-func (c *EntriesListCall) Do(opts ...googleapi.CallOption) (*ListLogEntriesResponse, error) {
- gensupport.SetOptions(c.urlParams_, opts...)
- res, err := c.doRequest("json")
- if res != nil && res.StatusCode == http.StatusNotModified {
- if res.Body != nil {
- res.Body.Close()
- }
- return nil, &googleapi.Error{
- Code: res.StatusCode,
- Header: res.Header,
- }
- }
- if err != nil {
- return nil, err
- }
- defer googleapi.CloseBody(res)
- if err := googleapi.CheckResponse(res); err != nil {
- return nil, err
- }
- ret := &ListLogEntriesResponse{
- ServerResponse: googleapi.ServerResponse{
- Header: res.Header,
- HTTPStatusCode: res.StatusCode,
- },
- }
- target := &ret
- if err := gensupport.DecodeResponse(target, res); err != nil {
- return nil, err
- }
- return ret, nil
- // {
- // "description": "Lists log entries. Use this method to retrieve log entries that originated from a project/folder/organization/billing account. For ways to export log entries, see Exporting Logs.",
- // "flatPath": "v2beta1/entries:list",
- // "httpMethod": "POST",
- // "id": "logging.entries.list",
- // "parameterOrder": [],
- // "parameters": {},
- // "path": "v2beta1/entries:list",
- // "request": {
- // "$ref": "ListLogEntriesRequest"
- // },
- // "response": {
- // "$ref": "ListLogEntriesResponse"
- // },
- // "scopes": [
- // "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"
- // ]
- // }
-
-}
-
-// Pages invokes f for each page of results.
-// A non-nil error returned from f will halt the iteration.
-// The provided context supersedes any context provided to the Context method.
-func (c *EntriesListCall) Pages(ctx context.Context, f func(*ListLogEntriesResponse) error) error {
- c.ctx_ = ctx
- defer func(pt string) { c.listlogentriesrequest.PageToken = pt }(c.listlogentriesrequest.PageToken) // reset paging to original point
- for {
- x, err := c.Do()
- if err != nil {
- return err
- }
- if err := f(x); err != nil {
- return err
- }
- if x.NextPageToken == "" {
- return nil
- }
- c.listlogentriesrequest.PageToken = x.NextPageToken
- }
-}
-
-// method id "logging.entries.write":
-
-type EntriesWriteCall struct {
- s *Service
- writelogentriesrequest *WriteLogEntriesRequest
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// Write: Writes log entries to Logging. This API method is the only way
-// to send log entries to Logging. This method is used, directly or
-// indirectly, by the Logging agent (fluentd) and all logging libraries
-// configured to use Logging. A single request may contain log entries
-// for a maximum of 1000 different resources (projects, organizations,
-// billing accounts or folders)
-func (r *EntriesService) Write(writelogentriesrequest *WriteLogEntriesRequest) *EntriesWriteCall {
- c := &EntriesWriteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.writelogentriesrequest = writelogentriesrequest
- 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 *EntriesWriteCall) Fields(s ...googleapi.Field) *EntriesWriteCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- return c
-}
-
-// Context sets the context to be used in this call's Do method. Any
-// pending HTTP request will be aborted if the provided context is
-// canceled.
-func (c *EntriesWriteCall) Context(ctx context.Context) *EntriesWriteCall {
- c.ctx_ = ctx
- return c
-}
-
-// Header returns an http.Header that can be modified by the caller to
-// add HTTP headers to the request.
-func (c *EntriesWriteCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *EntriesWriteCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- body, err := googleapi.WithoutDataWrapper.JSONReader(c.writelogentriesrequest)
- if err != nil {
- return nil, err
- }
- reqHeaders.Set("Content-Type", "application/json")
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta1/entries:write")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("POST", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "logging.entries.write" call.
-// Exactly one of *WriteLogEntriesResponse or error will be non-nil. Any
-// non-2xx status code is an error. Response headers are in either
-// *WriteLogEntriesResponse.ServerResponse.Header or (if a response was
-// returned at all) in error.(*googleapi.Error).Header. Use
-// googleapi.IsNotModified to check whether the returned error was
-// because http.StatusNotModified was returned.
-func (c *EntriesWriteCall) Do(opts ...googleapi.CallOption) (*WriteLogEntriesResponse, error) {
- gensupport.SetOptions(c.urlParams_, opts...)
- res, err := c.doRequest("json")
- if res != nil && res.StatusCode == http.StatusNotModified {
- if res.Body != nil {
- res.Body.Close()
- }
- return nil, &googleapi.Error{
- Code: res.StatusCode,
- Header: res.Header,
- }
- }
- if err != nil {
- return nil, err
- }
- defer googleapi.CloseBody(res)
- if err := googleapi.CheckResponse(res); err != nil {
- return nil, err
- }
- ret := &WriteLogEntriesResponse{
- ServerResponse: googleapi.ServerResponse{
- Header: res.Header,
- HTTPStatusCode: res.StatusCode,
- },
- }
- target := &ret
- if err := gensupport.DecodeResponse(target, res); err != nil {
- return nil, err
- }
- return ret, nil
- // {
- // "description": "Writes log entries to Logging. This API method is the only way to send log entries to Logging. This method is used, directly or indirectly, by the Logging agent (fluentd) and all logging libraries configured to use Logging. A single request may contain log entries for a maximum of 1000 different resources (projects, organizations, billing accounts or folders)",
- // "flatPath": "v2beta1/entries:write",
- // "httpMethod": "POST",
- // "id": "logging.entries.write",
- // "parameterOrder": [],
- // "parameters": {},
- // "path": "v2beta1/entries:write",
- // "request": {
- // "$ref": "WriteLogEntriesRequest"
- // },
- // "response": {
- // "$ref": "WriteLogEntriesResponse"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/logging.admin",
- // "https://www.googleapis.com/auth/logging.write"
- // ]
- // }
-
-}
-
-// method id "logging.monitoredResourceDescriptors.list":
-
-type MonitoredResourceDescriptorsListCall struct {
- s *Service
- urlParams_ gensupport.URLParams
- ifNoneMatch_ string
- ctx_ context.Context
- header_ http.Header
-}
-
-// List: Lists the descriptors for monitored resource types used by
-// Logging.
-func (r *MonitoredResourceDescriptorsService) List() *MonitoredResourceDescriptorsListCall {
- c := &MonitoredResourceDescriptorsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- return c
-}
-
-// PageSize sets the optional parameter "pageSize": The maximum number
-// of results to return from this request. Non-positive values are
-// ignored. The presence of nextPageToken in the response indicates that
-// more results might be available.
-func (c *MonitoredResourceDescriptorsListCall) PageSize(pageSize int64) *MonitoredResourceDescriptorsListCall {
- c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
- return c
-}
-
-// PageToken sets the optional parameter "pageToken": If present, then
-// retrieve the next batch of results from the preceding call to this
-// method. pageToken must be the value of nextPageToken from the
-// previous response. The values of other method parameters should be
-// identical to those in the previous call.
-func (c *MonitoredResourceDescriptorsListCall) PageToken(pageToken string) *MonitoredResourceDescriptorsListCall {
- c.urlParams_.Set("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 *MonitoredResourceDescriptorsListCall) Fields(s ...googleapi.Field) *MonitoredResourceDescriptorsListCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- return c
-}
-
-// IfNoneMatch sets the optional parameter which makes the operation
-// fail if the object's ETag matches the given value. This is useful for
-// getting updates only after the object has changed since the last
-// request. Use googleapi.IsNotModified to check whether the response
-// error from Do is the result of In-None-Match.
-func (c *MonitoredResourceDescriptorsListCall) IfNoneMatch(entityTag string) *MonitoredResourceDescriptorsListCall {
- c.ifNoneMatch_ = entityTag
- return c
-}
-
-// Context sets the context to be used in this call's Do method. Any
-// pending HTTP request will be aborted if the provided context is
-// canceled.
-func (c *MonitoredResourceDescriptorsListCall) Context(ctx context.Context) *MonitoredResourceDescriptorsListCall {
- c.ctx_ = ctx
- return c
-}
-
-// Header returns an http.Header that can be modified by the caller to
-// add HTTP headers to the request.
-func (c *MonitoredResourceDescriptorsListCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *MonitoredResourceDescriptorsListCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- if c.ifNoneMatch_ != "" {
- reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
- }
- var body io.Reader = nil
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta1/monitoredResourceDescriptors")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("GET", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "logging.monitoredResourceDescriptors.list" call.
-// Exactly one of *ListMonitoredResourceDescriptorsResponse or error
-// will be non-nil. Any non-2xx status code is an error. Response
-// headers are in either
-// *ListMonitoredResourceDescriptorsResponse.ServerResponse.Header or
-// (if a response was returned at all) in
-// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
-// whether the returned error was because http.StatusNotModified was
-// returned.
-func (c *MonitoredResourceDescriptorsListCall) Do(opts ...googleapi.CallOption) (*ListMonitoredResourceDescriptorsResponse, error) {
- gensupport.SetOptions(c.urlParams_, opts...)
- res, err := c.doRequest("json")
- if res != nil && res.StatusCode == http.StatusNotModified {
- if res.Body != nil {
- res.Body.Close()
- }
- return nil, &googleapi.Error{
- Code: res.StatusCode,
- Header: res.Header,
- }
- }
- if err != nil {
- return nil, err
- }
- defer googleapi.CloseBody(res)
- if err := googleapi.CheckResponse(res); err != nil {
- return nil, err
- }
- ret := &ListMonitoredResourceDescriptorsResponse{
- ServerResponse: googleapi.ServerResponse{
- Header: res.Header,
- HTTPStatusCode: res.StatusCode,
- },
- }
- target := &ret
- if err := gensupport.DecodeResponse(target, res); err != nil {
- return nil, err
- }
- return ret, nil
- // {
- // "description": "Lists the descriptors for monitored resource types used by Logging.",
- // "flatPath": "v2beta1/monitoredResourceDescriptors",
- // "httpMethod": "GET",
- // "id": "logging.monitoredResourceDescriptors.list",
- // "parameterOrder": [],
- // "parameters": {
- // "pageSize": {
- // "description": "Optional. The maximum number of results to return from this request. Non-positive values are ignored. The presence of nextPageToken in the response indicates that more results might be available.",
- // "format": "int32",
- // "location": "query",
- // "type": "integer"
- // },
- // "pageToken": {
- // "description": "Optional. If present, then retrieve the next batch of results from the preceding call to this method. pageToken must be the value of nextPageToken from the previous response. The values of other method parameters should be identical to those in the previous call.",
- // "location": "query",
- // "type": "string"
- // }
- // },
- // "path": "v2beta1/monitoredResourceDescriptors",
- // "response": {
- // "$ref": "ListMonitoredResourceDescriptorsResponse"
- // },
- // "scopes": [
- // "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"
- // ]
- // }
-
-}
-
-// Pages invokes f for each page of results.
-// A non-nil error returned from f will halt the iteration.
-// The provided context supersedes any context provided to the Context method.
-func (c *MonitoredResourceDescriptorsListCall) Pages(ctx context.Context, f func(*ListMonitoredResourceDescriptorsResponse) error) error {
- c.ctx_ = ctx
- defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
- for {
- x, err := c.Do()
- if err != nil {
- return err
- }
- if err := f(x); err != nil {
- return err
- }
- if x.NextPageToken == "" {
- return nil
- }
- c.PageToken(x.NextPageToken)
- }
-}
-
-// method id "logging.projects.metrics.create":
-
-type ProjectsMetricsCreateCall struct {
- s *Service
- parent string
- logmetric *LogMetric
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// Create: Creates a logs-based metric.
-func (r *ProjectsMetricsService) Create(parent string, logmetric *LogMetric) *ProjectsMetricsCreateCall {
- c := &ProjectsMetricsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.parent = parent
- c.logmetric = logmetric
- 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 *ProjectsMetricsCreateCall) Fields(s ...googleapi.Field) *ProjectsMetricsCreateCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- return c
-}
-
-// Context sets the context to be used in this call's Do method. Any
-// pending HTTP request will be aborted if the provided context is
-// canceled.
-func (c *ProjectsMetricsCreateCall) Context(ctx context.Context) *ProjectsMetricsCreateCall {
- c.ctx_ = ctx
- return c
-}
-
-// Header returns an http.Header that can be modified by the caller to
-// add HTTP headers to the request.
-func (c *ProjectsMetricsCreateCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *ProjectsMetricsCreateCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- body, err := googleapi.WithoutDataWrapper.JSONReader(c.logmetric)
- if err != nil {
- return nil, err
- }
- reqHeaders.Set("Content-Type", "application/json")
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta1/{+parent}/metrics")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("POST", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "parent": c.parent,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "logging.projects.metrics.create" call.
-// Exactly one of *LogMetric or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *LogMetric.ServerResponse.Header or (if a response was returned at
-// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
-// to check whether the returned error was because
-// http.StatusNotModified was returned.
-func (c *ProjectsMetricsCreateCall) Do(opts ...googleapi.CallOption) (*LogMetric, error) {
- gensupport.SetOptions(c.urlParams_, opts...)
- res, err := c.doRequest("json")
- if res != nil && res.StatusCode == http.StatusNotModified {
- if res.Body != nil {
- res.Body.Close()
- }
- return nil, &googleapi.Error{
- Code: res.StatusCode,
- Header: res.Header,
- }
- }
- if err != nil {
- return nil, err
- }
- defer googleapi.CloseBody(res)
- if err := googleapi.CheckResponse(res); err != nil {
- return nil, err
- }
- ret := &LogMetric{
- ServerResponse: googleapi.ServerResponse{
- Header: res.Header,
- HTTPStatusCode: res.StatusCode,
- },
- }
- target := &ret
- if err := gensupport.DecodeResponse(target, res); err != nil {
- return nil, err
- }
- return ret, nil
- // {
- // "description": "Creates a logs-based metric.",
- // "flatPath": "v2beta1/projects/{projectsId}/metrics",
- // "httpMethod": "POST",
- // "id": "logging.projects.metrics.create",
- // "parameterOrder": [
- // "parent"
- // ],
- // "parameters": {
- // "parent": {
- // "description": "The resource name of the project in which to create the metric:\n\"projects/[PROJECT_ID]\"\nThe new metric must be provided in the request.",
- // "location": "path",
- // "pattern": "^projects/[^/]+$",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "v2beta1/{+parent}/metrics",
- // "request": {
- // "$ref": "LogMetric"
- // },
- // "response": {
- // "$ref": "LogMetric"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/logging.admin",
- // "https://www.googleapis.com/auth/logging.write"
- // ]
- // }
-
-}
-
-// method id "logging.projects.metrics.delete":
-
-type ProjectsMetricsDeleteCall struct {
- s *Service
- metricName string
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// Delete: Deletes a logs-based metric.
-func (r *ProjectsMetricsService) Delete(metricName string) *ProjectsMetricsDeleteCall {
- c := &ProjectsMetricsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.metricName = metricName
- 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 *ProjectsMetricsDeleteCall) Fields(s ...googleapi.Field) *ProjectsMetricsDeleteCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- return c
-}
-
-// Context sets the context to be used in this call's Do method. Any
-// pending HTTP request will be aborted if the provided context is
-// canceled.
-func (c *ProjectsMetricsDeleteCall) Context(ctx context.Context) *ProjectsMetricsDeleteCall {
- c.ctx_ = ctx
- return c
-}
-
-// Header returns an http.Header that can be modified by the caller to
-// add HTTP headers to the request.
-func (c *ProjectsMetricsDeleteCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *ProjectsMetricsDeleteCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta1/{+metricName}")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("DELETE", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "metricName": c.metricName,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "logging.projects.metrics.delete" call.
-// Exactly one of *Empty or error will be non-nil. Any non-2xx status
-// code is an error. Response headers are in either
-// *Empty.ServerResponse.Header or (if a response was returned at all)
-// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
-// check whether the returned error was because http.StatusNotModified
-// was returned.
-func (c *ProjectsMetricsDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) {
- gensupport.SetOptions(c.urlParams_, opts...)
- res, err := c.doRequest("json")
- if res != nil && res.StatusCode == http.StatusNotModified {
- if res.Body != nil {
- res.Body.Close()
- }
- return nil, &googleapi.Error{
- Code: res.StatusCode,
- Header: res.Header,
- }
- }
- if err != nil {
- return nil, err
- }
- defer googleapi.CloseBody(res)
- if err := googleapi.CheckResponse(res); err != nil {
- return nil, err
- }
- ret := &Empty{
- ServerResponse: googleapi.ServerResponse{
- Header: res.Header,
- HTTPStatusCode: res.StatusCode,
- },
- }
- target := &ret
- if err := gensupport.DecodeResponse(target, res); err != nil {
- return nil, err
- }
- return ret, nil
- // {
- // "description": "Deletes a logs-based metric.",
- // "flatPath": "v2beta1/projects/{projectsId}/metrics/{metricsId}",
- // "httpMethod": "DELETE",
- // "id": "logging.projects.metrics.delete",
- // "parameterOrder": [
- // "metricName"
- // ],
- // "parameters": {
- // "metricName": {
- // "description": "The resource name of the metric to delete:\n\"projects/[PROJECT_ID]/metrics/[METRIC_ID]\"\n",
- // "location": "path",
- // "pattern": "^projects/[^/]+/metrics/[^/]+$",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "v2beta1/{+metricName}",
- // "response": {
- // "$ref": "Empty"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/logging.admin",
- // "https://www.googleapis.com/auth/logging.write"
- // ]
- // }
-
-}
-
-// method id "logging.projects.metrics.get":
-
-type ProjectsMetricsGetCall struct {
- s *Service
- metricName string
- urlParams_ gensupport.URLParams
- ifNoneMatch_ string
- ctx_ context.Context
- header_ http.Header
-}
-
-// Get: Gets a logs-based metric.
-func (r *ProjectsMetricsService) Get(metricName string) *ProjectsMetricsGetCall {
- c := &ProjectsMetricsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.metricName = metricName
- 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 *ProjectsMetricsGetCall) Fields(s ...googleapi.Field) *ProjectsMetricsGetCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- return c
-}
-
-// IfNoneMatch sets the optional parameter which makes the operation
-// fail if the object's ETag matches the given value. This is useful for
-// getting updates only after the object has changed since the last
-// request. Use googleapi.IsNotModified to check whether the response
-// error from Do is the result of In-None-Match.
-func (c *ProjectsMetricsGetCall) IfNoneMatch(entityTag string) *ProjectsMetricsGetCall {
- c.ifNoneMatch_ = entityTag
- return c
-}
-
-// Context sets the context to be used in this call's Do method. Any
-// pending HTTP request will be aborted if the provided context is
-// canceled.
-func (c *ProjectsMetricsGetCall) Context(ctx context.Context) *ProjectsMetricsGetCall {
- c.ctx_ = ctx
- return c
-}
-
-// Header returns an http.Header that can be modified by the caller to
-// add HTTP headers to the request.
-func (c *ProjectsMetricsGetCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *ProjectsMetricsGetCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- if c.ifNoneMatch_ != "" {
- reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
- }
- var body io.Reader = nil
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta1/{+metricName}")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("GET", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "metricName": c.metricName,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "logging.projects.metrics.get" call.
-// Exactly one of *LogMetric or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *LogMetric.ServerResponse.Header or (if a response was returned at
-// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
-// to check whether the returned error was because
-// http.StatusNotModified was returned.
-func (c *ProjectsMetricsGetCall) Do(opts ...googleapi.CallOption) (*LogMetric, error) {
- gensupport.SetOptions(c.urlParams_, opts...)
- res, err := c.doRequest("json")
- if res != nil && res.StatusCode == http.StatusNotModified {
- if res.Body != nil {
- res.Body.Close()
- }
- return nil, &googleapi.Error{
- Code: res.StatusCode,
- Header: res.Header,
- }
- }
- if err != nil {
- return nil, err
- }
- defer googleapi.CloseBody(res)
- if err := googleapi.CheckResponse(res); err != nil {
- return nil, err
- }
- ret := &LogMetric{
- ServerResponse: googleapi.ServerResponse{
- Header: res.Header,
- HTTPStatusCode: res.StatusCode,
- },
- }
- target := &ret
- if err := gensupport.DecodeResponse(target, res); err != nil {
- return nil, err
- }
- return ret, nil
- // {
- // "description": "Gets a logs-based metric.",
- // "flatPath": "v2beta1/projects/{projectsId}/metrics/{metricsId}",
- // "httpMethod": "GET",
- // "id": "logging.projects.metrics.get",
- // "parameterOrder": [
- // "metricName"
- // ],
- // "parameters": {
- // "metricName": {
- // "description": "The resource name of the desired metric:\n\"projects/[PROJECT_ID]/metrics/[METRIC_ID]\"\n",
- // "location": "path",
- // "pattern": "^projects/[^/]+/metrics/[^/]+$",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "v2beta1/{+metricName}",
- // "response": {
- // "$ref": "LogMetric"
- // },
- // "scopes": [
- // "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"
- // ]
- // }
-
-}
-
-// method id "logging.projects.metrics.list":
-
-type ProjectsMetricsListCall struct {
- s *Service
- parent string
- urlParams_ gensupport.URLParams
- ifNoneMatch_ string
- ctx_ context.Context
- header_ http.Header
-}
-
-// List: Lists logs-based metrics.
-func (r *ProjectsMetricsService) List(parent string) *ProjectsMetricsListCall {
- c := &ProjectsMetricsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.parent = parent
- return c
-}
-
-// PageSize sets the optional parameter "pageSize": The maximum number
-// of results to return from this request. Non-positive values are
-// ignored. The presence of nextPageToken in the response indicates that
-// more results might be available.
-func (c *ProjectsMetricsListCall) PageSize(pageSize int64) *ProjectsMetricsListCall {
- c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
- return c
-}
-
-// PageToken sets the optional parameter "pageToken": If present, then
-// retrieve the next batch of results from the preceding call to this
-// method. pageToken must be the value of nextPageToken from the
-// previous response. The values of other method parameters should be
-// identical to those in the previous call.
-func (c *ProjectsMetricsListCall) PageToken(pageToken string) *ProjectsMetricsListCall {
- c.urlParams_.Set("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 *ProjectsMetricsListCall) Fields(s ...googleapi.Field) *ProjectsMetricsListCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- return c
-}
-
-// IfNoneMatch sets the optional parameter which makes the operation
-// fail if the object's ETag matches the given value. This is useful for
-// getting updates only after the object has changed since the last
-// request. Use googleapi.IsNotModified to check whether the response
-// error from Do is the result of In-None-Match.
-func (c *ProjectsMetricsListCall) IfNoneMatch(entityTag string) *ProjectsMetricsListCall {
- c.ifNoneMatch_ = entityTag
- return c
-}
-
-// Context sets the context to be used in this call's Do method. Any
-// pending HTTP request will be aborted if the provided context is
-// canceled.
-func (c *ProjectsMetricsListCall) Context(ctx context.Context) *ProjectsMetricsListCall {
- c.ctx_ = ctx
- return c
-}
-
-// Header returns an http.Header that can be modified by the caller to
-// add HTTP headers to the request.
-func (c *ProjectsMetricsListCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *ProjectsMetricsListCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- if c.ifNoneMatch_ != "" {
- reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
- }
- var body io.Reader = nil
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta1/{+parent}/metrics")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("GET", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "parent": c.parent,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "logging.projects.metrics.list" call.
-// Exactly one of *ListLogMetricsResponse or error will be non-nil. Any
-// non-2xx status code is an error. Response headers are in either
-// *ListLogMetricsResponse.ServerResponse.Header or (if a response was
-// returned at all) in error.(*googleapi.Error).Header. Use
-// googleapi.IsNotModified to check whether the returned error was
-// because http.StatusNotModified was returned.
-func (c *ProjectsMetricsListCall) Do(opts ...googleapi.CallOption) (*ListLogMetricsResponse, error) {
- gensupport.SetOptions(c.urlParams_, opts...)
- res, err := c.doRequest("json")
- if res != nil && res.StatusCode == http.StatusNotModified {
- if res.Body != nil {
- res.Body.Close()
- }
- return nil, &googleapi.Error{
- Code: res.StatusCode,
- Header: res.Header,
- }
- }
- if err != nil {
- return nil, err
- }
- defer googleapi.CloseBody(res)
- if err := googleapi.CheckResponse(res); err != nil {
- return nil, err
- }
- ret := &ListLogMetricsResponse{
- ServerResponse: googleapi.ServerResponse{
- Header: res.Header,
- HTTPStatusCode: res.StatusCode,
- },
- }
- target := &ret
- if err := gensupport.DecodeResponse(target, res); err != nil {
- return nil, err
- }
- return ret, nil
- // {
- // "description": "Lists logs-based metrics.",
- // "flatPath": "v2beta1/projects/{projectsId}/metrics",
- // "httpMethod": "GET",
- // "id": "logging.projects.metrics.list",
- // "parameterOrder": [
- // "parent"
- // ],
- // "parameters": {
- // "pageSize": {
- // "description": "Optional. The maximum number of results to return from this request. Non-positive values are ignored. The presence of nextPageToken in the response indicates that more results might be available.",
- // "format": "int32",
- // "location": "query",
- // "type": "integer"
- // },
- // "pageToken": {
- // "description": "Optional. If present, then retrieve the next batch of results from the preceding call to this method. pageToken must be the value of nextPageToken from the previous response. The values of other method parameters should be identical to those in the previous call.",
- // "location": "query",
- // "type": "string"
- // },
- // "parent": {
- // "description": "Required. The name of the project containing the metrics:\n\"projects/[PROJECT_ID]\"\n",
- // "location": "path",
- // "pattern": "^projects/[^/]+$",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "v2beta1/{+parent}/metrics",
- // "response": {
- // "$ref": "ListLogMetricsResponse"
- // },
- // "scopes": [
- // "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"
- // ]
- // }
-
-}
-
-// Pages invokes f for each page of results.
-// A non-nil error returned from f will halt the iteration.
-// The provided context supersedes any context provided to the Context method.
-func (c *ProjectsMetricsListCall) Pages(ctx context.Context, f func(*ListLogMetricsResponse) error) error {
- c.ctx_ = ctx
- defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
- for {
- x, err := c.Do()
- if err != nil {
- return err
- }
- if err := f(x); err != nil {
- return err
- }
- if x.NextPageToken == "" {
- return nil
- }
- c.PageToken(x.NextPageToken)
- }
-}
-
-// method id "logging.projects.metrics.update":
-
-type ProjectsMetricsUpdateCall struct {
- s *Service
- metricName string
- logmetric *LogMetric
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// Update: Creates or updates a logs-based metric.
-func (r *ProjectsMetricsService) Update(metricName string, logmetric *LogMetric) *ProjectsMetricsUpdateCall {
- c := &ProjectsMetricsUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.metricName = metricName
- c.logmetric = logmetric
- 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 *ProjectsMetricsUpdateCall) Fields(s ...googleapi.Field) *ProjectsMetricsUpdateCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- return c
-}
-
-// Context sets the context to be used in this call's Do method. Any
-// pending HTTP request will be aborted if the provided context is
-// canceled.
-func (c *ProjectsMetricsUpdateCall) Context(ctx context.Context) *ProjectsMetricsUpdateCall {
- c.ctx_ = ctx
- return c
-}
-
-// Header returns an http.Header that can be modified by the caller to
-// add HTTP headers to the request.
-func (c *ProjectsMetricsUpdateCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *ProjectsMetricsUpdateCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- body, err := googleapi.WithoutDataWrapper.JSONReader(c.logmetric)
- if err != nil {
- return nil, err
- }
- reqHeaders.Set("Content-Type", "application/json")
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta1/{+metricName}")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("PUT", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "metricName": c.metricName,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "logging.projects.metrics.update" call.
-// Exactly one of *LogMetric or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *LogMetric.ServerResponse.Header or (if a response was returned at
-// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
-// to check whether the returned error was because
-// http.StatusNotModified was returned.
-func (c *ProjectsMetricsUpdateCall) Do(opts ...googleapi.CallOption) (*LogMetric, error) {
- gensupport.SetOptions(c.urlParams_, opts...)
- res, err := c.doRequest("json")
- if res != nil && res.StatusCode == http.StatusNotModified {
- if res.Body != nil {
- res.Body.Close()
- }
- return nil, &googleapi.Error{
- Code: res.StatusCode,
- Header: res.Header,
- }
- }
- if err != nil {
- return nil, err
- }
- defer googleapi.CloseBody(res)
- if err := googleapi.CheckResponse(res); err != nil {
- return nil, err
- }
- ret := &LogMetric{
- ServerResponse: googleapi.ServerResponse{
- Header: res.Header,
- HTTPStatusCode: res.StatusCode,
- },
- }
- target := &ret
- if err := gensupport.DecodeResponse(target, res); err != nil {
- return nil, err
- }
- return ret, nil
- // {
- // "description": "Creates or updates a logs-based metric.",
- // "flatPath": "v2beta1/projects/{projectsId}/metrics/{metricsId}",
- // "httpMethod": "PUT",
- // "id": "logging.projects.metrics.update",
- // "parameterOrder": [
- // "metricName"
- // ],
- // "parameters": {
- // "metricName": {
- // "description": "The resource name of the metric to update:\n\"projects/[PROJECT_ID]/metrics/[METRIC_ID]\"\nThe updated metric must be provided in the request and it's name field must be the same as [METRIC_ID] If the metric does not exist in [PROJECT_ID], then a new metric is created.",
- // "location": "path",
- // "pattern": "^projects/[^/]+/metrics/[^/]+$",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "v2beta1/{+metricName}",
- // "request": {
- // "$ref": "LogMetric"
- // },
- // "response": {
- // "$ref": "LogMetric"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/logging.admin",
- // "https://www.googleapis.com/auth/logging.write"
- // ]
- // }
-
-}
-
-// method id "logging.projects.sinks.create":
-
-type ProjectsSinksCreateCall struct {
- s *Service
- parent string
- logsink *LogSink
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// Create: Creates a sink that exports specified log entries to a
-// destination. The export of newly-ingested log entries begins
-// immediately, unless the sink's writer_identity is not permitted to
-// write to the destination. A sink can export log entries only from the
-// resource owning the sink.
-func (r *ProjectsSinksService) Create(parent string, logsink *LogSink) *ProjectsSinksCreateCall {
- c := &ProjectsSinksCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.parent = parent
- c.logsink = logsink
- return c
-}
-
-// UniqueWriterIdentity sets the optional parameter
-// "uniqueWriterIdentity": Determines the kind of IAM identity returned
-// as writer_identity in the new sink. If this value is omitted or set
-// to false, and if the sink's parent is a project, then the value
-// returned as writer_identity is the same group or service account used
-// by Logging before the addition of writer identities to this API. The
-// sink's destination must be in the same project as the sink itself.If
-// this field is set to true, or if the sink is owned by a non-project
-// resource such as an organization, then the value of writer_identity
-// will be a unique service account used only for exports from the new
-// sink. For more information, see writer_identity in LogSink.
-func (c *ProjectsSinksCreateCall) UniqueWriterIdentity(uniqueWriterIdentity bool) *ProjectsSinksCreateCall {
- c.urlParams_.Set("uniqueWriterIdentity", fmt.Sprint(uniqueWriterIdentity))
- 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 *ProjectsSinksCreateCall) Fields(s ...googleapi.Field) *ProjectsSinksCreateCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- return c
-}
-
-// Context sets the context to be used in this call's Do method. Any
-// pending HTTP request will be aborted if the provided context is
-// canceled.
-func (c *ProjectsSinksCreateCall) Context(ctx context.Context) *ProjectsSinksCreateCall {
- c.ctx_ = ctx
- return c
-}
-
-// Header returns an http.Header that can be modified by the caller to
-// add HTTP headers to the request.
-func (c *ProjectsSinksCreateCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *ProjectsSinksCreateCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- body, err := googleapi.WithoutDataWrapper.JSONReader(c.logsink)
- if err != nil {
- return nil, err
- }
- reqHeaders.Set("Content-Type", "application/json")
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta1/{+parent}/sinks")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("POST", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "parent": c.parent,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "logging.projects.sinks.create" call.
-// Exactly one of *LogSink or error will be non-nil. Any non-2xx status
-// code is an error. Response headers are in either
-// *LogSink.ServerResponse.Header or (if a response was returned at all)
-// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
-// check whether the returned error was because http.StatusNotModified
-// was returned.
-func (c *ProjectsSinksCreateCall) Do(opts ...googleapi.CallOption) (*LogSink, error) {
- gensupport.SetOptions(c.urlParams_, opts...)
- res, err := c.doRequest("json")
- if res != nil && res.StatusCode == http.StatusNotModified {
- if res.Body != nil {
- res.Body.Close()
- }
- return nil, &googleapi.Error{
- Code: res.StatusCode,
- Header: res.Header,
- }
- }
- if err != nil {
- return nil, err
- }
- defer googleapi.CloseBody(res)
- if err := googleapi.CheckResponse(res); err != nil {
- return nil, err
- }
- ret := &LogSink{
- ServerResponse: googleapi.ServerResponse{
- Header: res.Header,
- HTTPStatusCode: res.StatusCode,
- },
- }
- target := &ret
- if err := gensupport.DecodeResponse(target, res); err != nil {
- return nil, err
- }
- return ret, nil
- // {
- // "description": "Creates a sink that exports specified log entries to a destination. The export of newly-ingested log entries begins immediately, unless the sink's writer_identity is not permitted to write to the destination. A sink can export log entries only from the resource owning the sink.",
- // "flatPath": "v2beta1/projects/{projectsId}/sinks",
- // "httpMethod": "POST",
- // "id": "logging.projects.sinks.create",
- // "parameterOrder": [
- // "parent"
- // ],
- // "parameters": {
- // "parent": {
- // "description": "Required. The resource in which to create the sink:\n\"projects/[PROJECT_ID]\"\n\"organizations/[ORGANIZATION_ID]\"\n\"billingAccounts/[BILLING_ACCOUNT_ID]\"\n\"folders/[FOLDER_ID]\"\nExamples: \"projects/my-logging-project\", \"organizations/123456789\".",
- // "location": "path",
- // "pattern": "^projects/[^/]+$",
- // "required": true,
- // "type": "string"
- // },
- // "uniqueWriterIdentity": {
- // "description": "Optional. Determines the kind of IAM identity returned as writer_identity in the new sink. If this value is omitted or set to false, and if the sink's parent is a project, then the value returned as writer_identity is the same group or service account used by Logging before the addition of writer identities to this API. The sink's destination must be in the same project as the sink itself.If this field is set to true, or if the sink is owned by a non-project resource such as an organization, then the value of writer_identity will be a unique service account used only for exports from the new sink. For more information, see writer_identity in LogSink.",
- // "location": "query",
- // "type": "boolean"
- // }
- // },
- // "path": "v2beta1/{+parent}/sinks",
- // "request": {
- // "$ref": "LogSink"
- // },
- // "response": {
- // "$ref": "LogSink"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/logging.admin"
- // ]
- // }
-
-}
-
-// method id "logging.projects.sinks.delete":
-
-type ProjectsSinksDeleteCall struct {
- s *Service
- sinkNameid string
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// Delete: Deletes a sink. If the sink has a unique writer_identity,
-// then that service account is also deleted.
-func (r *ProjectsSinksService) Delete(sinkNameid string) *ProjectsSinksDeleteCall {
- c := &ProjectsSinksDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.sinkNameid = sinkNameid
- 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 *ProjectsSinksDeleteCall) Fields(s ...googleapi.Field) *ProjectsSinksDeleteCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- return c
-}
-
-// Context sets the context to be used in this call's Do method. Any
-// pending HTTP request will be aborted if the provided context is
-// canceled.
-func (c *ProjectsSinksDeleteCall) Context(ctx context.Context) *ProjectsSinksDeleteCall {
- c.ctx_ = ctx
- return c
-}
-
-// Header returns an http.Header that can be modified by the caller to
-// add HTTP headers to the request.
-func (c *ProjectsSinksDeleteCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *ProjectsSinksDeleteCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta1/{+sinkName}")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("DELETE", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "sinkName": c.sinkNameid,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "logging.projects.sinks.delete" call.
-// Exactly one of *Empty or error will be non-nil. Any non-2xx status
-// code is an error. Response headers are in either
-// *Empty.ServerResponse.Header or (if a response was returned at all)
-// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
-// check whether the returned error was because http.StatusNotModified
-// was returned.
-func (c *ProjectsSinksDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) {
- gensupport.SetOptions(c.urlParams_, opts...)
- res, err := c.doRequest("json")
- if res != nil && res.StatusCode == http.StatusNotModified {
- if res.Body != nil {
- res.Body.Close()
- }
- return nil, &googleapi.Error{
- Code: res.StatusCode,
- Header: res.Header,
- }
- }
- if err != nil {
- return nil, err
- }
- defer googleapi.CloseBody(res)
- if err := googleapi.CheckResponse(res); err != nil {
- return nil, err
- }
- ret := &Empty{
- ServerResponse: googleapi.ServerResponse{
- Header: res.Header,
- HTTPStatusCode: res.StatusCode,
- },
- }
- target := &ret
- if err := gensupport.DecodeResponse(target, res); err != nil {
- return nil, err
- }
- return ret, nil
- // {
- // "description": "Deletes a sink. If the sink has a unique writer_identity, then that service account is also deleted.",
- // "flatPath": "v2beta1/projects/{projectsId}/sinks/{sinksId}",
- // "httpMethod": "DELETE",
- // "id": "logging.projects.sinks.delete",
- // "parameterOrder": [
- // "sinkName"
- // ],
- // "parameters": {
- // "sinkName": {
- // "description": "Required. The full resource name of the sink to delete, including the parent resource and the sink identifier:\n\"projects/[PROJECT_ID]/sinks/[SINK_ID]\"\n\"organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]\"\n\"billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]\"\n\"folders/[FOLDER_ID]/sinks/[SINK_ID]\"\nExample: \"projects/my-project-id/sinks/my-sink-id\".",
- // "location": "path",
- // "pattern": "^projects/[^/]+/sinks/[^/]+$",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "v2beta1/{+sinkName}",
- // "response": {
- // "$ref": "Empty"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/logging.admin"
- // ]
- // }
-
-}
-
-// method id "logging.projects.sinks.get":
-
-type ProjectsSinksGetCall struct {
- s *Service
- sinkName string
- urlParams_ gensupport.URLParams
- ifNoneMatch_ string
- ctx_ context.Context
- header_ http.Header
-}
-
-// Get: Gets a sink.
-func (r *ProjectsSinksService) Get(sinkName string) *ProjectsSinksGetCall {
- c := &ProjectsSinksGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.sinkName = sinkName
- 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 *ProjectsSinksGetCall) Fields(s ...googleapi.Field) *ProjectsSinksGetCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- return c
-}
-
-// IfNoneMatch sets the optional parameter which makes the operation
-// fail if the object's ETag matches the given value. This is useful for
-// getting updates only after the object has changed since the last
-// request. Use googleapi.IsNotModified to check whether the response
-// error from Do is the result of In-None-Match.
-func (c *ProjectsSinksGetCall) IfNoneMatch(entityTag string) *ProjectsSinksGetCall {
- c.ifNoneMatch_ = entityTag
- return c
-}
-
-// Context sets the context to be used in this call's Do method. Any
-// pending HTTP request will be aborted if the provided context is
-// canceled.
-func (c *ProjectsSinksGetCall) Context(ctx context.Context) *ProjectsSinksGetCall {
- c.ctx_ = ctx
- return c
-}
-
-// Header returns an http.Header that can be modified by the caller to
-// add HTTP headers to the request.
-func (c *ProjectsSinksGetCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *ProjectsSinksGetCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- if c.ifNoneMatch_ != "" {
- reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
- }
- var body io.Reader = nil
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta1/{+sinkName}")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("GET", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "sinkName": c.sinkName,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "logging.projects.sinks.get" call.
-// Exactly one of *LogSink or error will be non-nil. Any non-2xx status
-// code is an error. Response headers are in either
-// *LogSink.ServerResponse.Header or (if a response was returned at all)
-// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
-// check whether the returned error was because http.StatusNotModified
-// was returned.
-func (c *ProjectsSinksGetCall) Do(opts ...googleapi.CallOption) (*LogSink, error) {
- gensupport.SetOptions(c.urlParams_, opts...)
- res, err := c.doRequest("json")
- if res != nil && res.StatusCode == http.StatusNotModified {
- if res.Body != nil {
- res.Body.Close()
- }
- return nil, &googleapi.Error{
- Code: res.StatusCode,
- Header: res.Header,
- }
- }
- if err != nil {
- return nil, err
- }
- defer googleapi.CloseBody(res)
- if err := googleapi.CheckResponse(res); err != nil {
- return nil, err
- }
- ret := &LogSink{
- ServerResponse: googleapi.ServerResponse{
- Header: res.Header,
- HTTPStatusCode: res.StatusCode,
- },
- }
- target := &ret
- if err := gensupport.DecodeResponse(target, res); err != nil {
- return nil, err
- }
- return ret, nil
- // {
- // "description": "Gets a sink.",
- // "flatPath": "v2beta1/projects/{projectsId}/sinks/{sinksId}",
- // "httpMethod": "GET",
- // "id": "logging.projects.sinks.get",
- // "parameterOrder": [
- // "sinkName"
- // ],
- // "parameters": {
- // "sinkName": {
- // "description": "Required. The resource name of the sink:\n\"projects/[PROJECT_ID]/sinks/[SINK_ID]\"\n\"organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]\"\n\"billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]\"\n\"folders/[FOLDER_ID]/sinks/[SINK_ID]\"\nExample: \"projects/my-project-id/sinks/my-sink-id\".",
- // "location": "path",
- // "pattern": "^projects/[^/]+/sinks/[^/]+$",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "v2beta1/{+sinkName}",
- // "response": {
- // "$ref": "LogSink"
- // },
- // "scopes": [
- // "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"
- // ]
- // }
-
-}
-
-// method id "logging.projects.sinks.list":
-
-type ProjectsSinksListCall struct {
- s *Service
- parent string
- urlParams_ gensupport.URLParams
- ifNoneMatch_ string
- ctx_ context.Context
- header_ http.Header
-}
-
-// List: Lists sinks.
-func (r *ProjectsSinksService) List(parent string) *ProjectsSinksListCall {
- c := &ProjectsSinksListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.parent = parent
- return c
-}
-
-// PageSize sets the optional parameter "pageSize": The maximum number
-// of results to return from this request. Non-positive values are
-// ignored. The presence of nextPageToken in the response indicates that
-// more results might be available.
-func (c *ProjectsSinksListCall) PageSize(pageSize int64) *ProjectsSinksListCall {
- c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
- return c
-}
-
-// PageToken sets the optional parameter "pageToken": If present, then
-// retrieve the next batch of results from the preceding call to this
-// method. pageToken must be the value of nextPageToken from the
-// previous response. The values of other method parameters should be
-// identical to those in the previous call.
-func (c *ProjectsSinksListCall) PageToken(pageToken string) *ProjectsSinksListCall {
- c.urlParams_.Set("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 *ProjectsSinksListCall) Fields(s ...googleapi.Field) *ProjectsSinksListCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- return c
-}
-
-// IfNoneMatch sets the optional parameter which makes the operation
-// fail if the object's ETag matches the given value. This is useful for
-// getting updates only after the object has changed since the last
-// request. Use googleapi.IsNotModified to check whether the response
-// error from Do is the result of In-None-Match.
-func (c *ProjectsSinksListCall) IfNoneMatch(entityTag string) *ProjectsSinksListCall {
- c.ifNoneMatch_ = entityTag
- return c
-}
-
-// Context sets the context to be used in this call's Do method. Any
-// pending HTTP request will be aborted if the provided context is
-// canceled.
-func (c *ProjectsSinksListCall) Context(ctx context.Context) *ProjectsSinksListCall {
- c.ctx_ = ctx
- return c
-}
-
-// Header returns an http.Header that can be modified by the caller to
-// add HTTP headers to the request.
-func (c *ProjectsSinksListCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *ProjectsSinksListCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- if c.ifNoneMatch_ != "" {
- reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
- }
- var body io.Reader = nil
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta1/{+parent}/sinks")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("GET", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "parent": c.parent,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "logging.projects.sinks.list" call.
-// Exactly one of *ListSinksResponse or error will be non-nil. Any
-// non-2xx status code is an error. Response headers are in either
-// *ListSinksResponse.ServerResponse.Header or (if a response was
-// returned at all) in error.(*googleapi.Error).Header. Use
-// googleapi.IsNotModified to check whether the returned error was
-// because http.StatusNotModified was returned.
-func (c *ProjectsSinksListCall) Do(opts ...googleapi.CallOption) (*ListSinksResponse, error) {
- gensupport.SetOptions(c.urlParams_, opts...)
- res, err := c.doRequest("json")
- if res != nil && res.StatusCode == http.StatusNotModified {
- if res.Body != nil {
- res.Body.Close()
- }
- return nil, &googleapi.Error{
- Code: res.StatusCode,
- Header: res.Header,
- }
- }
- if err != nil {
- return nil, err
- }
- defer googleapi.CloseBody(res)
- if err := googleapi.CheckResponse(res); err != nil {
- return nil, err
- }
- ret := &ListSinksResponse{
- ServerResponse: googleapi.ServerResponse{
- Header: res.Header,
- HTTPStatusCode: res.StatusCode,
- },
- }
- target := &ret
- if err := gensupport.DecodeResponse(target, res); err != nil {
- return nil, err
- }
- return ret, nil
- // {
- // "description": "Lists sinks.",
- // "flatPath": "v2beta1/projects/{projectsId}/sinks",
- // "httpMethod": "GET",
- // "id": "logging.projects.sinks.list",
- // "parameterOrder": [
- // "parent"
- // ],
- // "parameters": {
- // "pageSize": {
- // "description": "Optional. The maximum number of results to return from this request. Non-positive values are ignored. The presence of nextPageToken in the response indicates that more results might be available.",
- // "format": "int32",
- // "location": "query",
- // "type": "integer"
- // },
- // "pageToken": {
- // "description": "Optional. If present, then retrieve the next batch of results from the preceding call to this method. pageToken must be the value of nextPageToken from the previous response. The values of other method parameters should be identical to those in the previous call.",
- // "location": "query",
- // "type": "string"
- // },
- // "parent": {
- // "description": "Required. The parent resource whose sinks are to be listed:\n\"projects/[PROJECT_ID]\"\n\"organizations/[ORGANIZATION_ID]\"\n\"billingAccounts/[BILLING_ACCOUNT_ID]\"\n\"folders/[FOLDER_ID]\"\n",
- // "location": "path",
- // "pattern": "^projects/[^/]+$",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "v2beta1/{+parent}/sinks",
- // "response": {
- // "$ref": "ListSinksResponse"
- // },
- // "scopes": [
- // "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"
- // ]
- // }
-
-}
-
-// Pages invokes f for each page of results.
-// A non-nil error returned from f will halt the iteration.
-// The provided context supersedes any context provided to the Context method.
-func (c *ProjectsSinksListCall) Pages(ctx context.Context, f func(*ListSinksResponse) error) error {
- c.ctx_ = ctx
- defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
- for {
- x, err := c.Do()
- if err != nil {
- return err
- }
- if err := f(x); err != nil {
- return err
- }
- if x.NextPageToken == "" {
- return nil
- }
- c.PageToken(x.NextPageToken)
- }
-}
-
-// method id "logging.projects.sinks.update":
-
-type ProjectsSinksUpdateCall struct {
- s *Service
- sinkNameid string
- logsink *LogSink
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// Update: Updates a sink. This method replaces the following fields in
-// the existing sink with values from the new sink: destination, and
-// filter.The updated sink might also have a new writer_identity; see
-// the unique_writer_identity field.
-func (r *ProjectsSinksService) Update(sinkNameid string, logsink *LogSink) *ProjectsSinksUpdateCall {
- c := &ProjectsSinksUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.sinkNameid = sinkNameid
- c.logsink = logsink
- return c
-}
-
-// UniqueWriterIdentity sets the optional parameter
-// "uniqueWriterIdentity": See sinks.create for a description of this
-// field. When updating a sink, the effect of this field on the value of
-// writer_identity in the updated sink depends on both the old and new
-// values of this field:
-// If the old and new values of this field are both false or both true,
-// then there is no change to the sink's writer_identity.
-// If the old value is false and the new value is true, then
-// writer_identity is changed to a unique service account.
-// It is an error if the old value is true and the new value is set to
-// false or defaulted to false.
-func (c *ProjectsSinksUpdateCall) UniqueWriterIdentity(uniqueWriterIdentity bool) *ProjectsSinksUpdateCall {
- c.urlParams_.Set("uniqueWriterIdentity", fmt.Sprint(uniqueWriterIdentity))
- return c
-}
-
-// UpdateMask sets the optional parameter "updateMask": Field mask that
-// specifies the fields in sink that need an update. A sink field will
-// be overwritten if, and only if, it is in the update mask. name and
-// output only fields cannot be updated.An empty updateMask is
-// temporarily treated as using the following mask for backwards
-// compatibility purposes: destination,filter,includeChildren At some
-// point in the future, behavior will be removed and specifying an empty
-// updateMask will be an error.For a detailed FieldMask definition, see
-// https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.FieldMaskExample:
-// updateMask=filter.
-func (c *ProjectsSinksUpdateCall) UpdateMask(updateMask string) *ProjectsSinksUpdateCall {
- c.urlParams_.Set("updateMask", updateMask)
- 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 *ProjectsSinksUpdateCall) Fields(s ...googleapi.Field) *ProjectsSinksUpdateCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- return c
-}
-
-// Context sets the context to be used in this call's Do method. Any
-// pending HTTP request will be aborted if the provided context is
-// canceled.
-func (c *ProjectsSinksUpdateCall) Context(ctx context.Context) *ProjectsSinksUpdateCall {
- c.ctx_ = ctx
- return c
-}
-
-// Header returns an http.Header that can be modified by the caller to
-// add HTTP headers to the request.
-func (c *ProjectsSinksUpdateCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *ProjectsSinksUpdateCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- body, err := googleapi.WithoutDataWrapper.JSONReader(c.logsink)
- if err != nil {
- return nil, err
- }
- reqHeaders.Set("Content-Type", "application/json")
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta1/{+sinkName}")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("PUT", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "sinkName": c.sinkNameid,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "logging.projects.sinks.update" call.
-// Exactly one of *LogSink or error will be non-nil. Any non-2xx status
-// code is an error. Response headers are in either
-// *LogSink.ServerResponse.Header or (if a response was returned at all)
-// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
-// check whether the returned error was because http.StatusNotModified
-// was returned.
-func (c *ProjectsSinksUpdateCall) Do(opts ...googleapi.CallOption) (*LogSink, error) {
- gensupport.SetOptions(c.urlParams_, opts...)
- res, err := c.doRequest("json")
- if res != nil && res.StatusCode == http.StatusNotModified {
- if res.Body != nil {
- res.Body.Close()
- }
- return nil, &googleapi.Error{
- Code: res.StatusCode,
- Header: res.Header,
- }
- }
- if err != nil {
- return nil, err
- }
- defer googleapi.CloseBody(res)
- if err := googleapi.CheckResponse(res); err != nil {
- return nil, err
- }
- ret := &LogSink{
- ServerResponse: googleapi.ServerResponse{
- Header: res.Header,
- HTTPStatusCode: res.StatusCode,
- },
- }
- target := &ret
- if err := gensupport.DecodeResponse(target, res); err != nil {
- return nil, err
- }
- return ret, nil
- // {
- // "description": "Updates a sink. This method replaces the following fields in the existing sink with values from the new sink: destination, and filter.The updated sink might also have a new writer_identity; see the unique_writer_identity field.",
- // "flatPath": "v2beta1/projects/{projectsId}/sinks/{sinksId}",
- // "httpMethod": "PUT",
- // "id": "logging.projects.sinks.update",
- // "parameterOrder": [
- // "sinkName"
- // ],
- // "parameters": {
- // "sinkName": {
- // "description": "Required. The full resource name of the sink to update, including the parent resource and the sink identifier:\n\"projects/[PROJECT_ID]/sinks/[SINK_ID]\"\n\"organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]\"\n\"billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]\"\n\"folders/[FOLDER_ID]/sinks/[SINK_ID]\"\nExample: \"projects/my-project-id/sinks/my-sink-id\".",
- // "location": "path",
- // "pattern": "^projects/[^/]+/sinks/[^/]+$",
- // "required": true,
- // "type": "string"
- // },
- // "uniqueWriterIdentity": {
- // "description": "Optional. See sinks.create for a description of this field. When updating a sink, the effect of this field on the value of writer_identity in the updated sink depends on both the old and new values of this field:\nIf the old and new values of this field are both false or both true, then there is no change to the sink's writer_identity.\nIf the old value is false and the new value is true, then writer_identity is changed to a unique service account.\nIt is an error if the old value is true and the new value is set to false or defaulted to false.",
- // "location": "query",
- // "type": "boolean"
- // },
- // "updateMask": {
- // "description": "Optional. Field mask that specifies the fields in sink that need an update. A sink field will be overwritten if, and only if, it is in the update mask. name and output only fields cannot be updated.An empty updateMask is temporarily treated as using the following mask for backwards compatibility purposes: destination,filter,includeChildren At some point in the future, behavior will be removed and specifying an empty updateMask will be an error.For a detailed FieldMask definition, see https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.FieldMaskExample: updateMask=filter.",
- // "format": "google-fieldmask",
- // "location": "query",
- // "type": "string"
- // }
- // },
- // "path": "v2beta1/{+sinkName}",
- // "request": {
- // "$ref": "LogSink"
- // },
- // "response": {
- // "$ref": "LogSink"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/logging.admin"
- // ]
- // }
-
-}
diff --git a/vendor/google.golang.org/api/pubsub/v1/BUILD b/vendor/google.golang.org/api/pubsub/v1/BUILD
deleted file mode 100644
index 64fb8a9ea06..00000000000
--- a/vendor/google.golang.org/api/pubsub/v1/BUILD
+++ /dev/null
@@ -1,29 +0,0 @@
-load("@io_bazel_rules_go//go:def.bzl", "go_library")
-
-go_library(
- name = "go_default_library",
- srcs = ["pubsub-gen.go"],
- importmap = "k8s.io/kubernetes/vendor/google.golang.org/api/pubsub/v1",
- importpath = "google.golang.org/api/pubsub/v1",
- visibility = ["//visibility:public"],
- deps = [
- "//vendor/google.golang.org/api/googleapi:go_default_library",
- "//vendor/google.golang.org/api/internal/gensupport:go_default_library",
- "//vendor/google.golang.org/api/option:go_default_library",
- "//vendor/google.golang.org/api/transport/http:go_default_library",
- ],
-)
-
-filegroup(
- name = "package-srcs",
- srcs = glob(["**"]),
- tags = ["automanaged"],
- visibility = ["//visibility:private"],
-)
-
-filegroup(
- name = "all-srcs",
- srcs = [":package-srcs"],
- tags = ["automanaged"],
- visibility = ["//visibility:public"],
-)
diff --git a/vendor/google.golang.org/api/pubsub/v1/pubsub-api.json b/vendor/google.golang.org/api/pubsub/v1/pubsub-api.json
deleted file mode 100644
index bb0f4787fd6..00000000000
--- a/vendor/google.golang.org/api/pubsub/v1/pubsub-api.json
+++ /dev/null
@@ -1,1698 +0,0 @@
-{
- "auth": {
- "oauth2": {
- "scopes": {
- "https://www.googleapis.com/auth/cloud-platform": {
- "description": "View and manage your data across Google Cloud Platform services"
- },
- "https://www.googleapis.com/auth/pubsub": {
- "description": "View and manage Pub/Sub topics and subscriptions"
- }
- }
- }
- },
- "basePath": "",
- "baseUrl": "https://pubsub.googleapis.com/",
- "batchPath": "batch",
- "canonicalName": "Pubsub",
- "description": "Provides reliable, many-to-many, asynchronous messaging between applications.\n",
- "discoveryVersion": "v1",
- "documentationLink": "https://cloud.google.com/pubsub/docs",
- "icons": {
- "x16": "http://www.google.com/images/icons/product/search-16.gif",
- "x32": "http://www.google.com/images/icons/product/search-32.gif"
- },
- "id": "pubsub:v1",
- "kind": "discovery#restDescription",
- "name": "pubsub",
- "ownerDomain": "google.com",
- "ownerName": "Google",
- "parameters": {
- "$.xgafv": {
- "description": "V1 error format.",
- "enum": [
- "1",
- "2"
- ],
- "enumDescriptions": [
- "v1 error format",
- "v2 error format"
- ],
- "location": "query",
- "type": "string"
- },
- "access_token": {
- "description": "OAuth access token.",
- "location": "query",
- "type": "string"
- },
- "alt": {
- "default": "json",
- "description": "Data format for response.",
- "enum": [
- "json",
- "media",
- "proto"
- ],
- "enumDescriptions": [
- "Responses with Content-Type of application/json",
- "Media download with context-dependent Content-Type",
- "Responses with Content-Type of application/x-protobuf"
- ],
- "location": "query",
- "type": "string"
- },
- "callback": {
- "description": "JSONP",
- "location": "query",
- "type": "string"
- },
- "fields": {
- "description": "Selector specifying which fields to include in a partial response.",
- "location": "query",
- "type": "string"
- },
- "key": {
- "description": "API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.",
- "location": "query",
- "type": "string"
- },
- "oauth_token": {
- "description": "OAuth 2.0 token for the current user.",
- "location": "query",
- "type": "string"
- },
- "prettyPrint": {
- "default": "true",
- "description": "Returns response with indentations and line breaks.",
- "location": "query",
- "type": "boolean"
- },
- "quotaUser": {
- "description": "Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.",
- "location": "query",
- "type": "string"
- },
- "uploadType": {
- "description": "Legacy upload protocol for media (e.g. \"media\", \"multipart\").",
- "location": "query",
- "type": "string"
- },
- "upload_protocol": {
- "description": "Upload protocol for media (e.g. \"raw\", \"multipart\").",
- "location": "query",
- "type": "string"
- }
- },
- "protocol": "rest",
- "resources": {
- "projects": {
- "resources": {
- "snapshots": {
- "methods": {
- "create": {
- "description": "Creates a snapshot from the requested subscription. Snapshots are used in\n\u003ca href=\"https://cloud.google.com/pubsub/docs/replay-overview\"\u003eSeek\u003c/a\u003e\noperations, which allow\nyou to manage message acknowledgments in bulk. That is, you can set the\nacknowledgment state of messages in an existing subscription to the state\ncaptured by a snapshot.\n\u003cbr\u003e\u003cbr\u003eIf the snapshot already exists, returns `ALREADY_EXISTS`.\nIf the requested subscription doesn't exist, returns `NOT_FOUND`.\nIf the backlog in the subscription is too old -- and the resulting snapshot\nwould expire in less than 1 hour -- then `FAILED_PRECONDITION` is returned.\nSee also the `Snapshot.expire_time` field. If the name is not provided in\nthe request, the server will assign a random\nname for this snapshot on the same project as the subscription, conforming\nto the\n[resource name\nformat](https://cloud.google.com/pubsub/docs/admin#resource_names). The\ngenerated name is populated in the returned Snapshot object. Note that for\nREST API requests, you must specify a name in the request.",
- "flatPath": "v1/projects/{projectsId}/snapshots/{snapshotsId}",
- "httpMethod": "PUT",
- "id": "pubsub.projects.snapshots.create",
- "parameterOrder": [
- "name"
- ],
- "parameters": {
- "name": {
- "description": "User-provided name for this snapshot. If the name is not provided in the\nrequest, the server will assign a random name for this snapshot on the same\nproject as the subscription. Note that for REST API requests, you must\nspecify a name. See the \u003ca\nhref=\"https://cloud.google.com/pubsub/docs/admin#resource_names\"\u003e resource\nname rules\u003c/a\u003e. Format is `projects/{project}/snapshots/{snap}`.",
- "location": "path",
- "pattern": "^projects/[^/]+/snapshots/[^/]+$",
- "required": true,
- "type": "string"
- }
- },
- "path": "v1/{+name}",
- "request": {
- "$ref": "CreateSnapshotRequest"
- },
- "response": {
- "$ref": "Snapshot"
- },
- "scopes": [
- "https://www.googleapis.com/auth/cloud-platform",
- "https://www.googleapis.com/auth/pubsub"
- ]
- },
- "delete": {
- "description": "Removes an existing snapshot. Snapshots are used in\n\u003ca href=\"https://cloud.google.com/pubsub/docs/replay-overview\"\u003eSeek\u003c/a\u003e\noperations, which allow\nyou to manage message acknowledgments in bulk. That is, you can set the\nacknowledgment state of messages in an existing subscription to the state\ncaptured by a snapshot.\u003cbr\u003e\u003cbr\u003e\nWhen the snapshot is deleted, all messages retained in the snapshot\nare immediately dropped. After a snapshot is deleted, a new one may be\ncreated with the same name, but the new one has no association with the old\nsnapshot or its subscription, unless the same subscription is specified.",
- "flatPath": "v1/projects/{projectsId}/snapshots/{snapshotsId}",
- "httpMethod": "DELETE",
- "id": "pubsub.projects.snapshots.delete",
- "parameterOrder": [
- "snapshot"
- ],
- "parameters": {
- "snapshot": {
- "description": "The name of the snapshot to delete.\nFormat is `projects/{project}/snapshots/{snap}`.",
- "location": "path",
- "pattern": "^projects/[^/]+/snapshots/[^/]+$",
- "required": true,
- "type": "string"
- }
- },
- "path": "v1/{+snapshot}",
- "response": {
- "$ref": "Empty"
- },
- "scopes": [
- "https://www.googleapis.com/auth/cloud-platform",
- "https://www.googleapis.com/auth/pubsub"
- ]
- },
- "get": {
- "description": "Gets the configuration details of a snapshot. Snapshots are used in\n\u003ca href=\"https://cloud.google.com/pubsub/docs/replay-overview\"\u003eSeek\u003c/a\u003e\noperations, which allow you to manage message acknowledgments in bulk. That\nis, you can set the acknowledgment state of messages in an existing\nsubscription to the state captured by a snapshot.",
- "flatPath": "v1/projects/{projectsId}/snapshots/{snapshotsId}",
- "httpMethod": "GET",
- "id": "pubsub.projects.snapshots.get",
- "parameterOrder": [
- "snapshot"
- ],
- "parameters": {
- "snapshot": {
- "description": "The name of the snapshot to get.\nFormat is `projects/{project}/snapshots/{snap}`.",
- "location": "path",
- "pattern": "^projects/[^/]+/snapshots/[^/]+$",
- "required": true,
- "type": "string"
- }
- },
- "path": "v1/{+snapshot}",
- "response": {
- "$ref": "Snapshot"
- },
- "scopes": [
- "https://www.googleapis.com/auth/cloud-platform",
- "https://www.googleapis.com/auth/pubsub"
- ]
- },
- "getIamPolicy": {
- "description": "Gets the access control policy for a resource.\nReturns an empty policy if the resource exists and does not have a policy\nset.",
- "flatPath": "v1/projects/{projectsId}/snapshots/{snapshotsId}:getIamPolicy",
- "httpMethod": "GET",
- "id": "pubsub.projects.snapshots.getIamPolicy",
- "parameterOrder": [
- "resource"
- ],
- "parameters": {
- "options.requestedPolicyVersion": {
- "description": "Optional. The policy format version to be returned.\n\nValid values are 0, 1, and 3. Requests specifying an invalid value will be\nrejected.\n\nRequests for policies with any conditional bindings must specify version 3.\nPolicies without any conditional bindings may specify any valid value or\nleave the field unset.",
- "format": "int32",
- "location": "query",
- "type": "integer"
- },
- "resource": {
- "description": "REQUIRED: The resource for which the policy is being requested.\nSee the operation documentation for the appropriate value for this field.",
- "location": "path",
- "pattern": "^projects/[^/]+/snapshots/[^/]+$",
- "required": true,
- "type": "string"
- }
- },
- "path": "v1/{+resource}:getIamPolicy",
- "response": {
- "$ref": "Policy"
- },
- "scopes": [
- "https://www.googleapis.com/auth/cloud-platform",
- "https://www.googleapis.com/auth/pubsub"
- ]
- },
- "list": {
- "description": "Lists the existing snapshots. Snapshots are used in\n\u003ca href=\"https://cloud.google.com/pubsub/docs/replay-overview\"\u003eSeek\u003c/a\u003e\noperations, which allow\nyou to manage message acknowledgments in bulk. That is, you can set the\nacknowledgment state of messages in an existing subscription to the state\ncaptured by a snapshot.",
- "flatPath": "v1/projects/{projectsId}/snapshots",
- "httpMethod": "GET",
- "id": "pubsub.projects.snapshots.list",
- "parameterOrder": [
- "project"
- ],
- "parameters": {
- "pageSize": {
- "description": "Maximum number of snapshots to return.",
- "format": "int32",
- "location": "query",
- "type": "integer"
- },
- "pageToken": {
- "description": "The value returned by the last `ListSnapshotsResponse`; indicates that this\nis a continuation of a prior `ListSnapshots` call, and that the system\nshould return the next page of data.",
- "location": "query",
- "type": "string"
- },
- "project": {
- "description": "The name of the project in which to list snapshots.\nFormat is `projects/{project-id}`.",
- "location": "path",
- "pattern": "^projects/[^/]+$",
- "required": true,
- "type": "string"
- }
- },
- "path": "v1/{+project}/snapshots",
- "response": {
- "$ref": "ListSnapshotsResponse"
- },
- "scopes": [
- "https://www.googleapis.com/auth/cloud-platform",
- "https://www.googleapis.com/auth/pubsub"
- ]
- },
- "patch": {
- "description": "Updates an existing snapshot. Snapshots are used in\n\u003ca href=\"https://cloud.google.com/pubsub/docs/replay-overview\"\u003eSeek\u003c/a\u003e\noperations, which allow\nyou to manage message acknowledgments in bulk. That is, you can set the\nacknowledgment state of messages in an existing subscription to the state\ncaptured by a snapshot.",
- "flatPath": "v1/projects/{projectsId}/snapshots/{snapshotsId}",
- "httpMethod": "PATCH",
- "id": "pubsub.projects.snapshots.patch",
- "parameterOrder": [
- "name"
- ],
- "parameters": {
- "name": {
- "description": "The name of the snapshot.",
- "location": "path",
- "pattern": "^projects/[^/]+/snapshots/[^/]+$",
- "required": true,
- "type": "string"
- }
- },
- "path": "v1/{+name}",
- "request": {
- "$ref": "UpdateSnapshotRequest"
- },
- "response": {
- "$ref": "Snapshot"
- },
- "scopes": [
- "https://www.googleapis.com/auth/cloud-platform",
- "https://www.googleapis.com/auth/pubsub"
- ]
- },
- "setIamPolicy": {
- "description": "Sets the access control policy on the specified resource. Replaces any\nexisting policy.\n\nCan return Public Errors: NOT_FOUND, INVALID_ARGUMENT and PERMISSION_DENIED",
- "flatPath": "v1/projects/{projectsId}/snapshots/{snapshotsId}:setIamPolicy",
- "httpMethod": "POST",
- "id": "pubsub.projects.snapshots.setIamPolicy",
- "parameterOrder": [
- "resource"
- ],
- "parameters": {
- "resource": {
- "description": "REQUIRED: The resource for which the policy is being specified.\nSee the operation documentation for the appropriate value for this field.",
- "location": "path",
- "pattern": "^projects/[^/]+/snapshots/[^/]+$",
- "required": true,
- "type": "string"
- }
- },
- "path": "v1/{+resource}:setIamPolicy",
- "request": {
- "$ref": "SetIamPolicyRequest"
- },
- "response": {
- "$ref": "Policy"
- },
- "scopes": [
- "https://www.googleapis.com/auth/cloud-platform",
- "https://www.googleapis.com/auth/pubsub"
- ]
- },
- "testIamPermissions": {
- "description": "Returns permissions that a caller has on the specified resource.\nIf the resource does not exist, this will return an empty set of\npermissions, not a NOT_FOUND error.\n\nNote: This operation is designed to be used for building permission-aware\nUIs and command-line tools, not for authorization checking. This operation\nmay \"fail open\" without warning.",
- "flatPath": "v1/projects/{projectsId}/snapshots/{snapshotsId}:testIamPermissions",
- "httpMethod": "POST",
- "id": "pubsub.projects.snapshots.testIamPermissions",
- "parameterOrder": [
- "resource"
- ],
- "parameters": {
- "resource": {
- "description": "REQUIRED: The resource for which the policy detail is being requested.\nSee the operation documentation for the appropriate value for this field.",
- "location": "path",
- "pattern": "^projects/[^/]+/snapshots/[^/]+$",
- "required": true,
- "type": "string"
- }
- },
- "path": "v1/{+resource}:testIamPermissions",
- "request": {
- "$ref": "TestIamPermissionsRequest"
- },
- "response": {
- "$ref": "TestIamPermissionsResponse"
- },
- "scopes": [
- "https://www.googleapis.com/auth/cloud-platform",
- "https://www.googleapis.com/auth/pubsub"
- ]
- }
- }
- },
- "subscriptions": {
- "methods": {
- "acknowledge": {
- "description": "Acknowledges the messages associated with the `ack_ids` in the\n`AcknowledgeRequest`. The Pub/Sub system can remove the relevant messages\nfrom the subscription.\n\nAcknowledging a message whose ack deadline has expired may succeed,\nbut such a message may be redelivered later. Acknowledging a message more\nthan once will not result in an error.",
- "flatPath": "v1/projects/{projectsId}/subscriptions/{subscriptionsId}:acknowledge",
- "httpMethod": "POST",
- "id": "pubsub.projects.subscriptions.acknowledge",
- "parameterOrder": [
- "subscription"
- ],
- "parameters": {
- "subscription": {
- "description": "The subscription whose message is being acknowledged.\nFormat is `projects/{project}/subscriptions/{sub}`.",
- "location": "path",
- "pattern": "^projects/[^/]+/subscriptions/[^/]+$",
- "required": true,
- "type": "string"
- }
- },
- "path": "v1/{+subscription}:acknowledge",
- "request": {
- "$ref": "AcknowledgeRequest"
- },
- "response": {
- "$ref": "Empty"
- },
- "scopes": [
- "https://www.googleapis.com/auth/cloud-platform",
- "https://www.googleapis.com/auth/pubsub"
- ]
- },
- "create": {
- "description": "Creates a subscription to a given topic. See the\n\u003ca href=\"https://cloud.google.com/pubsub/docs/admin#resource_names\"\u003e\nresource name rules\u003c/a\u003e.\nIf the subscription already exists, returns `ALREADY_EXISTS`.\nIf the corresponding topic doesn't exist, returns `NOT_FOUND`.\n\nIf the name is not provided in the request, the server will assign a random\nname for this subscription on the same project as the topic, conforming\nto the\n[resource name\nformat](https://cloud.google.com/pubsub/docs/admin#resource_names). The\ngenerated name is populated in the returned Subscription object. Note that\nfor REST API requests, you must specify a name in the request.",
- "flatPath": "v1/projects/{projectsId}/subscriptions/{subscriptionsId}",
- "httpMethod": "PUT",
- "id": "pubsub.projects.subscriptions.create",
- "parameterOrder": [
- "name"
- ],
- "parameters": {
- "name": {
- "description": "The name of the subscription. It must have the format\n`\"projects/{project}/subscriptions/{subscription}\"`. `{subscription}` must\nstart with a letter, and contain only letters (`[A-Za-z]`), numbers\n(`[0-9]`), dashes (`-`), underscores (`_`), periods (`.`), tildes (`~`),\nplus (`+`) or percent signs (`%`). It must be between 3 and 255 characters\nin length, and it must not start with `\"goog\"`.",
- "location": "path",
- "pattern": "^projects/[^/]+/subscriptions/[^/]+$",
- "required": true,
- "type": "string"
- }
- },
- "path": "v1/{+name}",
- "request": {
- "$ref": "Subscription"
- },
- "response": {
- "$ref": "Subscription"
- },
- "scopes": [
- "https://www.googleapis.com/auth/cloud-platform",
- "https://www.googleapis.com/auth/pubsub"
- ]
- },
- "delete": {
- "description": "Deletes an existing subscription. All messages retained in the subscription\nare immediately dropped. Calls to `Pull` after deletion will return\n`NOT_FOUND`. After a subscription is deleted, a new one may be created with\nthe same name, but the new one has no association with the old\nsubscription or its topic unless the same topic is specified.",
- "flatPath": "v1/projects/{projectsId}/subscriptions/{subscriptionsId}",
- "httpMethod": "DELETE",
- "id": "pubsub.projects.subscriptions.delete",
- "parameterOrder": [
- "subscription"
- ],
- "parameters": {
- "subscription": {
- "description": "The subscription to delete.\nFormat is `projects/{project}/subscriptions/{sub}`.",
- "location": "path",
- "pattern": "^projects/[^/]+/subscriptions/[^/]+$",
- "required": true,
- "type": "string"
- }
- },
- "path": "v1/{+subscription}",
- "response": {
- "$ref": "Empty"
- },
- "scopes": [
- "https://www.googleapis.com/auth/cloud-platform",
- "https://www.googleapis.com/auth/pubsub"
- ]
- },
- "get": {
- "description": "Gets the configuration details of a subscription.",
- "flatPath": "v1/projects/{projectsId}/subscriptions/{subscriptionsId}",
- "httpMethod": "GET",
- "id": "pubsub.projects.subscriptions.get",
- "parameterOrder": [
- "subscription"
- ],
- "parameters": {
- "subscription": {
- "description": "The name of the subscription to get.\nFormat is `projects/{project}/subscriptions/{sub}`.",
- "location": "path",
- "pattern": "^projects/[^/]+/subscriptions/[^/]+$",
- "required": true,
- "type": "string"
- }
- },
- "path": "v1/{+subscription}",
- "response": {
- "$ref": "Subscription"
- },
- "scopes": [
- "https://www.googleapis.com/auth/cloud-platform",
- "https://www.googleapis.com/auth/pubsub"
- ]
- },
- "getIamPolicy": {
- "description": "Gets the access control policy for a resource.\nReturns an empty policy if the resource exists and does not have a policy\nset.",
- "flatPath": "v1/projects/{projectsId}/subscriptions/{subscriptionsId}:getIamPolicy",
- "httpMethod": "GET",
- "id": "pubsub.projects.subscriptions.getIamPolicy",
- "parameterOrder": [
- "resource"
- ],
- "parameters": {
- "options.requestedPolicyVersion": {
- "description": "Optional. The policy format version to be returned.\n\nValid values are 0, 1, and 3. Requests specifying an invalid value will be\nrejected.\n\nRequests for policies with any conditional bindings must specify version 3.\nPolicies without any conditional bindings may specify any valid value or\nleave the field unset.",
- "format": "int32",
- "location": "query",
- "type": "integer"
- },
- "resource": {
- "description": "REQUIRED: The resource for which the policy is being requested.\nSee the operation documentation for the appropriate value for this field.",
- "location": "path",
- "pattern": "^projects/[^/]+/subscriptions/[^/]+$",
- "required": true,
- "type": "string"
- }
- },
- "path": "v1/{+resource}:getIamPolicy",
- "response": {
- "$ref": "Policy"
- },
- "scopes": [
- "https://www.googleapis.com/auth/cloud-platform",
- "https://www.googleapis.com/auth/pubsub"
- ]
- },
- "list": {
- "description": "Lists matching subscriptions.",
- "flatPath": "v1/projects/{projectsId}/subscriptions",
- "httpMethod": "GET",
- "id": "pubsub.projects.subscriptions.list",
- "parameterOrder": [
- "project"
- ],
- "parameters": {
- "pageSize": {
- "description": "Maximum number of subscriptions to return.",
- "format": "int32",
- "location": "query",
- "type": "integer"
- },
- "pageToken": {
- "description": "The value returned by the last `ListSubscriptionsResponse`; indicates that\nthis is a continuation of a prior `ListSubscriptions` call, and that the\nsystem should return the next page of data.",
- "location": "query",
- "type": "string"
- },
- "project": {
- "description": "The name of the project in which to list subscriptions.\nFormat is `projects/{project-id}`.",
- "location": "path",
- "pattern": "^projects/[^/]+$",
- "required": true,
- "type": "string"
- }
- },
- "path": "v1/{+project}/subscriptions",
- "response": {
- "$ref": "ListSubscriptionsResponse"
- },
- "scopes": [
- "https://www.googleapis.com/auth/cloud-platform",
- "https://www.googleapis.com/auth/pubsub"
- ]
- },
- "modifyAckDeadline": {
- "description": "Modifies the ack deadline for a specific message. This method is useful\nto indicate that more time is needed to process a message by the\nsubscriber, or to make the message available for redelivery if the\nprocessing was interrupted. Note that this does not modify the\nsubscription-level `ackDeadlineSeconds` used for subsequent messages.",
- "flatPath": "v1/projects/{projectsId}/subscriptions/{subscriptionsId}:modifyAckDeadline",
- "httpMethod": "POST",
- "id": "pubsub.projects.subscriptions.modifyAckDeadline",
- "parameterOrder": [
- "subscription"
- ],
- "parameters": {
- "subscription": {
- "description": "The name of the subscription.\nFormat is `projects/{project}/subscriptions/{sub}`.",
- "location": "path",
- "pattern": "^projects/[^/]+/subscriptions/[^/]+$",
- "required": true,
- "type": "string"
- }
- },
- "path": "v1/{+subscription}:modifyAckDeadline",
- "request": {
- "$ref": "ModifyAckDeadlineRequest"
- },
- "response": {
- "$ref": "Empty"
- },
- "scopes": [
- "https://www.googleapis.com/auth/cloud-platform",
- "https://www.googleapis.com/auth/pubsub"
- ]
- },
- "modifyPushConfig": {
- "description": "Modifies the `PushConfig` for a specified subscription.\n\nThis may be used to change a push subscription to a pull one (signified by\nan empty `PushConfig`) or vice versa, or change the endpoint URL and other\nattributes of a push subscription. Messages will accumulate for delivery\ncontinuously through the call regardless of changes to the `PushConfig`.",
- "flatPath": "v1/projects/{projectsId}/subscriptions/{subscriptionsId}:modifyPushConfig",
- "httpMethod": "POST",
- "id": "pubsub.projects.subscriptions.modifyPushConfig",
- "parameterOrder": [
- "subscription"
- ],
- "parameters": {
- "subscription": {
- "description": "The name of the subscription.\nFormat is `projects/{project}/subscriptions/{sub}`.",
- "location": "path",
- "pattern": "^projects/[^/]+/subscriptions/[^/]+$",
- "required": true,
- "type": "string"
- }
- },
- "path": "v1/{+subscription}:modifyPushConfig",
- "request": {
- "$ref": "ModifyPushConfigRequest"
- },
- "response": {
- "$ref": "Empty"
- },
- "scopes": [
- "https://www.googleapis.com/auth/cloud-platform",
- "https://www.googleapis.com/auth/pubsub"
- ]
- },
- "patch": {
- "description": "Updates an existing subscription. Note that certain properties of a\nsubscription, such as its topic, are not modifiable.",
- "flatPath": "v1/projects/{projectsId}/subscriptions/{subscriptionsId}",
- "httpMethod": "PATCH",
- "id": "pubsub.projects.subscriptions.patch",
- "parameterOrder": [
- "name"
- ],
- "parameters": {
- "name": {
- "description": "The name of the subscription. It must have the format\n`\"projects/{project}/subscriptions/{subscription}\"`. `{subscription}` must\nstart with a letter, and contain only letters (`[A-Za-z]`), numbers\n(`[0-9]`), dashes (`-`), underscores (`_`), periods (`.`), tildes (`~`),\nplus (`+`) or percent signs (`%`). It must be between 3 and 255 characters\nin length, and it must not start with `\"goog\"`.",
- "location": "path",
- "pattern": "^projects/[^/]+/subscriptions/[^/]+$",
- "required": true,
- "type": "string"
- }
- },
- "path": "v1/{+name}",
- "request": {
- "$ref": "UpdateSubscriptionRequest"
- },
- "response": {
- "$ref": "Subscription"
- },
- "scopes": [
- "https://www.googleapis.com/auth/cloud-platform",
- "https://www.googleapis.com/auth/pubsub"
- ]
- },
- "pull": {
- "description": "Pulls messages from the server. The server may return `UNAVAILABLE` if\nthere are too many concurrent pull requests pending for the given\nsubscription.",
- "flatPath": "v1/projects/{projectsId}/subscriptions/{subscriptionsId}:pull",
- "httpMethod": "POST",
- "id": "pubsub.projects.subscriptions.pull",
- "parameterOrder": [
- "subscription"
- ],
- "parameters": {
- "subscription": {
- "description": "The subscription from which messages should be pulled.\nFormat is `projects/{project}/subscriptions/{sub}`.",
- "location": "path",
- "pattern": "^projects/[^/]+/subscriptions/[^/]+$",
- "required": true,
- "type": "string"
- }
- },
- "path": "v1/{+subscription}:pull",
- "request": {
- "$ref": "PullRequest"
- },
- "response": {
- "$ref": "PullResponse"
- },
- "scopes": [
- "https://www.googleapis.com/auth/cloud-platform",
- "https://www.googleapis.com/auth/pubsub"
- ]
- },
- "seek": {
- "description": "Seeks an existing subscription to a point in time or to a given snapshot,\nwhichever is provided in the request. Snapshots are used in\n\u003ca href=\"https://cloud.google.com/pubsub/docs/replay-overview\"\u003eSeek\u003c/a\u003e\noperations, which allow\nyou to manage message acknowledgments in bulk. That is, you can set the\nacknowledgment state of messages in an existing subscription to the state\ncaptured by a snapshot. Note that both the subscription and the snapshot\nmust be on the same topic.",
- "flatPath": "v1/projects/{projectsId}/subscriptions/{subscriptionsId}:seek",
- "httpMethod": "POST",
- "id": "pubsub.projects.subscriptions.seek",
- "parameterOrder": [
- "subscription"
- ],
- "parameters": {
- "subscription": {
- "description": "The subscription to affect.",
- "location": "path",
- "pattern": "^projects/[^/]+/subscriptions/[^/]+$",
- "required": true,
- "type": "string"
- }
- },
- "path": "v1/{+subscription}:seek",
- "request": {
- "$ref": "SeekRequest"
- },
- "response": {
- "$ref": "SeekResponse"
- },
- "scopes": [
- "https://www.googleapis.com/auth/cloud-platform",
- "https://www.googleapis.com/auth/pubsub"
- ]
- },
- "setIamPolicy": {
- "description": "Sets the access control policy on the specified resource. Replaces any\nexisting policy.\n\nCan return Public Errors: NOT_FOUND, INVALID_ARGUMENT and PERMISSION_DENIED",
- "flatPath": "v1/projects/{projectsId}/subscriptions/{subscriptionsId}:setIamPolicy",
- "httpMethod": "POST",
- "id": "pubsub.projects.subscriptions.setIamPolicy",
- "parameterOrder": [
- "resource"
- ],
- "parameters": {
- "resource": {
- "description": "REQUIRED: The resource for which the policy is being specified.\nSee the operation documentation for the appropriate value for this field.",
- "location": "path",
- "pattern": "^projects/[^/]+/subscriptions/[^/]+$",
- "required": true,
- "type": "string"
- }
- },
- "path": "v1/{+resource}:setIamPolicy",
- "request": {
- "$ref": "SetIamPolicyRequest"
- },
- "response": {
- "$ref": "Policy"
- },
- "scopes": [
- "https://www.googleapis.com/auth/cloud-platform",
- "https://www.googleapis.com/auth/pubsub"
- ]
- },
- "testIamPermissions": {
- "description": "Returns permissions that a caller has on the specified resource.\nIf the resource does not exist, this will return an empty set of\npermissions, not a NOT_FOUND error.\n\nNote: This operation is designed to be used for building permission-aware\nUIs and command-line tools, not for authorization checking. This operation\nmay \"fail open\" without warning.",
- "flatPath": "v1/projects/{projectsId}/subscriptions/{subscriptionsId}:testIamPermissions",
- "httpMethod": "POST",
- "id": "pubsub.projects.subscriptions.testIamPermissions",
- "parameterOrder": [
- "resource"
- ],
- "parameters": {
- "resource": {
- "description": "REQUIRED: The resource for which the policy detail is being requested.\nSee the operation documentation for the appropriate value for this field.",
- "location": "path",
- "pattern": "^projects/[^/]+/subscriptions/[^/]+$",
- "required": true,
- "type": "string"
- }
- },
- "path": "v1/{+resource}:testIamPermissions",
- "request": {
- "$ref": "TestIamPermissionsRequest"
- },
- "response": {
- "$ref": "TestIamPermissionsResponse"
- },
- "scopes": [
- "https://www.googleapis.com/auth/cloud-platform",
- "https://www.googleapis.com/auth/pubsub"
- ]
- }
- }
- },
- "topics": {
- "methods": {
- "create": {
- "description": "Creates the given topic with the given name. See the\n\u003ca href=\"https://cloud.google.com/pubsub/docs/admin#resource_names\"\u003e\nresource name rules\u003c/a\u003e.",
- "flatPath": "v1/projects/{projectsId}/topics/{topicsId}",
- "httpMethod": "PUT",
- "id": "pubsub.projects.topics.create",
- "parameterOrder": [
- "name"
- ],
- "parameters": {
- "name": {
- "description": "The name of the topic. It must have the format\n`\"projects/{project}/topics/{topic}\"`. `{topic}` must start with a letter,\nand contain only letters (`[A-Za-z]`), numbers (`[0-9]`), dashes (`-`),\nunderscores (`_`), periods (`.`), tildes (`~`), plus (`+`) or percent\nsigns (`%`). It must be between 3 and 255 characters in length, and it\nmust not start with `\"goog\"`.",
- "location": "path",
- "pattern": "^projects/[^/]+/topics/[^/]+$",
- "required": true,
- "type": "string"
- }
- },
- "path": "v1/{+name}",
- "request": {
- "$ref": "Topic"
- },
- "response": {
- "$ref": "Topic"
- },
- "scopes": [
- "https://www.googleapis.com/auth/cloud-platform",
- "https://www.googleapis.com/auth/pubsub"
- ]
- },
- "delete": {
- "description": "Deletes the topic with the given name. Returns `NOT_FOUND` if the topic\ndoes not exist. After a topic is deleted, a new topic may be created with\nthe same name; this is an entirely new topic with none of the old\nconfiguration or subscriptions. Existing subscriptions to this topic are\nnot deleted, but their `topic` field is set to `_deleted-topic_`.",
- "flatPath": "v1/projects/{projectsId}/topics/{topicsId}",
- "httpMethod": "DELETE",
- "id": "pubsub.projects.topics.delete",
- "parameterOrder": [
- "topic"
- ],
- "parameters": {
- "topic": {
- "description": "Name of the topic to delete.\nFormat is `projects/{project}/topics/{topic}`.",
- "location": "path",
- "pattern": "^projects/[^/]+/topics/[^/]+$",
- "required": true,
- "type": "string"
- }
- },
- "path": "v1/{+topic}",
- "response": {
- "$ref": "Empty"
- },
- "scopes": [
- "https://www.googleapis.com/auth/cloud-platform",
- "https://www.googleapis.com/auth/pubsub"
- ]
- },
- "get": {
- "description": "Gets the configuration of a topic.",
- "flatPath": "v1/projects/{projectsId}/topics/{topicsId}",
- "httpMethod": "GET",
- "id": "pubsub.projects.topics.get",
- "parameterOrder": [
- "topic"
- ],
- "parameters": {
- "topic": {
- "description": "The name of the topic to get.\nFormat is `projects/{project}/topics/{topic}`.",
- "location": "path",
- "pattern": "^projects/[^/]+/topics/[^/]+$",
- "required": true,
- "type": "string"
- }
- },
- "path": "v1/{+topic}",
- "response": {
- "$ref": "Topic"
- },
- "scopes": [
- "https://www.googleapis.com/auth/cloud-platform",
- "https://www.googleapis.com/auth/pubsub"
- ]
- },
- "getIamPolicy": {
- "description": "Gets the access control policy for a resource.\nReturns an empty policy if the resource exists and does not have a policy\nset.",
- "flatPath": "v1/projects/{projectsId}/topics/{topicsId}:getIamPolicy",
- "httpMethod": "GET",
- "id": "pubsub.projects.topics.getIamPolicy",
- "parameterOrder": [
- "resource"
- ],
- "parameters": {
- "options.requestedPolicyVersion": {
- "description": "Optional. The policy format version to be returned.\n\nValid values are 0, 1, and 3. Requests specifying an invalid value will be\nrejected.\n\nRequests for policies with any conditional bindings must specify version 3.\nPolicies without any conditional bindings may specify any valid value or\nleave the field unset.",
- "format": "int32",
- "location": "query",
- "type": "integer"
- },
- "resource": {
- "description": "REQUIRED: The resource for which the policy is being requested.\nSee the operation documentation for the appropriate value for this field.",
- "location": "path",
- "pattern": "^projects/[^/]+/topics/[^/]+$",
- "required": true,
- "type": "string"
- }
- },
- "path": "v1/{+resource}:getIamPolicy",
- "response": {
- "$ref": "Policy"
- },
- "scopes": [
- "https://www.googleapis.com/auth/cloud-platform",
- "https://www.googleapis.com/auth/pubsub"
- ]
- },
- "list": {
- "description": "Lists matching topics.",
- "flatPath": "v1/projects/{projectsId}/topics",
- "httpMethod": "GET",
- "id": "pubsub.projects.topics.list",
- "parameterOrder": [
- "project"
- ],
- "parameters": {
- "pageSize": {
- "description": "Maximum number of topics to return.",
- "format": "int32",
- "location": "query",
- "type": "integer"
- },
- "pageToken": {
- "description": "The value returned by the last `ListTopicsResponse`; indicates that this is\na continuation of a prior `ListTopics` call, and that the system should\nreturn the next page of data.",
- "location": "query",
- "type": "string"
- },
- "project": {
- "description": "The name of the project in which to list topics.\nFormat is `projects/{project-id}`.",
- "location": "path",
- "pattern": "^projects/[^/]+$",
- "required": true,
- "type": "string"
- }
- },
- "path": "v1/{+project}/topics",
- "response": {
- "$ref": "ListTopicsResponse"
- },
- "scopes": [
- "https://www.googleapis.com/auth/cloud-platform",
- "https://www.googleapis.com/auth/pubsub"
- ]
- },
- "patch": {
- "description": "Updates an existing topic. Note that certain properties of a\ntopic are not modifiable.",
- "flatPath": "v1/projects/{projectsId}/topics/{topicsId}",
- "httpMethod": "PATCH",
- "id": "pubsub.projects.topics.patch",
- "parameterOrder": [
- "name"
- ],
- "parameters": {
- "name": {
- "description": "The name of the topic. It must have the format\n`\"projects/{project}/topics/{topic}\"`. `{topic}` must start with a letter,\nand contain only letters (`[A-Za-z]`), numbers (`[0-9]`), dashes (`-`),\nunderscores (`_`), periods (`.`), tildes (`~`), plus (`+`) or percent\nsigns (`%`). It must be between 3 and 255 characters in length, and it\nmust not start with `\"goog\"`.",
- "location": "path",
- "pattern": "^projects/[^/]+/topics/[^/]+$",
- "required": true,
- "type": "string"
- }
- },
- "path": "v1/{+name}",
- "request": {
- "$ref": "UpdateTopicRequest"
- },
- "response": {
- "$ref": "Topic"
- },
- "scopes": [
- "https://www.googleapis.com/auth/cloud-platform",
- "https://www.googleapis.com/auth/pubsub"
- ]
- },
- "publish": {
- "description": "Adds one or more messages to the topic. Returns `NOT_FOUND` if the topic\ndoes not exist.",
- "flatPath": "v1/projects/{projectsId}/topics/{topicsId}:publish",
- "httpMethod": "POST",
- "id": "pubsub.projects.topics.publish",
- "parameterOrder": [
- "topic"
- ],
- "parameters": {
- "topic": {
- "description": "The messages in the request will be published on this topic.\nFormat is `projects/{project}/topics/{topic}`.",
- "location": "path",
- "pattern": "^projects/[^/]+/topics/[^/]+$",
- "required": true,
- "type": "string"
- }
- },
- "path": "v1/{+topic}:publish",
- "request": {
- "$ref": "PublishRequest"
- },
- "response": {
- "$ref": "PublishResponse"
- },
- "scopes": [
- "https://www.googleapis.com/auth/cloud-platform",
- "https://www.googleapis.com/auth/pubsub"
- ]
- },
- "setIamPolicy": {
- "description": "Sets the access control policy on the specified resource. Replaces any\nexisting policy.\n\nCan return Public Errors: NOT_FOUND, INVALID_ARGUMENT and PERMISSION_DENIED",
- "flatPath": "v1/projects/{projectsId}/topics/{topicsId}:setIamPolicy",
- "httpMethod": "POST",
- "id": "pubsub.projects.topics.setIamPolicy",
- "parameterOrder": [
- "resource"
- ],
- "parameters": {
- "resource": {
- "description": "REQUIRED: The resource for which the policy is being specified.\nSee the operation documentation for the appropriate value for this field.",
- "location": "path",
- "pattern": "^projects/[^/]+/topics/[^/]+$",
- "required": true,
- "type": "string"
- }
- },
- "path": "v1/{+resource}:setIamPolicy",
- "request": {
- "$ref": "SetIamPolicyRequest"
- },
- "response": {
- "$ref": "Policy"
- },
- "scopes": [
- "https://www.googleapis.com/auth/cloud-platform",
- "https://www.googleapis.com/auth/pubsub"
- ]
- },
- "testIamPermissions": {
- "description": "Returns permissions that a caller has on the specified resource.\nIf the resource does not exist, this will return an empty set of\npermissions, not a NOT_FOUND error.\n\nNote: This operation is designed to be used for building permission-aware\nUIs and command-line tools, not for authorization checking. This operation\nmay \"fail open\" without warning.",
- "flatPath": "v1/projects/{projectsId}/topics/{topicsId}:testIamPermissions",
- "httpMethod": "POST",
- "id": "pubsub.projects.topics.testIamPermissions",
- "parameterOrder": [
- "resource"
- ],
- "parameters": {
- "resource": {
- "description": "REQUIRED: The resource for which the policy detail is being requested.\nSee the operation documentation for the appropriate value for this field.",
- "location": "path",
- "pattern": "^projects/[^/]+/topics/[^/]+$",
- "required": true,
- "type": "string"
- }
- },
- "path": "v1/{+resource}:testIamPermissions",
- "request": {
- "$ref": "TestIamPermissionsRequest"
- },
- "response": {
- "$ref": "TestIamPermissionsResponse"
- },
- "scopes": [
- "https://www.googleapis.com/auth/cloud-platform",
- "https://www.googleapis.com/auth/pubsub"
- ]
- }
- },
- "resources": {
- "snapshots": {
- "methods": {
- "list": {
- "description": "Lists the names of the snapshots on this topic. Snapshots are used in\n\u003ca href=\"https://cloud.google.com/pubsub/docs/replay-overview\"\u003eSeek\u003c/a\u003e\noperations, which allow\nyou to manage message acknowledgments in bulk. That is, you can set the\nacknowledgment state of messages in an existing subscription to the state\ncaptured by a snapshot.",
- "flatPath": "v1/projects/{projectsId}/topics/{topicsId}/snapshots",
- "httpMethod": "GET",
- "id": "pubsub.projects.topics.snapshots.list",
- "parameterOrder": [
- "topic"
- ],
- "parameters": {
- "pageSize": {
- "description": "Maximum number of snapshot names to return.",
- "format": "int32",
- "location": "query",
- "type": "integer"
- },
- "pageToken": {
- "description": "The value returned by the last `ListTopicSnapshotsResponse`; indicates\nthat this is a continuation of a prior `ListTopicSnapshots` call, and\nthat the system should return the next page of data.",
- "location": "query",
- "type": "string"
- },
- "topic": {
- "description": "The name of the topic that snapshots are attached to.\nFormat is `projects/{project}/topics/{topic}`.",
- "location": "path",
- "pattern": "^projects/[^/]+/topics/[^/]+$",
- "required": true,
- "type": "string"
- }
- },
- "path": "v1/{+topic}/snapshots",
- "response": {
- "$ref": "ListTopicSnapshotsResponse"
- },
- "scopes": [
- "https://www.googleapis.com/auth/cloud-platform",
- "https://www.googleapis.com/auth/pubsub"
- ]
- }
- }
- },
- "subscriptions": {
- "methods": {
- "list": {
- "description": "Lists the names of the subscriptions on this topic.",
- "flatPath": "v1/projects/{projectsId}/topics/{topicsId}/subscriptions",
- "httpMethod": "GET",
- "id": "pubsub.projects.topics.subscriptions.list",
- "parameterOrder": [
- "topic"
- ],
- "parameters": {
- "pageSize": {
- "description": "Maximum number of subscription names to return.",
- "format": "int32",
- "location": "query",
- "type": "integer"
- },
- "pageToken": {
- "description": "The value returned by the last `ListTopicSubscriptionsResponse`; indicates\nthat this is a continuation of a prior `ListTopicSubscriptions` call, and\nthat the system should return the next page of data.",
- "location": "query",
- "type": "string"
- },
- "topic": {
- "description": "The name of the topic that subscriptions are attached to.\nFormat is `projects/{project}/topics/{topic}`.",
- "location": "path",
- "pattern": "^projects/[^/]+/topics/[^/]+$",
- "required": true,
- "type": "string"
- }
- },
- "path": "v1/{+topic}/subscriptions",
- "response": {
- "$ref": "ListTopicSubscriptionsResponse"
- },
- "scopes": [
- "https://www.googleapis.com/auth/cloud-platform",
- "https://www.googleapis.com/auth/pubsub"
- ]
- }
- }
- }
- }
- }
- }
- }
- },
- "revision": "20191203",
- "rootUrl": "https://pubsub.googleapis.com/",
- "schemas": {
- "AcknowledgeRequest": {
- "description": "Request for the Acknowledge method.",
- "id": "AcknowledgeRequest",
- "properties": {
- "ackIds": {
- "description": "The acknowledgment ID for the messages being acknowledged that was returned\nby the Pub/Sub system in the `Pull` response. Must not be empty.",
- "items": {
- "type": "string"
- },
- "type": "array"
- }
- },
- "type": "object"
- },
- "Binding": {
- "description": "Associates `members` with a `role`.",
- "id": "Binding",
- "properties": {
- "condition": {
- "$ref": "Expr",
- "description": "The condition that is associated with this binding.\nNOTE: An unsatisfied condition will not allow user access via current\nbinding. Different bindings, including their conditions, are examined\nindependently."
- },
- "members": {
- "description": "Specifies the identities requesting access for a Cloud Platform resource.\n`members` can have the following values:\n\n* `allUsers`: A special identifier that represents anyone who is\n on the internet; with or without a Google account.\n\n* `allAuthenticatedUsers`: A special identifier that represents anyone\n who is authenticated with a Google account or a service account.\n\n* `user:{emailid}`: An email address that represents a specific Google\n account. For example, `alice@example.com` .\n\n\n* `serviceAccount:{emailid}`: An email address that represents a service\n account. For example, `my-other-app@appspot.gserviceaccount.com`.\n\n* `group:{emailid}`: An email address that represents a Google group.\n For example, `admins@example.com`.\n\n* `deleted:user:{emailid}?uid={uniqueid}`: An email address (plus unique\n identifier) representing a user that has been recently deleted. For\n example, `alice@example.com?uid=123456789012345678901`. If the user is\n recovered, this value reverts to `user:{emailid}` and the recovered user\n retains the role in the binding.\n\n* `deleted:serviceAccount:{emailid}?uid={uniqueid}`: An email address (plus\n unique identifier) representing a service account that has been recently\n deleted. For example,\n `my-other-app@appspot.gserviceaccount.com?uid=123456789012345678901`.\n If the service account is undeleted, this value reverts to\n `serviceAccount:{emailid}` and the undeleted service account retains the\n role in the binding.\n\n* `deleted:group:{emailid}?uid={uniqueid}`: An email address (plus unique\n identifier) representing a Google group that has been recently\n deleted. For example, `admins@example.com?uid=123456789012345678901`. If\n the group is recovered, this value reverts to `group:{emailid}` and the\n recovered group retains the role in the binding.\n\n\n* `domain:{domain}`: The G Suite domain (primary) that represents all the\n users of that domain. For example, `google.com` or `example.com`.\n\n",
- "items": {
- "type": "string"
- },
- "type": "array"
- },
- "role": {
- "description": "Role that is assigned to `members`.\nFor example, `roles/viewer`, `roles/editor`, or `roles/owner`.",
- "type": "string"
- }
- },
- "type": "object"
- },
- "CreateSnapshotRequest": {
- "description": "Request for the `CreateSnapshot` method.",
- "id": "CreateSnapshotRequest",
- "properties": {
- "labels": {
- "additionalProperties": {
- "type": "string"
- },
- "description": "See \u003ca href=\"https://cloud.google.com/pubsub/docs/labels\"\u003e Creating and\nmanaging labels\u003c/a\u003e.",
- "type": "object"
- },
- "subscription": {
- "description": "The subscription whose backlog the snapshot retains.\nSpecifically, the created snapshot is guaranteed to retain:\n (a) The existing backlog on the subscription. More precisely, this is\n defined as the messages in the subscription's backlog that are\n unacknowledged upon the successful completion of the\n `CreateSnapshot` request; as well as:\n (b) Any messages published to the subscription's topic following the\n successful completion of the CreateSnapshot request.\nFormat is `projects/{project}/subscriptions/{sub}`.",
- "type": "string"
- }
- },
- "type": "object"
- },
- "Empty": {
- "description": "A generic empty message that you can re-use to avoid defining duplicated\nempty messages in your APIs. A typical example is to use it as the request\nor the response type of an API method. For instance:\n\n service Foo {\n rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty);\n }\n\nThe JSON representation for `Empty` is empty JSON object `{}`.",
- "id": "Empty",
- "properties": {},
- "type": "object"
- },
- "ExpirationPolicy": {
- "description": "A policy that specifies the conditions for resource expiration (i.e.,\nautomatic resource deletion).",
- "id": "ExpirationPolicy",
- "properties": {
- "ttl": {
- "description": "Specifies the \"time-to-live\" duration for an associated resource. The\nresource expires if it is not active for a period of `ttl`. The definition\nof \"activity\" depends on the type of the associated resource. The minimum\nand maximum allowed values for `ttl` depend on the type of the associated\nresource, as well. If `ttl` is not set, the associated resource never\nexpires.",
- "format": "google-duration",
- "type": "string"
- }
- },
- "type": "object"
- },
- "Expr": {
- "description": "Represents an expression text. Example:\n\n title: \"User account presence\"\n description: \"Determines whether the request has a user account\"\n expression: \"size(request.user) \u003e 0\"",
- "id": "Expr",
- "properties": {
- "description": {
- "description": "An optional description of the expression. This is a longer text which\ndescribes the expression, e.g. when hovered over it in a UI.",
- "type": "string"
- },
- "expression": {
- "description": "Textual representation of an expression in\nCommon Expression Language syntax.\n\nThe application context of the containing message determines which\nwell-known feature set of CEL is supported.",
- "type": "string"
- },
- "location": {
- "description": "An optional string indicating the location of the expression for error\nreporting, e.g. a file name and a position in the file.",
- "type": "string"
- },
- "title": {
- "description": "An optional title for the expression, i.e. a short string describing\nits purpose. This can be used e.g. in UIs which allow to enter the\nexpression.",
- "type": "string"
- }
- },
- "type": "object"
- },
- "ListSnapshotsResponse": {
- "description": "Response for the `ListSnapshots` method.",
- "id": "ListSnapshotsResponse",
- "properties": {
- "nextPageToken": {
- "description": "If not empty, indicates that there may be more snapshot that match the\nrequest; this value should be passed in a new `ListSnapshotsRequest`.",
- "type": "string"
- },
- "snapshots": {
- "description": "The resulting snapshots.",
- "items": {
- "$ref": "Snapshot"
- },
- "type": "array"
- }
- },
- "type": "object"
- },
- "ListSubscriptionsResponse": {
- "description": "Response for the `ListSubscriptions` method.",
- "id": "ListSubscriptionsResponse",
- "properties": {
- "nextPageToken": {
- "description": "If not empty, indicates that there may be more subscriptions that match\nthe request; this value should be passed in a new\n`ListSubscriptionsRequest` to get more subscriptions.",
- "type": "string"
- },
- "subscriptions": {
- "description": "The subscriptions that match the request.",
- "items": {
- "$ref": "Subscription"
- },
- "type": "array"
- }
- },
- "type": "object"
- },
- "ListTopicSnapshotsResponse": {
- "description": "Response for the `ListTopicSnapshots` method.",
- "id": "ListTopicSnapshotsResponse",
- "properties": {
- "nextPageToken": {
- "description": "If not empty, indicates that there may be more snapshots that match\nthe request; this value should be passed in a new\n`ListTopicSnapshotsRequest` to get more snapshots.",
- "type": "string"
- },
- "snapshots": {
- "description": "The names of the snapshots that match the request.",
- "items": {
- "type": "string"
- },
- "type": "array"
- }
- },
- "type": "object"
- },
- "ListTopicSubscriptionsResponse": {
- "description": "Response for the `ListTopicSubscriptions` method.",
- "id": "ListTopicSubscriptionsResponse",
- "properties": {
- "nextPageToken": {
- "description": "If not empty, indicates that there may be more subscriptions that match\nthe request; this value should be passed in a new\n`ListTopicSubscriptionsRequest` to get more subscriptions.",
- "type": "string"
- },
- "subscriptions": {
- "description": "The names of the subscriptions that match the request.",
- "items": {
- "type": "string"
- },
- "type": "array"
- }
- },
- "type": "object"
- },
- "ListTopicsResponse": {
- "description": "Response for the `ListTopics` method.",
- "id": "ListTopicsResponse",
- "properties": {
- "nextPageToken": {
- "description": "If not empty, indicates that there may be more topics that match the\nrequest; this value should be passed in a new `ListTopicsRequest`.",
- "type": "string"
- },
- "topics": {
- "description": "The resulting topics.",
- "items": {
- "$ref": "Topic"
- },
- "type": "array"
- }
- },
- "type": "object"
- },
- "MessageStoragePolicy": {
- "id": "MessageStoragePolicy",
- "properties": {
- "allowedPersistenceRegions": {
- "description": "A list of IDs of GCP regions where messages that are published to the topic\nmay be persisted in storage. Messages published by publishers running in\nnon-allowed GCP regions (or running outside of GCP altogether) will be\nrouted for storage in one of the allowed regions. An empty list means that\nno regions are allowed, and is not a valid configuration.",
- "items": {
- "type": "string"
- },
- "type": "array"
- }
- },
- "type": "object"
- },
- "ModifyAckDeadlineRequest": {
- "description": "Request for the ModifyAckDeadline method.",
- "id": "ModifyAckDeadlineRequest",
- "properties": {
- "ackDeadlineSeconds": {
- "description": "The new ack deadline with respect to the time this request was sent to\nthe Pub/Sub system. For example, if the value is 10, the new\nack deadline will expire 10 seconds after the `ModifyAckDeadline` call\nwas made. Specifying zero might immediately make the message available for\ndelivery to another subscriber client. This typically results in an\nincrease in the rate of message redeliveries (that is, duplicates).\nThe minimum deadline you can specify is 0 seconds.\nThe maximum deadline you can specify is 600 seconds (10 minutes).",
- "format": "int32",
- "type": "integer"
- },
- "ackIds": {
- "description": "List of acknowledgment IDs.",
- "items": {
- "type": "string"
- },
- "type": "array"
- }
- },
- "type": "object"
- },
- "ModifyPushConfigRequest": {
- "description": "Request for the ModifyPushConfig method.",
- "id": "ModifyPushConfigRequest",
- "properties": {
- "pushConfig": {
- "$ref": "PushConfig",
- "description": "The push configuration for future deliveries.\n\nAn empty `pushConfig` indicates that the Pub/Sub system should\nstop pushing messages from the given subscription and allow\nmessages to be pulled and acknowledged - effectively pausing\nthe subscription if `Pull` or `StreamingPull` is not called."
- }
- },
- "type": "object"
- },
- "OidcToken": {
- "description": "Contains information needed for generating an\n[OpenID Connect\ntoken](https://developers.google.com/identity/protocols/OpenIDConnect).",
- "id": "OidcToken",
- "properties": {
- "audience": {
- "description": "Audience to be used when generating OIDC token. The audience claim\nidentifies the recipients that the JWT is intended for. The audience\nvalue is a single case-sensitive string. Having multiple values (array)\nfor the audience field is not supported. More info about the OIDC JWT\ntoken audience here: https://tools.ietf.org/html/rfc7519#section-4.1.3\nNote: if not specified, the Push endpoint URL will be used.",
- "type": "string"
- },
- "serviceAccountEmail": {
- "description": "[Service account\nemail](https://cloud.google.com/iam/docs/service-accounts)\nto be used for generating the OIDC token. The caller (for\nCreateSubscription, UpdateSubscription, and ModifyPushConfig RPCs) must\nhave the iam.serviceAccounts.actAs permission for the service account.",
- "type": "string"
- }
- },
- "type": "object"
- },
- "Policy": {
- "description": "An Identity and Access Management (IAM) policy, which specifies access\ncontrols for Google Cloud resources.\n\n\nA `Policy` is a collection of `bindings`. A `binding` binds one or more\n`members` to a single `role`. Members can be user accounts, service accounts,\nGoogle groups, and domains (such as G Suite). A `role` is a named list of\npermissions; each `role` can be an IAM predefined role or a user-created\ncustom role.\n\nOptionally, a `binding` can specify a `condition`, which is a logical\nexpression that allows access to a resource only if the expression evaluates\nto `true`. A condition can add constraints based on attributes of the\nrequest, the resource, or both.\n\n**JSON example:**\n\n {\n \"bindings\": [\n {\n \"role\": \"roles/resourcemanager.organizationAdmin\",\n \"members\": [\n \"user:mike@example.com\",\n \"group:admins@example.com\",\n \"domain:google.com\",\n \"serviceAccount:my-project-id@appspot.gserviceaccount.com\"\n ]\n },\n {\n \"role\": \"roles/resourcemanager.organizationViewer\",\n \"members\": [\"user:eve@example.com\"],\n \"condition\": {\n \"title\": \"expirable access\",\n \"description\": \"Does not grant access after Sep 2020\",\n \"expression\": \"request.time \u003c timestamp('2020-10-01T00:00:00.000Z')\",\n }\n }\n ],\n \"etag\": \"BwWWja0YfJA=\",\n \"version\": 3\n }\n\n**YAML example:**\n\n bindings:\n - members:\n - user:mike@example.com\n - group:admins@example.com\n - domain:google.com\n - serviceAccount:my-project-id@appspot.gserviceaccount.com\n role: roles/resourcemanager.organizationAdmin\n - members:\n - user:eve@example.com\n role: roles/resourcemanager.organizationViewer\n condition:\n title: expirable access\n description: Does not grant access after Sep 2020\n expression: request.time \u003c timestamp('2020-10-01T00:00:00.000Z')\n - etag: BwWWja0YfJA=\n - version: 3\n\nFor a description of IAM and its features, see the\n[IAM documentation](https://cloud.google.com/iam/docs/).",
- "id": "Policy",
- "properties": {
- "bindings": {
- "description": "Associates a list of `members` to a `role`. Optionally, may specify a\n`condition` that determines how and when the `bindings` are applied. Each\nof the `bindings` must contain at least one member.",
- "items": {
- "$ref": "Binding"
- },
- "type": "array"
- },
- "etag": {
- "description": "`etag` is used for optimistic concurrency control as a way to help\nprevent simultaneous updates of a policy from overwriting each other.\nIt is strongly suggested that systems make use of the `etag` in the\nread-modify-write cycle to perform policy updates in order to avoid race\nconditions: An `etag` is returned in the response to `getIamPolicy`, and\nsystems are expected to put that etag in the request to `setIamPolicy` to\nensure that their change will be applied to the same version of the policy.\n\n**Important:** If you use IAM Conditions, you must include the `etag` field\nwhenever you call `setIamPolicy`. If you omit this field, then IAM allows\nyou to overwrite a version `3` policy with a version `1` policy, and all of\nthe conditions in the version `3` policy are lost.",
- "format": "byte",
- "type": "string"
- },
- "version": {
- "description": "Specifies the format of the policy.\n\nValid values are `0`, `1`, and `3`. Requests that specify an invalid value\nare rejected.\n\nAny operation that affects conditional role bindings must specify version\n`3`. This requirement applies to the following operations:\n\n* Getting a policy that includes a conditional role binding\n* Adding a conditional role binding to a policy\n* Changing a conditional role binding in a policy\n* Removing any role binding, with or without a condition, from a policy\n that includes conditions\n\n**Important:** If you use IAM Conditions, you must include the `etag` field\nwhenever you call `setIamPolicy`. If you omit this field, then IAM allows\nyou to overwrite a version `3` policy with a version `1` policy, and all of\nthe conditions in the version `3` policy are lost.\n\nIf a policy does not include any conditions, operations on that policy may\nspecify any valid version or leave the field unset.",
- "format": "int32",
- "type": "integer"
- }
- },
- "type": "object"
- },
- "PublishRequest": {
- "description": "Request for the Publish method.",
- "id": "PublishRequest",
- "properties": {
- "messages": {
- "description": "The messages to publish.",
- "items": {
- "$ref": "PubsubMessage"
- },
- "type": "array"
- }
- },
- "type": "object"
- },
- "PublishResponse": {
- "description": "Response for the `Publish` method.",
- "id": "PublishResponse",
- "properties": {
- "messageIds": {
- "description": "The server-assigned ID of each published message, in the same order as\nthe messages in the request. IDs are guaranteed to be unique within\nthe topic.",
- "items": {
- "type": "string"
- },
- "type": "array"
- }
- },
- "type": "object"
- },
- "PubsubMessage": {
- "description": "A message that is published by publishers and consumed by subscribers. The\nmessage must contain either a non-empty data field or at least one attribute.\nNote that client libraries represent this object differently\ndepending on the language. See the corresponding\n\u003ca href=\"https://cloud.google.com/pubsub/docs/reference/libraries\"\u003eclient\nlibrary documentation\u003c/a\u003e for more information. See\n\u003ca href=\"https://cloud.google.com/pubsub/quotas\"\u003eQuotas and limits\u003c/a\u003e\nfor more information about message limits.",
- "id": "PubsubMessage",
- "properties": {
- "attributes": {
- "additionalProperties": {
- "type": "string"
- },
- "description": "Attributes for this message. If this field is empty, the message must\ncontain non-empty data.",
- "type": "object"
- },
- "data": {
- "description": "The message data field. If this field is empty, the message must contain\nat least one attribute.",
- "format": "byte",
- "type": "string"
- },
- "messageId": {
- "description": "ID of this message, assigned by the server when the message is published.\nGuaranteed to be unique within the topic. This value may be read by a\nsubscriber that receives a `PubsubMessage` via a `Pull` call or a push\ndelivery. It must not be populated by the publisher in a `Publish` call.",
- "type": "string"
- },
- "publishTime": {
- "description": "The time at which the message was published, populated by the server when\nit receives the `Publish` call. It must not be populated by the\npublisher in a `Publish` call.",
- "format": "google-datetime",
- "type": "string"
- }
- },
- "type": "object"
- },
- "PullRequest": {
- "description": "Request for the `Pull` method.",
- "id": "PullRequest",
- "properties": {
- "maxMessages": {
- "description": "The maximum number of messages to return for this request. Must be a\npositive integer. The Pub/Sub system may return fewer than the number\nspecified.",
- "format": "int32",
- "type": "integer"
- },
- "returnImmediately": {
- "description": "If this field set to true, the system will respond immediately even if\nit there are no messages available to return in the `Pull` response.\nOtherwise, the system may wait (for a bounded amount of time) until at\nleast one message is available, rather than returning no messages.",
- "type": "boolean"
- }
- },
- "type": "object"
- },
- "PullResponse": {
- "description": "Response for the `Pull` method.",
- "id": "PullResponse",
- "properties": {
- "receivedMessages": {
- "description": "Received Pub/Sub messages. The list will be empty if there are no more\nmessages available in the backlog. For JSON, the response can be entirely\nempty. The Pub/Sub system may return fewer than the `maxMessages` requested\neven if there are more messages available in the backlog.",
- "items": {
- "$ref": "ReceivedMessage"
- },
- "type": "array"
- }
- },
- "type": "object"
- },
- "PushConfig": {
- "description": "Configuration for a push delivery endpoint.",
- "id": "PushConfig",
- "properties": {
- "attributes": {
- "additionalProperties": {
- "type": "string"
- },
- "description": "Endpoint configuration attributes that can be used to control different\naspects of the message delivery.\n\nThe only currently supported attribute is `x-goog-version`, which you can\nuse to change the format of the pushed message. This attribute\nindicates the version of the data expected by the endpoint. This\ncontrols the shape of the pushed message (i.e., its fields and metadata).\n\nIf not present during the `CreateSubscription` call, it will default to\nthe version of the Pub/Sub API used to make such call. If not present in a\n`ModifyPushConfig` call, its value will not be changed. `GetSubscription`\ncalls will always return a valid version, even if the subscription was\ncreated without this attribute.\n\nThe only supported values for the `x-goog-version` attribute are:\n\n* `v1beta1`: uses the push format defined in the v1beta1 Pub/Sub API.\n* `v1` or `v1beta2`: uses the push format defined in the v1 Pub/Sub API.\n\nFor example:\n\u003cpre\u003e\u003ccode\u003eattributes { \"x-goog-version\": \"v1\" } \u003c/code\u003e\u003c/pre\u003e",
- "type": "object"
- },
- "oidcToken": {
- "$ref": "OidcToken",
- "description": "If specified, Pub/Sub will generate and attach an OIDC JWT token as an\n`Authorization` header in the HTTP request for every pushed message."
- },
- "pushEndpoint": {
- "description": "A URL locating the endpoint to which messages should be pushed.\nFor example, a Webhook endpoint might use \"https://example.com/push\".",
- "type": "string"
- }
- },
- "type": "object"
- },
- "ReceivedMessage": {
- "description": "A message and its corresponding acknowledgment ID.",
- "id": "ReceivedMessage",
- "properties": {
- "ackId": {
- "description": "This ID can be used to acknowledge the received message.",
- "type": "string"
- },
- "message": {
- "$ref": "PubsubMessage",
- "description": "The message."
- }
- },
- "type": "object"
- },
- "SeekRequest": {
- "description": "Request for the `Seek` method.",
- "id": "SeekRequest",
- "properties": {
- "snapshot": {
- "description": "The snapshot to seek to. The snapshot's topic must be the same as that of\nthe provided subscription.\nFormat is `projects/{project}/snapshots/{snap}`.",
- "type": "string"
- },
- "time": {
- "description": "The time to seek to.\nMessages retained in the subscription that were published before this\ntime are marked as acknowledged, and messages retained in the\nsubscription that were published after this time are marked as\nunacknowledged. Note that this operation affects only those messages\nretained in the subscription (configured by the combination of\n`message_retention_duration` and `retain_acked_messages`). For example,\nif `time` corresponds to a point before the message retention\nwindow (or to a point before the system's notion of the subscription\ncreation time), only retained messages will be marked as unacknowledged,\nand already-expunged messages will not be restored.",
- "format": "google-datetime",
- "type": "string"
- }
- },
- "type": "object"
- },
- "SeekResponse": {
- "description": "Response for the `Seek` method (this response is empty).",
- "id": "SeekResponse",
- "properties": {},
- "type": "object"
- },
- "SetIamPolicyRequest": {
- "description": "Request message for `SetIamPolicy` method.",
- "id": "SetIamPolicyRequest",
- "properties": {
- "policy": {
- "$ref": "Policy",
- "description": "REQUIRED: The complete policy to be applied to the `resource`. The size of\nthe policy is limited to a few 10s of KB. An empty policy is a\nvalid policy but certain Cloud Platform services (such as Projects)\nmight reject them."
- }
- },
- "type": "object"
- },
- "Snapshot": {
- "description": "A snapshot resource. Snapshots are used in\n\u003ca href=\"https://cloud.google.com/pubsub/docs/replay-overview\"\u003eSeek\u003c/a\u003e\noperations, which allow\nyou to manage message acknowledgments in bulk. That is, you can set the\nacknowledgment state of messages in an existing subscription to the state\ncaptured by a snapshot.",
- "id": "Snapshot",
- "properties": {
- "expireTime": {
- "description": "The snapshot is guaranteed to exist up until this time.\nA newly-created snapshot expires no later than 7 days from the time of its\ncreation. Its exact lifetime is determined at creation by the existing\nbacklog in the source subscription. Specifically, the lifetime of the\nsnapshot is `7 days - (age of oldest unacked message in the subscription)`.\nFor example, consider a subscription whose oldest unacked message is 3 days\nold. If a snapshot is created from this subscription, the snapshot -- which\nwill always capture this 3-day-old backlog as long as the snapshot\nexists -- will expire in 4 days. The service will refuse to create a\nsnapshot that would expire in less than 1 hour after creation.",
- "format": "google-datetime",
- "type": "string"
- },
- "labels": {
- "additionalProperties": {
- "type": "string"
- },
- "description": "See \u003ca href=\"https://cloud.google.com/pubsub/docs/labels\"\u003e Creating and\nmanaging labels\u003c/a\u003e.",
- "type": "object"
- },
- "name": {
- "description": "The name of the snapshot.",
- "type": "string"
- },
- "topic": {
- "description": "The name of the topic from which this snapshot is retaining messages.",
- "type": "string"
- }
- },
- "type": "object"
- },
- "Subscription": {
- "description": "A subscription resource.",
- "id": "Subscription",
- "properties": {
- "ackDeadlineSeconds": {
- "description": "The approximate amount of time (on a best-effort basis) Pub/Sub waits for\nthe subscriber to acknowledge receipt before resending the message. In the\ninterval after the message is delivered and before it is acknowledged, it\nis considered to be \u003ci\u003eoutstanding\u003c/i\u003e. During that time period, the\nmessage will not be redelivered (on a best-effort basis).\n\nFor pull subscriptions, this value is used as the initial value for the ack\ndeadline. To override this value for a given message, call\n`ModifyAckDeadline` with the corresponding `ack_id` if using\nnon-streaming pull or send the `ack_id` in a\n`StreamingModifyAckDeadlineRequest` if using streaming pull.\nThe minimum custom deadline you can specify is 10 seconds.\nThe maximum custom deadline you can specify is 600 seconds (10 minutes).\nIf this parameter is 0, a default value of 10 seconds is used.\n\nFor push delivery, this value is also used to set the request timeout for\nthe call to the push endpoint.\n\nIf the subscriber never acknowledges the message, the Pub/Sub\nsystem will eventually redeliver the message.",
- "format": "int32",
- "type": "integer"
- },
- "expirationPolicy": {
- "$ref": "ExpirationPolicy",
- "description": "A policy that specifies the conditions for this subscription's expiration.\nA subscription is considered active as long as any connected subscriber is\nsuccessfully consuming messages from the subscription or is issuing\noperations on the subscription. If `expiration_policy` is not set, a\n*default policy* with `ttl` of 31 days will be used. The minimum allowed\nvalue for `expiration_policy.ttl` is 1 day."
- },
- "labels": {
- "additionalProperties": {
- "type": "string"
- },
- "description": "See \u003ca href=\"https://cloud.google.com/pubsub/docs/labels\"\u003e Creating and\nmanaging labels\u003c/a\u003e.",
- "type": "object"
- },
- "messageRetentionDuration": {
- "description": "How long to retain unacknowledged messages in the subscription's backlog,\nfrom the moment a message is published.\nIf `retain_acked_messages` is true, then this also configures the retention\nof acknowledged messages, and thus configures how far back in time a `Seek`\ncan be done. Defaults to 7 days. Cannot be more than 7 days or less than 10\nminutes.",
- "format": "google-duration",
- "type": "string"
- },
- "name": {
- "description": "The name of the subscription. It must have the format\n`\"projects/{project}/subscriptions/{subscription}\"`. `{subscription}` must\nstart with a letter, and contain only letters (`[A-Za-z]`), numbers\n(`[0-9]`), dashes (`-`), underscores (`_`), periods (`.`), tildes (`~`),\nplus (`+`) or percent signs (`%`). It must be between 3 and 255 characters\nin length, and it must not start with `\"goog\"`.",
- "type": "string"
- },
- "pushConfig": {
- "$ref": "PushConfig",
- "description": "If push delivery is used with this subscription, this field is\nused to configure it. An empty `pushConfig` signifies that the subscriber\nwill pull and ack messages using API methods."
- },
- "retainAckedMessages": {
- "description": "Indicates whether to retain acknowledged messages. If true, then\nmessages are not expunged from the subscription's backlog, even if they are\nacknowledged, until they fall out of the `message_retention_duration`\nwindow. This must be true if you would like to\n\u003ca\nhref=\"https://cloud.google.com/pubsub/docs/replay-overview#seek_to_a_time\"\u003e\nSeek to a timestamp\u003c/a\u003e.",
- "type": "boolean"
- },
- "topic": {
- "description": "The name of the topic from which this subscription is receiving messages.\nFormat is `projects/{project}/topics/{topic}`.\nThe value of this field will be `_deleted-topic_` if the topic has been\ndeleted.",
- "type": "string"
- }
- },
- "type": "object"
- },
- "TestIamPermissionsRequest": {
- "description": "Request message for `TestIamPermissions` method.",
- "id": "TestIamPermissionsRequest",
- "properties": {
- "permissions": {
- "description": "The set of permissions to check for the `resource`. Permissions with\nwildcards (such as '*' or 'storage.*') are not allowed. For more\ninformation see\n[IAM Overview](https://cloud.google.com/iam/docs/overview#permissions).",
- "items": {
- "type": "string"
- },
- "type": "array"
- }
- },
- "type": "object"
- },
- "TestIamPermissionsResponse": {
- "description": "Response message for `TestIamPermissions` method.",
- "id": "TestIamPermissionsResponse",
- "properties": {
- "permissions": {
- "description": "A subset of `TestPermissionsRequest.permissions` that the caller is\nallowed.",
- "items": {
- "type": "string"
- },
- "type": "array"
- }
- },
- "type": "object"
- },
- "Topic": {
- "description": "A topic resource.",
- "id": "Topic",
- "properties": {
- "kmsKeyName": {
- "description": "The resource name of the Cloud KMS CryptoKey to be used to protect access\nto messages published on this topic.\n\nThe expected format is `projects/*/locations/*/keyRings/*/cryptoKeys/*`.",
- "type": "string"
- },
- "labels": {
- "additionalProperties": {
- "type": "string"
- },
- "description": "See \u003ca href=\"https://cloud.google.com/pubsub/docs/labels\"\u003e Creating and\nmanaging labels\u003c/a\u003e.",
- "type": "object"
- },
- "messageStoragePolicy": {
- "$ref": "MessageStoragePolicy",
- "description": "Policy constraining the set of Google Cloud Platform regions where messages\npublished to the topic may be stored. If not present, then no constraints\nare in effect."
- },
- "name": {
- "description": "The name of the topic. It must have the format\n`\"projects/{project}/topics/{topic}\"`. `{topic}` must start with a letter,\nand contain only letters (`[A-Za-z]`), numbers (`[0-9]`), dashes (`-`),\nunderscores (`_`), periods (`.`), tildes (`~`), plus (`+`) or percent\nsigns (`%`). It must be between 3 and 255 characters in length, and it\nmust not start with `\"goog\"`.",
- "type": "string"
- }
- },
- "type": "object"
- },
- "UpdateSnapshotRequest": {
- "description": "Request for the UpdateSnapshot method.",
- "id": "UpdateSnapshotRequest",
- "properties": {
- "snapshot": {
- "$ref": "Snapshot",
- "description": "The updated snapshot object."
- },
- "updateMask": {
- "description": "Indicates which fields in the provided snapshot to update.\nMust be specified and non-empty.",
- "format": "google-fieldmask",
- "type": "string"
- }
- },
- "type": "object"
- },
- "UpdateSubscriptionRequest": {
- "description": "Request for the UpdateSubscription method.",
- "id": "UpdateSubscriptionRequest",
- "properties": {
- "subscription": {
- "$ref": "Subscription",
- "description": "The updated subscription object."
- },
- "updateMask": {
- "description": "Indicates which fields in the provided subscription to update.\nMust be specified and non-empty.",
- "format": "google-fieldmask",
- "type": "string"
- }
- },
- "type": "object"
- },
- "UpdateTopicRequest": {
- "description": "Request for the UpdateTopic method.",
- "id": "UpdateTopicRequest",
- "properties": {
- "topic": {
- "$ref": "Topic",
- "description": "The updated topic object."
- },
- "updateMask": {
- "description": "Indicates which fields in the provided topic to update. Must be specified\nand non-empty. Note that if `update_mask` contains\n\"message_storage_policy\" then the new value will be determined based on the\npolicy configured at the project or organization level. The\n`message_storage_policy` must not be set in the `topic` provided above.",
- "format": "google-fieldmask",
- "type": "string"
- }
- },
- "type": "object"
- }
- },
- "servicePath": "",
- "title": "Cloud Pub/Sub API",
- "version": "v1"
-}
\ No newline at end of file
diff --git a/vendor/google.golang.org/api/pubsub/v1/pubsub-gen.go b/vendor/google.golang.org/api/pubsub/v1/pubsub-gen.go
deleted file mode 100644
index c9ff529335a..00000000000
--- a/vendor/google.golang.org/api/pubsub/v1/pubsub-gen.go
+++ /dev/null
@@ -1,6938 +0,0 @@
-// Copyright 2019 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 pubsub provides access to the Cloud Pub/Sub API.
-//
-// This package is DEPRECATED. Use package cloud.google.com/go/pubsub instead.
-//
-// For product documentation, see: https://cloud.google.com/pubsub/docs
-//
-// Creating a client
-//
-// Usage example:
-//
-// import "google.golang.org/api/pubsub/v1"
-// ...
-// ctx := context.Background()
-// pubsubService, err := pubsub.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:
-//
-// pubsubService, err := pubsub.NewService(ctx, option.WithScopes(pubsub.PubsubScope))
-//
-// To use an API key for authentication (note: some APIs do not support API keys), use option.WithAPIKey:
-//
-// pubsubService, err := pubsub.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, ...)
-// pubsubService, err := pubsub.NewService(ctx, option.WithTokenSource(config.TokenSource(ctx, token)))
-//
-// See https://godoc.org/google.golang.org/api/option/ for details on options.
-package pubsub // import "google.golang.org/api/pubsub/v1"
-
-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 = "pubsub:v1"
-const apiName = "pubsub"
-const apiVersion = "v1"
-const basePath = "https://pubsub.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 and manage Pub/Sub topics and subscriptions
- PubsubScope = "https://www.googleapis.com/auth/pubsub"
-)
-
-// 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/pubsub",
- )
- // 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.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.Snapshots = NewProjectsSnapshotsService(s)
- rs.Subscriptions = NewProjectsSubscriptionsService(s)
- rs.Topics = NewProjectsTopicsService(s)
- return rs
-}
-
-type ProjectsService struct {
- s *Service
-
- Snapshots *ProjectsSnapshotsService
-
- Subscriptions *ProjectsSubscriptionsService
-
- Topics *ProjectsTopicsService
-}
-
-func NewProjectsSnapshotsService(s *Service) *ProjectsSnapshotsService {
- rs := &ProjectsSnapshotsService{s: s}
- return rs
-}
-
-type ProjectsSnapshotsService struct {
- s *Service
-}
-
-func NewProjectsSubscriptionsService(s *Service) *ProjectsSubscriptionsService {
- rs := &ProjectsSubscriptionsService{s: s}
- return rs
-}
-
-type ProjectsSubscriptionsService struct {
- s *Service
-}
-
-func NewProjectsTopicsService(s *Service) *ProjectsTopicsService {
- rs := &ProjectsTopicsService{s: s}
- rs.Snapshots = NewProjectsTopicsSnapshotsService(s)
- rs.Subscriptions = NewProjectsTopicsSubscriptionsService(s)
- return rs
-}
-
-type ProjectsTopicsService struct {
- s *Service
-
- Snapshots *ProjectsTopicsSnapshotsService
-
- Subscriptions *ProjectsTopicsSubscriptionsService
-}
-
-func NewProjectsTopicsSnapshotsService(s *Service) *ProjectsTopicsSnapshotsService {
- rs := &ProjectsTopicsSnapshotsService{s: s}
- return rs
-}
-
-type ProjectsTopicsSnapshotsService struct {
- s *Service
-}
-
-func NewProjectsTopicsSubscriptionsService(s *Service) *ProjectsTopicsSubscriptionsService {
- rs := &ProjectsTopicsSubscriptionsService{s: s}
- return rs
-}
-
-type ProjectsTopicsSubscriptionsService struct {
- s *Service
-}
-
-// AcknowledgeRequest: Request for the Acknowledge method.
-type AcknowledgeRequest struct {
- // AckIds: The acknowledgment ID for the messages being acknowledged
- // that was returned
- // by the Pub/Sub system in the `Pull` response. Must not be empty.
- AckIds []string `json:"ackIds,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "AckIds") 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. "AckIds") 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 *AcknowledgeRequest) MarshalJSON() ([]byte, error) {
- type NoMethod AcknowledgeRequest
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
-}
-
-// Binding: Associates `members` with a `role`.
-type Binding struct {
- // Condition: The condition that is associated with this binding.
- // NOTE: An unsatisfied condition will not allow user access via
- // current
- // binding. Different bindings, including their conditions, are
- // examined
- // independently.
- Condition *Expr `json:"condition,omitempty"`
-
- // Members: Specifies the identities requesting access for a Cloud
- // Platform resource.
- // `members` can have the following values:
- //
- // * `allUsers`: A special identifier that represents anyone who is
- // on the internet; with or without a Google account.
- //
- // * `allAuthenticatedUsers`: A special identifier that represents
- // anyone
- // who is authenticated with a Google account or a service
- // account.
- //
- // * `user:{emailid}`: An email address that represents a specific
- // Google
- // account. For example, `alice@example.com` .
- //
- //
- // * `serviceAccount:{emailid}`: An email address that represents a
- // service
- // account. For example,
- // `my-other-app@appspot.gserviceaccount.com`.
- //
- // * `group:{emailid}`: An email address that represents a Google
- // group.
- // For example, `admins@example.com`.
- //
- // * `deleted:user:{emailid}?uid={uniqueid}`: An email address (plus
- // unique
- // identifier) representing a user that has been recently deleted.
- // For
- // example, `alice@example.com?uid=123456789012345678901`. If the
- // user is
- // recovered, this value reverts to `user:{emailid}` and the
- // recovered user
- // retains the role in the binding.
- //
- // * `deleted:serviceAccount:{emailid}?uid={uniqueid}`: An email address
- // (plus
- // unique identifier) representing a service account that has been
- // recently
- // deleted. For example,
- //
- // `my-other-app@appspot.gserviceaccount.com?uid=123456789012345678901`.
- //
- // If the service account is undeleted, this value reverts to
- // `serviceAccount:{emailid}` and the undeleted service account
- // retains the
- // role in the binding.
- //
- // * `deleted:group:{emailid}?uid={uniqueid}`: An email address (plus
- // unique
- // identifier) representing a Google group that has been recently
- // deleted. For example,
- // `admins@example.com?uid=123456789012345678901`. If
- // the group is recovered, this value reverts to `group:{emailid}`
- // and the
- // recovered group retains the role in the binding.
- //
- //
- // * `domain:{domain}`: The G Suite domain (primary) that represents all
- // the
- // users of that domain. For example, `google.com` or
- // `example.com`.
- //
- //
- Members []string `json:"members,omitempty"`
-
- // Role: Role that is assigned to `members`.
- // For example, `roles/viewer`, `roles/editor`, or `roles/owner`.
- Role string `json:"role,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "Condition") 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. "Condition") 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 *Binding) MarshalJSON() ([]byte, error) {
- type NoMethod Binding
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
-}
-
-// CreateSnapshotRequest: Request for the `CreateSnapshot` method.
-type CreateSnapshotRequest struct {
- // Labels: See
- // Creating and
- // managing labels.
- Labels map[string]string `json:"labels,omitempty"`
-
- // Subscription: The subscription whose backlog the snapshot
- // retains.
- // Specifically, the created snapshot is guaranteed to retain:
- // (a) The existing backlog on the subscription. More precisely, this
- // is
- // defined as the messages in the subscription's backlog that are
- // unacknowledged upon the successful completion of the
- // `CreateSnapshot` request; as well as:
- // (b) Any messages published to the subscription's topic following
- // the
- // successful completion of the CreateSnapshot request.
- // Format is `projects/{project}/subscriptions/{sub}`.
- Subscription string `json:"subscription,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "Labels") 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. "Labels") 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 *CreateSnapshotRequest) MarshalJSON() ([]byte, error) {
- type NoMethod CreateSnapshotRequest
- 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:"-"`
-}
-
-// ExpirationPolicy: A policy that specifies the conditions for resource
-// expiration (i.e.,
-// automatic resource deletion).
-type ExpirationPolicy struct {
- // Ttl: Specifies the "time-to-live" duration for an associated
- // resource. The
- // resource expires if it is not active for a period of `ttl`. The
- // definition
- // of "activity" depends on the type of the associated resource. The
- // minimum
- // and maximum allowed values for `ttl` depend on the type of the
- // associated
- // resource, as well. If `ttl` is not set, the associated resource
- // never
- // expires.
- Ttl string `json:"ttl,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "Ttl") 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. "Ttl") 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 *ExpirationPolicy) MarshalJSON() ([]byte, error) {
- type NoMethod ExpirationPolicy
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
-}
-
-// Expr: Represents an expression text. Example:
-//
-// title: "User account presence"
-// description: "Determines whether the request has a user account"
-// expression: "size(request.user) > 0"
-type Expr struct {
- // Description: An optional description of the expression. This is a
- // longer text which
- // describes the expression, e.g. when hovered over it in a UI.
- Description string `json:"description,omitempty"`
-
- // Expression: Textual representation of an expression in
- // Common Expression Language syntax.
- //
- // The application context of the containing message determines
- // which
- // well-known feature set of CEL is supported.
- Expression string `json:"expression,omitempty"`
-
- // Location: An optional string indicating the location of the
- // expression for error
- // reporting, e.g. a file name and a position in the file.
- Location string `json:"location,omitempty"`
-
- // Title: An optional title for the expression, i.e. a short string
- // describing
- // its purpose. This can be used e.g. in UIs which allow to enter
- // the
- // expression.
- Title string `json:"title,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 *Expr) MarshalJSON() ([]byte, error) {
- type NoMethod Expr
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
-}
-
-// ListSnapshotsResponse: Response for the `ListSnapshots` method.
-type ListSnapshotsResponse struct {
- // NextPageToken: If not empty, indicates that there may be more
- // snapshot that match the
- // request; this value should be passed in a new `ListSnapshotsRequest`.
- NextPageToken string `json:"nextPageToken,omitempty"`
-
- // Snapshots: The resulting snapshots.
- Snapshots []*Snapshot `json:"snapshots,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 *ListSnapshotsResponse) MarshalJSON() ([]byte, error) {
- type NoMethod ListSnapshotsResponse
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
-}
-
-// ListSubscriptionsResponse: Response for the `ListSubscriptions`
-// method.
-type ListSubscriptionsResponse struct {
- // NextPageToken: If not empty, indicates that there may be more
- // subscriptions that match
- // the request; this value should be passed in a
- // new
- // `ListSubscriptionsRequest` to get more subscriptions.
- NextPageToken string `json:"nextPageToken,omitempty"`
-
- // Subscriptions: The subscriptions that match the request.
- Subscriptions []*Subscription `json:"subscriptions,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 *ListSubscriptionsResponse) MarshalJSON() ([]byte, error) {
- type NoMethod ListSubscriptionsResponse
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
-}
-
-// ListTopicSnapshotsResponse: Response for the `ListTopicSnapshots`
-// method.
-type ListTopicSnapshotsResponse struct {
- // NextPageToken: If not empty, indicates that there may be more
- // snapshots that match
- // the request; this value should be passed in a
- // new
- // `ListTopicSnapshotsRequest` to get more snapshots.
- NextPageToken string `json:"nextPageToken,omitempty"`
-
- // Snapshots: The names of the snapshots that match the request.
- Snapshots []string `json:"snapshots,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 *ListTopicSnapshotsResponse) MarshalJSON() ([]byte, error) {
- type NoMethod ListTopicSnapshotsResponse
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
-}
-
-// ListTopicSubscriptionsResponse: Response for the
-// `ListTopicSubscriptions` method.
-type ListTopicSubscriptionsResponse struct {
- // NextPageToken: If not empty, indicates that there may be more
- // subscriptions that match
- // the request; this value should be passed in a
- // new
- // `ListTopicSubscriptionsRequest` to get more subscriptions.
- NextPageToken string `json:"nextPageToken,omitempty"`
-
- // Subscriptions: The names of the subscriptions that match the request.
- Subscriptions []string `json:"subscriptions,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 *ListTopicSubscriptionsResponse) MarshalJSON() ([]byte, error) {
- type NoMethod ListTopicSubscriptionsResponse
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
-}
-
-// ListTopicsResponse: Response for the `ListTopics` method.
-type ListTopicsResponse struct {
- // NextPageToken: If not empty, indicates that there may be more topics
- // that match the
- // request; this value should be passed in a new `ListTopicsRequest`.
- NextPageToken string `json:"nextPageToken,omitempty"`
-
- // Topics: The resulting topics.
- Topics []*Topic `json:"topics,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 *ListTopicsResponse) MarshalJSON() ([]byte, error) {
- type NoMethod ListTopicsResponse
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
-}
-
-type MessageStoragePolicy struct {
- // AllowedPersistenceRegions: A list of IDs of GCP regions where
- // messages that are published to the topic
- // may be persisted in storage. Messages published by publishers running
- // in
- // non-allowed GCP regions (or running outside of GCP altogether) will
- // be
- // routed for storage in one of the allowed regions. An empty list means
- // that
- // no regions are allowed, and is not a valid configuration.
- AllowedPersistenceRegions []string `json:"allowedPersistenceRegions,omitempty"`
-
- // ForceSendFields is a list of field names (e.g.
- // "AllowedPersistenceRegions") 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.
- // "AllowedPersistenceRegions") 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 *MessageStoragePolicy) MarshalJSON() ([]byte, error) {
- type NoMethod MessageStoragePolicy
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
-}
-
-// ModifyAckDeadlineRequest: Request for the ModifyAckDeadline method.
-type ModifyAckDeadlineRequest struct {
- // AckDeadlineSeconds: The new ack deadline with respect to the time
- // this request was sent to
- // the Pub/Sub system. For example, if the value is 10, the new
- // ack deadline will expire 10 seconds after the `ModifyAckDeadline`
- // call
- // was made. Specifying zero might immediately make the message
- // available for
- // delivery to another subscriber client. This typically results in
- // an
- // increase in the rate of message redeliveries (that is,
- // duplicates).
- // The minimum deadline you can specify is 0 seconds.
- // The maximum deadline you can specify is 600 seconds (10 minutes).
- AckDeadlineSeconds int64 `json:"ackDeadlineSeconds,omitempty"`
-
- // AckIds: List of acknowledgment IDs.
- AckIds []string `json:"ackIds,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "AckDeadlineSeconds")
- // 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. "AckDeadlineSeconds") 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 *ModifyAckDeadlineRequest) MarshalJSON() ([]byte, error) {
- type NoMethod ModifyAckDeadlineRequest
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
-}
-
-// ModifyPushConfigRequest: Request for the ModifyPushConfig method.
-type ModifyPushConfigRequest struct {
- // PushConfig: The push configuration for future deliveries.
- //
- // An empty `pushConfig` indicates that the Pub/Sub system should
- // stop pushing messages from the given subscription and allow
- // messages to be pulled and acknowledged - effectively pausing
- // the subscription if `Pull` or `StreamingPull` is not called.
- PushConfig *PushConfig `json:"pushConfig,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "PushConfig") 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. "PushConfig") 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 *ModifyPushConfigRequest) MarshalJSON() ([]byte, error) {
- type NoMethod ModifyPushConfigRequest
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
-}
-
-// OidcToken: Contains information needed for generating an
-// [OpenID
-// Connect
-// token](https://developers.google.com/identity/protocols/OpenID
-// Connect).
-type OidcToken struct {
- // Audience: Audience to be used when generating OIDC token. The
- // audience claim
- // identifies the recipients that the JWT is intended for. The
- // audience
- // value is a single case-sensitive string. Having multiple values
- // (array)
- // for the audience field is not supported. More info about the OIDC
- // JWT
- // token audience here:
- // https://tools.ietf.org/html/rfc7519#section-4.1.3
- // Note: if not specified, the Push endpoint URL will be used.
- Audience string `json:"audience,omitempty"`
-
- // ServiceAccountEmail: [Service
- // account
- // email](https://cloud.google.com/iam/docs/service-accounts)
- // to be used for generating the OIDC token. The caller
- // (for
- // CreateSubscription, UpdateSubscription, and ModifyPushConfig RPCs)
- // must
- // have the iam.serviceAccounts.actAs permission for the service
- // account.
- ServiceAccountEmail string `json:"serviceAccountEmail,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "Audience") 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. "Audience") 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 *OidcToken) MarshalJSON() ([]byte, error) {
- type NoMethod OidcToken
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
-}
-
-// Policy: An Identity and Access Management (IAM) policy, which
-// specifies access
-// controls for Google Cloud resources.
-//
-//
-// A `Policy` is a collection of `bindings`. A `binding` binds one or
-// more
-// `members` to a single `role`. Members can be user accounts, service
-// accounts,
-// Google groups, and domains (such as G Suite). A `role` is a named
-// list of
-// permissions; each `role` can be an IAM predefined role or a
-// user-created
-// custom role.
-//
-// Optionally, a `binding` can specify a `condition`, which is a
-// logical
-// expression that allows access to a resource only if the expression
-// evaluates
-// to `true`. A condition can add constraints based on attributes of
-// the
-// request, the resource, or both.
-//
-// **JSON example:**
-//
-// {
-// "bindings": [
-// {
-// "role": "roles/resourcemanager.organizationAdmin",
-// "members": [
-// "user:mike@example.com",
-// "group:admins@example.com",
-// "domain:google.com",
-//
-// "serviceAccount:my-project-id@appspot.gserviceaccount.com"
-// ]
-// },
-// {
-// "role": "roles/resourcemanager.organizationViewer",
-// "members": ["user:eve@example.com"],
-// "condition": {
-// "title": "expirable access",
-// "description": "Does not grant access after Sep 2020",
-// "expression": "request.time <
-// timestamp('2020-10-01T00:00:00.000Z')",
-// }
-// }
-// ],
-// "etag": "BwWWja0YfJA=",
-// "version": 3
-// }
-//
-// **YAML example:**
-//
-// bindings:
-// - members:
-// - user:mike@example.com
-// - group:admins@example.com
-// - domain:google.com
-// - serviceAccount:my-project-id@appspot.gserviceaccount.com
-// role: roles/resourcemanager.organizationAdmin
-// - members:
-// - user:eve@example.com
-// role: roles/resourcemanager.organizationViewer
-// condition:
-// title: expirable access
-// description: Does not grant access after Sep 2020
-// expression: request.time <
-// timestamp('2020-10-01T00:00:00.000Z')
-// - etag: BwWWja0YfJA=
-// - version: 3
-//
-// For a description of IAM and its features, see the
-// [IAM documentation](https://cloud.google.com/iam/docs/).
-type Policy struct {
- // Bindings: Associates a list of `members` to a `role`. Optionally, may
- // specify a
- // `condition` that determines how and when the `bindings` are applied.
- // Each
- // of the `bindings` must contain at least one member.
- Bindings []*Binding `json:"bindings,omitempty"`
-
- // Etag: `etag` is used for optimistic concurrency control as a way to
- // help
- // prevent simultaneous updates of a policy from overwriting each
- // other.
- // It is strongly suggested that systems make use of the `etag` in
- // the
- // read-modify-write cycle to perform policy updates in order to avoid
- // race
- // conditions: An `etag` is returned in the response to `getIamPolicy`,
- // and
- // systems are expected to put that etag in the request to
- // `setIamPolicy` to
- // ensure that their change will be applied to the same version of the
- // policy.
- //
- // **Important:** If you use IAM Conditions, you must include the `etag`
- // field
- // whenever you call `setIamPolicy`. If you omit this field, then IAM
- // allows
- // you to overwrite a version `3` policy with a version `1` policy, and
- // all of
- // the conditions in the version `3` policy are lost.
- Etag string `json:"etag,omitempty"`
-
- // Version: Specifies the format of the policy.
- //
- // Valid values are `0`, `1`, and `3`. Requests that specify an invalid
- // value
- // are rejected.
- //
- // Any operation that affects conditional role bindings must specify
- // version
- // `3`. This requirement applies to the following operations:
- //
- // * Getting a policy that includes a conditional role binding
- // * Adding a conditional role binding to a policy
- // * Changing a conditional role binding in a policy
- // * Removing any role binding, with or without a condition, from a
- // policy
- // that includes conditions
- //
- // **Important:** If you use IAM Conditions, you must include the `etag`
- // field
- // whenever you call `setIamPolicy`. If you omit this field, then IAM
- // allows
- // you to overwrite a version `3` policy with a version `1` policy, and
- // all of
- // the conditions in the version `3` policy are lost.
- //
- // If a policy does not include any conditions, operations on that
- // policy may
- // specify any valid version or leave the field unset.
- Version int64 `json:"version,omitempty"`
-
- // ServerResponse contains the HTTP response code and headers from the
- // server.
- googleapi.ServerResponse `json:"-"`
-
- // ForceSendFields is a list of field names (e.g. "Bindings") 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. "Bindings") 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 *Policy) MarshalJSON() ([]byte, error) {
- type NoMethod Policy
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
-}
-
-// PublishRequest: Request for the Publish method.
-type PublishRequest struct {
- // Messages: The messages to publish.
- Messages []*PubsubMessage `json:"messages,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "Messages") 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. "Messages") 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 *PublishRequest) MarshalJSON() ([]byte, error) {
- type NoMethod PublishRequest
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
-}
-
-// PublishResponse: Response for the `Publish` method.
-type PublishResponse struct {
- // MessageIds: The server-assigned ID of each published message, in the
- // same order as
- // the messages in the request. IDs are guaranteed to be unique
- // within
- // the topic.
- MessageIds []string `json:"messageIds,omitempty"`
-
- // ServerResponse contains the HTTP response code and headers from the
- // server.
- googleapi.ServerResponse `json:"-"`
-
- // ForceSendFields is a list of field names (e.g. "MessageIds") 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. "MessageIds") 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 *PublishResponse) MarshalJSON() ([]byte, error) {
- type NoMethod PublishResponse
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
-}
-
-// PubsubMessage: A message that is published by publishers and consumed
-// by subscribers. The
-// message must contain either a non-empty data field or at least one
-// attribute.
-// Note that client libraries represent this object
-// differently
-// depending on the language. See the corresponding
-// client
-//
-// library documentation for more information. See
-// Quotas and
-// limits
-// for more information about message limits.
-type PubsubMessage struct {
- // Attributes: Attributes for this message. If this field is empty, the
- // message must
- // contain non-empty data.
- Attributes map[string]string `json:"attributes,omitempty"`
-
- // Data: The message data field. If this field is empty, the message
- // must contain
- // at least one attribute.
- Data string `json:"data,omitempty"`
-
- // MessageId: ID of this message, assigned by the server when the
- // message is published.
- // Guaranteed to be unique within the topic. This value may be read by
- // a
- // subscriber that receives a `PubsubMessage` via a `Pull` call or a
- // push
- // delivery. It must not be populated by the publisher in a `Publish`
- // call.
- MessageId string `json:"messageId,omitempty"`
-
- // PublishTime: The time at which the message was published, populated
- // by the server when
- // it receives the `Publish` call. It must not be populated by
- // the
- // publisher in a `Publish` call.
- PublishTime string `json:"publishTime,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "Attributes") 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. "Attributes") 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 *PubsubMessage) MarshalJSON() ([]byte, error) {
- type NoMethod PubsubMessage
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
-}
-
-// PullRequest: Request for the `Pull` method.
-type PullRequest struct {
- // MaxMessages: The maximum number of messages to return for this
- // request. Must be a
- // positive integer. The Pub/Sub system may return fewer than the
- // number
- // specified.
- MaxMessages int64 `json:"maxMessages,omitempty"`
-
- // ReturnImmediately: If this field set to true, the system will respond
- // immediately even if
- // it there are no messages available to return in the `Pull`
- // response.
- // Otherwise, the system may wait (for a bounded amount of time) until
- // at
- // least one message is available, rather than returning no messages.
- ReturnImmediately bool `json:"returnImmediately,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "MaxMessages") 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. "MaxMessages") 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 *PullRequest) MarshalJSON() ([]byte, error) {
- type NoMethod PullRequest
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
-}
-
-// PullResponse: Response for the `Pull` method.
-type PullResponse struct {
- // ReceivedMessages: Received Pub/Sub messages. The list will be empty
- // if there are no more
- // messages available in the backlog. For JSON, the response can be
- // entirely
- // empty. The Pub/Sub system may return fewer than the `maxMessages`
- // requested
- // even if there are more messages available in the backlog.
- ReceivedMessages []*ReceivedMessage `json:"receivedMessages,omitempty"`
-
- // ServerResponse contains the HTTP response code and headers from the
- // server.
- googleapi.ServerResponse `json:"-"`
-
- // ForceSendFields is a list of field names (e.g. "ReceivedMessages") 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. "ReceivedMessages") 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 *PullResponse) MarshalJSON() ([]byte, error) {
- type NoMethod PullResponse
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
-}
-
-// PushConfig: Configuration for a push delivery endpoint.
-type PushConfig struct {
- // Attributes: Endpoint configuration attributes that can be used to
- // control different
- // aspects of the message delivery.
- //
- // The only currently supported attribute is `x-goog-version`, which you
- // can
- // use to change the format of the pushed message. This
- // attribute
- // indicates the version of the data expected by the endpoint.
- // This
- // controls the shape of the pushed message (i.e., its fields and
- // metadata).
- //
- // If not present during the `CreateSubscription` call, it will default
- // to
- // the version of the Pub/Sub API used to make such call. If not present
- // in a
- // `ModifyPushConfig` call, its value will not be changed.
- // `GetSubscription`
- // calls will always return a valid version, even if the subscription
- // was
- // created without this attribute.
- //
- // The only supported values for the `x-goog-version` attribute are:
- //
- // * `v1beta1`: uses the push format defined in the v1beta1 Pub/Sub
- // API.
- // * `v1` or `v1beta2`: uses the push format defined in the v1 Pub/Sub
- // API.
- //
- // For example:
- //
attributes { "x-goog-version": "v1" }
- Attributes map[string]string `json:"attributes,omitempty"`
-
- // OidcToken: If specified, Pub/Sub will generate and attach an OIDC JWT
- // token as an
- // `Authorization` header in the HTTP request for every pushed message.
- OidcToken *OidcToken `json:"oidcToken,omitempty"`
-
- // PushEndpoint: A URL locating the endpoint to which messages should be
- // pushed.
- // For example, a Webhook endpoint might use "https://example.com/push".
- PushEndpoint string `json:"pushEndpoint,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "Attributes") 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. "Attributes") 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 *PushConfig) MarshalJSON() ([]byte, error) {
- type NoMethod PushConfig
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
-}
-
-// ReceivedMessage: A message and its corresponding acknowledgment ID.
-type ReceivedMessage struct {
- // AckId: This ID can be used to acknowledge the received message.
- AckId string `json:"ackId,omitempty"`
-
- // Message: The message.
- Message *PubsubMessage `json:"message,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "AckId") 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. "AckId") 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 *ReceivedMessage) MarshalJSON() ([]byte, error) {
- type NoMethod ReceivedMessage
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
-}
-
-// SeekRequest: Request for the `Seek` method.
-type SeekRequest struct {
- // Snapshot: The snapshot to seek to. The snapshot's topic must be the
- // same as that of
- // the provided subscription.
- // Format is `projects/{project}/snapshots/{snap}`.
- Snapshot string `json:"snapshot,omitempty"`
-
- // Time: The time to seek to.
- // Messages retained in the subscription that were published before
- // this
- // time are marked as acknowledged, and messages retained in
- // the
- // subscription that were published after this time are marked
- // as
- // unacknowledged. Note that this operation affects only those
- // messages
- // retained in the subscription (configured by the combination
- // of
- // `message_retention_duration` and `retain_acked_messages`). For
- // example,
- // if `time` corresponds to a point before the message retention
- // window (or to a point before the system's notion of the
- // subscription
- // creation time), only retained messages will be marked as
- // unacknowledged,
- // and already-expunged messages will not be restored.
- Time string `json:"time,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "Snapshot") 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. "Snapshot") 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 *SeekRequest) MarshalJSON() ([]byte, error) {
- type NoMethod SeekRequest
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
-}
-
-// SeekResponse: Response for the `Seek` method (this response is
-// empty).
-type SeekResponse struct {
- // ServerResponse contains the HTTP response code and headers from the
- // server.
- googleapi.ServerResponse `json:"-"`
-}
-
-// SetIamPolicyRequest: Request message for `SetIamPolicy` method.
-type SetIamPolicyRequest struct {
- // Policy: REQUIRED: The complete policy to be applied to the
- // `resource`. The size of
- // the policy is limited to a few 10s of KB. An empty policy is a
- // valid policy but certain Cloud Platform services (such as
- // Projects)
- // might reject them.
- Policy *Policy `json:"policy,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "Policy") 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. "Policy") 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 *SetIamPolicyRequest) MarshalJSON() ([]byte, error) {
- type NoMethod SetIamPolicyRequest
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
-}
-
-// Snapshot: A snapshot resource. Snapshots are used in
-// Seek
-// o
-// perations, which allow
-// you to manage message acknowledgments in bulk. That is, you can set
-// the
-// acknowledgment state of messages in an existing subscription to the
-// state
-// captured by a snapshot.
-type Snapshot struct {
- // ExpireTime: The snapshot is guaranteed to exist up until this time.
- // A newly-created snapshot expires no later than 7 days from the time
- // of its
- // creation. Its exact lifetime is determined at creation by the
- // existing
- // backlog in the source subscription. Specifically, the lifetime of
- // the
- // snapshot is `7 days - (age of oldest unacked message in the
- // subscription)`.
- // For example, consider a subscription whose oldest unacked message is
- // 3 days
- // old. If a snapshot is created from this subscription, the snapshot --
- // which
- // will always capture this 3-day-old backlog as long as the
- // snapshot
- // exists -- will expire in 4 days. The service will refuse to create
- // a
- // snapshot that would expire in less than 1 hour after creation.
- ExpireTime string `json:"expireTime,omitempty"`
-
- // Labels: See
- // Creating and
- // managing labels.
- Labels map[string]string `json:"labels,omitempty"`
-
- // Name: The name of the snapshot.
- Name string `json:"name,omitempty"`
-
- // Topic: The name of the topic from which this snapshot is retaining
- // messages.
- Topic string `json:"topic,omitempty"`
-
- // ServerResponse contains the HTTP response code and headers from the
- // server.
- googleapi.ServerResponse `json:"-"`
-
- // ForceSendFields is a list of field names (e.g. "ExpireTime") 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. "ExpireTime") 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 *Snapshot) MarshalJSON() ([]byte, error) {
- type NoMethod Snapshot
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
-}
-
-// Subscription: A subscription resource.
-type Subscription struct {
- // AckDeadlineSeconds: The approximate amount of time (on a best-effort
- // basis) Pub/Sub waits for
- // the subscriber to acknowledge receipt before resending the message.
- // In the
- // interval after the message is delivered and before it is
- // acknowledged, it
- // is considered to be outstanding. During that time period,
- // the
- // message will not be redelivered (on a best-effort basis).
- //
- // For pull subscriptions, this value is used as the initial value for
- // the ack
- // deadline. To override this value for a given message,
- // call
- // `ModifyAckDeadline` with the corresponding `ack_id` if
- // using
- // non-streaming pull or send the `ack_id` in
- // a
- // `StreamingModifyAckDeadlineRequest` if using streaming pull.
- // The minimum custom deadline you can specify is 10 seconds.
- // The maximum custom deadline you can specify is 600 seconds (10
- // minutes).
- // If this parameter is 0, a default value of 10 seconds is used.
- //
- // For push delivery, this value is also used to set the request timeout
- // for
- // the call to the push endpoint.
- //
- // If the subscriber never acknowledges the message, the Pub/Sub
- // system will eventually redeliver the message.
- AckDeadlineSeconds int64 `json:"ackDeadlineSeconds,omitempty"`
-
- // ExpirationPolicy: A policy that specifies the conditions for this
- // subscription's expiration.
- // A subscription is considered active as long as any connected
- // subscriber is
- // successfully consuming messages from the subscription or is
- // issuing
- // operations on the subscription. If `expiration_policy` is not set,
- // a
- // *default policy* with `ttl` of 31 days will be used. The minimum
- // allowed
- // value for `expiration_policy.ttl` is 1 day.
- ExpirationPolicy *ExpirationPolicy `json:"expirationPolicy,omitempty"`
-
- // Labels: See
- // Creating and
- // managing labels.
- Labels map[string]string `json:"labels,omitempty"`
-
- // MessageRetentionDuration: How long to retain unacknowledged messages
- // in the subscription's backlog,
- // from the moment a message is published.
- // If `retain_acked_messages` is true, then this also configures the
- // retention
- // of acknowledged messages, and thus configures how far back in time a
- // `Seek`
- // can be done. Defaults to 7 days. Cannot be more than 7 days or less
- // than 10
- // minutes.
- MessageRetentionDuration string `json:"messageRetentionDuration,omitempty"`
-
- // Name: The name of the subscription. It must have the
- // format
- // "projects/{project}/subscriptions/{subscription}". `{subscription}`
- // must
- // start with a letter, and contain only letters (`[A-Za-z]`),
- // numbers
- // (`[0-9]`), dashes (`-`), underscores (`_`), periods (`.`), tildes
- // (`~`),
- // plus (`+`) or percent signs (`%`). It must be between 3 and 255
- // characters
- // in length, and it must not start with "goog".
- Name string `json:"name,omitempty"`
-
- // PushConfig: If push delivery is used with this subscription, this
- // field is
- // used to configure it. An empty `pushConfig` signifies that the
- // subscriber
- // will pull and ack messages using API methods.
- PushConfig *PushConfig `json:"pushConfig,omitempty"`
-
- // RetainAckedMessages: Indicates whether to retain acknowledged
- // messages. If true, then
- // messages are not expunged from the subscription's backlog, even if
- // they are
- // acknowledged, until they fall out of the
- // `message_retention_duration`
- // window. This must be true if you would like
- // to
- //
- // Seek to a timestamp.
- RetainAckedMessages bool `json:"retainAckedMessages,omitempty"`
-
- // Topic: The name of the topic from which this subscription is
- // receiving messages.
- // Format is `projects/{project}/topics/{topic}`.
- // The value of this field will be `_deleted-topic_` if the topic has
- // been
- // deleted.
- Topic string `json:"topic,omitempty"`
-
- // ServerResponse contains the HTTP response code and headers from the
- // server.
- googleapi.ServerResponse `json:"-"`
-
- // ForceSendFields is a list of field names (e.g. "AckDeadlineSeconds")
- // 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. "AckDeadlineSeconds") 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 *Subscription) MarshalJSON() ([]byte, error) {
- type NoMethod Subscription
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
-}
-
-// TestIamPermissionsRequest: Request message for `TestIamPermissions`
-// method.
-type TestIamPermissionsRequest struct {
- // Permissions: The set of permissions to check for the `resource`.
- // Permissions with
- // wildcards (such as '*' or 'storage.*') are not allowed. For
- // more
- // information see
- // [IAM
- // Overview](https://cloud.google.com/iam/docs/overview#permissions).
- Permissions []string `json:"permissions,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "Permissions") 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. "Permissions") 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 *TestIamPermissionsRequest) MarshalJSON() ([]byte, error) {
- type NoMethod TestIamPermissionsRequest
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
-}
-
-// TestIamPermissionsResponse: Response message for `TestIamPermissions`
-// method.
-type TestIamPermissionsResponse struct {
- // Permissions: A subset of `TestPermissionsRequest.permissions` that
- // the caller is
- // allowed.
- Permissions []string `json:"permissions,omitempty"`
-
- // ServerResponse contains the HTTP response code and headers from the
- // server.
- googleapi.ServerResponse `json:"-"`
-
- // ForceSendFields is a list of field names (e.g. "Permissions") 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. "Permissions") 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 *TestIamPermissionsResponse) MarshalJSON() ([]byte, error) {
- type NoMethod TestIamPermissionsResponse
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
-}
-
-// Topic: A topic resource.
-type Topic struct {
- // KmsKeyName: The resource name of the Cloud KMS CryptoKey to be used
- // to protect access
- // to messages published on this topic.
- //
- // The expected format is
- // `projects/*/locations/*/keyRings/*/cryptoKeys/*`.
- KmsKeyName string `json:"kmsKeyName,omitempty"`
-
- // Labels: See
- // Creating and
- // managing labels.
- Labels map[string]string `json:"labels,omitempty"`
-
- // MessageStoragePolicy: Policy constraining the set of Google Cloud
- // Platform regions where messages
- // published to the topic may be stored. If not present, then no
- // constraints
- // are in effect.
- MessageStoragePolicy *MessageStoragePolicy `json:"messageStoragePolicy,omitempty"`
-
- // Name: The name of the topic. It must have the
- // format
- // "projects/{project}/topics/{topic}". `{topic}` must start with a
- // letter,
- // and contain only letters (`[A-Za-z]`), numbers (`[0-9]`), dashes
- // (`-`),
- // underscores (`_`), periods (`.`), tildes (`~`), plus (`+`) or
- // percent
- // signs (`%`). It must be between 3 and 255 characters in length, and
- // it
- // must not start with "goog".
- Name string `json:"name,omitempty"`
-
- // ServerResponse contains the HTTP response code and headers from the
- // server.
- googleapi.ServerResponse `json:"-"`
-
- // ForceSendFields is a list of field names (e.g. "KmsKeyName") 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. "KmsKeyName") 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 *Topic) MarshalJSON() ([]byte, error) {
- type NoMethod Topic
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
-}
-
-// UpdateSnapshotRequest: Request for the UpdateSnapshot method.
-type UpdateSnapshotRequest struct {
- // Snapshot: The updated snapshot object.
- Snapshot *Snapshot `json:"snapshot,omitempty"`
-
- // UpdateMask: Indicates which fields in the provided snapshot to
- // update.
- // Must be specified and non-empty.
- UpdateMask string `json:"updateMask,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "Snapshot") 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. "Snapshot") 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 *UpdateSnapshotRequest) MarshalJSON() ([]byte, error) {
- type NoMethod UpdateSnapshotRequest
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
-}
-
-// UpdateSubscriptionRequest: Request for the UpdateSubscription method.
-type UpdateSubscriptionRequest struct {
- // Subscription: The updated subscription object.
- Subscription *Subscription `json:"subscription,omitempty"`
-
- // UpdateMask: Indicates which fields in the provided subscription to
- // update.
- // Must be specified and non-empty.
- UpdateMask string `json:"updateMask,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "Subscription") 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. "Subscription") 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 *UpdateSubscriptionRequest) MarshalJSON() ([]byte, error) {
- type NoMethod UpdateSubscriptionRequest
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
-}
-
-// UpdateTopicRequest: Request for the UpdateTopic method.
-type UpdateTopicRequest struct {
- // Topic: The updated topic object.
- Topic *Topic `json:"topic,omitempty"`
-
- // UpdateMask: Indicates which fields in the provided topic to update.
- // Must be specified
- // and non-empty. Note that if `update_mask`
- // contains
- // "message_storage_policy" then the new value will be determined based
- // on the
- // policy configured at the project or organization level.
- // The
- // `message_storage_policy` must not be set in the `topic` provided
- // above.
- UpdateMask string `json:"updateMask,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "Topic") 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. "Topic") 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 *UpdateTopicRequest) MarshalJSON() ([]byte, error) {
- type NoMethod UpdateTopicRequest
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
-}
-
-// method id "pubsub.projects.snapshots.create":
-
-type ProjectsSnapshotsCreateCall struct {
- s *Service
- name string
- createsnapshotrequest *CreateSnapshotRequest
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// Create: Creates a snapshot from the requested subscription. Snapshots
-// are used in
-// Seek
-// o
-// perations, which allow
-// you to manage message acknowledgments in bulk. That is, you can set
-// the
-// acknowledgment state of messages in an existing subscription to the
-// state
-// captured by a snapshot.
-//