PHP Class Google\Cloud\Logging\Sink

Example: use Google\Cloud\ServiceBuilder; $cloud = new ServiceBuilder(); $logging = $cloud->logging(); $sink = $logging->sink('my-sink');
Datei anzeigen Open project: GoogleCloudPlatform/gcloud-php

Protected Properties

Property Type Description
$connection Represents a connection to Stackdriver Logging.

Public Methods

Method Description
__construct ( Google\Cloud\Logging\Connection\ConnectionInterface $connection, string $name, string $projectId, array $info = [] )
delete ( array $options = [] ) Delete the sink.
exists ( array $options = [] ) : boolean Check whether or not the sink exists.
info ( array $options = [] ) : array Retrieves the sink's details. If no sink data is cached a network request will be made to retrieve it.
name ( ) : string Returns the sink's name.
reload ( array $options = [] ) : array Triggers a network request to reload the sink's details.
update ( array $metadata, array $options = [] ) : array Update the sink. Please note this will trigger a network request if cached data is not available to perform the update with.

Method Details

__construct() public method

public __construct ( Google\Cloud\Logging\Connection\ConnectionInterface $connection, string $name, string $projectId, array $info = [] )
$connection Google\Cloud\Logging\Connection\ConnectionInterface Represents a connection to Cloud Logging.
$name string The sink's name.
$projectId string The project's ID.
$info array [optional] The sink's metadata.

delete() public method

Example: $sink->delete();
See also: https://cloud.google.com/logging/docs/api/reference/rest/v2/projects.sinks/delete projects.sinks delete API documentation.
public delete ( array $options = [] )
$options array [optional] Configuration Options.

exists() public method

Example: if ($sink->exists()) { echo "Sink exists!"; }
public exists ( array $options = [] ) : boolean
$options array [optional] Configuration Options
return boolean

info() public method

Example: $info = $sink->info(); echo $info['destination'];
See also: https://cloud.google.com/logging/docs/api/reference/rest/v2/projects.sinks#resource-logsink LogSink resource API documentation.
public info ( array $options = [] ) : array
$options array [optional] Configuration Options.
return array

name() public method

Example: echo $sink->name();
public name ( ) : string
return string

reload() public method

Example: $sink->reload(); $info = $sink->info(); echo $info['destination'];
See also: https://cloud.google.com/logging/docs/api/reference/rest/v2/projects.sinks/get projects.sinks get API documentation.
public reload ( array $options = [] ) : array
$options array [optional] Configuration Options.
return array

update() public method

Example: $sink->update([ 'destination' => 'storage.googleapis.com/my-bucket' ]);
See also: https://cloud.google.com/logging/docs/api/reference/rest/v2/projects.sinks/update projects.sinks update API documentation.
public update ( array $metadata, array $options = [] ) : array
$metadata array { The data to update. @type string $destination The export destination. Please see [Exporting Logs With Sinks](https://cloud.google.com/logging/docs/api/tasks/exporting-logs#about_sinks) for more information and examples. @type string $filter An [advanced logs filter](https://cloud.google.com/logging/docs/view/advanced_filters). @type string $outputVersionFormat The log entry version to use for this sink's exported log entries. This version does not have to correspond to the version of the log entry when it was written to Stackdriver Logging. May be either `V1` or `V2`. }
$options array [optional] Configuration Options.
return array

Property Details

$connection protected_oe property

Represents a connection to Stackdriver Logging.
protected $connection