定制 scottbass3/harbor-api-client 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

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

scottbass3/harbor-api-client

最新稳定版本:v1.0.1

Composer 安装命令:

composer require scottbass3/harbor-api-client

包简介

This package provides API models and a client for Harbor

关键字:

README 文档

README

MIT license

Harbor OpenAPI client

This package provides a client for Harbor. It was auto-generated with Jane based on the Harbor API v2.

Rebuilding the client library

Jane provides commands for generating the client code. Switch to this package's directory and install Composer dependencies. You can then run a command for generating the code:

composer update
bin/jane-openapi-generate

Usage

The client is instantiated using the create() factory method. The following example shows how to create a project, authenticating with username and password of a Harbor robot user:

use Http\Client\Common\Plugin\AddHostPlugin;
use Http\Client\Common\Plugin\AddPathPlugin;
use Http\Client\Common\Plugin\AuthenticationPlugin;
use Http\Message\Authentication\BasicAuth;
use Scottbass3\Harbor\Api\Model\ProjectReq;

…

$client = \Scottbass3\Harbor\Api\Client::create(
    null,
    [
        new AddHostPlugin(
            $endpointUri
        ),
        new AddPathPlugin(
            $endpointUri
        ),
        new AuthenticationPlugin(
            new BasicAuth(
                $username,
                $password,
            )
        )
    ]
);

$projectRequest = new ProjectReq();
$projectRequest
    ->setProjectName((string)$projectName)
    ->setPublic(false);

$client->createProject($projectRequest);

统计信息

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

GitHub 信息

  • Stars: 0
  • Watchers: 0
  • Forks: 1
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2025-08-22