예제 #1
0
 public function testNodeFindByUUID()
 {
     $node = Client::getInstance()->nodes()->find("3cb9e362-d4ef-4e4b-9ee6-280738b53172");
     $this->putExpectation("Nodes/FindByUUID", $node);
     $this->assertEquals($this->getExpectation("Nodes/FindByUUID"), $node);
     return $node;
 }
예제 #2
0
 public function setUp()
 {
     parent::setUp();
     VCR::turnOn();
     $calledClass = explode("\\", get_called_class());
     $cassette = end($calledClass) . "/" . $this->getName();
     VCR::insertCassette($cassette);
     $this->apiClient = Client::getInstance();
 }
예제 #3
0
 public function testRelatedObjects()
 {
     $webservice = Client::getInstance()->services()->find('6fe506a6-a85c-4bcf-9398-f1429657f4df');
     $mysqlService = Client::getInstance()->services()->find('4f07a3fa-5101-43c4-a973-a23571e88a53');
     $loadBalancerService = Client::getInstance()->services()->find('7a613296-e861-47c7-98c5-05f75b760bcf');
     $this->assertContainsOnlyInstancesOf("\\Thru\\TutumApi\\Models\\Container", $webservice->getContainers());
     $this->assertContainsOnlyInstancesOf("\\Thru\\TutumApi\\Models\\Service", $webservice->getLinkedFromService());
     $this->assertContainsOnlyInstancesOf("\\Thru\\TutumApi\\Models\\Service", $mysqlService->getLinkedToService());
     $this->assertContainsOnlyInstancesOf("\\Thru\\TutumApi\\Models\\Service", $loadBalancerService->getLinkedToExternalService());
     $this->assertContainsOnlyInstancesOf("\\Thru\\TutumApi\\Models\\Port", $webservice->getContainerPorts());
 }
예제 #4
0
 public function testContainerFindByName()
 {
     $container = Client::getInstance()->containers()->findByName("MySQL-1");
     $this->putExpectation("Containers/FindByName", $container);
     $this->assertEquals($this->getExpectation("Containers/FindByName"), $container);
 }
예제 #5
0
<?php

require_once "vendor/autoload.php";
function arrayify($object)
{
    return json_decode(json_encode($object), true);
}
function var_export_compact($object)
{
    $data = var_export($object, true);
    $data = str_replace("array (", "[", $data);
    $data = str_replace(")", "]", $data);
    $data = str_replace("\n", " ", $data);
    $data = str_replace("\t", "", $data);
    $data = preg_replace('/(\\s)+/', ' ', $data);
    $data = str_replace(", ]", "]", $data);
    $data = str_replace("[ ", "[", $data);
    return $data;
}
\Thru\TutumApi\Client::configure('matthewbaggett', 'decea003584f7df33be57f547f63f2cccd8e3188');
\VCR\VCR::configure()->setMode('new_episodes')->enableLibraryHooks(array('curl', 'stream_wrapper'));
예제 #6
0
파일: Stack.php 프로젝트: Thruio/TutumApi
 public function redeploy()
 {
     return Client::getInstance()->stacks()->redeploy($this->getUuid());
 }
예제 #7
0
 public function reload()
 {
     Client::getInstance()->stacks()->find($this->getUuid(), $this);
 }
예제 #8
0
 public function reload()
 {
     if ($this->getUuid()) {
         Client::getInstance()->services()->find($this->getUuid(), $this);
     }
 }
예제 #9
0
 public function testStackFindByName()
 {
     $stack = Client::getInstance()->stacks()->findByName("Thruio");
     #$this->putExpectation("Stack/FindByName", $stack);
     $this->assertEquals($this->getExpectation("Stack/FindByName"), $stack);
 }
예제 #10
0
파일: Service.php 프로젝트: Thruio/TutumApi
 /**
  * @return Service
  * @throws \Exception
  */
 public function terminate()
 {
     $service = Client::getInstance()->services()->terminateService($this->getUuid());
     return $service;
 }
예제 #11
0
 public function testServiceServices()
 {
     $service = Client::getInstance()->services()->findByName("MySQL");
     $this->assertTrue($service instanceof Models\Service);
 }
예제 #12
0
 public function testPropertiesWork()
 {
     $stack = Client::getInstance()->stacks()->findByName("Thruio");
     $this->assertEquals("Thruio", $stack->getName());
     $this->assertEquals("7734bf20-a765-47a1-82e6-019e885dc327", $stack->getUuid());
 }