neclimdul / coveo-push-api
The Push API allows you to *push* items and security identities, as opposed to letting standard Coveo Cloud V2 crawlers *pull* this data from a content repository. This is especially useful when you need to index content from a cloud or on-premises system for which no dedicated source type exists in
Requires
- php: >=8.1
- ext-curl: *
- ext-json: *
- ext-mbstring: *
- guzzlehttp/guzzle: ^6.2 || ^7.0
- neclimdul/openapi-php-helper: ^1.0@alpha
Requires (Dev)
- fakerphp/faker: ^1.20
- illuminate/support: >5.0.0
- neclimdul/openapi-php-testing: ^1.0
- php-parallel-lint/php-parallel-lint: ^1.2
- phpspec/prophecy-phpunit: ^2.0
- phpstan/phpstan: ^1.0.0
- phpunit/phpunit: ^8.0 | ^9.0
- squizlabs/php_codesniffer: ^3.7
- vimeo/psalm: ^5.9
This package is auto-updated.
Last update: 2024-10-21 19:20:17 UTC
README
The Push API allows you to push items and security identities, as opposed to letting standard Coveo Cloud V2 crawlers pull this data from a content repository. This is especially useful when you need to index content from a cloud or on-premises system for which no dedicated source type exists in the Coveo Cloud V2 platform.
Installation & Usage
Requirements
PHP 8.1 and later.
Composer
To install the bindings via Composer, add the following to composer.json
:
composer require neclimdul/coveo-push-api
Getting Started
Please follow the installation procedure and then run the following:
<?php
require_once(__DIR__ . '/vendor/autoload.php');
use NecLimDul\Coveo\PushApi\ApiException;
// Configure OAuth2 access token for authorization: oauth2
$config = \NecLimDul\Coveo\PushApi\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');
$apiInstance = new \NecLimDul\Coveo\PushApi\Api\FileContainerApi(
// If you want to use custom http client, pass your client which implements `\GuzzleHttp\ClientInterface`.
// This is optional, `\GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client(),
$config
);
$organization_id = 'organization_id_example'; // string | The unique identifier of the target Coveo Cloud V2 organization. **Example:** `mycoveocloudv2organizationg8tp8wu3`
$use_virtual_hosted_style_url = True; // bool | Whether to generate the presigned URL using the virtual hosted-style URL. **Example of a virtual hosted-style url:** `https://coveo-nprod-customer-data.s3.us-east-1.amazonaws.com/proda/blobstore/mycoveocloudv2organizationg8tp8wu3/b5e8767e-8f0d-4a89-9095-1127915c89c7[...]`
try {
$result = $apiInstance->organizationsOrganizationIdFilesPost($organization_id, $use_virtual_hosted_style_url);
print_r($result);
} catch (ApiException $e) {
echo 'Exception when calling FileContainerApi->organizationsOrganizationIdFilesPost: ', $e->getMessage(), PHP_EOL;
}
API Endpoints
All URIs are relative to https://api.cloud.coveo.com/push/v1
Class | Method | HTTP request | Description |
---|---|---|---|
FileContainerApi | organizationsOrganizationIdFilesPost | POST /organizations/{organizationId}/files | Create a file container |
ItemApi | organizationsOrganizationIdSourcesSourceIdDocumentsBatchPut | PUT /organizations/{organizationId}/sources/{sourceId}/documents/batch | Add, update, and/or delete a batch of items |
ItemApi | organizationsOrganizationIdSourcesSourceIdDocumentsDelete | DELETE /organizations/{organizationId}/sources/{sourceId}/documents | Delete an item and optionally its children |
ItemApi | organizationsOrganizationIdSourcesSourceIdDocumentsOlderthanDelete | DELETE /organizations/{organizationId}/sources/{sourceId}/documents/olderthan | Delete old items |
ItemApi | organizationsOrganizationIdSourcesSourceIdDocumentsPut | PUT /organizations/{organizationId}/sources/{sourceId}/documents | Add or update an item |
SecurityIdentityApi | organizationsOrganizationIdProvidersProviderIdMappingsPut | PUT /organizations/{organizationId}/providers/{providerId}/mappings | Add or update an alias |
SecurityIdentityApi | organizationsOrganizationIdProvidersProviderIdPermissionsBatchPut | PUT /organizations/{organizationId}/providers/{providerId}/permissions/batch | Add, update, and/or delete a batch of security identities |
SecurityIdentityApi | organizationsOrganizationIdProvidersProviderIdPermissionsDelete | DELETE /organizations/{organizationId}/providers/{providerId}/permissions | Delete a security identity |
SecurityIdentityApi | organizationsOrganizationIdProvidersProviderIdPermissionsOlderthanDelete | DELETE /organizations/{organizationId}/providers/{providerId}/permissions/olderthan | Delete old security identities |
SecurityIdentityApi | organizationsOrganizationIdProvidersProviderIdPermissionsPut | PUT /organizations/{organizationId}/providers/{providerId}/permissions | Add or update a security identity |
SourceStatusApi | organizationsOrganizationIdSourcesSourceIdStatusPost | POST /organizations/{organizationId}/sources/{sourceId}/status | Set the status of a Push source |
StreamApi | organizationsOrganizationIdSourcesSourceIdStreamDeleteolderthanEpochMillisecondsPost | POST /organizations/{organizationId}/sources/{sourceId}/stream/deleteolderthan/{epochMilliseconds} | Delete old documents |
StreamApi | organizationsOrganizationIdSourcesSourceIdStreamInlinePartialupdatePut | PUT /organizations/{organizationId}/sources/{sourceId}/stream/inline/partialupdate | Update a catalog stream source |
StreamApi | organizationsOrganizationIdSourcesSourceIdStreamMergePut | PUT /organizations/{organizationId}/sources/{sourceId}/stream/merge | Merge documents of a catalog stream source |
StreamApi | organizationsOrganizationIdSourcesSourceIdStreamOpenPost | POST /organizations/{organizationId}/sources/{sourceId}/stream/open | Open a stream |
StreamApi | organizationsOrganizationIdSourcesSourceIdStreamStreamIdChunkPost | POST /organizations/{organizationId}/sources/{sourceId}/stream/{streamId}/chunk | Get a new chunk for a stream |
StreamApi | organizationsOrganizationIdSourcesSourceIdStreamStreamIdClosePost | POST /organizations/{organizationId}/sources/{sourceId}/stream/{streamId}/close | Close a stream |
StreamApi | organizationsOrganizationIdSourcesSourceIdStreamUpdatePut | PUT /organizations/{organizationId}/sources/{sourceId}/stream/update | Update a catalog stream source |
Models
- BaseIdentityBody
- CatalogStreamOutArgs
- DocumentBody
- EntityUpdateResult
- Error
- GatewayTimeoutError
- Identity
- IdentityBody
- InlineUpdateBody
- MappedIdentity
- MappedIdentityBody
- PermissionIdentityModel
- PermissionSetsModel
- PresignedUploadUrl
Authorization
oauth2
- Type:
OAuth
- Flow:
implicit
- Authorization URL:
https://platform.cloud.coveo.com/oauth/authorize
- Scopes:
- full: Required
Tests
To run the tests, use:
composer install
vendor/bin/phpunit
Author
About this package
This PHP package is automatically generated by the OpenAPI Generator project:
- API version:
2016-03-03T13:22:11Z
- Build package:
org.openapitools.codegen.languages.PhpClientCodegen