hnhdigital-os/php-linode-api

View on GitHub
src/endpoints/Longview/Clients.php

Summary

Maintainability
A
1 hr
Test Coverage
<?php

namespace HnhDigital\LinodeApi\Longview;

/*
 * This file is part of the PHP Linode API.
 *
 * (c) H&H|Digital <hello@hnh.digital>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */

use HnhDigital\LinodeApi\Foundation\Base;

/**
 * This is the Clients class.
 *
 * This file is automatically generated.
 *
 * @link https://developers.linode.com/api/v4#tag/Longview-Clients
 *
 * @author Rocco Howard <rocco@hnh.digital>
 */
class Clients extends Base
{
    /**
     * Endpoint.
     *
     * @var string
     */
    protected $endpoint = 'longview/clients';

    /**
     * Constructor.
     *
     * @return void
     */
    public function __construct()
    {
        parent::__construct();
    }

    /**
     * Returns a paginated list of Longview Clients you have access to. Longview Client is used to monitor stats on your Linode
     * with the help of the Longview Client application.
     *
     * @link https://developers.linode.com/api/v4#operation/getLongviewClients
     *
     * @return array
     */
    public function get()
    {
        return $this->apiSearch($this->endpoint, ['class' => 'Longview\Client', 'parameters' => ['id']]);
    }

    /**
     * Creates a Longview Client.  This Client will not begin monitoring the status of your server until you configure the
     * Longview Client application on your Linode using the returning `install_code` and `api_key`.
     *
     * @link https://developers.linode.com/api/v4#operation/createLongviewClient
     *
     * @return mixed
     */
    public function create($optional = [])
    {
        return $this->apiCall('post', '', ['json' => array_merge([
        ], $optional)]);
    }
}