承接 ocolin/calix-axos-client 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

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

ocolin/calix-axos-client

Composer 安装命令:

composer require ocolin/calix-axos-client

包简介

REST Client for Calix AXOS SMx Northbound server

README 文档

README

What is it?

A lightweight HTTP REST client for Calix AXOS Northbound interface.

No worrying about HTTP and authentication. Just provide an endpoint path and the payload data.

Table of Contents

Installation

composer require ocolin/calix-axos

Requirements

  • php ^8.3
  • guzzlehttp/guzzle ^7.10
  • ocolin/global-type ^2.0

Instantiation

The client can be configured either via constructor arguments or environment parameters.

Argument Name Environment Name Type Description
$host SMX_AXOS_HOST string Hostname/IP, port, and URI path
$usernmae SMX_AXOS_USERNAME string Username of account to use
$password SMX_AXOS_PASSWORD string Password of account to use

Using Environment variables

// Setting manually for demonstration
$_ENV['SMX_AXOS_HOST'] = 'https://smx.servername.com:18443/rest/v1/';
$_ENV['SMX_AXOS_USERNAME'] = 'api_user';
$_ENV['SMX_AXOS_PASSWORD'] = 'password1234';

$client = new Ocolin\CalixAxos\Client();

Using Constructor arguments

The constructor takes a DTO called Config.

$client = new Ocolin\CalixAxos\Client(
    client: new Ocolin\CalixAxos\Config(
            host: 'https://smx.servername.com:18443/rest/v1/',
        username: 'api_user',
        password: 'password1234'
    )
);

Options

The Config object can also take an options parameter for setting guzzle options such as HTTP timeout, verifying SSL, etc.

Default Options:

  • timeout: 20 sec
  • verify: false
$client = new Ocolin\CalixAxos\Client(
    client: new Ocolin\CalixAxos\Config(
        options: [
            'timeout' => 60,
            'verify'  => true  
        ]
    )
);

Response

The client will response with a data object containing the following properties:

Name Type Description
status integer HTTP response status code
statusMessage string HTTP response status message
headers array HTTP response headers
body array|object API response payload

Request Methods

The Calix API allows four HTTP methods, each is a function on the client:

Method Function Description
GET get() Retrieve existing resource(s)
POST post() Create a new resource
PUT put() Modify an existing resource
DELETE delete() Delete an existing resource

Parameters

Name Type Description
endpoint string The URI of an API endpoint
method string The HTTP method (only used in request())
query array|object Both path and URI query parameters
body array|object Payload from API server

Path Replacement

Any parameters in the query argument with names that match a variable token in the endpoint path name will swap those token names with their value. This allows you to past the endpoint URI as is from the docs and replace them automatically. See the GET method example below.

GET Method

$response = $client->get(
    endpoint: '/config/device/{device-name}/ont',
       query: [ 
            'device-name' => 'OLT-NAME',
            'ont-id'      => 777
       ]
);

POST Method

$response = $client->post(
    endpoint: '/config/device/{device-name}/ont',
       query: [ 'device-name' => 'OLT-NAME' ],
        body: [
            'ont-id'         => 777,
            'ont-reg-id'     => 777,
            'ont-type'       => 'Residential',
            'ont-profile-id' => '844G'
        ]   
);

PUT Method

$response = $client->put(
    endpoint: '/config/device/{device-name}/ont',
       query: [ 'device-name' => 'OLT-NAME' ],
        body: [
            'ont-id'         => 777,
            'ont-reg-id'     => 777,
            'ont-type'       => 'Business',
            'ont-profile-id' => '844G'
        ]   
);

DELETE Method

$response = $client->delete(
    endpoint: '/config/device/{device-name}/ont',
       query: [ 
            'device-name' => 'OLT-NAME',
            'ont-id'      => 777
       ]
);

Request Method

There is a request method which lets you manually specify the HTTP method to use rather than a specific method function.

$response = $client->request(
    endpoint: '/config/device/{device-name}/ont',
      method: 'POST',
       query: [ 'device-name' => 'OLT-NAME' ],
        body: [
            'ont-id'         => 777,
            'ont-reg-id'     => 777,
            'ont-type'       => 'Business',
            'ont-profile-id' => '844G'
        ]   
);

ocolin/calix-axos-client 适用场景与选型建议

ocolin/calix-axos-client 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 6 次下载、GitHub Stars 达 0, 最近一次更新时间为 2025 年 11 月 13 日, 在 PHP 生态内属于活跃度较高的组件。

它主要适用于以下技术方向: 「http」 「rest」 「api」 「client」 「Guzzle」 「networking」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。

我们在过去多个企业项目中使用过 ocolin/calix-axos-client 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。

围绕 ocolin/calix-axos-client 我们能提供哪些服务?
定制开发 / 二次开发

基于 ocolin/calix-axos-client 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2025-11-13