Download the PHP package cdn77/papi without Composer

On this page you can find all versions of the php package cdn77/papi. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package papi

PApi - PHP Api client library for Prometheus

Build Status

Targets to provide simple means for obtaining data from Prometheus API.

Stable for Prometheus 1.x and <= v2.2 api spec NOTICE: some endpoints are only available in newer versions of Prometheus. For detailed list see table of available calls below.

Instalation

Use composer to add PApi as dependency:

$ composer install cdn77/papi

Usage

Create a client

<?php
use PApi\Client;

require __DIR__ . '/vendor/autoload.php';

$client = new Client([
    'host' => 'my-prometheus.com',
]);

Available options

Name Default value Description
scheme http Host scheme
host localhost Host address
port 9090 Host port
path /api/v1/ Path to base API endpoint
timeout 30 Timeout for requests
username null HTTP Auth username
password null HTTP Auth password
connectionHeaders [] Connection headers
connectionType CurlConnection::class Class to use for connection. See below

Available connection classes

Available calls

PApi currently has methods for all available endpoints provided by Prometheus.

Call Code Prometheus compatibility Official doc
Query $client->getQuery('up', new \DateTimeImmutable('now'); >=1.0 doc
QueryRange $client->getQueryRange('up', new \DateTimeImmutable('today'), new \DateTimeImmutable('now'), '12h'); >=1.0 doc
Series $client->getSeries(['up'], new \DateTimeImmutable('-1 minute'), new \DateTimeImmutable('now'); >=1.0 doc
Label Values $client->getLabelValues('job'); >=1.0 doc
Targets (active only) $client->getTargets(); >=1.0 doc
Alert Managers $client->getAlertManagers(); >=1.0 doc
Create snapshot $client->createSnapshot(); >=2.1 doc
Delete series $client->deleteSeries(['up'], new DateTimeImmutable('today'), new DateTimeImmutable('now'); >=2.1 doc
Clean tombstones $client->cleanTombstones(); >=2.1 doc
Get Config $client->getConfig(); >=2.2 doc
Get Flags $client->getFlags(); >=2.2 doc

All versions of papi with dependencies

PHP Build Version
Package Version
Requires php Version >=7.1
ext-curl Version *
skrz/meta Version ^3.1
symfony/finder Version ~2.7|~3.0|~4.0
symfony/yaml Version ~4.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package cdn77/papi contains the following files

Loading the files please wait ....