Reference documentation and code samples for the Google Cloud Chronicle V1 Client class FeedsServiceClient.
Service Description: FeedsService contains procedures for managing Chronicle third-party feeds.
This class provides the ability to make remote calls to the backing service through method calls that map to API methods.
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 parseName method to extract the individual identifiers contained within formatted names that are returned by the API.
Namespace
Google \ Cloud \ Chronicle \ V1 \ ClientMethods
__construct
Constructor.
| Parameters | |
|---|---|
| Name | Description |
options |
array|Google\ApiCore\Options\ClientOptions
Optional. Options for configuring the service API wrapper. |
↳ apiEndpoint |
string
The address of the API remote host. May optionally include the port, formatted as "
|
↳ credentials |
Google\Auth\FetchAuthTokenInterface|Google\ApiCore\CredentialsWrapper
This option should only be used with a pre-constructed Google\Auth\FetchAuthTokenInterface or Google\ApiCore\CredentialsWrapper object. Note that when one of these objects are provided, any settings in $credentialsConfig will be ignored. Important: If you are providing a path to a credentials file, or a decoded credentials file as a PHP array, this usage is now DEPRECATED. Providing an unvalidated credential configuration to Google APIs can compromise the security of your systems and data. It is recommended to create the credentials explicitly |
↳ credentialsConfig |
array
Options used to configure credentials, including auth token caching, for the client. For a full list of supporting configuration options, see Google\ApiCore\CredentialsWrapper::build() . |
↳ disableRetries |
bool
Determines whether or not retries defined by the client configuration should be disabled. Defaults to |
↳ clientConfig |
string|array
Client method configuration, including retry settings. This option can be either a path to a JSON file, or a PHP array containing the decoded JSON data. By default this settings points to the default client config file, which is provided in the resources folder. |
↳ transport |
string|Google\ApiCore\Transport\TransportInterface
The transport used for executing network requests. May be either the string |
↳ transportConfig |
array
Configuration options that will be used to construct the transport. Options for each supported transport type should be passed in a key for that transport. For example: $transportConfig = [ 'grpc' => [...], 'rest' => [...], ]; See the Google\ApiCore\Transport\GrpcTransport::build() and Google\ApiCore\Transport\RestTransport::build() methods for the supported options. |
↳ clientCertSource |
callable
A callable which returns the client cert as a string. This can be used to provide a certificate and private key to the transport layer for mTLS. |
↳ logger |
false|Psr\Log\LoggerInterface
A PSR-3 compliant logger. If set to false, logging is disabled, ignoring the 'GOOGLE_SDK_PHP_LOGGING' environment flag |
↳ universeDomain |
string
The service domain for the client. Defaults to 'googleapis.com'. |
createFeed
Creates a feed.
The async variant is FeedsServiceClient::createFeedAsync() .
| Parameters | |
|---|---|
| Name | Description |
request |
Google\Cloud\Chronicle\V1\CreateFeedRequest
A request to house fields associated with the call. |
callOptions |
array
Optional. |
↳ retrySettings |
Google\ApiCore\RetrySettings|array
Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage. |
| Returns | |
|---|---|
| Type | Description |
Google\Cloud\Chronicle\V1\Feed |
|
use Google\ApiCore\ApiException;
use Google\Cloud\Chronicle\V1\Client\FeedsServiceClient;
use Google\Cloud\Chronicle\V1\CreateFeedRequest;
use Google\Cloud\Chronicle\V1\Feed;
/**
* @param string $formattedParent The parent resource where this Feed will be created.
* Format: projects/{project}/locations/{location}/instances/{instance}
* Please see {@see FeedsServiceClient::instanceName()} for help formatting this field.
*/
function create_feed_sample(string $formattedParent): void
{
// Create a client.
$feedsServiceClient = new FeedsServiceClient();
// Prepare the request message.
$feed = new Feed();
$request = (new CreateFeedRequest())
->setParent($formattedParent)
->setFeed($feed);
// Call the API and handle any network failures.
try {
/** @var Feed $response */
$response = $feedsServiceClient->createFeed($request);
printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
} catch (ApiException $ex) {
printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
}
}
/**
* Helper to execute the sample.
*
* This sample has been automatically generated and should be regarded as a code
* template only. It will require modifications to work:
* - It may require correct/in-range values for request initialization.
* - It may require specifying regional endpoints when creating the service client,
* please see the apiEndpoint client configuration option for more details.
*/
function callSample(): void
{
$formattedParent = FeedsServiceClient::instanceName('[PROJECT]', '[LOCATION]', '[INSTANCE]');
create_feed_sample($formattedParent);
}
deleteFeed
Deletes a feed.
The async variant is FeedsServiceClient::deleteFeedAsync() .
| Parameters | |
|---|---|
| Name | Description |
request |
Google\Cloud\Chronicle\V1\DeleteFeedRequest
A request to house fields associated with the call. |
callOptions |
array
Optional. |
↳ retrySettings |
Google\ApiCore\RetrySettings|array
Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage. |
use Google\ApiCore\ApiException;
use Google\Cloud\Chronicle\V1\Client\FeedsServiceClient;
use Google\Cloud\Chronicle\V1\DeleteFeedRequest;
/**
* @param string $formattedName The ID of the feed to retrieve.
* Format:
* projects/{project}/locations/{location}/instances/{instance}/feeds/{feed}
* Please see {@see FeedsServiceClient::feedName()} for help formatting this field.
*/
function delete_feed_sample(string $formattedName): void
{
// Create a client.
$feedsServiceClient = new FeedsServiceClient();
// Prepare the request message.
$request = (new DeleteFeedRequest())
->setName($formattedName);
// Call the API and handle any network failures.
try {
$feedsServiceClient->deleteFeed($request);
printf('Call completed successfully.' . PHP_EOL);
} catch (ApiException $ex) {
printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
}
}
/**
* Helper to execute the sample.
*
* This sample has been automatically generated and should be regarded as a code
* template only. It will require modifications to work:
* - It may require correct/in-range values for request initialization.
* - It may require specifying regional endpoints when creating the service client,
* please see the apiEndpoint client configuration option for more details.
*/
function callSample(): void
{
$formattedName = FeedsServiceClient::feedName('[PROJECT]', '[LOCATION]', '[INSTANCE]', '[FEED]');
delete_feed_sample($formattedName);
}
disableFeed
Disable feed for ingestion. Make FeedState ARCHIVED.
The async variant is FeedsServiceClient::disableFeedAsync() .
| Parameters | |
|---|---|
| Name | Description |
request |
Google\Cloud\Chronicle\V1\DisableFeedRequest
A request to house fields associated with the call. |
callOptions |
array
Optional. |
↳ retrySettings |
Google\ApiCore\RetrySettings|array
Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage. |
| Returns | |
|---|---|
| Type | Description |
Google\Cloud\Chronicle\V1\Feed |
|
use Google\ApiCore\ApiException;
use Google\Cloud\Chronicle\V1\Client\FeedsServiceClient;
use Google\Cloud\Chronicle\V1\DisableFeedRequest;
use Google\Cloud\Chronicle\V1\Feed;
/**
* @param string $formattedName The name of the feed to disable.
* Format:
* projects/{project}/locations/{location}/instances/{instance}/feeds/{feed}
* Please see {@see FeedsServiceClient::feedName()} for help formatting this field.
*/
function disable_feed_sample(string $formattedName): void
{
// Create a client.
$feedsServiceClient = new FeedsServiceClient();
// Prepare the request message.
$request = (new DisableFeedRequest())
->setName($formattedName);
// Call the API and handle any network failures.
try {
/** @var Feed $response */
$response = $feedsServiceClient->disableFeed($request);
printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
} catch (ApiException $ex) {
printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
}
}
/**
* Helper to execute the sample.
*
* This sample has been automatically generated and should be regarded as a code
* template only. It will require modifications to work:
* - It may require correct/in-range values for request initialization.
* - It may require specifying regional endpoints when creating the service client,
* please see the apiEndpoint client configuration option for more details.
*/
function callSample(): void
{
$formattedName = FeedsServiceClient::feedName('[PROJECT]', '[LOCATION]', '[INSTANCE]', '[FEED]');
disable_feed_sample($formattedName);
}
enableFeed
Enable feed for ingestion.
The async variant is FeedsServiceClient::enableFeedAsync() .
| Parameters | |
|---|---|
| Name | Description |
request |
Google\Cloud\Chronicle\V1\EnableFeedRequest
A request to house fields associated with the call. |
callOptions |
array
Optional. |
↳ retrySettings |
Google\ApiCore\RetrySettings|array
Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage. |
| Returns | |
|---|---|
| Type | Description |
Google\Cloud\Chronicle\V1\Feed |
|
use Google\ApiCore\ApiException;
use Google\Cloud\Chronicle\V1\Client\FeedsServiceClient;
use Google\Cloud\Chronicle\V1\EnableFeedRequest;
use Google\Cloud\Chronicle\V1\Feed;
/**
* @param string $formattedName The name of the feed to enable.
* Format:
* projects/{project}/locations/{location}/instances/{instance}/feeds/{feed}
* Please see {@see FeedsServiceClient::feedName()} for help formatting this field.
*/
function enable_feed_sample(string $formattedName): void
{
// Create a client.
$feedsServiceClient = new FeedsServiceClient();
// Prepare the request message.
$request = (new EnableFeedRequest())
->setName($formattedName);
// Call the API and handle any network failures.
try {
/** @var Feed $response */
$response = $feedsServiceClient->enableFeed($request);
printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
} catch (ApiException $ex) {
printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
}
}
/**
* Helper to execute the sample.
*
* This sample has been automatically generated and should be regarded as a code
* template only. It will require modifications to work:
* - It may require correct/in-range values for request initialization.
* - It may require specifying regional endpoints when creating the service client,
* please see the apiEndpoint client configuration option for more details.
*/
function callSample(): void
{
$formattedName = FeedsServiceClient::feedName('[PROJECT]', '[LOCATION]', '[INSTANCE]', '[FEED]');
enable_feed_sample($formattedName);
}
fetchServiceAccountForCustomer
Fetch Chronicle's service account used for ingesting data from Cloud Storage buckets.
The async variant is FeedsServiceClient::fetchServiceAccountForCustomerAsync() .
| Parameters | |
|---|---|
| Name | Description |
request |
Google\Cloud\Chronicle\V1\FetchServiceAccountForCustomerRequest
A request to house fields associated with the call. |
callOptions |
array
Optional. |
↳ retrySettings |
Google\ApiCore\RetrySettings|array
Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage. |
| Returns | |
|---|---|
| Type | Description |
Google\Cloud\Chronicle\V1\FeedServiceAccount |
|
use Google\ApiCore\ApiException;
use Google\Cloud\Chronicle\V1\Client\FeedsServiceClient;
use Google\Cloud\Chronicle\V1\FeedServiceAccount;
use Google\Cloud\Chronicle\V1\FetchServiceAccountForCustomerRequest;
/**
* @param string $formattedParent The parent resource where this FeedServiceAccount will be
* created. Format:
* projects/{project}/locations/{location}/instances/{instance}
* Please see {@see FeedsServiceClient::instanceName()} for help formatting this field.
*/
function fetch_service_account_for_customer_sample(string $formattedParent): void
{
// Create a client.
$feedsServiceClient = new FeedsServiceClient();
// Prepare the request message.
$request = (new FetchServiceAccountForCustomerRequest())
->setParent($formattedParent);
// Call the API and handle any network failures.
try {
/** @var FeedServiceAccount $response */
$response = $feedsServiceClient->fetchServiceAccountForCustomer($request);
printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
} catch (ApiException $ex) {
printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
}
}
/**
* Helper to execute the sample.
*
* This sample has been automatically generated and should be regarded as a code
* template only. It will require modifications to work:
* - It may require correct/in-range values for request initialization.
* - It may require specifying regional endpoints when creating the service client,
* please see the apiEndpoint client configuration option for more details.
*/
function callSample(): void
{
$formattedParent = FeedsServiceClient::instanceName('[PROJECT]', '[LOCATION]', '[INSTANCE]');
fetch_service_account_for_customer_sample($formattedParent);
}
generateSecret
Generates a new secret for https push feeds which do not support jwt tokens. Secrets once generated should be copied and stored in safe place to be used while configuring https push feeds.Please note that you can always generate a new secret again for a feed using this API but it will invalidate the previously generated secret for the feed.
The async variant is FeedsServiceClient::generateSecretAsync() .
| Parameters | |
|---|---|
| Name | Description |
request |
Google\Cloud\Chronicle\V1\GenerateSecretRequest
A request to house fields associated with the call. |
callOptions |
array
Optional. |
↳ retrySettings |
Google\ApiCore\RetrySettings|array
Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage. |
| Returns | |
|---|---|
| Type | Description |
Google\Cloud\Chronicle\V1\GenerateSecretResponse |
|
use Google\ApiCore\ApiException;
use Google\Cloud\Chronicle\V1\Client\FeedsServiceClient;
use Google\Cloud\Chronicle\V1\GenerateSecretRequest;
use Google\Cloud\Chronicle\V1\GenerateSecretResponse;
/**
* @param string $formattedName The name of the feed to for which to generate secret.
* Format:
* projects/{project}/locations/{location}/instances/{instance}/feeds/{feed}
* Please see {@see FeedsServiceClient::feedName()} for help formatting this field.
*/
function generate_secret_sample(string $formattedName): void
{
// Create a client.
$feedsServiceClient = new FeedsServiceClient();
// Prepare the request message.
$request = (new GenerateSecretRequest())
->setName($formattedName);
// Call the API and handle any network failures.
try {
/** @var GenerateSecretResponse $response */
$response = $feedsServiceClient->generateSecret($request);
printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
} catch (ApiException $ex) {
printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
}
}
/**
* Helper to execute the sample.
*
* This sample has been automatically generated and should be regarded as a code
* template only. It will require modifications to work:
* - It may require correct/in-range values for request initialization.
* - It may require specifying regional endpoints when creating the service client,
* please see the apiEndpoint client configuration option for more details.
*/
function callSample(): void
{
$formattedName = FeedsServiceClient::feedName('[PROJECT]', '[LOCATION]', '[INSTANCE]', '[FEED]');
generate_secret_sample($formattedName);
}
getFeed
Gets a feed.
The async variant is FeedsServiceClient::getFeedAsync() .
| Parameters | |
|---|---|
| Name | Description |
request |
Google\Cloud\Chronicle\V1\GetFeedRequest
A request to house fields associated with the call. |
callOptions |
array
Optional. |
↳ retrySettings |
Google\ApiCore\RetrySettings|array
Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage. |
| Returns | |
|---|---|
| Type | Description |
Google\Cloud\Chronicle\V1\Feed |
|
use Google\ApiCore\ApiException;
use Google\Cloud\Chronicle\V1\Client\FeedsServiceClient;
use Google\Cloud\Chronicle\V1\Feed;
use Google\Cloud\Chronicle\V1\GetFeedRequest;
/**
* @param string $formattedName The ID of the feed to retrieve.
* Format:
* projects/{project}/locations/{location}/instances/{instance}/feeds/{feed}
* Please see {@see FeedsServiceClient::feedName()} for help formatting this field.
*/
function get_feed_sample(string $formattedName): void
{
// Create a client.
$feedsServiceClient = new FeedsServiceClient();
// Prepare the request message.
$request = (new GetFeedRequest())
->setName($formattedName);
// Call the API and handle any network failures.
try {
/** @var Feed $response */
$response = $feedsServiceClient->getFeed($request);
printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
} catch (ApiException $ex) {
printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
}
}
/**
* Helper to execute the sample.
*
* This sample has been automatically generated and should be regarded as a code
* template only. It will require modifications to work:
* - It may require correct/in-range values for request initialization.
* - It may require specifying regional endpoints when creating the service client,
* please see the apiEndpoint client configuration option for more details.
*/
function callSample(): void
{
$formattedName = FeedsServiceClient::feedName('[PROJECT]', '[LOCATION]', '[INSTANCE]', '[FEED]');
get_feed_sample($formattedName);
}
getFeedPack
Gets a feed pack.
The async variant is FeedsServiceClient::getFeedPackAsync() .
| Parameters | |
|---|---|
| Name | Description |
request |
Google\Cloud\Chronicle\V1\GetFeedPackRequest
A request to house fields associated with the call. |
callOptions |
array
Optional. |
↳ retrySettings |
Google\ApiCore\RetrySettings|array
Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage. |
| Returns | |
|---|---|
| Type | Description |
Google\Cloud\Chronicle\V1\FeedPack |
|
use Google\ApiCore\ApiException;
use Google\Cloud\Chronicle\V1\Client\FeedsServiceClient;
use Google\Cloud\Chronicle\V1\FeedPack;
use Google\Cloud\Chronicle\V1\GetFeedPackRequest;
/**
* @param string $formattedName The ID of the feed pack to retrieve.
* Format:
* projects/{project}/locations/{location}/instances/{instance}/feedPacks/{feedPack}
* Please see {@see FeedsServiceClient::feedPackName()} for help formatting this field.
*/
function get_feed_pack_sample(string $formattedName): void
{
// Create a client.
$feedsServiceClient = new FeedsServiceClient();
// Prepare the request message.
$request = (new GetFeedPackRequest())
->setName($formattedName);
// Call the API and handle any network failures.
try {
/** @var FeedPack $response */
$response = $feedsServiceClient->getFeedPack($request);
printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
} catch (ApiException $ex) {
printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
}
}
/**
* Helper to execute the sample.
*
* This sample has been automatically generated and should be regarded as a code
* template only. It will require modifications to work:
* - It may require correct/in-range values for request initialization.
* - It may require specifying regional endpoints when creating the service client,
* please see the apiEndpoint client configuration option for more details.
*/
function callSample(): void
{
$formattedName = FeedsServiceClient::feedPackName(
'[PROJECT]',
'[LOCATION]',
'[INSTANCE]',
'[FEED_PACK]'
);
get_feed_pack_sample($formattedName);
}
importPushLogs
Import logs coming from https push feeds.
All log entries must be valid UTF-8. A single invalid event will cause the entire request to be rejected.
The async variant is FeedsServiceClient::importPushLogsAsync() .
| Parameters | |
|---|---|
| Name | Description |
request |
Google\Cloud\Chronicle\V1\ImportPushLogsRequest
A request to house fields associated with the call. |
callOptions |
array
Optional. |
↳ retrySettings |
Google\ApiCore\RetrySettings|array
Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage. |
| Returns | |
|---|---|
| Type | Description |
Google\Api\HttpBody |
|
use Google\ApiCore\ApiException;
use Google\Api\HttpBody;
use Google\Cloud\Chronicle\V1\Client\FeedsServiceClient;
use Google\Cloud\Chronicle\V1\ImportPushLogsRequest;
/**
* @param string $formattedParent The parent, which owns this collection of logs.
* Format:
* projects/{project}/locations/{location}/instances/{instance}/feeds/{feed}
* Please see {@see FeedsServiceClient::feedName()} for help formatting this field.
*/
function import_push_logs_sample(string $formattedParent): void
{
// Create a client.
$feedsServiceClient = new FeedsServiceClient();
// Prepare the request message.
$httpBody = new HttpBody();
$request = (new ImportPushLogsRequest())
->setParent($formattedParent)
->setHttpBody($httpBody);
// Call the API and handle any network failures.
try {
/** @var HttpBody $response */
$response = $feedsServiceClient->importPushLogs($request);
printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
} catch (ApiException $ex) {
printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
}
}
/**
* Helper to execute the sample.
*
* This sample has been automatically generated and should be regarded as a code
* template only. It will require modifications to work:
* - It may require correct/in-range values for request initialization.
* - It may require specifying regional endpoints when creating the service client,
* please see the apiEndpoint client configuration option for more details.
*/
function callSample(): void
{
$formattedParent = FeedsServiceClient::feedName('[PROJECT]', '[LOCATION]', '[INSTANCE]', '[FEED]');
import_push_logs_sample($formattedParent);
}
listFeedPacks
Lists Packs for which feeds can be configured.
The async variant is FeedsServiceClient::listFeedPacksAsync() .
| Parameters | |
|---|---|
| Name | Description |
request |
Google\Cloud\Chronicle\V1\ListFeedPacksRequest
A request to house fields associated with the call. |
callOptions |
array
Optional. |
↳ retrySettings |
Google\ApiCore\RetrySettings|array
Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage. |
| Returns | |
|---|---|
| Type | Description |
Google\ApiCore\PagedListResponse |
|
use Google\ApiCore\ApiException;
use Google\ApiCore\PagedListResponse;
use Google\Cloud\Chronicle\V1\Client\FeedsServiceClient;
use Google\Cloud\Chronicle\V1\FeedPack;
use Google\Cloud\Chronicle\V1\ListFeedPacksRequest;
/**
* @param string $formattedParent The parent resource where this content pack will be created.
* Format: projects/{project}/locations/{location}/instances/{instance}
* Please see {@see FeedsServiceClient::instanceName()} for help formatting this field.
*/
function list_feed_packs_sample(string $formattedParent): void
{
// Create a client.
$feedsServiceClient = new FeedsServiceClient();
// Prepare the request message.
$request = (new ListFeedPacksRequest())
->setParent($formattedParent);
// Call the API and handle any network failures.
try {
/** @var PagedListResponse $response */
$response = $feedsServiceClient->listFeedPacks($request);
/** @var FeedPack $element */
foreach ($response as $element) {
printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString());
}
} catch (ApiException $ex) {
printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
}
}
/**
* Helper to execute the sample.
*
* This sample has been automatically generated and should be regarded as a code
* template only. It will require modifications to work:
* - It may require correct/in-range values for request initialization.
* - It may require specifying regional endpoints when creating the service client,
* please see the apiEndpoint client configuration option for more details.
*/
function callSample(): void
{
$formattedParent = FeedsServiceClient::instanceName('[PROJECT]', '[LOCATION]', '[INSTANCE]');
list_feed_packs_sample($formattedParent);
}
listFeedSourceTypeSchemas
List all FeedSourceTypeSchemas.
The async variant is FeedsServiceClient::listFeedSourceTypeSchemasAsync() .
| Parameters | |
|---|---|
| Name | Description |
request |
Google\Cloud\Chronicle\V1\ListFeedSourceTypeSchemasRequest
A request to house fields associated with the call. |
callOptions |
array
Optional. |
↳ retrySettings |
Google\ApiCore\RetrySettings|array
Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage. |
| Returns | |
|---|---|
| Type | Description |
Google\ApiCore\PagedListResponse |
|
use Google\ApiCore\ApiException;
use Google\ApiCore\PagedListResponse;
use Google\Cloud\Chronicle\V1\Client\FeedsServiceClient;
use Google\Cloud\Chronicle\V1\FeedSourceTypeSchema;
use Google\Cloud\Chronicle\V1\ListFeedSourceTypeSchemasRequest;
/**
* @param string $formattedParent The parent, which owns this collection of FeedSourceTypeSchemas.
* Format: projects/{project}/locations/{location}/instances/{instance}
* Please see {@see FeedsServiceClient::instanceName()} for help formatting this field.
*/
function list_feed_source_type_schemas_sample(string $formattedParent): void
{
// Create a client.
$feedsServiceClient = new FeedsServiceClient();
// Prepare the request message.
$request = (new ListFeedSourceTypeSchemasRequest())
->setParent($formattedParent);
// Call the API and handle any network failures.
try {
/** @var PagedListResponse $response */
$response = $feedsServiceClient->listFeedSourceTypeSchemas($request);
/** @var FeedSourceTypeSchema $element */
foreach ($response as $element) {
printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString());
}
} catch (ApiException $ex) {
printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
}
}
/**
* Helper to execute the sample.
*
* This sample has been automatically generated and should be regarded as a code
* template only. It will require modifications to work:
* - It may require correct/in-range values for request initialization.
* - It may require specifying regional endpoints when creating the service client,
* please see the apiEndpoint client configuration option for more details.
*/
function callSample(): void
{
$formattedParent = FeedsServiceClient::instanceName('[PROJECT]', '[LOCATION]', '[INSTANCE]');
list_feed_source_type_schemas_sample($formattedParent);
}
listFeeds
Lists all feeds for the customer.
The async variant is FeedsServiceClient::listFeedsAsync() .
| Parameters | |
|---|---|
| Name | Description |
request |
Google\Cloud\Chronicle\V1\ListFeedsRequest
A request to house fields associated with the call. |
callOptions |
array
Optional. |
↳ retrySettings |
Google\ApiCore\RetrySettings|array
Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage. |
| Returns | |
|---|---|
| Type | Description |
Google\ApiCore\PagedListResponse |
|
use Google\ApiCore\ApiException;
use Google\ApiCore\PagedListResponse;
use Google\Cloud\Chronicle\V1\Client\FeedsServiceClient;
use Google\Cloud\Chronicle\V1\Feed;
use Google\Cloud\Chronicle\V1\ListFeedsRequest;
/**
* @param string $formattedParent The parent resource where this Feed will be created.
* Format: projects/{project}/locations/{location}/instances/{instance}
* Please see {@see FeedsServiceClient::instanceName()} for help formatting this field.
*/
function list_feeds_sample(string $formattedParent): void
{
// Create a client.
$feedsServiceClient = new FeedsServiceClient();
// Prepare the request message.
$request = (new ListFeedsRequest())
->setParent($formattedParent);
// Call the API and handle any network failures.
try {
/** @var PagedListResponse $response */
$response = $feedsServiceClient->listFeeds($request);
/** @var Feed $element */
foreach ($response as $element) {
printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString());
}
} catch (ApiException $ex) {
printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
}
}
/**
* Helper to execute the sample.
*
* This sample has been automatically generated and should be regarded as a code
* template only. It will require modifications to work:
* - It may require correct/in-range values for request initialization.
* - It may require specifying regional endpoints when creating the service client,
* please see the apiEndpoint client configuration option for more details.
*/
function callSample(): void
{
$formattedParent = FeedsServiceClient::instanceName('[PROJECT]', '[LOCATION]', '[INSTANCE]');
list_feeds_sample($formattedParent);
}
listLogTypeSchemas
List all LogTypeSchemas compatible with a given FeedSourceType.
The async variant is FeedsServiceClient::listLogTypeSchemasAsync() .
| Parameters | |
|---|---|
| Name | Description |
request |
Google\Cloud\Chronicle\V1\ListLogTypeSchemasRequest
A request to house fields associated with the call. |
callOptions |
array
Optional. |
↳ retrySettings |
Google\ApiCore\RetrySettings|array
Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage. |
| Returns | |
|---|---|
| Type | Description |
Google\ApiCore\PagedListResponse |
|
use Google\ApiCore\ApiException;
use Google\ApiCore\PagedListResponse;
use Google\Cloud\Chronicle\V1\Client\FeedsServiceClient;
use Google\Cloud\Chronicle\V1\ListLogTypeSchemasRequest;
use Google\Cloud\Chronicle\V1\LogTypeSchema;
/**
* @param string $formattedParent The parent, which owns this collection of LogTypeSchemas.
* Format: Format:
* projects/{project}/locations/{location}/instances/{instance}/feedSourceTypeSchemas/{feed_source_type}
* Please see {@see FeedsServiceClient::feedSourceTypeSchemaName()} for help formatting this field.
*/
function list_log_type_schemas_sample(string $formattedParent): void
{
// Create a client.
$feedsServiceClient = new FeedsServiceClient();
// Prepare the request message.
$request = (new ListLogTypeSchemasRequest())
->setParent($formattedParent);
// Call the API and handle any network failures.
try {
/** @var PagedListResponse $response */
$response = $feedsServiceClient->listLogTypeSchemas($request);
/** @var LogTypeSchema $element */
foreach ($response as $element) {
printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString());
}
} catch (ApiException $ex) {
printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
}
}
/**
* Helper to execute the sample.
*
* This sample has been automatically generated and should be regarded as a code
* template only. It will require modifications to work:
* - It may require correct/in-range values for request initialization.
* - It may require specifying regional endpoints when creating the service client,
* please see the apiEndpoint client configuration option for more details.
*/
function callSample(): void
{
$formattedParent = FeedsServiceClient::feedSourceTypeSchemaName(
'[PROJECT]',
'[LOCATION]',
'[INSTANCE]',
'[FEED_SOURCE_TYPE]'
);
list_log_type_schemas_sample($formattedParent);
}
updateFeed
Updates the full feed.
The async variant is FeedsServiceClient::updateFeedAsync() .
| Parameters | |
|---|---|
| Name | Description |
request |
Google\Cloud\Chronicle\V1\UpdateFeedRequest
A request to house fields associated with the call. |
callOptions |
array
Optional. |
↳ retrySettings |
Google\ApiCore\RetrySettings|array
Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage. |
| Returns | |
|---|---|
| Type | Description |
Google\Cloud\Chronicle\V1\Feed |
|
use Google\ApiCore\ApiException;
use Google\Cloud\Chronicle\V1\Client\FeedsServiceClient;
use Google\Cloud\Chronicle\V1\Feed;
use Google\Cloud\Chronicle\V1\UpdateFeedRequest;
/**
* This sample has been automatically generated and should be regarded as a code
* template only. It will require modifications to work:
* - It may require correct/in-range values for request initialization.
* - It may require specifying regional endpoints when creating the service client,
* please see the apiEndpoint client configuration option for more details.
*/
function update_feed_sample(): void
{
// Create a client.
$feedsServiceClient = new FeedsServiceClient();
// Prepare the request message.
$feed = new Feed();
$request = (new UpdateFeedRequest())
->setFeed($feed);
// Call the API and handle any network failures.
try {
/** @var Feed $response */
$response = $feedsServiceClient->updateFeed($request);
printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
} catch (ApiException $ex) {
printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
}
}
createFeedAsync
| Parameters | |
|---|---|
| Name | Description |
request |
Google\Cloud\Chronicle\V1\CreateFeedRequest
|
optionalArgs |
array
|
| Returns | |
|---|---|
| Type | Description |
GuzzleHttp\Promise\PromiseInterface<Google\Cloud\Chronicle\V1\Feed> |
|
deleteFeedAsync
| Parameters | |
|---|---|
| Name | Description |
request |
Google\Cloud\Chronicle\V1\DeleteFeedRequest
|
optionalArgs |
array
|
| Returns | |
|---|---|
| Type | Description |
GuzzleHttp\Promise\PromiseInterface<void> |
|
disableFeedAsync
| Parameters | |
|---|---|
| Name | Description |
request |
Google\Cloud\Chronicle\V1\DisableFeedRequest
|
optionalArgs |
array
|
| Returns | |
|---|---|
| Type | Description |
GuzzleHttp\Promise\PromiseInterface<Google\Cloud\Chronicle\V1\Feed> |
|
enableFeedAsync
| Parameters | |
|---|---|
| Name | Description |
request |
Google\Cloud\Chronicle\V1\EnableFeedRequest
|
optionalArgs |
array
|
| Returns | |
|---|---|
| Type | Description |
GuzzleHttp\Promise\PromiseInterface<Google\Cloud\Chronicle\V1\Feed> |
|
fetchServiceAccountForCustomerAsync
| Parameters | |
|---|---|
| Name | Description |
request |
Google\Cloud\Chronicle\V1\FetchServiceAccountForCustomerRequest
|
optionalArgs |
array
|
| Returns | |
|---|---|
| Type | Description |
GuzzleHttp\Promise\PromiseInterface<Google\Cloud\Chronicle\V1\FeedServiceAccount> |
|
generateSecretAsync
| Parameters | |
|---|---|
| Name | Description |
request |
Google\Cloud\Chronicle\V1\GenerateSecretRequest
|
optionalArgs |
array
|
| Returns | |
|---|---|
| Type | Description |
GuzzleHttp\Promise\PromiseInterface<Google\Cloud\Chronicle\V1\GenerateSecretResponse> |
|
getFeedAsync
| Parameters | |
|---|---|
| Name | Description |
request |
Google\Cloud\Chronicle\V1\GetFeedRequest
|
optionalArgs |
array
|
| Returns | |
|---|---|
| Type | Description |
GuzzleHttp\Promise\PromiseInterface<Google\Cloud\Chronicle\V1\Feed> |
|
getFeedPackAsync
| Parameters | |
|---|---|
| Name | Description |
request |
Google\Cloud\Chronicle\V1\GetFeedPackRequest
|
optionalArgs |
array
|
| Returns | |
|---|---|
| Type | Description |
GuzzleHttp\Promise\PromiseInterface<Google\Cloud\Chronicle\V1\FeedPack> |
|
importPushLogsAsync
| Parameters | |
|---|---|
| Name | Description |
request |
Google\Cloud\Chronicle\V1\ImportPushLogsRequest
|
optionalArgs |
array
|
| Returns | |
|---|---|
| Type | Description |
GuzzleHttp\Promise\PromiseInterface<Google\Api\HttpBody> |
|
listFeedPacksAsync
| Parameters | |
|---|---|
| Name | Description |
request |
Google\Cloud\Chronicle\V1\ListFeedPacksRequest
|
optionalArgs |
array
|
| Returns | |
|---|---|
| Type | Description |
GuzzleHttp\Promise\PromiseInterface<Google\ApiCore\PagedListResponse> |
|
listFeedSourceTypeSchemasAsync
| Parameters | |
|---|---|
| Name | Description |
request |
Google\Cloud\Chronicle\V1\ListFeedSourceTypeSchemasRequest
|
optionalArgs |
array
|
| Returns | |
|---|---|
| Type | Description |
GuzzleHttp\Promise\PromiseInterface<Google\ApiCore\PagedListResponse> |
|
listFeedsAsync
| Parameters | |
|---|---|
| Name | Description |
request |
Google\Cloud\Chronicle\V1\ListFeedsRequest
|
optionalArgs |
array
|
| Returns | |
|---|---|
| Type | Description |
GuzzleHttp\Promise\PromiseInterface<Google\ApiCore\PagedListResponse> |
|
listLogTypeSchemasAsync
| Parameters | |
|---|---|
| Name | Description |
request |
Google\Cloud\Chronicle\V1\ListLogTypeSchemasRequest
|
optionalArgs |
array
|
| Returns | |
|---|---|
| Type | Description |
GuzzleHttp\Promise\PromiseInterface<Google\ApiCore\PagedListResponse> |
|
updateFeedAsync
| Parameters | |
|---|---|
| Name | Description |
request |
Google\Cloud\Chronicle\V1\UpdateFeedRequest
|
optionalArgs |
array
|
| Returns | |
|---|---|
| Type | Description |
GuzzleHttp\Promise\PromiseInterface<Google\Cloud\Chronicle\V1\Feed> |
|
static::feedName
Formats a string containing the fully-qualified path to represent a feed resource.
| Parameters | |
|---|---|
| Name | Description |
project |
string
|
location |
string
|
instance |
string
|
feed |
string
|
| Returns | |
|---|---|
| Type | Description |
string |
The formatted feed resource. |
static::feedPackName
Formats a string containing the fully-qualified path to represent a feed_pack resource.
| Parameters | |
|---|---|
| Name | Description |
project |
string
|
location |
string
|
instance |
string
|
feedPack |
string
|
| Returns | |
|---|---|
| Type | Description |
string |
The formatted feed_pack resource. |
static::feedSourceTypeSchemaName
Formats a string containing the fully-qualified path to represent a feed_source_type_schema resource.
| Parameters | |
|---|---|
| Name | Description |
project |
string
|
location |
string
|
instance |
string
|
feedSourceType |
string
|
| Returns | |
|---|---|
| Type | Description |
string |
The formatted feed_source_type_schema resource. |
static::instanceName
Formats a string containing the fully-qualified path to represent a instance resource.
| Parameters | |
|---|---|
| Name | Description |
project |
string
|
location |
string
|
instance |
string
|
| Returns | |
|---|---|
| Type | Description |
string |
The formatted instance resource. |
static::logTypeName
Formats a string containing the fully-qualified path to represent a log_type resource.
| Parameters | |
|---|---|
| Name | Description |
project |
string
|
location |
string
|
instance |
string
|
logType |
string
|
| Returns | |
|---|---|
| Type | Description |
string |
The formatted log_type resource. |
static::parseName
Parses a formatted name string and returns an associative array of the components in the name.
The following name formats are supported: Template: Pattern
- feed: projects/{project}/locations/{location}/instances/{instance}/feeds/{feed}
- feedPack: projects/{project}/locations/{location}/instances/{instance}/feedPacks/{feed_pack}
- feedSourceTypeSchema: projects/{project}/locations/{location}/instances/{instance}/feedSourceTypeSchemas/{feed_source_type}
- instance: projects/{project}/locations/{location}/instances/{instance}
- logType: projects/{project}/locations/{location}/instances/{instance}/logTypes/{log_type}
The optional $template argument can be supplied to specify a particular pattern, and must match one of the templates listed above. If no $template argument is provided, or if the $template argument does not match one of the templates listed, then parseName will check each of the supported templates, and return the first match.
| Parameters | |
|---|---|
| Name | Description |
formattedName |
string
The formatted name string |
template |
?string
Optional name of template to match |
| Returns | |
|---|---|
| Type | Description |
array |
An associative array from name component IDs to component values. |