Download the PHP package clivern/monkey without Composer

On this page you can find all versions of the php package clivern/monkey. 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 monkey

Monkey

Apache CloudStack SDK in PHP.

Build Status License Latest Stable Version

Installation

To install the package via composer, use the following:

This command requires you to have Composer installed globally.

CloudStack Simulator

Install Docker

To install docker on Ubuntu.

Then ensure that it is enabled to start after reboot:

Then Run CloudStack Simulator.

Usage

After adding the package as a dependency, Please read the following steps:

Configure CloudStack Credentials

Running Sync Calls

In order to run sync calls, Like creating a new user, you need to check cloudstack api to get the command and the required parameters. First lets create a call that will fail due to missing parametes and see the response data:

Now let's create a successful call:

Running Async Jobs

In case of async calls, we need to use another class called Job to execute our caller(s). The Job class can be exported as json encoded string and stored in database and reloaded again from the last state. This means that we can build a job that hold a lot of sync and async calls and the job class will continue every time we reload it and complete the main request.

Also Job class can retry to run your caller(s) if it failed and once it succeeded, it will move to the next caller. and for sure you will provide the number of trials for each job or per each caller.

First let's create a job that will stop a virtual machine. This job needs to run at least two times, one to create the machine and another to check the job status. Since we don't use database to store job state, we will do this manually. But for sure in real world we will store job in database and run in background.

Also we can start the virtual machine again

Running Complex Jobs

If we want to run two calls but they are independent on each other, it is all about the order. We just need to run one then another like stop and start the virtual machine. In this case we will create two callers and create a job with the two callers like the following:

More Complex Usage

Let's make it more complex, Now we need to deploy a virtual server with these data:

And as you know from API we need the id of the template, service offering and zone. In this case we will create a separate callers to get these ids before we deploy the virtual server. and we will use response callbacks to store these ids in the caller shared data to be used by the job object.

Monkey on Production

Here I was trying to describe different usage cases of monkey but in case of production, we must have a database table(s) for our jobs and executer to run our jobs in background.

We will need custom request classes for each specific command so we don't need to provide command data every time we create a request.

We will need custom response classes for each specific command so we don't need to parse the response to fetch the useful response data and has a direct method to do that.

Also build our response callbacks for calls so when we use it, we will be sure that these data will be available for other callers within the job.

Usage as Command Line Tool

Create an executable file run

Misc

Changelog

Version 1.1.0:

Version 1.0.6:

Version 1.0.5:

Version 1.0.4:

Version 1.0.3:

Version 1.0.2:

Version 1.0.1:

Version 1.0.0:

Acknowledgements

© 2018, Clivern. Released under MIT License.

Monkey is authored and maintained by @clivern.


All versions of monkey with dependencies

PHP Build Version
Package Version
Requires php Version >=7.2
guzzlehttp/guzzle Version ^7.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 clivern/monkey contains the following files

Loading the files please wait ....