Sink
(
name
,
*
,
filter_
=
None
,
parent
=
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
Properties
client
Client bound to the sink.
full_name
Fully-qualified name used in sink APIs
parent
Parent resource of the sink (project, organization, billingAccount, or folder).
path
URL path for the sink's APIs
writer_identity
Identity used for exports via the sink
Methods
Sink
Sink
(
name
,
*
,
filter_
=
None
,
parent
=
None
,
destination
=
None
,
client
=
None
)
name
str
The name of the sink.
parent
Optional[str]
The resource in which to create the sink: :: "projects/[PROJECT_ID]" "organizations/[ORGANIZATION_ID]" "billingAccounts/[BILLING_ACCOUNT_ID]" "folders/[FOLDER_ID]". Defaults to the project stored on the client.
filter_
Optional[str]
The advanced logs filter expression defining the entries exported by the sink.
destination
Optional[str]
Destination URI for the entries exported by the sink. If not passed, the instance should already exist, to be refreshed via reload
.
client
Optional[ logging_v2.client.Client
]
A client which holds credentials and project configuration for the sink (which requires a project).
create
create
(
*
,
client
=
None
,
unique_writer_identity
=
False
)
Create the sink via a PUT request
See https://cloud.google.com/logging/docs/reference/v2/rest/v2/projects.sinks/create
client
Optional[ logging_v2.client.Client
]
The client to use. If not passed, falls back to the client
stored on the current sink.
unique_writer_identity
Optional[bool]
Determines the kind of IAM identity returned as writer_identity in the new sink.
delete
delete
(
*
,
client
=
None
)
Delete a sink via a DELETE request
See https://cloud.google.com/logging/docs/reference/v2/rest/v2/projects.sinks/delete
client
Optional[ logging_v2.client.Client
]
The client to use. If not passed, falls back to the client
stored on the current sink.
exists
exists
(
*
,
client
=
None
)
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
client
Optional[ logging_v2.client.Client
]
The client to use. If not passed, falls back to the client
stored on the current sink.
bool
from_api_repr
from_api_repr
(
resource
,
client
,
*
,
parent
=
None
)
Construct a sink given its API representation
resource
dict
sink resource representation returned from the API
client
logging_v2.client.Client
Client which holds credentials and project configuration for the sink.
parent
Optional[str]
The resource in which to create the sink: :: "projects/[PROJECT_ID]" "organizations/[ORGANIZATION_ID]" "billingAccounts/[BILLING_ACCOUNT_ID]" "folders/[FOLDER_ID]". Defaults to the project stored on the client.
ValueError
client
is not None
and the project from the resource does not agree with the project from the client. logging_v2.sink.Sink
resource
.reload
reload
(
*
,
client
=
None
)
Sync local sink configuration via a GET request
See https://cloud.google.com/logging/docs/reference/v2/rest/v2/projects.sinks/get
client
Optional[ logging_v2.client.Client
]
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
)
Update sink configuration via a PUT request
See https://cloud.google.com/logging/docs/reference/v2/rest/v2/projects.sinks/update
client
Optional[ logging_v2.client.Client
]
The client to use. If not passed, falls back to the client
stored on the current sink.
unique_writer_identity
Optional[bool]
Determines the kind of IAM identity returned as writer_identity in the new sink.