List resources
Lists resources within an organization account.
If a kind
query parameter is given, narrows results to only resources of that kind.
If a limit
is given, returns no more than that number of results. Providing an offset
skips a number of resources before returning the rest.offset
will give limit
a default value of 10 if none other is provided.
If the parameter count
is true
, returns only the number of items in the list.
If the role
or acting_as
query parameter is given, then the resource list can be retrieved for a different role (as long as the authenticated role has access).
Text search
If the search
parameter is provided, narrows results to those pertaining to the search query. Search works across resource IDs and the values of annotations. It weights results so that those with matching id
or a matching value of an annotation called name
appear first, then those with another matching annotation value, and finally those with a matching kind
.
Kinds of resources
Kind |
Description |
---|---|
User |
One unique human |
Host |
A single logical machine (in the broad sense, not just physical) |
Layer |
A collection of hosts that have the same privileges |
Group |
A collection of users and groups that have the same privileges |
Policy |
Privileges on policies enable a user to create and modify objects and permissions |
Variable |
A secret such as a password, API key, SSH key, etc |
Webservice |
An HTTP(S) web service which performs sensitive operations |
URI
|
Example URI
|
URI Parameters
Parameter |
Type |
Mandatory |
Description |
---|---|---|---|
account |
String |
Yes |
Organization account name Example: |
kind |
String |
No |
Kind of object to list Example: |
search |
String |
No |
Search term used to narrow results Example: |
limit |
number |
No |
Number of results to return Example: |
offset |
number |
No |
Number of results to skip Example: |
count |
boolean |
No |
If Example: |
acting_as |
String |
No |
The fully qualified identifier for the role whose resource list you want to view. It should be entered as
|
List resources from an Edge
Consider the following when you send a request directly to an Edge:
-
Only variable resources (
kind=variable
) can be listed directly from an Edge. Requests for any other kind of resources are forwarded to Conjur Cloud. -
If a request for variable resources contains parameters other than
limit
oroffset
, the request is forwarded to Conjur Cloud. -
Responses from an Edge contain only the variable's ID (see see Response 200 > Example 2 below). For a full response, send the request directly to Conjur Cloud.
Example with curl
Suppose your organization name is “myorg” and you want to search for the first two resources matching the word “db”:
|
Request header
Field |
Description |
Example |
---|---|---|
Authorization |
Conjur access token |
Token token=“eyJkYX…Rhb=” |
|
Response
Code |
Description |
---|---|
200 |
Resources returned as a JSON list. A list of variable resources sent from an Edge displays variable IDs only. For examples, see Response 200 below. |
401 |
The request lacks valid authentication credentials |
403 |
The authenticated user lacks the necessary privilege |
See response examples below.
Response 200
Headers
|
Body
|