For the complete documentation index, see llms.txt. This page is also available as Markdown.

Import Ansible static inventory from YAML/INI

Create a new static (manual) Ansible inventory by parsing YAML or INI content.

post
Path parameters
orgstring · min: 1 · max: 128Required

Org is the organisation identifier.

Example: t7
projectstring · min: 1 · max: 128Required

Project is the project identifier.

Example: 0n6
Header parameters
Harness-Accountstring · min: 1 · max: 128Required

Account is the internal customer account ID.

Example: uok
Body
contentstring · min: 1 · max: 1048576Required

Raw inventory content as a string (paste or client-read file).

Example: da
formatstring · enumRequired

Source format of the content.

Example: iniPossible values:
identifierstring · min: 1 · max: 128Required

The identifier of the new inventory.

Example: 4
namestring · min: 1 · max: 128Required

Display name of the new inventory.

Example: e6s
tagsstring[]Optional

Optional tags to apply to the new inventory.

Example: ["Recusandae facere nemo.","Provident earum aut.","Voluptas voluptatem commodi.","Illo dolore accusamus voluptas et."]
Responses
201

Created response.

application/json
warningsstring[]Required

Warnings surfaced during import (lossy conversions, flattened groups, etc.).

Example: ["Tenetur eius esse consequatur est.","Et itaque ratione.","Reiciendis molestiae molestias."]
post/api/orgs/{org}/projects/{project}/ansible/inventory/import
POST /api/orgs/{org}/projects/{project}/ansible/inventory/import HTTP/1.1
Host: localhost:80
Harness-Account: uok
Content-Type: application/json
Accept: */*
Content-Length: 180

{
  "content": "93c",
  "format": "ini",
  "identifier": "0y",
  "name": "i",
  "tags": [
    "Eos deserunt reprehenderit neque.",
    "Doloribus numquam qui sit.",
    "Facere odit beatae ullam delectus tenetur."
  ]
}
{
  "inventory": {
    "account": "zd",
    "created": 1627590400,
    "description": "Production infrastructure inventory",
    "identifier": "test_inventory",
    "name": "test inventory",
    "org": "2w0",
    "project": "u",
    "tags": [
      "Molestias autem cum sint.",
      "Eum omnis."
    ],
    "type": "remote",
    "updated": 1627686800
  },
  "warnings": [
    "Nisi ea eius sunt facilis similique.",
    "Adipisci omnis labore voluptatem autem et.",
    "Sapiente distinctio nostrum nostrum vero."
  ]
}

Last updated

Was this helpful?