承接 scherhak/uplinkr-api 相关项目开发

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

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

scherhak/uplinkr-api

Composer 安装命令:

composer require scherhak/uplinkr-api

包简介

REST API package for Uplinkr monitoring.

README 文档

README

Uplinkr Logo

Uplinkr API

REST API for Uplinkr monitoring projects, probes, and global settings.
Versioned Laravel endpoints for managing Uplinkr over HTTP.

tests Latest Stable Version Total Downloads License

REST API for Uplinkr monitoring projects, probes, and global settings.

Uplinkr API extends the CLI-first Uplinkr package with HTTP endpoints so monitoring data and configuration can be managed from external systems, internal tooling, or test clients such as Postman.

Documentation

What is Uplinkr API?

Uplinkr API is a lightweight Laravel package that exposes selected Uplinkr functionality through a versioned REST API.

It is designed for teams that want to:

  • manage Uplinkr projects and probes over HTTP
  • integrate monitoring setup into internal tools or deployment flows
  • inspect and update global monitoring settings programmatically
  • use OpenAPI-based API documentation during development

The package stays close to the architecture of the base package:

  • file-based storage remains the source of truth
  • API routes are explicit and versioned under /api/v1
  • package logic prefers direct integration with handlers and storage classes
  • no dashboard, no SPA, no additional persistence layer

Key Features

  • REST API for Uplinkr with versioned endpoints under /api/v1
  • Project management for listing, creating, updating, and deleting projects
  • Probe management with project-scoped probe resources
  • Global settings endpoint for I-am-alive configuration
  • API key authentication with optional Bearer token support
  • Rate limiting for the API surface
  • Interactive API docs via OpenAPI UI under /api/docs
  • Direct integration with Uplinkr internals instead of shelling out to Artisan commands

How It Works

Uplinkr API is installed into a Laravel application that already uses, or should use, Uplinkr.

The package registers:

  1. versioned API routes
  2. JSON controllers and actions
  3. API-key based request protection
  4. interactive OpenAPI documentation

The API delegates to the underlying Uplinkr package:

  • project endpoints use Uplinkr project handlers
  • probe endpoints use Uplinkr probe handlers
  • settings endpoints use Uplinkr\Storage\FileSettingsStorage

This keeps the API predictable and avoids coupling HTTP behavior to CLI output.

Quick Start

1. Install the package

composer require scherhak/uplinkr-api

scherhak/uplinkr is installed as a dependency.

2. Optionally publish the API config

php artisan vendor:publish --tag=uplinkr-api-config

Publishing is optional. The package works without publishing because config values are merged automatically.

3. Configure API access

UPLINKR_API_AUTH_ENABLED=true
UPLINKR_API_AUTH_HEADER=X-Uplinkr-Api-Key
UPLINKR_API_KEYS=replace-me-with-a-long-random-key
UPLINKR_API_ACCEPT_BEARER_TOKEN=false

UPLINKR_API_RATE_LIMIT_ENABLED=true
UPLINKR_API_RATE_LIMIT_MAX_ATTEMPTS=60
UPLINKR_API_RATE_LIMIT_DECAY_MINUTES=1

4. Clear config cache

php artisan optimize:clear

5. Open the API docs

  • UI: GET /api/docs
  • OpenAPI JSON: GET /api/docs/openapi

Authentication

By default, the API expects an API key in a custom header:

X-Uplinkr-Api-Key: replace-me-with-a-long-random-key

If Bearer support is enabled, the following is also accepted:

Authorization: Bearer replace-me-with-a-long-random-key

If authentication is enabled and the key is missing or invalid, the API responds with 401 Unauthorized.

API Documentation

The package uses dedoc/scramble to provide interactive API documentation.

  • UI: GET /api/docs
  • OpenAPI JSON: GET /api/docs/openapi

Documentation is rendered dynamically from the registered package routes. No generate step is required.

Available Endpoints

Projects

Method URI
GET /api/v1/projects
POST /api/v1/projects
GET /api/v1/projects/{project}
PATCH /api/v1/projects/{project}
DELETE /api/v1/projects/{project}

Probes

Method URI
GET /api/v1/probes
POST /api/v1/probes
GET /api/v1/projects/{project}/probes
POST /api/v1/projects/{project}/probes
GET /api/v1/projects/{project}/probes/{probeId}
PATCH /api/v1/projects/{project}/probes/{probeId}
DELETE /api/v1/projects/{project}/probes/{probeId}

Settings

Method URI
GET /api/v1/settings/iam-alive
PATCH /api/v1/settings/iam-alive

Example request body for PATCH /api/v1/settings/iam-alive:

{
  "enabled": true,
  "interval_hours": 6,
  "channels": ["mail", "webhook"]
}

Example Requests

Create a project:

curl -X POST http://localhost/api/v1/projects \
  -H "X-Uplinkr-Api-Key: replace-me-with-a-long-random-key" \
  -H "Content-Type: application/json" \
  -d '{
    "project": "status-page",
    "label": "Status Page",
    "description": "Public status page monitoring"
  }'

Create a project probe:

curl -X POST http://localhost/api/v1/projects/status-page/probes \
  -H "X-Uplinkr-Api-Key: replace-me-with-a-long-random-key" \
  -H "Content-Type: application/json" \
  -d '{
    "url": "https://example.com/health",
    "method": "GET",
    "latency": 1500
  }'

Read I-am-alive settings:

curl http://localhost/api/v1/settings/iam-alive \
  -H "X-Uplinkr-Api-Key: replace-me-with-a-long-random-key"

Configuration

Default route prefix:

UPLINKR_API_ROUTE_PREFIX=api/v1

Main configuration areas:

  • route prefix and route middleware
  • API key authentication header and accepted keys
  • optional Bearer token support
  • rate limiting behavior

If you need to customize package defaults locally, publish the config first:

php artisan vendor:publish --tag=uplinkr-api-config

Design Decisions

  • Handlers over Commands: The API uses Uplinkr handlers directly for projects and probes. This avoids shell execution, CLI output parsing, and unnecessary overhead.
  • Storage access for settings: The settings API uses Uplinkr\Storage\FileSettingsStorage directly because the underlying resource is a single global settings document.
  • Versioned routing: All package endpoints live under /api/v1 to keep future evolution explicit.
  • Minimal scope: The package intentionally exposes a focused subset of Uplinkr through HTTP instead of introducing a dashboard or separate application layer.

Requirements

  • PHP: 8.4 or higher
  • Laravel: 12.x

Development Notes

Contributing

Contributions are welcome. Please see CONTRIBUTING.md for details.

Security

If you discover a security issue, please see SECURITY.md for how to report it responsibly.

License

MIT License. See LICENSE.

scherhak/uplinkr-api 适用场景与选型建议

scherhak/uplinkr-api 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 1 次下载、GitHub Stars 达 0, 最近一次更新时间为 2026 年 03 月 22 日, 在 PHP 生态内属于活跃度较高的组件。

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

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

围绕 scherhak/uplinkr-api 我们能提供哪些服务?
定制开发 / 二次开发

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

BUG 修复 & 性能优化

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

项目外包 & 长期维护

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

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

统计信息

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

GitHub 信息

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

其他信息

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