Retrieve a Credential
get
/api/v2/credentials/{id}/
Make GET request to this resource to retrieve a single credential record containing the following fields:
id
: Database ID for this credential. (integer)type
: Data type for this credential. (choice)url
: URL for this credential. (string)related
: Data structure with URLs of related resources. (object)summary_fields
: Data structure with name/description for related resources. The output for some objects may be limited for performance reasons. (object)created
: Timestamp when this credential was created. (datetime)modified
: Timestamp when this credential was last modified. (datetime)name
: Name of this credential. (string)description
: Optional description of this credential. (string)organization
: (id)credential_type
: Specify the type of credential you want to create. Refer to the Ansible Tower documentation for details on each type. (id)managed_by_tower
: (boolean)inputs
: Enter inputs using either JSON or YAML syntax. Refer to the Ansible Tower documentation for example syntax. (json)kind
: (field)cloud
: (field)kubernetes
: (field)
Request
Supported Media Types
- application/json
Path Parameters
Query Parameters
-
search(optional): string
A search term.
Response
Supported Media Types
- application/json
200 Response
Example Response (application/json)
{
"cloud":false,
"created":"2018-02-01T08:00:00.000000Z",
"credential_type":1,
"description":"",
"id":1,
"inputs":{
"username":"someusername"
},
"kind":"ssh",
"kubernetes":false,
"managed_by_tower":false,
"modified":"2018-02-01T08:00:00.000000Z",
"name":"Some name",
"organization":1,
"related":{
"access_list":"/api/v2/credentials/1/access_list/",
"activity_stream":"/api/v2/credentials/1/activity_stream/",
"copy":"/api/v2/credentials/1/copy/",
"credential_type":"/api/v2/credential_types/1/",
"input_sources":"/api/v2/credentials/1/input_sources/",
"object_roles":"/api/v2/credentials/1/object_roles/",
"organization":"/api/v2/organizations/1/",
"owner_teams":"/api/v2/credentials/1/owner_teams/",
"owner_users":"/api/v2/credentials/1/owner_users/"
},
"summary_fields":{
"credential_type":{
"description":"",
"id":1,
"name":"Machine"
},
"object_roles":{
"admin_role":{
"description":"Can manage all aspects of the credential",
"id":15,
"name":"Admin"
},
"read_role":{
"description":"May view settings for the credential",
"id":17,
"name":"Read"
},
"use_role":{
"description":"Can use the credential in a job template",
"id":16,
"name":"Use"
}
},
"organization":{
"description":"test-org-desc",
"id":1,
"name":"test-org"
},
"owners":[
{
"description":"test-org-desc",
"id":1,
"name":"test-org",
"type":"organization",
"url":"/api/v2/organizations/1/"
}
],
"user_capabilities":{
"copy":false,
"delete":true,
"edit":true,
"use":true
}
},
"type":"credential",
"url":"/api/v2/credentials/1/"
}