<?php

require_once '../StormAPI.class.php';
$apiUser = "******";
$apiPass = "******";
$apiMethod = "storm/server/list";
$paramsArray = FALSE;
$apiVersion = "v1";
$storm = new \LiquidWeb\StormAPI($apiUser, $apiPass, $apiMethod, $paramsArray, $apiVersion);
$storm->addParam("page_size", 999);
$results = $storm->request();
foreach ($results['items'] as $item) {
    echo $item['domain'] . " || " . $item['uniq_id'] . "\n";
}
/*
 * 	Author: Jason Gillman Jr.
 *	Description: My attempt at writing a simple interactive CLI script for dumping raw data from Storm API returns.
 * 	I've adjusted this script so that instead of just a print_r() dump, it "breadcrumbs" the returned location so you don't get lost
 * 	Hope it's useful!
 */
require_once '../StormAPI.class.php';
// Edit location as needed
// Initial information
// echo "\nAPI Username: "******"Password: "******"Initial Method: ";
$api_method = trim(fgets(STDIN));
$storm = new \LiquidWeb\StormAPI($apiUser, $apiPass, $api_method);
// Menu
while (!isset($stop)) {
    // Get logging status
    if (isset($logging)) {
        $logStatus = "(Currently Active " . $logging['filename'] . ")\n";
    } else {
        $logStatus = "(Currently Inactive)\n";
    }
    echo "\n\nPick your poison... \n";
    echo "1. Change method (will clear all params) \n";
    echo "2. Add parameter \n";
    echo "3. List currently set parameters \n";
    echo "4. Clear ALL parameters \n";
    echo "5. Execute request and display \n";
    echo "6. Toggle logging " . $logStatus;