neclimdul / coveo-push-api
Push API 允许您 *push* 项目和安全标识符,而不是让标准的 Coveo Cloud V2 捕获器 *pull* 来自内容存储库的数据。当您需要索引来自云或本地系统的内容,而这些系统在 Coveo Cloud V2 平台上没有专用的源类型时,这尤其有用。
1.1.0
2024-09-24 15:40 UTC
Requires
- php: >=8.1
- ext-curl: *
- ext-json: *
- ext-mbstring: *
- guzzlehttp/guzzle: ^6.2 || ^7.0
- neclimdul/openapi-php-helper: ^1.0@beta
Requires (Dev)
- fakerphp/faker: ^1.20
- illuminate/support: >5.0.0
- neclimdul/openapi-php-testing: ^1.0@beta
- 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
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 请求 | 描述 |
---|---|---|---|
FileContainerApi | organizationsOrganizationIdFilesPost | POST /organizations/{organizationId}/files | 创建文件容器 |
ItemApi | organizationsOrganizationIdSourcesSourceIdDocumentsBatchPut | PUT /organizations/{organizationId}/sources/{sourceId}/documents/batch | 添加、更新和/或删除一批项目 |
ItemApi | organizationsOrganizationIdSourcesSourceIdDocumentsDelete | DELETE /organizations/{organizationId}/sources/{sourceId}/documents | 删除项目及其子项目(如有) |
ItemApi | organizationsOrganizationIdSourcesSourceIdDocumentsOlderthanDelete | DELETE /organizations/{organizationId}/sources/{sourceId}/documents/olderthan | 删除旧项目 |
ItemApi | organizationsOrganizationIdSourcesSourceIdDocumentsPut | PUT /organizations/{organizationId}/sources/{sourceId}/documents | 添加或更新项目 |
SecurityIdentityApi | organizationsOrganizationIdProvidersProviderIdMappingsPut | PUT /organizations/{organizationId}/providers/{providerId}/mappings | 添加或更新别名 |
SecurityIdentityApi | organizationsOrganizationIdProvidersProviderIdPermissionsBatchPut | PUT /organizations/{organizationId}/providers/{providerId}/permissions/batch | 添加、更新和/或删除一批安全标识符 |
SecurityIdentityApi | organizationsOrganizationIdProvidersProviderIdPermissionsDelete | DELETE /organizations/{organizationId}/providers/{providerId}/permissions | 删除安全标识符 |
SecurityIdentityApi | organizationsOrganizationIdProvidersProviderIdPermissionsOlderthanDelete | DELETE /organizations/{organizationId}/providers/{providerId}/permissions/olderthan | 删除旧安全标识符 |
SecurityIdentityApi | organizationsOrganizationIdProvidersProviderIdPermissionsPut | PUT /organizations/{organizationId}/providers/{providerId}/permissions | 添加或更新安全标识符 |
SourceStatusApi | organizationsOrganizationIdSourcesSourceIdStatusPost | POST /organizations/{organizationId}/sources/{sourceId}/status | 设置 Push 源的状态 |
StreamApi | organizationsOrganizationIdSourcesSourceIdStreamDeleteolderthanEpochMillisecondsPost | POST /organizations/{organizationId}/sources/{sourceId}/stream/deleteolderthan/{epochMilliseconds} | 删除旧文档 |
StreamApi | organizationsOrganizationIdSourcesSourceIdStreamInlinePartialupdatePut | PUT /organizations/{organizationId}/sources/{sourceId}/stream/inline/partialupdate | 更新目录流源 |
StreamApi | organizationsOrganizationIdSourcesSourceIdStreamMergePut | PUT /organizations/{organizationId}/sources/{sourceId}/stream/merge | 合并目录流源文档 |
StreamApi | organizationsOrganizationIdSourcesSourceIdStreamOpenPost | POST /organizations/{organizationId}/sources/{sourceId}/stream/open | 打开流 |
StreamApi | organizationsOrganizationIdSourcesSourceIdStreamStreamIdChunkPost | POST /organizations/{organizationId}/sources/{sourceId}/stream/{streamId}/chunk | 获取流的新的数据块 |
StreamApi | organizationsOrganizationIdSourcesSourceIdStreamStreamIdClosePost | POST /organizations/{organizationId}/sources/{sourceId}/stream/{streamId}/close | 关闭流 |
StreamApi | organizationsOrganizationIdSourcesSourceIdStreamUpdatePut | PUT /organizations/{organizationId}/sources/{sourceId}/stream/update | 更新目录流源 |
模型
- BaseIdentityBody
- CatalogStreamOutArgs
- DocumentBody
- EntityUpdateResult
- 错误
- GatewayTimeoutError
- Identity
- IdentityBody
- InlineUpdateBody
- MappedIdentity
- MappedIdentityBody
- PermissionIdentityModel
- PermissionSetsModel
- PresignedUploadUrl
授权
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