Documentation

13. Inventory Script List API Endpoint

Make a GET request to this resource to retrieve the list of custom inventory scripts.

GET /api/v1/inventory_scripts/
HTTP 200 OK
Content-Type: application/json
Vary: Accept
Allow: GET, POST, HEAD, OPTIONS
X-API-Time: 0.049s

The resulting data structure contains:

{
    "count": 0,
    "next": null,
    "previous": null,
    "results": []
}

The count field indicates the total number of inventories 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 inventory script records.

13.1. Results

Each custom inventory script data structure includes the following fields:

  • id: Database ID for this custom inventory script. (integer)
  • type: Data type for this custom inventory script. (multiple choice)
    • custom_inventory_script: Custom Inventory Script
  • url: URL for this custom inventory script. (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 custom inventory script was created. (datetime)
  • modified: Timestamp when this custom inventory script was last modified. (datetime)
  • name: (string)
  • description: (string)
  • script: Inventory script contents (string)
  • organization: (field)

13.2. Create Custom Inventory Scripts

Make a POST request to this resource with the following custom inventory script fields to create a new custom inventory script:

  • name: (string, required)
  • description: (string, default=””)
  • script: Inventory script contents (string, default=””)
  • organization: (field, required)

13.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 Inventory Script List
description # List Custom Inventory Scripts: Make a GET request to this resource to retrieve the list of custom inventory scripts.
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)
script
type string
required
false
label script
help_text Inventory script contents
default (Empty Text)
organization
type field
required
true
GET
id
type integer
label ID
help_text Database ID for this custom inventory script.
type
type multiple choice
help_text Data type for this custom inventory script.
choices
0
0 custom_inventory_script
1 Custom Inventory Script
url
type string
help_text URL for this custom inventory script.
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 custom inventory script was created.
modified
type datetime
help_text Timestamp when this custom inventory script was last modified.
name
type string
label name
description
type string
label description
script
type string
label script
help_text Inventory script contents
organization
type field
types
0 custom_inventory_script
search_fields
0 description
1 name