logging

package
v0.0.0-...-0297be7 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 7, 2015 License: BSD-3-Clause Imports: 11 Imported by: 0

Documentation

Overview

Package logging provides access to the Google Cloud Logging API.

Usage example:

import "google.golang.org/api/logging/v1beta3"
...
loggingService, err := logging.New(oauthHttpClient)

Index

Constants

View Source
const (
	// View and manage your data across Google Cloud Platform services
	CloudPlatformScope = "https://www.googleapis.com/auth/cloud-platform"
)

OAuth2 scopes used by this API.

Variables

This section is empty.

Functions

This section is empty.

Types

type Empty

type Empty struct {
}

type ListLogServiceIndexesResponse

type ListLogServiceIndexesResponse struct {
	// NextPageToken: If there are more results, then `nextPageToken` is
	// returned in the response. To get the next batch of indexes, use the
	// value of `nextPageToken` as `pageToken` in the next call of
	// `ListLogServiceIndexess`. If `nextPageToken` is empty, then there are
	// no more results.
	NextPageToken string `json:"nextPageToken,omitempty"`

	// ServiceIndexPrefixes: A list of log service index prefixes.
	ServiceIndexPrefixes []string `json:"serviceIndexPrefixes,omitempty"`
}

type ListLogServiceSinksResponse

type ListLogServiceSinksResponse struct {
	// Sinks: The requested log service sinks. If any of the returned
	// `LogSink` objects have an empty `destination` field, then call
	// `logServices.sinks.get` to retrieve the complete `LogSink` object.
	Sinks []*LogSink `json:"sinks,omitempty"`
}

type ListLogServicesResponse

type ListLogServicesResponse struct {
	// LogServices: A list of log services.
	LogServices []*LogService `json:"logServices,omitempty"`

	// NextPageToken: If there are more results, then `nextPageToken` is
	// returned in the response. To get the next batch of services, use the
	// value of `nextPageToken` as `pageToken` in the next call of
	// `ListLogServices`. If `nextPageToken` is empty, then there are no
	// more results.
	NextPageToken string `json:"nextPageToken,omitempty"`
}

type ListLogSinksResponse

type ListLogSinksResponse struct {
	// Sinks: The requested log sinks. If any of the returned `LogSink`
	// objects have an empty `destination` field, then call
	// `logServices.sinks.get` to retrieve the complete `LogSink` object.
	Sinks []*LogSink `json:"sinks,omitempty"`
}

type ListLogsResponse

type ListLogsResponse struct {
	// Logs: A list of log resources.
	Logs []*Log `json:"logs,omitempty"`

	// NextPageToken: If there are more results, then `nextPageToken` is
	// returned in the response. To get the next batch of logs, use the
	// value of `nextPageToken` as `pageToken` in the next call of
	// `ListLogs`. If `nextPageToken` is empty, then there are no more
	// results.
	NextPageToken string `json:"nextPageToken,omitempty"`
}

type Log

type Log struct {
	// DisplayName: Name used when displaying the log to the user (for
	// example, in a UI). Example: `"activity_log"`
	DisplayName string `json:"displayName,omitempty"`

	// Name: REQUIRED: The log's name name. Example:
	// `"compute.googleapis.com/activity_log"`.
	Name string `json:"name,omitempty"`

	// PayloadType: Type URL describing the expected payload type for the
	// log.
	PayloadType string `json:"payloadType,omitempty"`
}

type LogEntry

type LogEntry struct {
	// InsertId: A unique ID for the log entry. If you provide this field,
	// the logging service considers other log entries in the same log with
	// the same ID as duplicates which can be removed.
	InsertId string `json:"insertId,omitempty"`

	// Log: The log to which this entry belongs. When a log entry is
	// ingested, the value of this field is set by the logging system.
	Log string `json:"log,omitempty"`

	// Metadata: Information about the log entry.
	Metadata *LogEntryMetadata `json:"metadata,omitempty"`

	// ProtoPayload: The log entry payload, represented as a protocol buffer
	// that is expressed as a JSON object. You can only pass `protoPayload`
	// values that belong to a set of approved types.
	ProtoPayload *LogEntryProtoPayload `json:"protoPayload,omitempty"`

	// StructPayload: The log entry payload, represented as a structure that
	// is expressed as a JSON object.
	StructPayload *LogEntryStructPayload `json:"structPayload,omitempty"`

	// TextPayload: The log entry payload, represented as a text string.
	TextPayload string `json:"textPayload,omitempty"`
}

type LogEntryMetadata

type LogEntryMetadata struct {
	// Labels: A set of (key, value) data that provides additional
	// information about the log entry. If the log entry is from one of the
	// Google Cloud Platform sources listed below, the indicated (key,
	// value) information must be provided: Google App Engine, service_name
	// `appengine.googleapis.com`: "appengine.googleapis.com/module_id",
	// "appengine.googleapis.com/version_id",  and one of:
	// "appengine.googleapis.com/replica_index",
	// "appengine.googleapis.com/clone_id",  or else provide the following
	// Compute Engine labels: Google Compute Engine, service_name
	// `compute.googleapis.com`: "compute.googleapis.com/resource_type",
	// "instance" "compute.googleapis.com/resource_id",
	Labels map[string]string `json:"labels,omitempty"`

	// ProjectId: The project ID of the Google Cloud Platform service that
	// created the log entry.
	ProjectId string `json:"projectId,omitempty"`

	// Region: The region name of the Google Cloud Platform service that
	// created the log entry. For example, `"us-central1"`.
	Region string `json:"region,omitempty"`

	// ServiceName: The API name of the Google Cloud Platform service that
	// created the log entry. For example, `"compute.googleapis.com"`.
	ServiceName string `json:"serviceName,omitempty"`

	// Severity: The severity of the log entry.
	Severity string `json:"severity,omitempty"`

	// Timestamp: The time the event described by the log entry occurred.
	// Timestamps must be later than January 1, 1970.
	Timestamp string `json:"timestamp,omitempty"`

	// UserId: The fully-qualified email address of the authenticated user
	// that performed or requested the action represented by the log entry.
	// If the log entry does not apply to an action taken by an
	// authenticated user, then the field should be empty.
	UserId string `json:"userId,omitempty"`

	// Zone: The zone of the Google Cloud Platform service that created the
	// log entry. For example, `"us-central1-a"`.
	Zone string `json:"zone,omitempty"`
}

type LogEntryProtoPayload

type LogEntryProtoPayload struct {
}

type LogEntryStructPayload

type LogEntryStructPayload struct {
}

type LogError

type LogError struct {
	// Resource: The resource associated with the error. It may be different
	// from the sink destination. For example, the sink may point to a
	// BigQuery dataset, but the error may refer to a table resource inside
	// the dataset.
	Resource string `json:"resource,omitempty"`

	// Status: The description of the last error observed.
	Status *Status `json:"status,omitempty"`

	// TimeNanos: The last time the error was observed, in nanoseconds since
	// the Unix epoch.
	TimeNanos int64 `json:"timeNanos,omitempty,string"`
}

type LogService

type LogService struct {
	// IndexKeys: Label keys used when labeling log entries for this
	// service. The order of the keys is significant, with higher priority
	// keys coming earlier in the list.
	IndexKeys []string `json:"indexKeys,omitempty"`

	// Name: The service's name.
	Name string `json:"name,omitempty"`
}

type LogSink

type LogSink struct {
	// Destination: The resource to send log entries to. The supported sink
	// resource types are: + Google Cloud Storage:
	// `storage.googleapis.com/BUCKET` or `BUCKET.storage.googleapis.com/` +
	// Google BigQuery:
	// `bigquery.googleapis.com/projects/PROJECT/datasets/DATASET` Currently
	// the Cloud Logging API supports at most one sink for each resource
	// type per log or log service resource.
	Destination string `json:"destination,omitempty"`

	// Errors: _Output only._ All active errors found for this sink.
	Errors []*LogError `json:"errors,omitempty"`

	// Name: The name of this sink. This is a client-assigned identifier for
	// the resource. This is ignored by UpdateLogSink and
	// UpdateLogServicesSink.
	Name string `json:"name,omitempty"`
}

type ProjectsLogServicesIndexesListCall

type ProjectsLogServicesIndexesListCall struct {
	// contains filtered or unexported fields
}

func (*ProjectsLogServicesIndexesListCall) Depth

Depth sets the optional parameter "depth": A limit to the number of levels of the index hierarchy that are expanded. If `depth` is 0, it defaults to the level specified by the prefix field (the number of slash separators). The default empty prefix implies a `depth` of 1. It is an error for `depth` to be any non-zero value less than the number of components in `indexPrefix`.

func (*ProjectsLogServicesIndexesListCall) Do

func (*ProjectsLogServicesIndexesListCall) Fields

Fields allows partial responses to be retrieved. See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more information.

func (*ProjectsLogServicesIndexesListCall) IndexPrefix

IndexPrefix sets the optional parameter "indexPrefix": Restricts the indexes returned to be those with a specified prefix. The prefix has the form `"/label_value/label_value/..."`, in order corresponding to the [`LogService indexKeys`][google.logging.v1.LogService.index_keys]. Non-empty prefixes must begin with `/` . Example prefixes: + `"/myModule/"` retrieves App Engine versions associated with `myModule`. The trailing slash terminates the value. + `"/myModule"` retrieves App Engine modules with names beginning with `myModule`. + `""` retrieves all indexes.

func (*ProjectsLogServicesIndexesListCall) Log

Log sets the optional parameter "log": A log resource like `/projects/project_id/logs/log_name`, identifying the log for which to list service indexes.

func (*ProjectsLogServicesIndexesListCall) PageSize

PageSize sets the optional parameter "pageSize": The maximum number of log service index resources to return in one operation.

func (*ProjectsLogServicesIndexesListCall) PageToken

PageToken sets the optional parameter "pageToken": An opaque token, returned as `nextPageToken` by a prior `ListLogServiceIndexes` operation. If `pageToken` is supplied, then the other fields of this request are ignored, and instead the previous `ListLogServiceIndexes` operation is continued.

type ProjectsLogServicesIndexesService

type ProjectsLogServicesIndexesService struct {
	// contains filtered or unexported fields
}

func NewProjectsLogServicesIndexesService

func NewProjectsLogServicesIndexesService(s *Service) *ProjectsLogServicesIndexesService

func (*ProjectsLogServicesIndexesService) List

List: Lists log service indexes associated with a log service.

type ProjectsLogServicesListCall

type ProjectsLogServicesListCall struct {
	// contains filtered or unexported fields
}

func (*ProjectsLogServicesListCall) Do

func (*ProjectsLogServicesListCall) Fields

Fields allows partial responses to be retrieved. See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more information.

func (*ProjectsLogServicesListCall) Log

Log sets the optional parameter "log": The name of the log resource whose services are to be listed. log for which to list services. When empty, all services are listed.

func (*ProjectsLogServicesListCall) PageSize

PageSize sets the optional parameter "pageSize": The maximum number of `LogService` objects to return in one operation.

func (*ProjectsLogServicesListCall) PageToken

PageToken sets the optional parameter "pageToken": An opaque token, returned as `nextPageToken` by a prior `ListLogServices` operation. If `pageToken` is supplied, then the other fields of this request are ignored, and instead the previous `ListLogServices` operation is continued.

type ProjectsLogServicesService

type ProjectsLogServicesService struct {
	Indexes *ProjectsLogServicesIndexesService

	Sinks *ProjectsLogServicesSinksService
	// contains filtered or unexported fields
}

func NewProjectsLogServicesService

func NewProjectsLogServicesService(s *Service) *ProjectsLogServicesService

func (*ProjectsLogServicesService) List

List: Lists log services associated with log entries ingested for a project.

type ProjectsLogServicesSinksCreateCall

type ProjectsLogServicesSinksCreateCall struct {
	// contains filtered or unexported fields
}

func (*ProjectsLogServicesSinksCreateCall) Do

func (*ProjectsLogServicesSinksCreateCall) Fields

Fields allows partial responses to be retrieved. See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more information.

type ProjectsLogServicesSinksDeleteCall

type ProjectsLogServicesSinksDeleteCall struct {
	// contains filtered or unexported fields
}

func (*ProjectsLogServicesSinksDeleteCall) Do

func (*ProjectsLogServicesSinksDeleteCall) Fields

Fields allows partial responses to be retrieved. See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more information.

type ProjectsLogServicesSinksGetCall

type ProjectsLogServicesSinksGetCall struct {
	// contains filtered or unexported fields
}

func (*ProjectsLogServicesSinksGetCall) Do

func (*ProjectsLogServicesSinksGetCall) Fields

Fields allows partial responses to be retrieved. See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more information.

type ProjectsLogServicesSinksListCall

type ProjectsLogServicesSinksListCall struct {
	// contains filtered or unexported fields
}

func (*ProjectsLogServicesSinksListCall) Do

func (*ProjectsLogServicesSinksListCall) Fields

Fields allows partial responses to be retrieved. See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more information.

type ProjectsLogServicesSinksService

type ProjectsLogServicesSinksService struct {
	// contains filtered or unexported fields
}

func NewProjectsLogServicesSinksService

func NewProjectsLogServicesSinksService(s *Service) *ProjectsLogServicesSinksService

func (*ProjectsLogServicesSinksService) Create

func (r *ProjectsLogServicesSinksService) Create(projectsId string, logServicesId string, logsink *LogSink) *ProjectsLogServicesSinksCreateCall

Create: Creates the specified log service sink resource.

func (*ProjectsLogServicesSinksService) Delete

func (r *ProjectsLogServicesSinksService) Delete(projectsId string, logServicesId string, sinksId string) *ProjectsLogServicesSinksDeleteCall

Delete: Deletes the specified log service sink.

func (*ProjectsLogServicesSinksService) Get

func (r *ProjectsLogServicesSinksService) Get(projectsId string, logServicesId string, sinksId string) *ProjectsLogServicesSinksGetCall

Get: Gets the specified log service sink resource.

func (*ProjectsLogServicesSinksService) List

List: Lists log service sinks associated with the specified service.

func (*ProjectsLogServicesSinksService) Update

func (r *ProjectsLogServicesSinksService) Update(projectsId string, logServicesId string, sinksId string, logsink *LogSink) *ProjectsLogServicesSinksUpdateCall

Update: Creates or update the specified log service sink resource.

type ProjectsLogServicesSinksUpdateCall

type ProjectsLogServicesSinksUpdateCall struct {
	// contains filtered or unexported fields
}

func (*ProjectsLogServicesSinksUpdateCall) Do

func (*ProjectsLogServicesSinksUpdateCall) Fields

Fields allows partial responses to be retrieved. See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more information.

type ProjectsLogsDeleteCall

type ProjectsLogsDeleteCall struct {
	// contains filtered or unexported fields
}

func (*ProjectsLogsDeleteCall) Do

func (c *ProjectsLogsDeleteCall) Do() (*Empty, error)

func (*ProjectsLogsDeleteCall) Fields

Fields allows partial responses to be retrieved. See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more information.

type ProjectsLogsEntriesService

type ProjectsLogsEntriesService struct {
	// contains filtered or unexported fields
}

func NewProjectsLogsEntriesService

func NewProjectsLogsEntriesService(s *Service) *ProjectsLogsEntriesService

func (*ProjectsLogsEntriesService) Write

func (r *ProjectsLogsEntriesService) Write(projectsId string, logsId string, writelogentriesrequest *WriteLogEntriesRequest) *ProjectsLogsEntriesWriteCall

Write: Creates one or more log entries in a log. You must supply a list of `LogEntry` objects, named `entries`. Each `LogEntry` object must contain a payload object and a `LogEntryMetadata` object that describes the entry. You must fill in all the fields of the entry, metadata, and payload. You can also supply a map, `commonLabels`, that supplies default (key, value) data for the `entries[].metadata.labels` maps, saving you the trouble of creating identical copies for each entry.

type ProjectsLogsEntriesWriteCall

type ProjectsLogsEntriesWriteCall struct {
	// contains filtered or unexported fields
}

func (*ProjectsLogsEntriesWriteCall) Do

func (*ProjectsLogsEntriesWriteCall) Fields

Fields allows partial responses to be retrieved. See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more information.

type ProjectsLogsListCall

type ProjectsLogsListCall struct {
	// contains filtered or unexported fields
}

func (*ProjectsLogsListCall) Do

func (*ProjectsLogsListCall) Fields

Fields allows partial responses to be retrieved. See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more information.

func (*ProjectsLogsListCall) PageSize

func (c *ProjectsLogsListCall) PageSize(pageSize int64) *ProjectsLogsListCall

PageSize sets the optional parameter "pageSize": The maximum number of results to return.

func (*ProjectsLogsListCall) PageToken

func (c *ProjectsLogsListCall) PageToken(pageToken string) *ProjectsLogsListCall

PageToken sets the optional parameter "pageToken": An opaque token, returned as `nextPageToken` by a prior `ListLogs` operation. If `pageToken` is supplied, then the other fields of this request are ignored, and instead the previous `ListLogs` operation is continued.

func (*ProjectsLogsListCall) ServiceIndexPrefix

func (c *ProjectsLogsListCall) ServiceIndexPrefix(serviceIndexPrefix string) *ProjectsLogsListCall

ServiceIndexPrefix sets the optional parameter "serviceIndexPrefix": A log service index prefix for which to list logs. Only logs containing entries whose metadata that includes these label values (associated with index keys) are returned. The prefix is a slash separated list of values, and need not specify all index labels. An empty index (or a single slash) matches all log service indexes.

func (*ProjectsLogsListCall) ServiceName

func (c *ProjectsLogsListCall) ServiceName(serviceName string) *ProjectsLogsListCall

ServiceName sets the optional parameter "serviceName": A service name for which to list logs. Only logs containing entries whose metadata includes this service name are returned. If `serviceName` and `serviceIndexPrefix` are both empty, then all log names are returned. To list all log names, regardless of service, leave both the `serviceName` and `serviceIndexPrefix` empty. To list log names containing entries with a particular service name (or explicitly empty service name) set `serviceName` to the desired value and `serviceIndexPrefix` to `"/"`.

type ProjectsLogsService

type ProjectsLogsService struct {
	Entries *ProjectsLogsEntriesService

	Sinks *ProjectsLogsSinksService
	// contains filtered or unexported fields
}

func NewProjectsLogsService

func NewProjectsLogsService(s *Service) *ProjectsLogsService

func (*ProjectsLogsService) Delete

func (r *ProjectsLogsService) Delete(projectsId string, logsId string) *ProjectsLogsDeleteCall

Delete: Deletes the specified log resource and all log entries contained in it.

func (*ProjectsLogsService) List

func (r *ProjectsLogsService) List(projectsId string) *ProjectsLogsListCall

List: Lists log resources belonging to the specified project.

type ProjectsLogsSinksCreateCall

type ProjectsLogsSinksCreateCall struct {
	// contains filtered or unexported fields
}

func (*ProjectsLogsSinksCreateCall) Do

func (*ProjectsLogsSinksCreateCall) Fields

Fields allows partial responses to be retrieved. See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more information.

type ProjectsLogsSinksDeleteCall

type ProjectsLogsSinksDeleteCall struct {
	// contains filtered or unexported fields
}

func (*ProjectsLogsSinksDeleteCall) Do

func (*ProjectsLogsSinksDeleteCall) Fields

Fields allows partial responses to be retrieved. See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more information.

type ProjectsLogsSinksGetCall

type ProjectsLogsSinksGetCall struct {
	// contains filtered or unexported fields
}

func (*ProjectsLogsSinksGetCall) Do

func (*ProjectsLogsSinksGetCall) Fields

Fields allows partial responses to be retrieved. See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more information.

type ProjectsLogsSinksListCall

type ProjectsLogsSinksListCall struct {
	// contains filtered or unexported fields
}

func (*ProjectsLogsSinksListCall) Do

func (*ProjectsLogsSinksListCall) Fields

Fields allows partial responses to be retrieved. See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more information.

type ProjectsLogsSinksService

type ProjectsLogsSinksService struct {
	// contains filtered or unexported fields
}

func NewProjectsLogsSinksService

func NewProjectsLogsSinksService(s *Service) *ProjectsLogsSinksService

func (*ProjectsLogsSinksService) Create

func (r *ProjectsLogsSinksService) Create(projectsId string, logsId string, logsink *LogSink) *ProjectsLogsSinksCreateCall

Create: Creates the specified log sink resource.

func (*ProjectsLogsSinksService) Delete

func (r *ProjectsLogsSinksService) Delete(projectsId string, logsId string, sinksId string) *ProjectsLogsSinksDeleteCall

Delete: Deletes the specified log sink resource.

func (*ProjectsLogsSinksService) Get

func (r *ProjectsLogsSinksService) Get(projectsId string, logsId string, sinksId string) *ProjectsLogsSinksGetCall

Get: Gets the specified log sink resource.

func (*ProjectsLogsSinksService) List

func (r *ProjectsLogsSinksService) List(projectsId string, logsId string) *ProjectsLogsSinksListCall

List: Lists log sinks associated with the specified log.

func (*ProjectsLogsSinksService) Update

func (r *ProjectsLogsSinksService) Update(projectsId string, logsId string, sinksId string, logsink *LogSink) *ProjectsLogsSinksUpdateCall

Update: Creates or updates the specified log sink resource.

type ProjectsLogsSinksUpdateCall

type ProjectsLogsSinksUpdateCall struct {
	// contains filtered or unexported fields
}

func (*ProjectsLogsSinksUpdateCall) Do

func (*ProjectsLogsSinksUpdateCall) Fields

Fields allows partial responses to be retrieved. See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more information.

type ProjectsService

type ProjectsService struct {
	LogServices *ProjectsLogServicesService

	Logs *ProjectsLogsService
	// contains filtered or unexported fields
}

func NewProjectsService

func NewProjectsService(s *Service) *ProjectsService

type Service

type Service struct {
	BasePath  string // API endpoint base URL
	UserAgent string // optional additional User-Agent fragment

	Projects *ProjectsService
	// contains filtered or unexported fields
}

func New

func New(client *http.Client) (*Service, error)

type Status

type Status struct {
	// Code: The status code, which should be an enum value of
	// [google.rpc.Code][].
	Code int64 `json:"code,omitempty"`

	// Details: A list of messages that carry the error details. There will
	// be a common set of message types for APIs to use.
	Details []*StatusDetails `json:"details,omitempty"`

	// Message: A developer-facing error message, which should be in
	// English. The user-facing error message should be localized and stored
	// in the [google.rpc.Status.details][google.rpc.Status.details] field.
	Message string `json:"message,omitempty"`
}

type StatusDetails

type StatusDetails struct {
}

type WriteLogEntriesRequest

type WriteLogEntriesRequest struct {
	// CommonLabels: Metadata labels that apply to all entries in this
	// request. If one of the log entries contains a (key, value) with the
	// same key that is in `commonLabels`, then the entry's (key, value)
	// overrides the one in `commonLabels`.
	CommonLabels map[string]string `json:"commonLabels,omitempty"`

	// Entries: Log entries to insert.
	Entries []*LogEntry `json:"entries,omitempty"`
}

type WriteLogEntriesResponse

type WriteLogEntriesResponse struct {
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL