nodeum-io/nodeum-sdk-php

Nodeum API 使您轻松访问在组织中运行的数字数据网格。向我们的API端点发出请求,我们将为您提供连接您的业务流程与存储所需的一切。所有生产API请求均发送到:http://nodeumhostname/api

dev-master 2020-09-01 09:56 UTC

This package is auto-updated.

Last update: 2024-09-29 06:02:19 UTC


README

Nodeum API 使您轻松访问在组织中运行的数字数据网格。向我们的API端点发出请求,我们将为您提供连接您的业务流程与存储所需的一切。

所有生产API请求均发送到

http://nodeumhostname/api/

API的当前生产版本为v1。

REST Nodeum API 是一个RESTful API。这意味着API旨在允许您使用HTTP动词GET、POST、PUT、PATCH和DELETE获取、创建、更新和删除对象。

JSON Nodeum API 仅使用JSON进行通信。这意味着您应始终设置Content-Type头为application/json,以确保API正确接收和处理您的请求。

身份验证 所有API调用都需要用户密码身份验证。

跨源资源共享 Nodeum API 支持CORS,用于从JavaScript与这些端点通信。在创建应用程序时,您需要指定一个源URI,以便为您的域名允许CORS白名单。

分页 一些端点(如文件列表)返回一个可能很长的对象数组。为了使响应大小可控,API将利用分页。分页是一种返回请求结果子集的机制,允许通过后续请求“翻页”查看剩余的结果,直到达到末尾。分页端点遵循标准接口,接受两个查询参数limit和offset,并返回一个遵循标准格式的有效载荷。这些参数名称和行为是从SQL的LIMIT和OFFSET关键字借用的。

版本控制 Nodeum API 不断进行改进,添加功能、改进和修复错误。这意味着您应该预计会有变化并被记录。

然而,有些更改或添加被认为是向后兼容的,并且您的应用程序应该足够灵活以处理它们。这包括

  • 向API添加新端点
  • 向现有端点的响应中添加新属性
  • 更改响应属性的顺序(根据定义,JSON是无序键/值对的对象)

过滤参数 浏览项目列表时,可以应用多个过滤参数。某些运算符可以添加到值的开头作为前缀

  • = 值相等。默认运算符,可以省略
  • != 值不同
  • > 大于
  • >= 大于等于
  • < 小于
  • <= 小于等于
  • >< 包含在列表中,项目应使用|分隔
  • !>< 不包含在列表中,项目应使用|分隔
  • ~ 模式匹配,可以包含%(任意字符)和_(一个字符)
  • !~ 模式不匹配,可以包含%(任意字符)和_(一个字符)

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

  • API版本:2.1.0
  • 包版本:1.88.0
  • 构建包:org.openapitools.codegen.languages.PhpClientCodegen 更多信息,请访问 https://www.nodeum.io/

要求

PHP 5.5及以上

安装与使用

Composer

要通过Composer安装绑定,请在composer.json中添加以下内容

{
  "repositories": [
    {
      "type": "vcs",
      "url": "https://github.com/nodeum-io/nodeum-sdk-php.git"
    }
  ],
  "require": {
    "nodeum-io/nodeum-sdk-php": "*@dev"
  }
}

然后运行composer install

手动安装

下载文件并包含autoload.php

    require_once('/path/to/NodeumSDK/vendor/autoload.php');

测试

要运行单元测试

composer install
./vendor/bin/phpunit

入门指南

请按照安装步骤进行操作,然后运行以下命令

<?php
require_once(__DIR__ . '/vendor/autoload.php');



// Configure HTTP basic authorization: BasicAuth
$config = NodeumSDK\Client\Configuration::getDefaultConfiguration()
              ->setUsername('YOUR_USERNAME')
              ->setPassword('YOUR_PASSWORD');

// Configure API key authorization: BearerAuth
$config = NodeumSDK\Client\Configuration::getDefaultConfiguration()->setApiKey('Authorization', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = NodeumSDK\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('Authorization', 'Bearer');


$apiInstance = new NodeumSDK\Client\Api\CloudBucketsApi(
    // If you want 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
);
$limit = 56; // int | The number of items to display for pagination.
$offset = 56; // int | The number of items to skip for pagination.
$sort_by = array('sort_by_example'); // string[] | Sort results by attribute.  Can sort on multiple attributes, separated by `|`. Order direction can be suffixing the attribute by either `:asc` (default) or `:desc`.
$id = 'id_example'; // string | Filter on id
$cloud_connector_id = 'cloud_connector_id_example'; // string | Filter on cloud connector id
$pool_id = 'pool_id_example'; // string | Filter on a pool id
$name = 'name_example'; // string | Filter on name
$location = 'location_example'; // string | Filter on location
$price = 'price_example'; // string | Filter on price

try {
    $result = $apiInstance->indexCloudBuckets($limit, $offset, $sort_by, $id, $cloud_connector_id, $pool_id, $name, $location, $price);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling CloudBucketsApi->indexCloudBuckets: ', $e->getMessage(), PHP_EOL;
}

?>

API端点文档

所有URI都是相对于 https:///api/v2

模型文档

授权文档

基本认证

  • 类型:HTTP基本认证

Bearer认证

  • 类型:API密钥
  • API密钥参数名:Authorization
  • 位置:HTTP头

作者

info@nodeum.io