Documentation

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)
    • credential: Credential
  • 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)
  • 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=””)
  • 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
0 application/json
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
0 ssh
1 Machine
1
0 scm
1 Source Control
2
0 aws
1 Amazon Web Services
3
0 rax
1 Rackspace
4
0 vmware
1 VMware vCenter
5
0 gce
1 Google Compute Engine
6
0 azure
1 Microsoft Azure
7
0 openstack
1 OpenStack
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)
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
0
0 (Empty Text)
1 None
1
0 sudo
1 Sudo
2
0 su
1 Su
3
0 pbrun
1 Pbrun
4
0 pfexec
1 Pfexec
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
type string
label name
description
type string
label description
user
type field
team
type field
kind
type multiple choice
label kind
choices
0
0 ssh
1 Machine
1
0 scm
1 Source Control
2
0 aws
1 Amazon Web Services
3
0 rax
1 Rackspace
4
0 vmware
1 VMware vCenter
5
0 gce
1 Google Compute Engine
6
0 azure
1 Microsoft Azure
7
0 openstack
1 OpenStack
cloud
type boolean
label 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
type string
project
type string
label Project
help_text The identifier for the project.
ssh_key_data
type string
ssh_key_unlock
type string
become_method
type multiple choice
label become method
help_text Privilege escalation method.
choices
0
0 (Empty Text)
1 None
1
0 sudo
1 Sudo
2
0 su
1 Su
3
0 pbrun
1 Pbrun
4
0 pfexec
1 Pfexec
become_username
type string
label become username
help_text Privilege escalation username.
become_password
type string
vault_password
type string
types
0 credential
search_fields
0 description
1 name
2 username