neclimdul / coveo-push-api

Push API 允许您 *push* 项目和安全标识符,而不是让标准的 Coveo Cloud V2 捕获器 *pull* 来自内容存储库的数据。当您需要索引来自云或本地系统的内容,而这些系统在 Coveo Cloud V2 平台上没有专用的源类型时,这尤其有用。

1.1.0 2024-09-24 15:40 UTC

This package is auto-updated.

Last update: 2024-09-24 20:53:49 UTC


README

Push API 允许您 push 项目和安全标识符,而不是让标准的 Coveo Cloud V2 捕获器 pull 这些数据从内容存储库。当您需要从没有在 Coveo Cloud V2 平台上设置专用源类型的云或本地系统索引内容时,这尤其有用。

安装和用法

要求

PHP 8.1 及更高版本。

Composer

要使用 Composer 安装绑定,请将以下内容添加到 composer.json

composer require neclimdul/coveo-push-api

入门

请按照 安装程序 进行操作,然后运行以下命令:

<?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 端点

所有 URI 都是相对于 https://api.cloud.coveo.com/push/v1

方法HTTP 请求描述
FileContainerApiorganizationsOrganizationIdFilesPostPOST /organizations/{organizationId}/files创建文件容器
ItemApiorganizationsOrganizationIdSourcesSourceIdDocumentsBatchPutPUT /organizations/{organizationId}/sources/{sourceId}/documents/batch添加、更新和/或删除一批项目
ItemApiorganizationsOrganizationIdSourcesSourceIdDocumentsDeleteDELETE /organizations/{organizationId}/sources/{sourceId}/documents删除项目及其子项目(如有)
ItemApiorganizationsOrganizationIdSourcesSourceIdDocumentsOlderthanDeleteDELETE /organizations/{organizationId}/sources/{sourceId}/documents/olderthan删除旧项目
ItemApiorganizationsOrganizationIdSourcesSourceIdDocumentsPutPUT /organizations/{organizationId}/sources/{sourceId}/documents添加或更新项目
SecurityIdentityApiorganizationsOrganizationIdProvidersProviderIdMappingsPutPUT /organizations/{organizationId}/providers/{providerId}/mappings添加或更新别名
SecurityIdentityApiorganizationsOrganizationIdProvidersProviderIdPermissionsBatchPutPUT /organizations/{organizationId}/providers/{providerId}/permissions/batch添加、更新和/或删除一批安全标识符
SecurityIdentityApiorganizationsOrganizationIdProvidersProviderIdPermissionsDeleteDELETE /organizations/{organizationId}/providers/{providerId}/permissions删除安全标识符
SecurityIdentityApiorganizationsOrganizationIdProvidersProviderIdPermissionsOlderthanDeleteDELETE /organizations/{organizationId}/providers/{providerId}/permissions/olderthan删除旧安全标识符
SecurityIdentityApiorganizationsOrganizationIdProvidersProviderIdPermissionsPutPUT /organizations/{organizationId}/providers/{providerId}/permissions添加或更新安全标识符
SourceStatusApiorganizationsOrganizationIdSourcesSourceIdStatusPostPOST /organizations/{organizationId}/sources/{sourceId}/status设置 Push 源的状态
StreamApiorganizationsOrganizationIdSourcesSourceIdStreamDeleteolderthanEpochMillisecondsPostPOST /organizations/{organizationId}/sources/{sourceId}/stream/deleteolderthan/{epochMilliseconds}删除旧文档
StreamApiorganizationsOrganizationIdSourcesSourceIdStreamInlinePartialupdatePutPUT /organizations/{organizationId}/sources/{sourceId}/stream/inline/partialupdate更新目录流源
StreamApiorganizationsOrganizationIdSourcesSourceIdStreamMergePutPUT /organizations/{organizationId}/sources/{sourceId}/stream/merge合并目录流源文档
StreamApiorganizationsOrganizationIdSourcesSourceIdStreamOpenPostPOST /organizations/{organizationId}/sources/{sourceId}/stream/open打开流
StreamApiorganizationsOrganizationIdSourcesSourceIdStreamStreamIdChunkPostPOST /organizations/{organizationId}/sources/{sourceId}/stream/{streamId}/chunk获取流的新的数据块
StreamApiorganizationsOrganizationIdSourcesSourceIdStreamStreamIdClosePostPOST /organizations/{organizationId}/sources/{sourceId}/stream/{streamId}/close关闭流
StreamApiorganizationsOrganizationIdSourcesSourceIdStreamUpdatePutPUT /organizations/{organizationId}/sources/{sourceId}/stream/update更新目录流源

模型

授权

oauth2

  • 类型: OAuth
  • 流程: implicit
  • 授权 URL: https://platform.cloud.coveo.com/oauth/authorize
  • 作用域:
    • full: 必需

测试

要运行测试,使用

composer install
vendor/bin/phpunit

作者

关于此包

此 PHP 包由 OpenAPI Generator 项目自动生成

  • API 版本: 2016-03-03T13:22:11Z
  • 构建包: org.openapitools.codegen.languages.PhpClientCodegen