2017 © Pedro Peláez
 

library openshift-client

Simple OpenShift client for PHP.

image

universityofadelaide/openshift-client

Simple OpenShift client for PHP.

  • Wednesday, August 1, 2018
  • by caseyfw
  • Repository
  • 6 Watchers
  • 1 Stars
  • 920 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 16 Versions
  • 4 % Grown

The README.md

Simple OpenShift PHP Client

Provides a simple standalone client and a wrapper for the rather verbose universityofadelaide/openshift-restclient-php generated by Swagger codegen., (*1)

Getting started

Require the client using composer:, (*2)

composer require universityofadelaide/openshift-client dev-master

Usage

Create an instance of the Client class by providing an OpenShift API URL and authentication token:, (*3)

use UniversityOfAdelaide\OpenShift\Client;

...

$client = new Client('https://192.168.64.2:8443/api/v1/', 'big_secret_token_hash', 'project');

How to Test

Create a test.php or similar file in the root of the project., (*4)

Add the following to this file:, (*5)

require_once __DIR__ . './../../autoload.php';

use UniversityOfAdelaide\OpenShift\Client;

$host = 'https://pathToOpenshift.host';
$token = 'yourOpenShiftToken';
$namespace = 'project';

// Get the arguments required
$client = new Client($host, $token, $namespace, TRUE);

// Attempt to create a secret.
$response = $client->createSecret('superSecret', ['username' => 'pied_piper', 'pass', 'middleout']);

How to test with phpunit and minishift

Ensure that you have the oc command available., (*6)

The token will expire every 24 hours, if the token is expired you will need to login again., (*7)

oc login -u developer -p developer
# Assumes myproject (default) is available.
# From the /vendor/universityofadelaide/openshift-client directory
../../bin/phpunit tests/ClientTest.php $(minishift console --url) $(oc whoami -t) myproject client_test.json

Actual deployment

Manually create a mysql container in OpenShift, make note of the db name, username and password, and put those into the client_test.json envVars section., (*8)

Test clean up scripts

Remove all objects created during tests :, (*9)

# Assuming all the names for items created contain 'pied'
name=pied; for type in dc bc is svc pvc route pods job cronjob secrets; do for item in $(oc get "${type}" | grep ${name} | awk '{ print $1 }'); do oc delete ${type} ${item}; done; done

Todo

  • Complete implementation of interface.
  • Improve test coverage, test the response json object rather that just the status code.

The Versions

01/08 2018

dev-develop

dev-develop

Simple OpenShift client for PHP.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Chris Barton
by Casey Fulton

27/06 2018

dev-feature/deployment-memory-request

dev-feature/deployment-memory-request

Simple OpenShift client for PHP.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Chris Barton
by Casey Fulton

08/02 2018

dev-feature/shepherd-78

dev-feature/shepherd-78

Simple OpenShift client for PHP.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Chris Barton
by Casey Fulton

08/02 2018

dev-feature/shepherd-79

dev-feature/shepherd-79

Simple OpenShift client for PHP.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Chris Barton
by Casey Fulton

27/11 2017

dev-feature/fix-request-exception

dev-feature/fix-request-exception

Simple OpenShift client for PHP.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Chris Barton
by Casey Fulton

31/10 2017

dev-feature/generate-build-config

dev-feature/generate-build-config

Simple OpenShift client for PHP.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Chris Barton
by Casey Fulton

26/10 2017

dev-feature/webops-265-re-enable-deployed-cron

dev-feature/webops-265-re-enable-deployed-cron

Simple OpenShift client for PHP.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Chris Barton
by Casey Fulton

27/09 2017

dev-feature/stdout-debugging

dev-feature/stdout-debugging

Simple OpenShift client for PHP.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Chris Barton
by Casey Fulton

17/08 2017

dev-feature/feature/webops-226-redis-deploy

dev-feature/feature/webops-226-redis-deploy

Simple OpenShift client for PHP.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Chris Barton
by Casey Fulton

03/07 2017

dev-feature/add-update-hooks

dev-feature/add-update-hooks

Simple OpenShift client for PHP.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Chris Barton
by Casey Fulton

30/06 2017

dev-feature/add-label-support-deploymentconfigs

dev-feature/add-label-support-deploymentconfigs

Simple OpenShift client for PHP.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Chris Barton
by Casey Fulton

30/06 2017

dev-feature/models-concept

dev-feature/models-concept

Simple OpenShift client for PHP.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Chris Barton
by Casey Fulton

27/06 2017

dev-feature/deploymentconfigs-get-via-label

dev-feature/deploymentconfigs-get-via-label

Simple OpenShift client for PHP.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Chris Barton
by Casey Fulton

16/06 2017

dev-feature/more-delete-cleanup

dev-feature/more-delete-cleanup

Simple OpenShift client for PHP.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Chris Barton
by Casey Fulton

30/05 2017

dev-feature/fix-service

dev-feature/fix-service

Simple OpenShift client for PHP.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Chris Barton
by Casey Fulton

17/05 2017

dev-master

9999999-dev

Simple OpenShift client for PHP.

  Sources   Download

MIT

The Requires

 

by Chris Barton
by Casey Fulton