shellrent/veeam-vspc-api-client 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

shellrent/veeam-vspc-api-client

最新稳定版本:3.0.2

Composer 安装命令:

composer require shellrent/veeam-vspc-api-client

包简介

PHP Client for Veeam Service Provider Console API

README 文档

README

A PHP SDK for integrating with the Veeam Service Provider Console (VSPC) REST API. The library wraps the official OpenAPI specification provided with VSPC v9.2 and offers repositories, request builders, and payload helpers to quickly interact with the console from PHP applications and automation scripts.

Features

  • Guzzle-based HTTP client preconfigured for the VSPC REST endpoints.
  • Repository classes mirroring the API tags (Authentication, Companies, Backup Servers, and more).
  • Fluent payload builders to compose request bodies for complex operations.
  • Helpers for filters, pagination, and query parameters.
  • Returns PSR-7 responses or decoded JSON payloads for convenience.

Requirements

  • PHP ^8.3 with the JSON extension enabled.
  • Composer for dependency management.
  • Access to a VSPC environment (on-premises or hosted) with API credentials.

Installation

Install the package via Composer:

composer require shellrent/veeam-vspc-api-client

Getting Started

Create an instance of the SDK by providing the base endpoint of your VSPC installation. The client accepts an optional bearer token and additional Guzzle client options.

use Shellrent\VeeamVspcApiClient\VeeamSPCClient;

$client = new VeeamSPCClient(
    endpoint: 'https://vspc.example.com',
    token: null,
    options: [
        // Any Guzzle option (timeouts, proxies, etc.)
    ]
);

Authenticate and Fetch a Token

Use the AuthenticationRepository with the OAuthPayload helper to request an access token.

use Shellrent\VeeamVspcApiClient\Payloads\OAuthPayload;
use Shellrent\VeeamVspcApiClient\Repositories\AuthenticationRepository;

$authRepository = new AuthenticationRepository();
$request = $authRepository->postOAuthAuthentication(new OAuthPayload('username', 'password'));

$tokenResponse = $client->jsonResponse($request);
$token = $tokenResponse->access_token ?? null;

Subsequent requests can be executed by instantiating the client with the retrieved token or by updating the constructor argument.

Calling Other Endpoints

Each repository maps to an API tag and provides helpers to build the corresponding request.

use Shellrent\VeeamVspcApiClient\Repositories\CompanyRepository;

$companyRepository = new CompanyRepository();
$request = $companyRepository->getCompanies();

$response = $client->jsonResponse($request);

Repositories accept optional filters and query parameters when executed through VeeamSPCClient::send() or VeeamSPCClient::jsonResponse(). You can build complex filters using Filter and FilterCollection helpers located under Shellrent\VeeamVspcApiClient\Support.

OpenAPI Specification

The official VSPC OpenAPI definition used to generate the SDK is stored in openapi/3.6/vspc-api.json. Refer to it for a complete list of available operations, parameters, and payload schemas.

Contributing

Contributions are welcome! If you plan to submit a pull request:

  1. Fork the repository and create a feature branch.
  2. Follow the existing coding standards (tabs for indentation, camelCase properties).
  3. Update or add documentation when introducing new repositories or payload builders.
  4. Ensure your code builds and, when possible, provide usage examples in the PR description.

License

This project is released under the MIT License.

统计信息

  • 总下载量: 626
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 2
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 4
  • Forks: 2
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2023-01-03

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固