Package com.google.cloud.logging.spi.v2
Class GrpcLoggingRpc
- java.lang.Object
-
- com.google.cloud.logging.spi.v2.GrpcLoggingRpc
-
- All Implemented Interfaces:
LoggingRpc
,com.google.cloud.ServiceRpc
,AutoCloseable
public class GrpcLoggingRpc extends Object implements LoggingRpc
-
-
Constructor Summary
Constructors Constructor Description GrpcLoggingRpc(LoggingOptions options)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
close()
com.google.api.core.ApiFuture<LogExclusion>
create(CreateExclusionRequest request)
Sends a request to create a new exclusion in a specified parent resource.com.google.api.core.ApiFuture<LogMetric>
create(CreateLogMetricRequest request)
Sends a request to create a log metric.com.google.api.core.ApiFuture<LogSink>
create(CreateSinkRequest request)
Sends a request to create a sink.com.google.api.core.ApiFuture<com.google.protobuf.Empty>
delete(DeleteExclusionRequest request)
Sends a request to delete an exclusion.com.google.api.core.ApiFuture<com.google.protobuf.Empty>
delete(DeleteLogMetricRequest request)
Sends a request to delete a log metric.com.google.api.core.ApiFuture<com.google.protobuf.Empty>
delete(DeleteLogRequest request)
Sends a request to deletes a log.com.google.api.core.ApiFuture<com.google.protobuf.Empty>
delete(DeleteSinkRequest request)
Sends a request to delete a sink.com.google.api.core.ApiFuture<LogExclusion>
get(GetExclusionRequest request)
Sends a request to get the description of an exclusion.com.google.api.core.ApiFuture<LogMetric>
get(GetLogMetricRequest request)
Sends a request to get a log metric.com.google.api.core.ApiFuture<LogSink>
get(GetSinkRequest request)
Sends a request to get a sink.com.google.api.gax.rpc.BidiStream<TailLogEntriesRequest,TailLogEntriesResponse>
getTailLogEntriesStream()
This method returns a {code BidiStream} object to consume the stream of log entries.com.google.api.core.ApiFuture<ListExclusionsResponse>
list(ListExclusionsRequest request)
Sends a request to list all the exclusions in parent resource.com.google.api.core.ApiFuture<ListLogEntriesResponse>
list(ListLogEntriesRequest request)
Sends a request to list log entries.com.google.api.core.ApiFuture<ListLogMetricsResponse>
list(ListLogMetricsRequest request)
Sends a request to list the log metrics in a project.com.google.api.core.ApiFuture<ListMonitoredResourceDescriptorsResponse>
list(ListMonitoredResourceDescriptorsRequest request)
Sends a request to list monitored resource descriptors.com.google.api.core.ApiFuture<ListSinksResponse>
list(ListSinksRequest request)
Sends a request to list the sinks in a project.com.google.api.core.ApiFuture<ListLogsResponse>
listLogs(ListLogsRequest request)
Sends a request to list the log names in a project.com.google.api.core.ApiFuture<LogExclusion>
update(UpdateExclusionRequest request)
Sends a request to change one or more properties of an existing exclusion.com.google.api.core.ApiFuture<LogMetric>
update(UpdateLogMetricRequest request)
Sends a request to update a log metric.com.google.api.core.ApiFuture<LogSink>
update(UpdateSinkRequest request)
Sends a request to update a sink.com.google.api.core.ApiFuture<WriteLogEntriesResponse>
write(WriteLogEntriesRequest request)
Sends a request to write log entries to Cloud Logging.
-
-
-
Constructor Detail
-
GrpcLoggingRpc
public GrpcLoggingRpc(LoggingOptions options) throws IOException
- Throws:
IOException
-
-
Method Detail
-
create
public com.google.api.core.ApiFuture<LogSink> create(CreateSinkRequest request)
Description copied from interface:LoggingRpc
Sends a request to create a sink. This method returns aApiFuture
object to consume the result.Future.get()
returns the created sink.- Specified by:
create
in interfaceLoggingRpc
- Parameters:
request
- the request object containing all of the parameters for the API call
-
update
public com.google.api.core.ApiFuture<LogSink> update(UpdateSinkRequest request)
Description copied from interface:LoggingRpc
Sends a request to update a sink. If the sink does not exist, it is created. This method returns aApiFuture
object to consume the result.Future.get()
returns the updated or created sink.- Specified by:
update
in interfaceLoggingRpc
- Parameters:
request
- the request object containing all of the parameters for the API call
-
get
public com.google.api.core.ApiFuture<LogSink> get(GetSinkRequest request)
Description copied from interface:LoggingRpc
Sends a request to get a sink. This method returns aApiFuture
object to consume the result.Future.get()
returns the requested sink ornull
if not found.- Specified by:
get
in interfaceLoggingRpc
- Parameters:
request
- the request object containing all of the parameters for the API call
-
list
public com.google.api.core.ApiFuture<ListSinksResponse> list(ListSinksRequest request)
Description copied from interface:LoggingRpc
Sends a request to list the sinks in a project. This method returns aApiFuture
object to consume the result.Future.get()
returns a response object containing the listing result.- Specified by:
list
in interfaceLoggingRpc
- Parameters:
request
- the request object containing all of the parameters for the API call
-
delete
public com.google.api.core.ApiFuture<com.google.protobuf.Empty> delete(DeleteSinkRequest request)
Description copied from interface:LoggingRpc
Sends a request to delete a sink. This method returns aApiFuture
object to consume the result.Future.get()
returnsEmpty.getDefaultInstance()
ornull
if the sink was not found.- Specified by:
delete
in interfaceLoggingRpc
- Parameters:
request
- the request object containing all of the parameters for the API call
-
create
public com.google.api.core.ApiFuture<LogExclusion> create(CreateExclusionRequest request)
Description copied from interface:LoggingRpc
Sends a request to create a new exclusion in a specified parent resource. This method returns anApiFuture
object to consume the result.Future.get()
returns the created exclusion.- Specified by:
create
in interfaceLoggingRpc
- Parameters:
request
- the request object containing all of the parameters for the API call
-
get
public com.google.api.core.ApiFuture<LogExclusion> get(GetExclusionRequest request)
Description copied from interface:LoggingRpc
Sends a request to get the description of an exclusion. This method returns anApiFuture
object to consume the result.Future.get()
returns the requested exclusion ornull
if not found.- Specified by:
get
in interfaceLoggingRpc
- Parameters:
request
- the request object containing all of the parameters for the API call
-
update
public com.google.api.core.ApiFuture<LogExclusion> update(UpdateExclusionRequest request)
Description copied from interface:LoggingRpc
Sends a request to change one or more properties of an existing exclusion. This method returns anApiFuture
object to consume the result.Future.get()
returns the updated exclusion.- Specified by:
update
in interfaceLoggingRpc
- Parameters:
request
- the request object containing all of the parameters for the API call
-
list
public com.google.api.core.ApiFuture<ListExclusionsResponse> list(ListExclusionsRequest request)
Description copied from interface:LoggingRpc
Sends a request to list all the exclusions in parent resource. Use this method to retrieve exclusions from Cloud Logging. This method returns anApiFuture
object to consume the result.Future.get()
returns a response object containing the listing result.- Specified by:
list
in interfaceLoggingRpc
- Parameters:
request
- the request object containing all of the parameters for the API call
-
delete
public com.google.api.core.ApiFuture<com.google.protobuf.Empty> delete(DeleteExclusionRequest request)
Description copied from interface:LoggingRpc
Sends a request to delete an exclusion. This method returns anApiFuture
object to consume the result.Future.get()
returnsEmpty.getDefaultInstance()
ornull
if the log exclusion was not found.- Specified by:
delete
in interfaceLoggingRpc
- Parameters:
request
- the request object containing all of the parameters for the API call
-
listLogs
public com.google.api.core.ApiFuture<ListLogsResponse> listLogs(ListLogsRequest request)
Description copied from interface:LoggingRpc
Sends a request to list the log names in a project. This method returns aApiFuture
object to consume the result.Future.get()
returns a response object containing the listing result.- Specified by:
listLogs
in interfaceLoggingRpc
- Parameters:
request
- the request object containing all of the parameters for the API call
-
delete
public com.google.api.core.ApiFuture<com.google.protobuf.Empty> delete(DeleteLogRequest request)
Description copied from interface:LoggingRpc
Sends a request to deletes a log. This method returns aApiFuture
object to consume the result.Future.get()
returnsEmpty.getDefaultInstance()
ornull
if the log was not found. The deleted log will reappear if it receives new log entries.- Specified by:
delete
in interfaceLoggingRpc
- Parameters:
request
- the request object containing all of the parameters for the API call
-
write
public com.google.api.core.ApiFuture<WriteLogEntriesResponse> write(WriteLogEntriesRequest request)
Description copied from interface:LoggingRpc
Sends a request to write log entries to Cloud Logging. This method returns aApiFuture
object to consume the result.Future.get()
returns a response object for the write operation.- Specified by:
write
in interfaceLoggingRpc
- Parameters:
request
- the request object containing all of the parameters for the API call
-
list
public com.google.api.core.ApiFuture<ListLogEntriesResponse> list(ListLogEntriesRequest request)
Description copied from interface:LoggingRpc
Sends a request to list log entries. Use this method to retrieve log entries from Cloud Logging. This method returns aApiFuture
object to consume the result.Future.get()
returns a response object containing the listing result.- Specified by:
list
in interfaceLoggingRpc
- Parameters:
request
- the request object containing all of the parameters for the API call
-
getTailLogEntriesStream
public com.google.api.gax.rpc.BidiStream<TailLogEntriesRequest,TailLogEntriesResponse> getTailLogEntriesStream()
Description copied from interface:LoggingRpc
This method returns a {code BidiStream} object to consume the stream of log entries.- Specified by:
getTailLogEntriesStream
in interfaceLoggingRpc
-
list
public com.google.api.core.ApiFuture<ListMonitoredResourceDescriptorsResponse> list(ListMonitoredResourceDescriptorsRequest request)
Description copied from interface:LoggingRpc
Sends a request to list monitored resource descriptors. This method returns aApiFuture
object to consume the result.Future.get()
returns a response object containing the listing result.- Specified by:
list
in interfaceLoggingRpc
- Parameters:
request
- the request object containing all of the parameters for the API call
-
create
public com.google.api.core.ApiFuture<LogMetric> create(CreateLogMetricRequest request)
Description copied from interface:LoggingRpc
Sends a request to create a log metric. This method returns aApiFuture
object to consume the result.Future.get()
returns the created metric.- Specified by:
create
in interfaceLoggingRpc
- Parameters:
request
- the request object containing all of the parameters for the API call
-
update
public com.google.api.core.ApiFuture<LogMetric> update(UpdateLogMetricRequest request)
Description copied from interface:LoggingRpc
Sends a request to update a log metric. If the log metric does not exist, it is created. This method returns aApiFuture
object to consume the result.Future.get()
returns the updated or created log metric.- Specified by:
update
in interfaceLoggingRpc
- Parameters:
request
- the request object containing all of the parameters for the API call
-
get
public com.google.api.core.ApiFuture<LogMetric> get(GetLogMetricRequest request)
Description copied from interface:LoggingRpc
Sends a request to get a log metric. This method returns aApiFuture
object to consume the result.Future.get()
returns the requested log metric ornull
if not found.- Specified by:
get
in interfaceLoggingRpc
- Parameters:
request
- the request object containing all of the parameters for the API call
-
list
public com.google.api.core.ApiFuture<ListLogMetricsResponse> list(ListLogMetricsRequest request)
Description copied from interface:LoggingRpc
Sends a request to list the log metrics in a project. This method returns aApiFuture
object to consume the result.Future.get()
returns a response object containing the listing result.- Specified by:
list
in interfaceLoggingRpc
- Parameters:
request
- the request object containing all of the parameters for the API call
-
delete
public com.google.api.core.ApiFuture<com.google.protobuf.Empty> delete(DeleteLogMetricRequest request)
Description copied from interface:LoggingRpc
Sends a request to delete a log metric. This method returns aApiFuture
object to consume the result.Future.get()
returnsEmpty.getDefaultInstance()
ornull
if the log was not found.- Specified by:
delete
in interfaceLoggingRpc
- Parameters:
request
- the request object containing all of the parameters for the API call
-
close
public void close() throws Exception
- Specified by:
close
in interfaceAutoCloseable
- Throws:
Exception
-
-