SDK classes have been auto generated from the open api documentation for the OnePortal API. They can be used to interface with the API programmatically.
Included is a console client with some basic commands configured.
Available commands:
help Displays help for a command
list Lists commands
tinker Tinker!
core
core:get Get a core
core:list Get the list of cores.
facility
facility:list Get the stock for a facility.
facility:stock Get the stock for a facility.
image
image:list Get the image list.
job
job:get Get a job status.
project
project:create Creates a new project.
project:delete Delete a project.
project:get Get a project.
project:list Get the list of projects.
server
server:create Creates a new server.
server:delete Delete an server
server:list Get the list of a project's server.
sshkey
sshkey:create Creates a new ssh pubkey.
sshkey:delete Delete an ssh key.
sshkey:get Get an ssh key
sshkey:list Get the list of ssh keys
The client expects a profile.ini
file in the root of the project. An example is provided in profiles.ini.example
.
- OnePortal API token
- Docker Installation
- Docker
- docker-compose
- Local PHP Installation
- PHP 7.2 or later
- Composer
Note: The Dockerfile and docker-compose configuration included in this repo can be used instead of installing PHP on your system.
- Install PHP and composer
- Clone this repo:
git clone https://github.com/limestonenetworks/oneportal-api-php-sdk
- Change directory to the SDK:
cd oneportal-api-php-sdk
- Install SDK dependencies:
composer install
- Copy the example profiles.ini:
cp profiles.ini.example profiles.ini
- Configure
profiles.ini
with your API token and (optionally) project ID. - Run
./api core:list
to verify the API access is functioning
- Clone this repo:
git clone https://github.com/limestonenetworks/oneportal-api-php-sdk
- Change directory to the SDK:
cd oneportal-api-php-sdk
- Copy the example profiles.ini:
cp profiles.ini.example profiles.ini
- Configure
profiles.ini
with your API token and (optionally) project ID. - Start the docker container:
docker-compose up -d
- Console into the docker container:
docker-compose exec oneportal-sdk /bin/bash
- Install SDK dependencies:
composer install
- Run
./api core:list
to verify the API access is functioning
After installation is complete, run ./api
to see a list of available commands. Show available parameters for a command by passing -h
(ie. ./api server:create -h
)