Download the PHP package devstub/kubernetes-api-php-client without Composer
On this page you can find all versions of the php package devstub/kubernetes-api-php-client. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download devstub/kubernetes-api-php-client
More information about devstub/kubernetes-api-php-client
Files in devstub/kubernetes-api-php-client
Package kubernetes-api-php-client
Short Description PHP client for the kubernetes api
License Apache-2.0
Homepage https://github.com/devstub/kubernetes-api-php-client
Informations about the package kubernetes-api-php-client
This project is not being maintained, you should use something else.
kubernetesAPI-PHP-client
PHP client library for the Kubernetes API
Current Version : v0.1.0
Contents
- Usage
- Basic Usage
- How to use the library
- Configuration
- API Endpoints
- Response
- Installation
- Requirements
- Install with composer
- To Do
- About
Usage
Basic Usage
- Install the client and all of its required libraries (instructions)
- Register an PSR-0 compatible autoloader
- Create
\DevStub\KubernetesAPIClient\Client()
object instance - Setup all of the configuration options
- Send a request
How to use the library
For most of the functionality Client supports 3 ways of setting properties and options. Not all 3 ways are always supported yet so check the each object and it's method for it support
-
Explicitly instantiating objects and passing them as properties
-
Implicit creation of object by not setting the param
-
Passing a json string as an argument
In below example we are just passing the full service request as json
Configuration
Before any requests can be made with the client you will need to setup some configuration options.
Following options are available
setSslVerify($value) $value = TRUE | FALSE - defaults: [TRUE] Set it to false when you don't want to verify the SSL cert. (Useful for development)
setAPINodeUrl($value) $value = String Set it to the full url of the Kubernetes API server. Note: don't include the version path portion. It is added by the client.
setAPIVersion($value) $value = String - defaults: [v1beta1] Set the version of the API Schema
setAuthType($value) $value = String - defaults: [Config::AUTH_TYPE_HTTP_BASIC] Options: Config::AUTH_TYPE_HTTP_BASIC, Config::AUTH_TYPE_NONE At this time only one type of auth type is supported
setAuthOptions($value) $value = Array *Options: username, password Set the array which provides auth data based on the authType Selected
setConnectionAdapter($value) $value = String - defaults: [Config::CONNECTION_ADAPTER_GUZZLE] *Options: CONNECTION_ADAPTER_GUZZLE Sets the type of rest http adapter to use, currently only guzzle is supported.
Configuration setting Example:
API Endpoints
To make requests to the API endpoints you call endpoint methods on the client object, which returns an endpoint object on which you can call: create, update, delete and get methods.
Available endpoint methods on the client object:
- pods()
- replicationControllers()
- endpoints()
- services()
- minions()
- events()
- bindings()
Response
All of the requests will return an instance AdapterResponse class. With it you can check the status of the response:
or retrieve the response content as JSON :
or as nested objects :
For a full list of available kubernetes entities check the \DevStub\KubernetesAPIClient\Entity
namespace
Installation
Requirements
Easies way to retrieve all of the dependencies is by using composer
Install with composer
The recommended way is to use Composer to install the kubernetes PHP API Client
Next run composer to install the latest version of the kubernetes PHP API Client:
And don't forget to require the autoloader in your project:
Alternatively you can also specify the dependency in your exisitng composer.json
To do
- [ ] Add unit tests
- [ ] Support other API Versions
- [ ] Support additional REST adapters
- [ ] Add way to poll/watch the endpoints for changes
About
License
Kubernetes PHP API Client is licensed under Apache 2.0
Author
Faruk Brbovic, DevStub.com
All versions of kubernetes-api-php-client with dependencies
guzzlehttp/guzzle Version 5.0.3
netresearch/jsonmapper Version dev-master