Skip to content

Commit 5392bef

Browse files
reenjiiLudovic Lamarche
authored and
Ludovic Lamarche
committed
feat(identity): add get endpoint by ID
1 parent bef463f commit 5392bef

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed

openstack/identity/v3/endpoints/requests.go

+7
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,13 @@ func List(client *gophercloud.ServiceClient, opts ListOptsBuilder) pagination.Pa
8888
})
8989
}
9090

91+
// Get retrieves details on a single endpoint, by ID.
92+
func Get(client *gophercloud.ServiceClient, id string) (r GetResult) {
93+
resp, err := client.Get(endpointURL(client, id), &r.Body, nil)
94+
_, r.Header, r.Err = gophercloud.ParseResponse(resp, err)
95+
return
96+
}
97+
9198
// UpdateOptsBuilder allows extensions to add parameters to the Update request.
9299
type UpdateOptsBuilder interface {
93100
ToEndpointUpdateMap() (map[string]interface{}, error)

openstack/identity/v3/endpoints/results.go

+6
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,12 @@ func (r commonResult) Extract() (*Endpoint, error) {
1919
return s.Endpoint, err
2020
}
2121

22+
// GetResult is the response from a Get operation. Call its Extract method
23+
// to interpret it as an Endpoint.
24+
type GetResult struct {
25+
commonResult
26+
}
27+
2228
// CreateResult is the response from a Create operation. Call its Extract
2329
// method to interpret it as an Endpoint.
2430
type CreateResult struct {

0 commit comments

Comments
 (0)