Google\Cloud\Logging\V2\ConfigServiceV2Client::updateSink PHP Метод

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
    public function updateSink($sinkName, $sink, $optionalArgs = [])
    {
        $request = new UpdateSinkRequest();
        $request->setSinkName($sinkName);
        $request->setSink($sink);
        if (isset($optionalArgs['uniqueWriterIdentity'])) {
            $request->setUniqueWriterIdentity($optionalArgs['uniqueWriterIdentity']);
        }
        $mergedSettings = $this->defaultCallSettings['updateSink']->merge(new CallSettings($optionalArgs));
        $callable = ApiCallable::createApiCall($this->configServiceV2Stub, 'UpdateSink', $mergedSettings, $this->descriptors['updateSink']);
        return $callable($request, [], ['call_credentials_callback' => $this->createCredentialsCallback()]);
    }