A Virtualmin API designed to run standalone or as part of a Laravel Application

Related tags

API virtualmin-api
Overview

Virtualmin API

GitHub release (latest by date) Build Status GitHub

A Virtualmin API designed to run standalone or as part of a Laravel Application

Requirements:

  • PHP 8.0
  • A running Virtualmin server

Features:

  • List Domains (Virtualmin output)
  • Get Domains (User-Friendly Output)
  • Change Plan
  • List Plans (Virtualmin output)
  • Get Plans (User-Friendly Output)

Get Domains

Framework Agnostic PHP:

use \FintechSystems\VirtualminApi\VirtualminApi;
$api = new VirtualminApi(
        'hostname' => 'virtualmin.test',
        'username' => 'root',
        'password' => '********'
    );
$api->getDomains();

Laravel App:

VirtualminApi::getDomains();

Output:

Array of all domains on a Virtualmin server.

Change Plan

Framework Agnostic PHP:

use \FintechSystems\VirtualminApi\VirtualminApi;
$api = new VirtualminApi;
$api->changePlan('example.com', 'New Plan Name);

Laravel App:

VirtualminApi::changePlan('example.com', 'New Plan Name);

Testing

We have tests! Use the command below to run the tests.

Live API calls will be made otherwise causing your tests to fail.

vendor/bin/phpunit --exclude-group=live

Coverage reports

To regenerate coverage reports:

XDEBUG_MODE=coverage ./vendor/bin/phpunit --coverage-html=tests/coverage-report

See also .travis.yml

Changelog

Please see CHANGELOG for more information on what has changed recently.

Version Control

This application uses Semantic Versioning

https://semver.org/

Local Editing

For local editing, add this to composer.json:

"repositories" : [
        {
            "type": "path",
            "url": "../virtualmin-api"
        }
    ]

Credits

Inspiration

This standalone package was inspired by video course by Marcel Pociot of BeyondCode:
PHP Package Development

Before doing the video course I had developed many versions of the same thing but it was never standalone and as a consequence over the years it was difficult to maintain and quickly use in new projects.

License

The MIT License (MIT). Please see License File for more information.

Comments
  • [FIX] foreach loop when getting domains and there is no data

    [FIX] foreach loop when getting domains and there is no data

    Let's take the case where the user tries to connect with false identifiers, then he will want to retrieve the list of domains to be sure that he is connected. except that $output will be null because its identifiers are wrong. what will bug the foreach loop

    opened by Domeshow 2
  • Make possible to create/delete a domain in virtualmin

    Make possible to create/delete a domain in virtualmin

    Then we can use something like

    $api->createDomain([
        // New virtual server details
        'domain'                 => 'demo.example.com',
        'desc'                   => 'My demo website',
        'pass'                   => '***************',
        'template'               => 'WikiSuite 1',
        'plan'                   => 'WikiSuite 1',
        
        // Advanced options
        'email'                  => '[email protected]',
        'db'                     => 'demo_example_com',
        
        // Enabled features
        'features-from-plan'     => ''
    ]))
    
    • https://www.virtualmin.com/documentation/developer/cli/create_domain/
    opened by fabiomontefuscolo 2
  • Make possibe to use runProgram on classes inheriting from VirtualminA…

    Make possibe to use runProgram on classes inheriting from VirtualminA…

    That empower developers to extend you API to connect to custom endpoints in Virtualmin

    I also suggest to make public all other methods that does not leak credentials.

    $api = new VirtualminApi(
        [
            'hostname' => 'example.com',
            'username' => 'fabio',
            'password' => '***************'
        ],
        'debug'
    );
    
    $api->runProgram(
        'tiki-install',
        [
            'domain' => 'test2.example.com',
            'branch' => '22.x',
            'password' => 'tikiwiki' // 8 chars long
        ]
    );
    
    opened by fabiomontefuscolo 1
  • Public run program

    Public run program

    https://github.com/fintech-systems/virtualmin-api/blob/eb88dd9a9fd12b5ce02fbe0fa6b38d2d3b1a95e3/src/VirtualminApi.php#L171

    Can runProgram be public?

    We need that to call different plugins on virtualmin and would no make sense creating new pull-requests with methods for dealing with custom plugins, If runProgram is public, I can extend the class to create custom calls. Makes sense?

    opened by fabiomontefuscolo 1
  • [FIX] foreach loop when getting domains and there is no data

    [FIX] foreach loop when getting domains and there is no data

    Let's take the case where the user tries to connect with false identifiers, then he will want to retrieve the list of domains to be sure that he is connected. except that $output will be null because its identifiers are wrong. what will bug the foreach loop

    opened by Domeshow 0
  • Semantic versionning

    Semantic versionning

    I propose we use https://semver.org/

    Current issue:

    • 2021-09-01: https://packagist.org/packages/fintech-systems/virtualmin-api#1.0.0
    • 2022-02-14: https://packagist.org/packages/fintech-systems/virtualmin-api#v0.1.5

    Thanks!

    enhancement 
    opened by marclaporte 1
Releases(v0.1.5)
Owner
Fintech Systems
Software developer for the financial industry
Fintech Systems
A PHP library for the CoinMarketCap API designed to be easy to use.

Help wanted: I don't have enough time to keep updating this library, if you can, don't be shy. Pull requests are welcome. PHP CoinMarketCap API This p

Shahrad Elahi 12 Sep 23, 2022
This API provides functionality for creating and maintaining users to control a simple To-Do-List application. The following shows the API structure for users and tasks resources.

PHP API TO-DO-LIST v.2.0 This API aims to present a brief to consume a API resources, mainly for students in the early years of Computer Science cours

Edson M. de Souza 6 Oct 13, 2022
Simple and effective multi-format Web API Server to host your PHP API as Pragmatic REST and / or RESTful API

Luracast Restler ![Gitter](https://badges.gitter.im/Join Chat.svg) Version 3.0 Release Candidate 5 Restler is a simple and effective multi-format Web

Luracast 1.4k Dec 14, 2022
Laravel api tool kit is a set of tools that will help you to build a fast and well-organized API using laravel best practices.

Laravel API tool kit and best API practices Laravel api tool kit is a set of tools that will help you to build a fast and well-organized API using lar

Ahmed Esa 106 Nov 22, 2022
Zoho CRM API SDK is a wrapper to Zoho CRM APIs. By using this sdk, user can build the application with ease

Archival Notice: This SDK is archived. You can continue to use it, but no new features or support requests will be accepted. For the new version, refe

null 81 Nov 4, 2022
An SDK built to facilitate application development for Facebook Ads API.

Facebook Business SDK for PHP Introduction The Facebook Business SDK is a one-stop shop to help our partners better serve their businesses. Partners a

Meta 719 Dec 28, 2022
test listmonk & smtp application api

About Laravel Laravel is a web application framework with expressive, elegant syntax. We believe development must be an enjoyable and creative experie

Iman Imen 0 Dec 26, 2021
This API aims to present a brief to consume a API resources, mainly for students in the early years of Computer Science courses and the like.

Simple PHP API v.1.0 This API aims to present a brief to consume a API resources, mainly for students in the early years of Computer Science courses a

Edson M. de Souza 14 Nov 18, 2021
微信支付 API v3 的 PHP Library,同时也支持 API v2

微信支付 WeChatPay OpenAPI SDK [A]Sync Chainable WeChatPay v2&v3's OpenAPI SDK for PHP 概览 微信支付 APIv2&APIv3 的Guzzle HttpClient封装组合, APIv2已内置请求数据签名及XML转换器,应

null 275 Jan 5, 2023
API documentation API SCB EASY APP

SCB-API-EASY V3.0 API documentation SIAM COMMERCIAL BANK PUBLIC COMPANY LTD. API SCB Easy V3 endpoint = https://fasteasy.scbeasy.link 1.0. Get balance

SCB API Esay team 2 Sep 28, 2021
Courier API adalah project API untuk mengetahui ongkos kirim Logistik-logistik pengiriman barang antar kota & International

Courier API Courier API adalah project API untuk mengetahui ongkos kirim Logistik-logistik pengiriman barang antar kota (dalam negeri) & International

Rangga Darmajati 2 Sep 24, 2021
LaraBooks API - Simple API for iOS SwiftUI app tests.

About Laravel Laravel is a web application framework with expressive, elegant syntax. We believe development must be an enjoyable and creative experie

Konrad Podrygalski 1 Nov 13, 2021
Simple PHP API client for tube-hosting.com rest API

Tube-Hosting API PHP client Explanation This PHP library is a simple api wrapper/client for the tube-hosting.com api. It is based on the provided docu

null 4 Sep 12, 2022
Best resources restful api for developers (with JSON:API standar specification design)

List API Best resources restful api for developers (with JSON:API standar specification design). API Resource Endpoint Name Resource Description Al Qu

Noval 2 Jan 18, 2022
Chargebee API PHP Client (for API version 2 and Product Catalog version 2.0)

chargebee-php-sdk Overview This package provides an API client for Chargebee subscription management services. It connects to Chargebee REST APIs for

GLOBALIS media systems 8 Mar 8, 2022
GraphQL API to Studio Ghibli REST API

GhibliQL GhibliQL is a GraphQL wrapper to the Studio Ghibli REST API Usage First, you'll need a GraphQL client to query GhibliQL, like GraphQL IDE Con

Sebastien Bizet 8 Nov 5, 2022
Adds CORS (Cross-Origin Resource Sharing) headers support in your Laravel application

CORS Middleware for Laravel Implements https://github.com/asm89/stack-cors for Laravel About The laravel-cors package allows you to send Cross-Origin

Fruitcake 6.2k Jan 8, 2023
A Laravel Fractal package for building API responses, giving you the power of Fractal with Laravel's elegancy.

Laravel Responder is a package for building API responses, integrating Fractal into Laravel and Lumen. It can transform your data using transformers,

Alexander Tømmerås 776 Dec 25, 2022
Laravel API 文档生成器,可以将基于 Laravel 项目的项目代码,自动生成 json 或 md 格式的描述文件。

Thresh Laravel API 文档生成器,可以将基于 Laravel 项目的项目代码,自动生成 json 或 md 格式的描述文件。 安装 $ composer require telstatic/thresh -vvv 功能 生成 Markdown 文档 生成 Postman 配置文件 生

静止 5 Jul 12, 2021