Get grants issued for a gateway
/apiplatform/management/v1/gateways/{gwId}/grants
Returns a collection of grants that have been issued for the {gwId}
gateway. By default, the grant type, role, and user or group ID for users or groups issued each grant are returned. Additional fields can be returned by sending any of these field names, separated by commas, in the fields query parameter: createdAt
, createdBy
, user.roles
, and group.roles
.
The response also contains HATEOAS links to related operations.
Users requesting this resource must be assigned the Gateway Manager role and the Manage Gateway grant for the specified gateway.
Request
- application/json
-
gwId: string
A unique ID referencing a specific gateway.
-
fields(optional): array
Collection Format:
csv
Pass optional fields, separated by commas, in this parameter to return them in the response. See the operation's description for a list of field values. - links(optional): array
Response
- application/json
200 Response
object
-
count(optional):
integer(int32)
The number of items in this collection.
object
-
links(optional):
array links
Includes 'canonical'.
object
-
href(optional):
string
Link href.
-
method(optional):
string
HTTP Operation GET, POST, PUT
-
rel(optional):
string
Link relation.
object
-
createdAt(optional):
string
The date and time the grant was issued.
-
createdBy(optional):
string
The user who issued the grant.
-
group(optional):
object Group
-
type:
string
The grant type's name.
-
user(optional):
object User
object
-
links(optional):
array links
Includes 'canonical'.
403 Response
object
-
detail(optional):
string
Detailed error message
-
errorCode(optional):
string
Application specific error code
-
errorDetails(optional):
array errorDetails
additional errors
-
errorPath(optional):
string
-
instance(optional):
string
URI to the link that provides more detail about the error
-
status(optional):
string
HTTP status code
-
title:
string
Summary error message
-
type:
string
Error type
500 Response
object
-
detail(optional):
string
Detailed error message
-
errorCode(optional):
string
Application specific error code
-
errorDetails(optional):
array errorDetails
additional errors
-
errorPath(optional):
string
-
instance(optional):
string
URI to the link that provides more detail about the error
-
status(optional):
string
HTTP status code
-
title:
string
Summary error message
-
type:
string
Error type
Examples
The following example shows how to retrieve all grants that have been issued for a gateway by submitting a GET request on the REST resource using cURL. For more information about cURL, see Use cURL
curl -i -X GET -u apicsadmin:password https://example.com/apiplatform/management/v1/gateways/{gwId}/grants
{gwId}
is the unique of a gateway. To retrieve available gateway Ids, see Get gateways.
You can pass the following optional field values in the fields
query parameter, separated by commas, to include them in the response:
-
createdAt
: The date and time the grant was issued. -
createdBy
: The user who issued the grant. -
user.roles
: The roles the user is assigned. -
group.roles
: The roles the group is assigned.
The following example shows you how to include these fields in the response:
curl -i -X GET -u apicsadmin:password https://example.com/apiplatform/management/v1/gateways/{gwId}/grants?fields=user.roles,group.roles
Example of Response Headers
The following shows an example of the response headers.
HTTP/1.1 200 OK Server: Oracle-Traffic-Director/12.2.1.0.0 Date: Thu, 16 Mar 2017 09:44:48 GMT Content-Length: 2589 Content-Type: application/json X-oracle-dms-ecid: f102c33f-1c5b-4409-806d-03bf5706c492-00026f02 X-oracle-dms-rid: 0:1 Via: 1.1 otd_opc Proxy-agent: Oracle-Traffic-Director/12.2.1.0.0
Example of Response Body
The following example shows the contents of the response body in JSON format, including details about the grants and grantees and HATEOAS links to related operations.
{ "count": 5, "links": [{ "templated": "true", "method": "GET", "rel": "grantees", "href": "https://example.com:443/apiplatform/management/v1/gateways/grants/ManageGatewayGrant/grantees", "grant": "ManageGatewayGrant" }, { "templated": "true", "method": "GET", "rel": "grantees", "href": "http:/example.com:7201/apiplatform/management/v1/gateways/grants/ViewGatewayGrant/grantees", "grant": "ViewGatewayGrant" }, { "templated": "true", "method": "GET", "rel": "grantees", "href": "https://example.com:443/apiplatform/management/v1/gateways/grants/DeployAPIToGatewayGrant/grantees", "grant": "DeployAPIToGatewayGrant" }, { "templated": "true", "method": "GET", "rel": "grantees", "href": "https://example.com:443/apiplatform/management/v1/gateways/grants/RequestDeployAPIToGatewayGrant/grantees", "grant": "RequestDeployAPIToGatewayGrant" }, { "templated": "true", "method": "GET", "rel": "grantees", "href": "https://example.com:443/apiplatform/management/v1/gateways/grants/ServiceGatewayGrant/grantees", "grant": "ServiceGatewayGrant" }, { "templated": "true", "method": "GET", "rel": "self", "href": "https://example.com:443/apiplatform/management/v1/gateways/100/grants" }, { "templated": "true", "method": "GET", "rel": "canonical", "href": "https://example.com:443/apiplatform/management/v1/gateways/100/grants" }, { "method": "GET", "rel": "types", "href": "https://example.com:443/apiplatform/management/v1/gateways/grants/types" }, { "templated": "true", "method": "POST", "rel": "create", "href": "https://example.com:443/apiplatform/management/v1/gateways/100/grants", "grant": "ManageGatewayGrant" }, { "templated": "true", "method": "POST", "rel": "create", "href": "https://example.com:443/apiplatform/management/v1/gateways/100/grants", "grant": "ViewGatewayGrant" }, { "templated": "true", "method": "POST", "rel": "create", "href": "https://example.com:443/apiplatform/management/v1/gateways/100/grants", "grant": "DeployAPIToGatewayGrant" }, { "templated": "true", "method": "POST", "rel": "create", "href": "https://example.com:443/apiplatform/management/v1/gateways/100/grants", "grant": "RequestDeployAPIToGatewayGrant" }, { "templated": "true", "method": "POST", "rel": "create", "href": "https://example.com:443/apiplatform/management/v1/gateways/100/grants", "grant": "ServiceGatewayGrant" }], "items": [{ "links": [{ "templated": "true", "method": "DELETE", "rel": "delete", "href": "https://example.com:443/apiplatform/management/v1/gateways/100/grants/ManageGatewayGrant/users/api-gateway-user" }], "type": "ManageGatewayGrant", "user": { "roles": [ "GatewayManager" ], "id": "api-gateway-user" } }, { "links": [{ "templated": "true", "method": "DELETE", "rel": "delete", "href": "https://example.com:443/apiplatform/management/v1/gateways/100/grants/ManageGatewayGrant/users/api-gateway-user2" }], "type": "ManageGatewayGrant", "user": { "roles": [ "GatewayManager" ], "id": "api-gateway-user2" } }, { "links": [{ "templated": "true", "method": "DELETE", "rel": "delete", "href": "https://example.com:443/apiplatform/management/v1/gateways/100/grants/ManageGatewayGrant/users/api-admin-user" }], "type": "ManageGatewayGrant", "user": { "roles": [ "Administrator" ], "id": "api-admin-user" } }, { "links": [{ "templated": "true", "method": "DELETE", "rel": "delete", "href": "https://example.com:443/apiplatform/management/v1/gateways/100/grants/ManageGatewayGrant/groups/APIGatewayManagers" }], "type": "ManageGatewayGrant", "group": { "roles": [ "GatewayManager" ], "id": "APIGatewayManagers" } }, { "links": [{ "templated": "true", "method": "DELETE", "rel": "delete", "href": "https://example.com:443/apiplatform/management/v1/gateways/100/grants/ServiceGatewayGrant/users/gateway-runtime-user" }], "type": "ServiceGatewayGrant", "user": { "roles": [ "GatewayRuntime" ], "id": "gateway-runtime-user" } }] }