承接 ocolin/tarana-tcs 相关项目开发

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

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

ocolin/tarana-tcs

最新稳定版本:v1.0.0

Composer 安装命令:

composer require ocolin/tarana-tcs

包简介

PHP Rest client for Tarana TSC API

README 文档

README

What is it?

This is a lightweight PHP REST client for the Tarana TCS API services.

Requirements

  • PHP >=8.3
  • guzzlehttp/guzzle ^7.10
  • ocolin/global-type ^2.0

Installation

composer require ocolin/tarana-tcs

Configuration

Configuration can be done either through environment settings or constructor arguments. Only properties are needed for configuration. Your API token and the URL of the TSC server. The TSC hostname is also optional as Tarana's API is sell established. However, should that ever change, the hostname can be configured.

Configuration Properties

Environment Argument type Description
TARANA_TCS_API_TOKEN $token string API Key assigned by Tarana
TARANA_TCS_API_HOST $host string Tarana TSC hostname
-- $options array|object Optional guzzle properties

Environment Variables

// Manual for demonstration
$_ENV['TARANA_TCS_API_TOKEN'] = 'abcdefg';
$_ENV['TARANA_TCS_API_HOST'] = 'https://api.tcs.taranawireless.com';
$taranaTCS = new Ocolin\TaranaTCS\TaranaTCS();

Constructor Arguments

$taranaTCS = new Ocolin\TaranaTCS\TaranaTCS(
       host: 'https://api.tcs.taranawireless.com',
      token: 'abcdefg'
);

Options

Optional guzzle parameters can be set using the options argument.

$taranaTcs = new Ocolin\TaranaTCS\TaranaTCS( options: [ 'verify' => false ] );

HTTP Defaults

Option Default Description
timeout 20 Seconds to give HTTP attempt
verify true Verify SSL credentials

Response

The client returns a response object with the payload as well as HTTP data. Tarana TCS returns an object with a property for data, and a property for error on all calls. This client body payload will be either the error content or data content depending on whether the call was successful or not.

Parameter Type Description
status integer HTTP status code
statusMessage string HTTP status message
headers array HTTP response headers
body object TSC payload. Data or error content

Path interpolation

The TSC client will interpolate any path variable tokens with value in any matching keys or properties in the $query parameter. See the GET method example to see a path token being replaced.

Method functions

GET

Get a resource(s)

// End point will be /v2/network/radios/abcdefg
$output = $taranaTCS->get( 
    endpoint: '/v2/network/radios/{serialNumber}',
       query: [ 'serialNumber' => 'abcdefg' ]
);

POST

Create a resource.

$output = $taranaTCS->post(
    endpoint: '/v1/network/regions',
        body: [ 'name' => 'RegionName' ]
);

PATCH

Update a resource.

$output = $taranaTCS->patch(
    endpoint: '/v1/network/regions/{regionName}',
       query: [ 'regionName' => 'RegionName' ],
        body: [ 'notes' => 'My new notes' ]
);

PUT

Complete update of resource.

$output = $taranaTCS->put(
    endpoint: '/v1/users/{email}',
       query: [ 'email' => 'email@address.com' ],
        body: [ ... ]
);

DELETE

Remove resource

$output = $taranaTCS->delete(
    endpoint: '/v1/users/{email}',
       query: [ 'email' => 'email@address.com' ]
);

REQUEST

Generic HTTP request function.

$output = $taranaTCS->request(
    endpoint: '/v1/network/regions/{regionName}',
      method: 'PATCH',
       query: [ 'regionName' => 'RegionName' ],
        body: [ 'notes' => 'My new notes' ]
);

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2026-04-03

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固