PHP 클래스 Google\Cloud\Logging\V2\ConfigServiceV2Client

EXPERIMENTAL: this client library class has not yet been declared beta. This class may change more frequently than those which have been declared beta or 1.0, including changes which break backwards compatibility. This class provides the ability to make remote calls to the backing service through method calls that map to API methods. Sample code to get started: try { $configServiceV2Client = new ConfigServiceV2Client(); $formattedParent = ConfigServiceV2Client::formatProjectName("[PROJECT]"); foreach ($configServiceV2Client->listSinks($formattedParent) as $element) { doThingsWith(element); } } finally { if (isset($configServiceV2Client)) { $configServiceV2Client->close(); } } Many parameters require resource names to be formatted in a particular way. To assist with these names, this class includes a format method for each type of name, and additionally a parse method to extract the individual identifiers contained within names that are returned.
파일 보기 프로젝트 열기: GoogleCloudPlatform/gcloud-php

공개 메소드들

메소드 설명
__construct ( array $options = [] ) Constructor.
close ( ) Initiates an orderly shutdown in which preexisting calls continue but new calls are immediately cancelled.
createSink ( string $parent, google\logging\v2\LogSink $sink, array $optionalArgs = [] ) : google\logging\v2\LogSink Creates a sink.
deleteSink ( string $sinkName, array $optionalArgs = [] ) Deletes a sink.
formatProjectName ( $project ) Formats a string containing the fully-qualified path to represent a project resource.
formatSinkName ( $project, $sink ) Formats a string containing the fully-qualified path to represent a sink resource.
getSink ( string $sinkName, array $optionalArgs = [] ) : google\logging\v2\LogSink Gets a sink.
listSinks ( string $parent, array $optionalArgs = [] ) : Google\GAX\PagedListResponse Lists sinks.
parseProjectFromProjectName ( $projectName ) Parses the project from the given fully-qualified path which represents a project resource.
parseProjectFromSinkName ( $sinkName ) Parses the project from the given fully-qualified path which represents a sink resource.
parseSinkFromSinkName ( $sinkName ) Parses the sink from the given fully-qualified path which represents a sink resource.
updateSink ( string $sinkName, google\logging\v2\LogSink $sink, array $optionalArgs = [] ) : google\logging\v2\LogSink Updates or creates a sink.

비공개 메소드들

메소드 설명
createCredentialsCallback ( )
getPageStreamingDescriptors ( )
getProjectNameTemplate ( )
getSinkNameTemplate ( )

메소드 상세

__construct() 공개 메소드

Constructor.
public __construct ( array $options = [] )
$options array { Optional. Options for configuring the service API wrapper. @type string $serviceAddress The domain name of the API remote host. Default 'logging.googleapis.com'. @type mixed $port The port on which to connect to the remote host. Default 443. @type Grpc\ChannelCredentials $sslCreds A `ChannelCredentials` for use with an SSL-enabled channel. Default: a credentials object returned from Grpc\ChannelCredentials::createSsl() @type array $scopes A string array of scopes to use when acquiring credentials. Default the scopes for the Stackdriver Logging API. @type array $retryingOverride An associative array of string => RetryOptions, where the keys are method names (e.g. 'createFoo'), that overrides default retrying settings. A value of null indicates that the method in question should not retry. @type int $timeoutMillis The timeout in milliseconds to use for calls that don't use retries. For calls that use retries, set the timeout in RetryOptions. Default: 30000 (30 seconds) @type string $appName The codename of the calling service. Default 'gax'. @type string $appVersion The version of the calling service. Default: the current version of GAX. @type Google\Auth\CredentialsLoader $credentialsLoader A CredentialsLoader object created using the Google\Auth library. }

close() 공개 메소드

Initiates an orderly shutdown in which preexisting calls continue but new calls are immediately cancelled.
public close ( )

createSink() 공개 메소드

Sample code: try { $configServiceV2Client = new ConfigServiceV2Client(); $formattedParent = ConfigServiceV2Client::formatProjectName("[PROJECT]"); $sink = new LogSink(); $response = $configServiceV2Client->createSink($formattedParent, $sink); } finally { if (isset($configServiceV2Client)) { $configServiceV2Client->close(); } }
public createSink ( string $parent, google\logging\v2\LogSink $sink, array $optionalArgs = [] ) : google\logging\v2\LogSink
$parent string Required. The resource in which to create the sink: "projects/[PROJECT_ID]" "organizations/[ORGANIZATION_ID]"
$sink google\logging\v2\LogSink Required. The new sink, whose `name` parameter is a sink identifier that is not already in use.
$optionalArgs array { Optional. @type bool $uniqueWriterIdentity Optional. Whether the sink will have a dedicated service account returned in the sink's writer_identity. Set this field to be true to export logs from one project to a different project. This field is ignored for non-project sinks (e.g. organization sinks) because those sinks are required to have dedicated service accounts. @type \Google\GAX\RetrySettings $retrySettings Retry settings to use for this call. If present, then $timeoutMillis is ignored. @type int $timeoutMillis Timeout to use for this call. Only used if $retrySettings is not set. }
리턴 google\logging\v2\LogSink

deleteSink() 공개 메소드

Sample code: try { $configServiceV2Client = new ConfigServiceV2Client(); $formattedSinkName = ConfigServiceV2Client::formatSinkName("[PROJECT]", "[SINK]"); $configServiceV2Client->deleteSink($formattedSinkName); } finally { if (isset($configServiceV2Client)) { $configServiceV2Client->close(); } }
public deleteSink ( string $sinkName, array $optionalArgs = [] )
$sinkName string Required. The resource name of the sink to delete, including the parent resource and the sink identifier: "projects/[PROJECT_ID]/sinks/[SINK_ID]" "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]" It is an error if the sink does not exist.
$optionalArgs array { Optional. @type \Google\GAX\RetrySettings $retrySettings Retry settings to use for this call. If present, then $timeoutMillis is ignored. @type int $timeoutMillis Timeout to use for this call. Only used if $retrySettings is not set. }

formatProjectName() 공개 정적인 메소드

Formats a string containing the fully-qualified path to represent a project resource.
public static formatProjectName ( $project )

formatSinkName() 공개 정적인 메소드

Formats a string containing the fully-qualified path to represent a sink resource.
public static formatSinkName ( $project, $sink )

getSink() 공개 메소드

Sample code: try { $configServiceV2Client = new ConfigServiceV2Client(); $formattedSinkName = ConfigServiceV2Client::formatSinkName("[PROJECT]", "[SINK]"); $response = $configServiceV2Client->getSink($formattedSinkName); } finally { if (isset($configServiceV2Client)) { $configServiceV2Client->close(); } }
public getSink ( string $sinkName, array $optionalArgs = [] ) : google\logging\v2\LogSink
$sinkName string Required. The resource name of the sink to return: "projects/[PROJECT_ID]/sinks/[SINK_ID]" "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]"
$optionalArgs array { Optional. @type \Google\GAX\RetrySettings $retrySettings Retry settings to use for this call. If present, then $timeoutMillis is ignored. @type int $timeoutMillis Timeout to use for this call. Only used if $retrySettings is not set. }
리턴 google\logging\v2\LogSink

listSinks() 공개 메소드

Sample code: try { $configServiceV2Client = new ConfigServiceV2Client(); $formattedParent = ConfigServiceV2Client::formatProjectName("[PROJECT]"); foreach ($configServiceV2Client->listSinks($formattedParent) as $element) { doThingsWith(element); } } finally { if (isset($configServiceV2Client)) { $configServiceV2Client->close(); } }
public listSinks ( string $parent, array $optionalArgs = [] ) : Google\GAX\PagedListResponse
$parent string Required. The resource name where this sink was created: "projects/[PROJECT_ID]" "organizations/[ORGANIZATION_ID]"
$optionalArgs array { Optional. @type string $pageToken A page token is used to specify a page of values to be returned. If no page token is specified (the default), the first page of values will be returned. Any page token used here must have been generated by a previous call to the API. @type int $pageSize The maximum number of resources contained in the underlying API response. The API may return fewer values in a page, even if there are additional values to be retrieved. @type \Google\GAX\RetrySettings $retrySettings Retry settings to use for this call. If present, then $timeoutMillis is ignored. @type int $timeoutMillis Timeout to use for this call. Only used if $retrySettings is not set. }
리턴 Google\GAX\PagedListResponse

parseProjectFromProjectName() 공개 정적인 메소드

Parses the project from the given fully-qualified path which represents a project resource.
public static parseProjectFromProjectName ( $projectName )

parseProjectFromSinkName() 공개 정적인 메소드

Parses the project from the given fully-qualified path which represents a sink resource.
public static parseProjectFromSinkName ( $sinkName )

parseSinkFromSinkName() 공개 정적인 메소드

Parses the sink from the given fully-qualified path which represents a sink resource.
public static parseSinkFromSinkName ( $sinkName )

updateSink() 공개 메소드

Sample code: try { $configServiceV2Client = new ConfigServiceV2Client(); $formattedSinkName = ConfigServiceV2Client::formatSinkName("[PROJECT]", "[SINK]"); $sink = new LogSink(); $response = $configServiceV2Client->updateSink($formattedSinkName, $sink); } finally { if (isset($configServiceV2Client)) { $configServiceV2Client->close(); } }
public updateSink ( string $sinkName, google\logging\v2\LogSink $sink, array $optionalArgs = [] ) : google\logging\v2\LogSink
$sinkName string Required. The resource name of the sink to update, including the parent resource and the sink identifier: "projects/[PROJECT_ID]/sinks/[SINK_ID]" "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]" Example: `"projects/my-project-id/sinks/my-sink-id"`.
$sink google\logging\v2\LogSink Required. The updated sink, whose name is the same identifier that appears as part of `sinkName`. If `sinkName` does not exist, then this method creates a new sink.
$optionalArgs array { Optional. @type bool $uniqueWriterIdentity Optional. Whether the sink will have a dedicated service account returned in the sink's writer_identity. Set this field to be true to export logs from one project to a different project. This field is ignored for non-project sinks (e.g. organization sinks) because those sinks are required to have dedicated service accounts. @type \Google\GAX\RetrySettings $retrySettings Retry settings to use for this call. If present, then $timeoutMillis is ignored. @type int $timeoutMillis Timeout to use for this call. Only used if $retrySettings is not set. }
리턴 google\logging\v2\LogSink