Class Sink (1.13.0)

  Sink 
 ( 
 name 
 , 
 filter_ 
 = 
 None 
 , 
 destination 
 = 
 None 
 , 
 client 
 = 
 None 
 ) 
 

Sinks represent filtered exports for log entries.

See https://cloud.google.com/logging/docs/reference/v2/rest/v2/projects.sinks

Parameters

Name
Description
name
str

the name of the sink

filter_
str

(optional) the advanced logs filter expression defining the entries exported by the sink.

destination
str

destination URI for the entries exported by the sink. If not passed, the instance should already exist, to be refreshed via reload .

client
Client

A client which holds credentials and project configuration for the sink (which requires a project).

Properties

client

Client bound to the sink.

full_name

Fully-qualified name used in sink APIs

path

URL path for the sink's APIs

project

Project bound to the sink.

writer_identity

Identity used for exports via the sink

Methods

create

  create 
 ( 
 client 
 = 
 None 
 , 
 unique_writer_identity 
 = 
 False 
 ) 
 
Parameters
Name
Description
client
Client or NoneType

the client to use. If not passed, falls back to the client stored on the current sink.

unique_writer_identity
bool

(Optional) determines the kind of IAM identity returned as writer_identity in the new sink.

delete

  delete 
 ( 
 client 
 = 
 None 
 ) 
 
Parameter
Name
Description
client
Client or NoneType

the client to use. If not passed, falls back to the client stored on the current sink.

exists

  exists 
 ( 
 client 
 = 
 None 
 ) 
 

API call: test for the existence of the sink via a GET request

See https://cloud.google.com/logging/docs/reference/v2/rest/v2/projects.sinks/get

Parameter
Name
Description
client
Client or NoneType

the client to use. If not passed, falls back to the client stored on the current sink.

Returns
Type
Description
bool
Boolean indicating existence of the sink.

from_api_repr

  from_api_repr 
 ( 
 resource 
 , 
 client 
 ) 
 

Factory: construct a sink given its API representation

Parameters
Name
Description
resource
dict

sink resource representation returned from the API

client
Client

Client which holds credentials and project configuration for the sink.

Exceptions
Type
Description
`ValueError
if client is not None and the project from the resource does not agree with the project from the client.
Returns
Type
Description
Sink parsed from resource .

reload

  reload 
 ( 
 client 
 = 
 None 
 ) 
 

API call: sync local sink configuration via a GET request

See https://cloud.google.com/logging/docs/reference/v2/rest/v2/projects.sinks/get

Parameter
Name
Description
client
Client or NoneType

the client to use. If not passed, falls back to the client stored on the current sink.

update

  update 
 ( 
 client 
 = 
 None 
 , 
 unique_writer_identity 
 = 
 False 
 ) 
 

API call: update sink configuration via a PUT request

See https://cloud.google.com/logging/docs/reference/v2/rest/v2/projects.sinks/update

Parameters
Name
Description
client
Client or NoneType

the client to use. If not passed, falls back to the client stored on the current sink.

unique_writer_identity
bool

(Optional) determines the kind of IAM identity returned as writer_identity in the new sink.

Design a Mobile Site
View Site in Mobile | Classic
Share by: