Created
April 6, 2020 01:57
-
-
Save rezen/090c011656e9bda2003ee9bbae500bb6 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
require_once(__DIR__ . '/vendor/autoload.php'); | |
$config = new OpenAPI\Client\Configuration; | |
$config->setHost('http://localhost/v1.40'); | |
$apiInstance = new OpenAPI\Client\Api\ContainerApi( | |
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. | |
// This is optional, `GuzzleHttp\Client` will be used as default. | |
new GuzzleHttp\Client([ | |
'curl' => [ | |
CURLOPT_UNIX_SOCKET_PATH => '/var/run/docker.sock' // If you are on mac ... | |
] | |
]), | |
$config, | |
); | |
try { | |
print_r($apiInstance->containerList(true)); | |
} catch (Exception $e) { | |
echo 'Exception when calling ContainerApi->containerArchive: ', $e->getMessage(), PHP_EOL; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment