Skip to content

Commit 30eaeb9

Browse files
author
Jamie Hannaford
authored
Merge pull request #125 from samuel4x4/patch-1
Endpoint model implements Retrievable interface
2 parents 06de123 + 54d9bee commit 30eaeb9

File tree

2 files changed

+22
-1
lines changed

2 files changed

+22
-1
lines changed

src/Identity/v3/Api.php

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,17 @@ public function getEndpoints(): array
136136
];
137137
}
138138

139+
public function getEndpoint(): array
140+
{
141+
return [
142+
'method' => 'GET',
143+
'path' => 'endpoints/{id}',
144+
'params' => [
145+
'id' => $this->params->idUrl('service')
146+
]
147+
];
148+
}
149+
139150
public function patchEndpoint(): array
140151
{
141152
return [

src/Identity/v3/Models/Endpoint.php

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,12 @@
66
use OpenStack\Common\Resource\Creatable;
77
use OpenStack\Common\Resource\Deletable;
88
use OpenStack\Common\Resource\Updateable;
9+
use OpenStack\Common\Resource\Retrievable;
910

1011
/**
1112
* @property \OpenStack\Identity\v3\Api $api
1213
*/
13-
class Endpoint extends OperatorResource implements Creatable, Updateable, Deletable
14+
class Endpoint extends OperatorResource implements Creatable, Updateable, Deletable, Retrievable
1415
{
1516
/** @var string */
1617
public $id;
@@ -48,6 +49,15 @@ public function create(array $data): Creatable
4849
return $this->populateFromResponse($response);
4950
}
5051

52+
/**
53+
* {@inheritDoc}
54+
*/
55+
public function retrieve()
56+
{
57+
$response = $this->executeWithState($this->api->getEndpoint());
58+
$this->populateFromResponse($response);
59+
}
60+
5161
/**
5262
* {@inheritDoc}
5363
*/

0 commit comments

Comments
 (0)