Skip to content

Commit c40c85b

Browse files
Merge pull request #5 from ByteInternet/rename-ephemeral-to-brancher
2 parents 0a40102 + a56d63a commit c40c85b

File tree

5 files changed

+29
-29
lines changed

5 files changed

+29
-29
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,4 +49,4 @@ Here's a list of Hypernode API features implemented in the client.
4949

5050
- Updating one or multiple Hypernode settings at once.
5151
- Querying/polling the logbook for the status of a job.
52-
- Creating and cancelling Ephemeral Hypernode instances.
52+
- Creating and cancelling Brancher Hypernode instances.

src/HypernodeClient.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
use Hypernode\Api\Exception\HypernodeApiClientException;
99
use Hypernode\Api\Exception\HypernodeApiServerException;
1010
use Hypernode\Api\Service\App;
11-
use Hypernode\Api\Service\EphemeralApp;
11+
use Hypernode\Api\Service\BrancherApp;
1212
use Hypernode\Api\Service\Logbook;
1313
use Hypernode\Api\Service\Settings;
1414
use Psr\Http\Message\ResponseInterface;
@@ -19,15 +19,15 @@ class HypernodeClient
1919

2020
public HttpMethodsClientInterface $api;
2121
public App $app;
22-
public EphemeralApp $ephemeralApp;
22+
public BrancherApp $brancherApp;
2323
public Settings $settings;
2424
public Logbook $logbook;
2525

2626
public function __construct(HttpMethodsClientInterface $apiClient)
2727
{
2828
$this->api = $apiClient;
2929
$this->app = new App($this);
30-
$this->ephemeralApp = new EphemeralApp($this);
30+
$this->brancherApp = new BrancherApp($this);
3131
$this->settings = new Settings($this);
3232
$this->logbook = new Logbook($this);
3333
}
@@ -46,4 +46,4 @@ public function maybeThrowApiExceptions(ResponseInterface $response)
4646
throw new HypernodeApiClientException($response);
4747
}
4848
}
49-
}
49+
}

src/Service/App.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,6 @@ class App extends AbstractService
88
{
99
public const V2_APP_DETAIL_URL = "/v2/app/%s/";
1010
public const V2_APP_CANCEL_URL = "/v2/app/%s/cancel/";
11-
public const V2_APP_EPHEMERAL_URL = "/v2/app/%s/ephemeral/";
11+
public const V2_APP_BRANCHER_URL = "/v2/app/%s/brancher/";
1212
public const V1_APP_FLOWS_URL = "/logbook/v1/logbooks/%s/flows/";
1313
}

src/Service/EphemeralApp.php renamed to src/Service/BrancherApp.php

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,19 +7,19 @@
77
use Hypernode\Api\Exception\HypernodeApiClientException;
88
use Hypernode\Api\Exception\HypernodeApiServerException;
99

10-
class EphemeralApp extends AbstractService
10+
class BrancherApp extends AbstractService
1111
{
1212
/**
13-
* Create an ephemeral app for given parent app.
13+
* Create an brancher app for given parent app.
1414
*
1515
* @param string $app Name of the parent app
16-
* @return string Name of the ephemeral app
16+
* @return string Name of the brancher app
1717
* @throws HypernodeApiClientException
1818
* @throws HypernodeApiServerException
1919
*/
2020
public function create(string $app): string
2121
{
22-
$url = sprintf(App::V2_APP_EPHEMERAL_URL, $app);
22+
$url = sprintf(App::V2_APP_BRANCHER_URL, $app);
2323

2424
$response = $this->client->api->post($url);
2525

@@ -31,9 +31,9 @@ public function create(string $app): string
3131
}
3232

3333
/**
34-
* Cancel an ephemeral app.
34+
* Cancel an brancher app.
3535
*
36-
* @param string $app Name of the ephemeral app
36+
* @param string $app Name of the brancher app
3737
* @return void
3838
* @throws HypernodeApiClientException
3939
* @throws HypernodeApiServerException
@@ -46,4 +46,4 @@ public function cancel(string $app): void
4646

4747
$this->client->maybeThrowApiExceptions($response);
4848
}
49-
}
49+
}

tests/unit/Service/EphemeralAppTest.php renamed to tests/unit/Service/BrancherAppTest.php

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -9,27 +9,27 @@
99
use Hypernode\Api\Exception\HypernodeApiServerException;
1010
use Hypernode\Api\HypernodeClientTestCase;
1111

12-
class EphemeralAppTest extends HypernodeClientTestCase
12+
class BrancherAppTest extends HypernodeClientTestCase
1313
{
14-
public function testCreateEphemeralApp()
14+
public function testCreateBrancherApp()
1515
{
1616
$this->responses->append(
1717
new Response(200, [], json_encode([
1818
'name' => 'johndoe-eph123456',
1919
'parent' => 'johndoe',
20-
'type' => 'ephemeral',
20+
'type' => 'brancher',
2121
])),
2222
);
2323

24-
$ephemeralAppName = $this->client->ephemeralApp->create('johndoe');
24+
$brancherAppName = $this->client->brancherApp->create('johndoe');
2525

2626
$request = $this->responses->getLastRequest();
2727
$this->assertEquals('POST', $request->getMethod());
28-
$this->assertEquals('/v2/app/johndoe/ephemeral/', $request->getUri());
29-
$this->assertEquals('johndoe-eph123456', $ephemeralAppName);
28+
$this->assertEquals('/v2/app/johndoe/brancher/', $request->getUri());
29+
$this->assertEquals('johndoe-eph123456', $brancherAppName);
3030
}
3131

32-
public function testCreateEphemeralAppRaisesClientExceptions()
32+
public function testCreateBrancherAppRaisesClientExceptions()
3333
{
3434
$badRequestResponse = new Response(400, [], json_encode([
3535
'non_field_errors' => ['Your request was invalid.']
@@ -38,10 +38,10 @@ public function testCreateEphemeralAppRaisesClientExceptions()
3838

3939
$this->expectExceptionObject(new HypernodeApiClientException($badRequestResponse));
4040

41-
$this->client->ephemeralApp->create('johndoe');
41+
$this->client->brancherApp->create('johndoe');
4242
}
4343

44-
public function testCreateEphemeralAppRaisesServerExceptions()
44+
public function testCreateBrancherAppRaisesServerExceptions()
4545
{
4646
$badRequestResponse = new Response(500, [], json_encode([
4747
'non_field_errors' => ['Something went wrong processing your request.']
@@ -50,23 +50,23 @@ public function testCreateEphemeralAppRaisesServerExceptions()
5050

5151
$this->expectExceptionObject(new HypernodeApiServerException($badRequestResponse));
5252

53-
$this->client->ephemeralApp->create('johndoe');
53+
$this->client->brancherApp->create('johndoe');
5454
}
5555

56-
public function testCancelEphemeralApp()
56+
public function testCancelBrancherApp()
5757
{
5858
$this->responses->append(
5959
new Response(204, [], null),
6060
);
6161

62-
$this->client->ephemeralApp->cancel('johndoe-eph123456');
62+
$this->client->brancherApp->cancel('johndoe-eph123456');
6363

6464
$request = $this->responses->getLastRequest();
6565
$this->assertEquals('POST', $request->getMethod());
6666
$this->assertEquals('/v2/app/johndoe-eph123456/cancel/', $request->getUri());
6767
}
6868

69-
public function testCancelEphemeralAppRaisesClientExceptions()
69+
public function testCancelBrancherAppRaisesClientExceptions()
7070
{
7171
$badRequestResponse = new Response(400, [], json_encode([
7272
'non_field_errors' => ['Your request was invalid.']
@@ -75,10 +75,10 @@ public function testCancelEphemeralAppRaisesClientExceptions()
7575

7676
$this->expectExceptionObject(new HypernodeApiClientException($badRequestResponse));
7777

78-
$this->client->ephemeralApp->cancel('johndoe');
78+
$this->client->brancherApp->cancel('johndoe');
7979
}
8080

81-
public function testCancelEphemeralAppRaisesServerExceptions()
81+
public function testCancelBrancherAppRaisesServerExceptions()
8282
{
8383
$badRequestResponse = new Response(500, [], json_encode([
8484
'non_field_errors' => ['Something went wrong processing your request.']
@@ -87,6 +87,6 @@ public function testCancelEphemeralAppRaisesServerExceptions()
8787

8888
$this->expectExceptionObject(new HypernodeApiServerException($badRequestResponse));
8989

90-
$this->client->ephemeralApp->cancel('johndoe');
90+
$this->client->brancherApp->cancel('johndoe');
9191
}
9292
}

0 commit comments

Comments
 (0)