11. Credential List API Endpoint
Make a GET request to this resource to retrieve the list of credentials.
GET /api/v1/credentials/
HTTP 200 OK
Content-Type: application/json
Vary: Accept
Allow: GET, POST, HEAD, OPTIONS
X-API-Time: 0.046s
{
"count": 0,
"next": null,
"previous": null,
"results": []
}
The count
field indicates the total number of hosts found for the given query. The next
and previous
fields provides links to additional results if there are more than will fit on a single page. The results
list contains zero or more credential records.
11.1. Results
Each credential data structure includes the following fields:
id
: Database ID for this credential. (integer)
type
: Data type for this credential. (multiple 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. (object)
created
: Timestamp when this credential was created. (datetime)
modified
: Timestamp when this credential was last modified. (datetime)
name
: (string)
description
: (string)
user
: (field)
team
: (field)
kind
: (multiple choice)
ssh
: Machine
scm
: Source Control
aws
: Amazon Web Services
rax
: Rackspace
vmware
: VMware vCenter
gce
: Google Compute Engine
azure
: Microsoft Azure
openstack
: OpenStack
cloud
: (boolean)
host
: The hostname or IP address to use. (string)
username
: Username for this credential. (string)
password
: (string)
security token
: (string)
project
: The identifier for the project. (string)
ssh_key_data
: (string)
ssh_key_unlock
: (string)
become_method
: Privilege escalation method. (multiple choice)
""
: None
sudo
: Sudo
su
: Su
pbrun
: Pbrun
pfexec
: Pfexec
become_username
: Privilege escalation username. (string)
become_password
: (string)
vault_password
: (string)
11.2. Create Credentials
Make a POST request to this resource with the following credential fields to create a new credential:
name
: (string, required)
description
: (string, default=””)
user
: (field, default=None)
team
: (field, default=None)
kind
: (multiple choice, required)
ssh
: Machine (default)
scm
: Source Control
aws
: Amazon Web Services
rax
: Rackspace
vmware
: VMware vCenter
gce
: Google Compute Engine
azure
: Microsoft Azure
openstack
: OpenStack
host
: The hostname or IP address to use. (string, default=””)
username
: Username for this credential. (string, default=””)
password
: (string, default=””)
security token
: (string, default=””)
project
: The identifier for the project. (string, default=””)
ssh_key_data
: (string, default=””)
ssh_key_unlock
: (string, default=””)
become_method
: Privilege escalation method. (multiple choice)
""
: None (default)
sudo
: Sudo
su`
: Su
pbrun
: Pbrun
pfexec
: Pfexec
become_username
: Privilege escalation username. (string, default=””)
become_password
: (string, default=””)
vault_password
: (string, default=””)
11.3. Reviewing the Options Endpoint
The Options Endpoint table offers a view of the Options for this endpoint. When viewing the endpoint in the browsable API, clicking the “Options” button gives you the raw JSON for the following:
name |
Credential List
|
description |
# List Credentials: Make a GET request to this resource to retrieve the list of
credentials.
|
renders |
0 |
application/json
|
1 |
text/html
|
|
parses |
|
added_in_version |
1.2
|
actions |
POST |
name |
type |
string
|
required |
true
|
label |
name
|
max_length |
512
|
|
description |
type |
string
|
required |
false
|
label |
description
|
default |
(Empty Text)
|
|
user |
type |
field
|
required |
false
|
default |
null
|
|
team |
type |
field
|
required |
false
|
default |
null
|
|
kind |
type |
multiple choice
|
required |
true
|
label |
kind
|
default |
ssh
|
choices |
0 |
|
1 |
|
2 |
0 |
aws
|
1 |
Amazon Web Services
|
|
3 |
|
4 |
0 |
vmware
|
1 |
VMware vCenter
|
|
5 |
0 |
gce
|
1 |
Google Compute Engine
|
|
6 |
0 |
azure
|
1 |
Microsoft Azure
|
|
7 |
|
|
|
host |
type |
string
|
required |
false
|
label |
Host
|
help_text |
The hostname or IP address to use.
|
max_length |
1024
|
default |
(Empty Text)
|
|
username |
type |
string
|
required |
false
|
label |
Username
|
help_text |
Username for this credential.
|
max_length |
1024
|
default |
(Empty Text)
|
|
password |
type |
string
|
required |
false
|
default |
(Empty Text)
|
|
security token |
type |
string
|
required |
false
|
default |
(Empty Text)
|
|
project |
type |
string
|
required |
false
|
label |
Project
|
help_text |
The identifier for the project.
|
max_length |
100
|
default |
(Empty Text)
|
|
ssh_key_data |
type |
string
|
required |
false
|
default |
(Empty Text)
|
|
ssh_key_unlock |
type |
string
|
required |
false
|
default |
(Empty Text)
|
|
become_method |
type |
multiple choice
|
required |
false
|
label |
become method
|
help_text |
Privilege escalation method.
|
default |
(Empty Text)
|
choices |
|
|
become_username |
type |
string
|
required |
false
|
label |
become username
|
help_text |
Privilege escalation username.
|
max_length |
1024
|
default |
(Empty Text)
|
|
become_password |
type |
string
|
required |
false
|
default |
(Empty Text)
|
|
vault_password |
type |
string
|
required |
false
|
default |
(Empty Text)
|
|
|
GET |
id |
type |
integer
|
label |
ID
|
help_text |
Database ID for this credential.
|
|
type |
type |
multiple choice
|
help_text |
Data type for this credential.
|
choices |
0 |
0 |
credential
|
1 |
Credential
|
|
|
|
url |
type |
string
|
help_text |
URL for this credential.
|
|
related |
type |
object
|
help_text |
Data structure with URLs of related resources.
|
|
summary_fields |
type |
object
|
help_text |
Data structure with name/description for related resources.
|
|
created |
type |
datetime
|
help_text |
Timestamp when this credential was created.
|
|
modified |
type |
datetime
|
help_text |
Timestamp when this credential was last modified.
|
|
name |
|
description |
type |
string
|
label |
description
|
|
user |
|
team |
|
kind |
type |
multiple choice
|
label |
kind
|
choices |
0 |
|
1 |
|
2 |
0 |
aws
|
1 |
Amazon Web Services
|
|
3 |
|
4 |
0 |
vmware
|
1 |
VMware vCenter
|
|
5 |
0 |
gce
|
1 |
Google Compute Engine
|
|
6 |
0 |
azure
|
1 |
Microsoft Azure
|
|
7 |
|
|
|
cloud |
|
host |
type |
string
|
label |
Host
|
help_text |
The hostname or IP address to use.
|
|
username |
type |
string
|
label |
Username
|
help_text |
Username for this credential.
|
|
password |
|
security token |
|
project |
type |
string
|
label |
Project
|
help_text |
The identifier for the project.
|
|
ssh_key_data |
|
ssh_key_unlock |
|
become_method |
type |
multiple choice
|
label |
become method
|
help_text |
Privilege escalation method.
|
choices |
|
|
become_username |
type |
string
|
label |
become username
|
help_text |
Privilege escalation username.
|
|
become_password |
|
vault_password |
|
|
|
types |
|
search_fields |
0 |
description
|
1 |
name
|
2 |
username
|
|