diff --git a/docs/development.md b/docs/development.md index 3df7110..e03fab8 100644 --- a/docs/development.md +++ b/docs/development.md @@ -1,10 +1,10 @@ # Development Environment Setup -This guide will help you set up a development environment for the asyncgateway project. +This guide covers setting up a development environment for asyncgateway. ## Prerequisites -- Python 3.8 or higher +- Python 3.10 or higher (dev environment pinned to 3.11 via `.python-version`) - Git - [uv](https://github.com/astral-sh/uv) package manager @@ -27,10 +27,6 @@ This guide will help you set up a development environment for the asyncgateway p 3. **Set up the development environment:** ```bash - # Install all dependencies and sync the virtual environment - uv sync - - # Install development dependencies uv sync --group dev ``` @@ -39,69 +35,82 @@ This guide will help you set up a development environment for the asyncgateway p ### Package Management - **Add a dependency:** `uv add ` - **Remove a dependency:** `uv remove ` -- **Sync dependencies:** `uv sync` +- **Sync dependencies:** `uv sync --group dev` ### Running Tests - **Run all tests:** `uv run pytest` - **Run tests with verbose output:** `uv run pytest -v` -- **Run tests with coverage:** `uv run pytest --cov` +- **Run tests with coverage:** `uv run pytest -v --cov` - **Run specific test pattern:** `uv run pytest -k ` -- **Run tests in specific directory:** `uv run pytest tests/` + +No live IAG instance is required — all tests mock `ipsdk`. + +### Multi-version Testing + +Tests run across Python 3.10–3.13 via tox: + +```bash +tox # all versions +tox -e py312 # single version +``` ### Code Quality -- **Check code style:** `uv run ruff check` -- **Format code:** `uv run ruff format` -- **Run type checking:** `uv run mypy src/` -- **Security linting:** `uv run bandit -r src/` +- **Lint:** `uv run ruff check src tests` +- **Format:** `uv run ruff format src tests` +- **Type check:** `uv run mypy src/` +- **Security scan:** `uv run bandit -r src/asyncgateway --configfile pyproject.toml` + +### Full Local CI + +Run the complete CI suite (lint + typecheck + security + tests) with: + +```bash +make ci +``` ### Building the Package - **Build distributions:** `uv build` -- **Alternative build:** `python -m build` - -### Running Examples -- **Run example scripts:** - ```bash - uv run python examples/get.py - uv run python examples/add_devices.py - ``` ## Project Structure ``` asyncgateway/ ├── src/asyncgateway/ -│ ├── client.py # Main async client class -│ ├── services/ # Service modules (devices, etc.) -│ ├── exceptions.py # Exception hierarchy -│ └── logger.py # Logging configuration -├── tests/ # Test files -├── examples/ # Example scripts -├── docs/ # Documentation -└── pyproject.toml # Project configuration +│ ├── __init__.py # Public API: client, logging +│ ├── client.py # Client class with service/resource discovery +│ ├── exceptions.py # Exception hierarchy (AsyncGatewayError, ValidationError) +│ ├── logging.py # Logging with sensitive data filtering +│ ├── serdes.py # JSON/YAML serialization +│ ├── services/ # 23 thin async wrappers, one per IAG API tag group +│ └── resources/ # 22 declarative resource abstractions +├── tests/ # Test files (mock ipsdk, no live IAG needed) +├── docs/ # Documentation +└── pyproject.toml # Project configuration and tool settings ``` ## Development Notes -- The project uses a dynamic service loading pattern where services are discovered from the `services/` directory -- Each service module must have a `Service` class inheriting from `ServiceBase` -- Services are automatically attached to the client instance -- The project uses `ipsdk` for Itential Gateway communication and `httpx` for HTTP requests +- Services and resources are filesystem-discovered at client init. Adding a file with a `Service` or `Resource` class and a `name` attribute is sufficient for registration — no other wiring required. +- `Operation` (`MERGE`, `REPLACE`, `OVERWRITE`) is a plain string class, not an enum. It lives in `services/__init__.py` and is re-exported from `resources/__init__.py`. +- Logging is silent by default (level `NONE = 100`). Enable with `asyncgateway.logging.set_level(asyncgateway.logging.DEBUG)`. +- `client.load(path, op)` reads files from a directory tree and dispatches to `service.load()`. `client.resources.devices.load(data, op)` takes an in-memory list. These are separate code paths. +- `playbooks.get_all()` uses a manual pagination loop and does not call `_get_all()` — the playbooks endpoint uses `meta["count"]` rather than `meta["total_count"]`. ## Contributing -1. Make your changes following the existing code style -2. Run the code quality tools before committing: +1. Make your changes following the existing code style. +2. Run the full CI suite before committing: ```bash - uv run ruff format - uv run ruff check - uv run mypy src/ - uv run pytest + make ci ``` -3. Ensure all tests pass and coverage remains high -4. Follow the existing exception handling patterns using the classification utilities +3. Ensure all tests pass and coverage remains high. +4. Raise typed exceptions from `exceptions.py`. Never raise bare `Exception`. +5. Services must be thin — one method per API operation, return `res.json()`, no logic. +6. Resources catch broad `Exception` for "not found" detection (ipsdk exception types are not part of the public contract). ## Troubleshooting -- If you encounter import errors, ensure all dependencies are installed with `uv sync` -- For test failures, run with `-v` flag for more detailed output -- Check the `CLAUDE.md` file for additional development guidance and known issues +- If you encounter import errors, ensure all dependencies are installed with `uv sync --group dev`. +- For test failures, run with `-v` for more detailed output. +- If tests mock `os.listdir`, note that `Client.__init__` calls it **twice** — once for `services/` and once for `resources/`. Use `side_effect=[service_files, resource_files]`. +- YAML support is optional. If `PyYAML` is not installed, YAML paths raise `ValidationError` rather than `ImportError`. diff --git a/docs/feature_reviews/asyncgateway_2026-03-08.md b/docs/feature_reviews/asyncgateway_2026-03-08.md deleted file mode 100644 index d596b52..0000000 --- a/docs/feature_reviews/asyncgateway_2026-03-08.md +++ /dev/null @@ -1,317 +0,0 @@ -# Architecture Review: asyncgateway -**Language:** python | **Reviewed:** 2026-03-08T17:25:00Z - -## 🟡 Summary - -Well-structured async client library with solid test coverage and clean error hierarchy, but carrying several reliability risks: an unbounded pagination loop, a hardcoded filter in a destructive operation, shadowing of builtins, missing type annotations on public interfaces, deferred inline imports, and no pytest-asyncio mode pinned. - -**11 findings:** 🔴 0 critical 🟠 3 high 🟡 5 medium ⚪ 3 low - -## Architecture - -**Layers observed:** client → service → serdes → exceptions → logger - -**Dependency direction:** clean - -``` -asyncgateway (public API) - └── Client - ├── services/devices.py ──┐ - ├── services/playbooks.py ──┤──> asyncgateway.serdes - ├── services/config.py ──┘ asyncgateway.exceptions - └── load() / _load_service_data() - -ipsdk (external gateway SDK) <── Client.__init_services__ -httpx (HTTP) <── exceptions.py (classify helpers) -``` - -Services are dynamically loaded from the filesystem at client construction via importlib, which is creative but fragile (no error recovery when a module fails to load). Dependency direction is clean: exceptions and serdes are shared utilities with no upward imports. The services themselves import from asyncgateway (absolute) rather than using relative imports, which is acceptable but slightly unusual inside a src-layout package. - -## Findings - -### 🟠 P1 — High - -#### [F01] Pagination loop can hang indefinitely if API returns fewer items than declared total -**Location:** `src/asyncgateway/services/devices.py:110-124` | **Category:** concurrency - -**Problem:** The `get_all()` loop breaks only when `len(results) == total`. If the API ever returns fewer items than `total_count` (server-side bug, concurrent deletion, or an off-by-one in the API's pagination), the condition is never satisfied and the loop runs forever, pegging the event loop. - -**Risk:** Infinite loop in any caller that uses `get_all()`, including `load()` and `delete_all()`. In a coroutine environment this blocks all other work on the event loop until the process is killed. - -**Before:** -``` -while True: - params["offset"] = offset - res = await self.client.get("/devices", params=params) - json_data = res.json() - total = json_data["meta"]["total_count"] - results.extend(json_data["data"]) - if len(results) == total: - break - offset += limit -``` -**After:** -``` -while True: - params["offset"] = offset - res = await self.client.get("/devices", params=params) - json_data = res.json() - page = json_data["data"] - total = json_data["meta"]["total_count"] - results.extend(page) - if not page or len(results) >= total: - break - offset += limit -``` - -#### [F02] Playbooks get_all() has the same unbounded pagination loop with a different meta key -**Location:** `src/asyncgateway/services/playbooks.py:99-113` | **Category:** concurrency - -**Problem:** Identical pagination pattern as F01, but uses `json_data["meta"]["count"]` rather than `json_data["meta"]["total_count"]`. This is also a latent KeyError if the API returns a different shape, and carries the same infinite loop risk. - -**Risk:** Infinite loop or KeyError crashing the coroutine. The inconsistent meta key (`count` vs `total_count`) suggests the two services were written against different API versions or documentation and one of them is wrong. - -**Before:** -``` -total = json_data["meta"]["count"] -``` -**After:** -``` -# Align with devices.py and fix the loop guard: -total = json_data["meta"]["total_count"] # or "count" — pick one key and use it consistently -# Also apply the same break guard as F01 -``` - -#### [F03] delete_all() deletes only devices whose names start with 'router' — hardcoded filter on a destructive method -**Location:** `src/asyncgateway/services/devices.py:222-225` | **Category:** structure - -**Problem:** `delete_all()` silently applies a `startswith("router")` filter. The method name and docstring imply it deletes all devices, but it actually deletes only a hardcoded subset. A caller who reads only the method signature will delete far fewer devices than expected — or none at all in an environment without devices named 'router*'. - -**Risk:** Operational correctness risk: callers that expect a full wipe for cleanup or REPLACE-like workflows will leave stale devices behind. The filter appears to be a copy-paste artifact from a test environment. - -**Before:** -``` -async def delete_all(self) -> None: - devices = await self.get_all() - for ele in devices: - if ele["name"].startswith("router"): - await self.delete(ele["name"]) -``` -**After:** -``` -async def delete_all(self) -> None: - devices = await self.get_all() - for device in devices: - await self.delete(device["name"]) -``` - -### 🟡 P2 — Medium - -#### [F04] exceptions.py defines ConnectionError and TimeoutError, shadowing Python builtins -**Location:** `src/asyncgateway/exceptions.py:23,60` | **Category:** structure - -**Problem:** `class ConnectionError(AsyncGatewayError)` shadows the built-in `ConnectionError`. `TimeoutError = ConnectionError` also shadows the built-in `TimeoutError`. Any file that imports `from asyncgateway.exceptions import *` (or does `from asyncgateway import exceptions`) and then uses the bare name gets the library class instead of the builtin, which can mask real network exceptions at the Python level. - -**Risk:** Subtle bugs in callers that rely on catching the builtin `ConnectionError` or `TimeoutError` from standard library code. The `classify_httpx_error` function itself is insulated because it uses the local `ConnectionError` name, but library consumers may be confused. - -**Before:** -``` -class ConnectionError(AsyncGatewayError): - ... -TimeoutError = ConnectionError -``` -**After:** -``` -class GatewayConnectionError(AsyncGatewayError): - ... -TimeoutError = GatewayConnectionError # or GatewayTimeoutError -# provide backward-compat aliases in __init__.py if needed -``` - -#### [F05] Deferred inline imports of ValidationError inside service methods -**Location:** `src/asyncgateway/services/devices.py:257,365 | src/asyncgateway/services/playbooks.py:325` | **Category:** structure - -**Problem:** `ValidationError` is imported inline inside `load()` and `dump()` methods rather than at the module top level. There is no circular-import reason to do this: `devices.py` already imports `AsyncGatewayError` from the same module at the top. The inline imports are inconsistent and add latency on first call. - -**Risk:** Code quality issue that confuses readers into thinking there is a circular-import constraint that doesn't exist. If the exception path is hot it adds repeated import overhead. - -**Before:** -``` -# Inside devices.py load(): -from asyncgateway.exceptions import ValidationError -raise ValidationError(...) -``` -**After:** -``` -# At top of devices.py: -from asyncgateway.exceptions import AsyncGatewayError, ValidationError -# remove inline imports -``` - -#### [F06] No pytest-asyncio mode configured; relies on implicit deprecated auto-detection -**Location:** `pyproject.toml (missing [tool.pytest.ini_options])` | **Category:** testing - -**Problem:** pytest-asyncio requires an explicit `asyncio_mode` setting (`auto`, `strict`, or `loose`). Without it, the library uses its deprecated auto-detection, which will break in pytest-asyncio 0.22+ and is already emitting deprecation warnings. The project has no `[tool.pytest.ini_options]` section in `pyproject.toml` at all. - -**Risk:** Test suite will start failing silently or with hard errors when pytest-asyncio is upgraded. In CI with unpinned dev deps this can break builds without a clear cause. - -**Before:** -``` -# pyproject.toml has no [tool.pytest.ini_options] section -``` -**After:** -``` -[tool.pytest.ini_options] -asyncio_mode = "auto" -addopts = "--tb=short" -``` - -#### [F07] Missing type annotations on all public Client and ServiceBase signatures -**Location:** `src/asyncgateway/client.py:17,20,37 | src/asyncgateway/services/__init__.py:56` | **Category:** structure - -**Problem:** `Client.__init__(**kwargs)`, `__aenter__`, `__aexit__`, and `ServiceBase.__init__(client)` all lack return type annotations and parameter types. The project classifies itself as `Typing :: Typed` in pyproject.toml classifiers, and mypy is in the dev toolchain, but these core public interfaces are untyped. - -**Risk:** mypy provides no type coverage over the entry point into the library. Callers using the library with mypy will get `Any` for the client instance, defeating the purpose of the typed annotation. - -**Before:** -``` -def __init__(self, **kwargs): - ... -async def __aenter__(self): - ... -async def __aexit__(self, exc_type, exc_value, traceback): - pass -``` -**After:** -``` -from typing import Any, Optional, Type -from types import TracebackType - -def __init__(self, **kwargs: Any) -> None: - ... -async def __aenter__(self) -> "Client": - ... -async def __aexit__(self, exc_type: Optional[Type[BaseException]], exc_value: Optional[BaseException], traceback: Optional[TracebackType]) -> None: - pass -``` - -#### [F08] Runtime dependency on ipsdk has no version pin; PyYAML is a soft dep with no declared optional extra -**Location:** `pyproject.toml:9-11` | **Category:** dependencies - -**Problem:** `ipsdk` is listed without a version constraint (`ipsdk` with no specifier). If ipsdk releases a breaking change, all builds and deploys will start silently using the incompatible version. Additionally, `PyYAML` is used in `serdes.py` with a try/except import but is not declared as a dependency — not even as an optional extra — so `uv add PyYAML` is required manually. - -**Risk:** Non-reproducible installs. A fresh `uv sync` on a CI runner or in production can pull a broken ipsdk version. YAML support appears to work in practice only if the user's environment happens to have PyYAML installed. - -**Before:** -``` -dependencies = [ - "ipsdk", -] -``` -**After:** -``` -dependencies = [ - "ipsdk>=", -] - -[project.optional-dependencies] -yaml = ["PyYAML>=6.0"] -``` - -### ⚪ P3 — Low - -#### [F09] logger.fatal() calls sys.exit(1), making it unsuitable for use inside a library -**Location:** `src/asyncgateway/logger.py:87` | **Category:** observability - -**Problem:** `logger.fatal()` logs a message and then calls `sys.exit(1)`. A library should never call `sys.exit()`; that decision belongs to the application consuming the library. If a caller is running a long-lived service and hits a transient error that triggers this path, the entire process is killed. - -**Risk:** If any service method surfaces an error and a caller wraps it in `logger.fatal()`, the whole process exits. Library consumers have no way to recover from this. - -**Before:** -``` -def fatal(msg: str) -> None: - log(logging.FATAL, msg) - print(f"ERROR: {msg}") - sys.exit(1) -``` -**After:** -``` -# Either remove fatal() entirely or raise an exception instead of sys.exit: -def fatal(msg: str) -> None: - log(logging.FATAL, msg) - raise SystemExit(1) # at minimum; ideally just raise AsyncGatewayError -``` - -#### [F10] __main__.py uses print() instead of sys.stdout or logging, and calls it a placeholder -**Location:** `src/asyncgateway/__main__.py:11-12` | **Category:** structure - -**Problem:** The module entry point uses bare `print()` calls. The module docstring says it is a placeholder for future CLI. This is fine for a placeholder, but if a CLI is ever added the prints will need to be replaced with proper output handling. - -**Risk:** Low. Nit for now, but worth flagging before CLI work begins. - -#### [F11] dump() in devices.py writes files to cwd-relative path with no configurable base directory -**Location:** `src/asyncgateway/services/devices.py:393` | **Category:** structure - -**Problem:** `folder_path = Path(devices_folder)` uses a relative path by default (`"devices"`), which resolves against whatever the current working directory is at call time. Library code that writes to relative paths is unpredictable when called from different working directories. - -**Risk:** Files land in an unexpected location depending on where the caller's process started. Low risk for now since the method is optional, but will surprise users. - -## What's Working Well - -- 200 tests pass, 93% overall line coverage. Error paths, pagination edge cases, and all three load operation modes are tested. -- Custom exception hierarchy is well-designed: AsyncGatewayError as the base, specific subclasses for connection/auth/validation, plus classify_httpx_error() that maps httpx exceptions to domain types. classify_httpx_error and classify_http_status are both tested thoroughly. -- serdes module is a good single-responsibility abstraction: JSON/YAML parsing isolated in one place, graceful degradation when PyYAML is absent, YAML_AVAILABLE flag used consistently across client and serdes. -- Pre-commit hooks configured for linting, security (bandit), and formatting with pre-push test enforcement — strong quality gate for a library. -- The dynamic service loader pattern is clean: adding a new service requires only dropping a .py file with a Service class into services/. No manual registration in __init__ needed. -- bandit reports zero security findings across all source files. -- load() in client.py properly aggregates per-service errors into a results dict rather than raising on the first failure, allowing partial success and detailed reporting. -- CI matrix covers Python 3.10–3.13 with fail-fast disabled, ensuring broad compatibility. - -## Refactor Plan - -Each step is independently mergeable and must not break existing behavior. - -### Step 1: Fix pagination infinite loop in get_all() for both devices and playbooks -*Addresses: F01, F02* - -**What:** In `devices.py` and `playbooks.py`, change the `while True` break condition from `len(results) == total` to `not page or len(results) >= total`. Also align the meta key (`total_count` vs `count`) across both services — decide which one the API actually returns and use it consistently. - -**Why now:** This is the highest-reliability risk in the codebase. An API quirk or concurrent deletion can cause an infinite async loop. Fixing it is a one-line change per service with clear test coverage already in place. - -**Safe when:** Existing pagination tests still pass. Add a new test with a mock that returns `total_count=5` but only 3 items; confirm `get_all()` returns after one call. - -### Step 2: Remove hardcoded 'router' filter from delete_all() -*Addresses: F03* - -**What:** Delete the `if ele["name"].startswith("router"):` guard in `devices.py:delete_all()`. Update the docstring to accurately describe that all devices are deleted. - -**Why now:** The method is dangerous in its current form — a caller reading the signature gets a false contract. This is a one-line fix. - -**Safe when:** Existing test `test_delete_all_devices_with_router_prefix` is updated to expect all listed devices to be deleted, and a new test confirms non-router devices are also deleted. - -### Step 3: Add pytest.ini_options with asyncio_mode=auto and pin ipsdk version -*Addresses: F06, F08* - -**What:** Add `[tool.pytest.ini_options]` with `asyncio_mode = "auto"` to pyproject.toml. Pin `ipsdk` to a minimum known-good version. Optionally add a `[project.optional-dependencies]` yaml extra for PyYAML. - -**Why now:** The pytest-asyncio deprecation will silently break tests on next minor upgrade. The ipsdk pin prevents a broken CI from a dependency update. Both are config-only changes with no code impact. - -**Safe when:** Test suite passes without deprecation warnings. `uv sync` produces the same resolved ipsdk version across two independent environments. - -### Step 4: Fix inline imports of ValidationError and add top-level type annotations -*Addresses: F05, F07* - -**What:** Move the `from asyncgateway.exceptions import ValidationError` inline imports in `devices.py` and `playbooks.py` to module-level. Add return and parameter type annotations to `Client.__init__`, `__aenter__`, `__aexit__`, and `ServiceBase.__init__`. - -**Why now:** These are cleanup items that make the codebase consistent and unlock mypy coverage over the public interface. No logic changes required. - -**Safe when:** `uv run mypy src/` reports zero new errors. All 200 tests still pass. - -### Step 5: Rename ConnectionError and TimeoutError to avoid shadowing builtins -*Addresses: F04* - -**What:** Rename `class ConnectionError` to `class GatewayConnectionError` (and update `TimeoutError = GatewayConnectionError`). Add backward-compat aliases `ConnectionError = GatewayConnectionError` if this is a published API, but mark them deprecated. - -**Why now:** Lower urgency than the above steps since the shadowing only affects code that mixes asyncgateway exceptions with builtins in the same scope, but it's a correctness hazard worth addressing before the 1.0 API surface is locked. - -**Safe when:** All exception tests pass. Verify via `python -c 'from asyncgateway.exceptions import ConnectionError; import builtins; assert ConnectionError is not builtins.ConnectionError'` prints the correct class. diff --git a/docs/openapi.json b/docs/openapi.json deleted file mode 100644 index 0e92adc..0000000 --- a/docs/openapi.json +++ /dev/null @@ -1,16926 +0,0 @@ -{ - "components": { - "examples": { - "AuthenticationError": { - "value": { - "code": "401", - "message": "The specified authorization token is malformed or does not correspond with an active session" - } - }, - "BadParameter": { - "value": { - "code": "400", - "message": "'hosts' parameter must contain at least one device" - } - }, - "Deleted": { - "value": { - "code": "200", - "message": "deleted", - "status": "200" - } - }, - "Duplicate": { - "value": { - "code": "409", - "message": "A resource with the same name already exists" - } - }, - "InvalidGroup": { - "value": { - "code": "409", - "message": "Unable to find groups: sample1, sample2" - } - }, - "InvalidJSONError": { - "value": { - "code": "400", - "message": "Invalid JSON" - } - }, - "InvalidSchemaError": { - "value": { - "code": "400", - "message": "Invalid schema type: 'sample'" - } - }, - "MissingParameter": { - "value": { - "detail": "'args' is a required property", - "status": "400", - "title": "Bad Request", - "type": "about:blank" - } - }, - "NotFoundError": { - "value": { - "code": "404", - "message": "Not Found" - } - }, - "SearchFilterError": { - "value": { - "code": "400", - "message": "Invalid JSON in search filter" - } - }, - "ServerError": { - "value": { - "code": "500", - "message": "Internal server error: EXCEPTION: events missing" - } - }, - "UserNotFoundError": { - "value": { - "code": "404", - "message": "User Name not found" - } - } - }, - "responses": { - "AuthenticationError": { - "content": { - "application/json": { - "example": { - "code": "401", - "message": "The specified authorization token is malformed or does not correspond with an active session" - }, - "schema": { - "$ref": "#/components/schemas/Error" - } - } - }, - "description": "Authentication Error" - }, - "BadRequest": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Error" - } - } - }, - "description": "Bad Request Error" - }, - "GenericExecutionSuccess": { - "content": { - "JSON Response": { - "example": { - "response": { - "example": "This is an example of a json response object." - }, - "status": "SUCCESS", - "status_code": "200" - } - }, - "Text Response": { - "example": { - "response": "This is an example of a text response string.", - "status": "SUCCESS", - "status_code": "200" - } - }, - "application/json": { - "schema": { - "$ref": "#/components/schemas/GenericExecutionSuccessBody" - } - } - }, - "description": "Successful Requests Response" - }, - "InternalError": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Error" - } - }, - "server error": { - "example": { - "code": "500", - "message": "Internal server error: EXCEPTION: events missing" - } - } - }, - "description": "Internal Server Error" - }, - "NotFoundError": { - "content": { - "Not Found": { - "example": { - "code": "404", - "message": "Not Found" - } - }, - "application/json": { - "schema": { - "$ref": "#/components/schemas/NotFoundError" - } - } - }, - "description": "Entity Not Found" - } - }, - "schemas": { - "Account": { - "properties": { - "email": { - "type": "string" - }, - "firstname": { - "type": "string" - }, - "lastname": { - "type": "string" - }, - "username": { - "type": "string" - } - }, - "required": [ - "username" - ], - "type": "object" - }, - "AccountParameters": { - "properties": { - "email": { - "type": "string" - }, - "firstname": { - "type": "string" - }, - "lastname": { - "type": "string" - }, - "password": { - "type": "string" - }, - "username": { - "type": "string" - } - }, - "required": [ - "email", - "password", - "username" - ], - "type": "object" - }, - "AccountUpdateParameters": { - "properties": { - "email": { - "type": "string" - }, - "firstname": { - "type": "string" - }, - "lastname": { - "type": "string" - } - }, - "type": "object" - }, - "Audit": { - "properties": { - "request": { - "properties": {}, - "type": "object" - }, - "response": { - "properties": {}, - "type": "object" - } - }, - "required": [ - "request", - "response" - ], - "type": "object" - }, - "BaseConnection": { - "properties": { - "app_port": { - "description": "the http port of the service for iap adapter", - "example": "5005", - "type": "integer" - }, - "app_type": { - "default": "iag", - "description": "the name of service needs to connected to IAP", - "example": "iag", - "type": "string" - }, - "host": { - "description": "URL for IAP WebSocket Server", - "example": "example.com", - "minLength": "1", - "type": "string" - }, - "password": { - "description": "token for setting up WebSocket connection to IAP", - "minLength": "36", - "type": "string" - }, - "port": { - "description": "Port for IAP WebSocket Server", - "example": "443", - "type": "integer" - }, - "timeout": { - "description": "Set a timeout (in seconds) to wait for response.", - "maximum": "3600", - "minimum": "1", - "type": "integer" - } - }, - "required": [ - "app_port", - "host", - "password" - ], - "type": "object" - }, - "Collection": { - "properties": { - "name": { - "type": "string" - } - }, - "required": [ - "name" - ], - "type": "object" - }, - "CollectionInstallParameters": { - "properties": { - "filename": { - "description": "Path to package if installing locally", - "type": "string" - }, - "force": { - "description": "Add force flag to force package installation (when collection is already installed and you want to upgrade or downgrade version)", - "type": "boolean" - }, - "package_name": { - "description": "Name of package to install if installing from Galaxy server", - "type": "string" - }, - "server_params": { - "description": "Parameters for connection to Galaxy server", - "properties": { - "auth_url": { - "type": "string" - }, - "password": { - "type": "string" - }, - "token": { - "type": "string" - }, - "url": { - "type": "string" - }, - "username": { - "type": "string" - } - }, - "type": "object" - }, - "version": { - "description": "Version of Collection to be installed", - "type": "string" - } - }, - "type": "object" - }, - "CollectionRefresh": { - "properties": { - "code": { - "type": "integer" - }, - "message": { - "type": "string" - } - }, - "required": [ - "code", - "message" - ], - "type": "object" - }, - "ConfigParameters": { - "additionalProperties": "false", - "properties": { - "ansible_debug": { - "type": "boolean" - }, - "ansible_enabled": { - "type": "boolean" - }, - "collection_path": { - "items": { - "type": "string" - }, - "minItems": "0", - "type": "array" - }, - "extended_device_role_path": { - "items": { - "type": "string" - }, - "minItems": "0", - "type": "array" - }, - "git_enabled": { - "type": "boolean" - }, - "git_exec": { - "minLength": "3", - "type": "string" - }, - "git_key_path": { - "type": "string" - }, - "git_repo_path": { - "type": "string" - }, - "git_strict_host_check": { - "type": "boolean" - }, - "grpc_enabled": { - "type": "boolean" - }, - "http_requests_enabled": { - "type": "boolean" - }, - "inventory_file": { - "type": "string" - }, - "ldap_always_search_bind": { - "type": "boolean" - }, - "ldap_auth_enabled": { - "type": "boolean" - }, - "ldap_base_dn": { - "type": "string" - }, - "ldap_bind_user_dn": { - "type": "string" - }, - "ldap_bind_user_password": { - "type": "string" - }, - "ldap_ca_certs_file": { - "type": "string" - }, - "ldap_group_dn": { - "type": "string" - }, - "ldap_group_members_attr": { - "type": "string" - }, - "ldap_group_search_filter": { - "type": "string" - }, - "ldap_group_search_scope": { - "type": "string" - }, - "ldap_secure_enabled": { - "type": "boolean" - }, - "ldap_secure_validation_enabled": { - "type": "boolean" - }, - "ldap_secure_validation_tls_version": { - "type": "string" - }, - "ldap_server": { - "type": "string" - }, - "ldap_user_dn": { - "type": "string" - }, - "ldap_user_login_attr": { - "type": "string" - }, - "ldap_user_rdn_attr": { - "type": "string" - }, - "ldap_user_search_filter": { - "type": "string" - }, - "ldap_user_search_scope": { - "type": "string" - }, - "module_path": { - "items": { - "type": "string" - }, - "minItems": "0", - "type": "array" - }, - "netconf_enabled": { - "type": "boolean" - }, - "netmiko_enabled": { - "type": "boolean" - }, - "no_cleanup": { - "type": "boolean" - }, - "nornir_config_file": { - "type": "string" - }, - "nornir_enabled": { - "type": "boolean" - }, - "nornir_module_path": { - "items": { - "type": "string" - }, - "minItems": "0", - "type": "array" - }, - "nornir_module_recursive": { - "type": "boolean" - }, - "playbook_path": { - "items": { - "type": "string" - }, - "minItems": "0", - "type": "array" - }, - "playbook_recursive": { - "type": "boolean" - }, - "process_count": { - "minimum": "0", - "type": "integer" - }, - "python_venv_enabled": { - "type": "boolean" - }, - "python_venv_paths": { - "items": { - "type": "string" - }, - "minItems": "1", - "type": "array" - }, - "repos_enabled": { - "type": "boolean" - }, - "repos_path": { - "type": "string" - }, - "role_path": { - "items": { - "type": "string" - }, - "minItems": "0", - "type": "array" - }, - "script_path": { - "items": { - "type": "string" - }, - "minItems": "0", - "type": "array" - }, - "script_recursive": { - "type": "boolean" - }, - "scripts_enabled": { - "type": "boolean" - }, - "terraform_enabled": { - "type": "boolean" - }, - "terraform_path": { - "items": { - "type": "string" - }, - "minItems": "0", - "type": "array" - }, - "terraform_recursive": { - "type": "boolean" - }, - "vault_access_token": { - "type": "string" - }, - "vault_ca_file": { - "type": "string" - }, - "vault_cert_verification": { - "type": "boolean" - }, - "vault_client_cert_file": { - "type": "string" - }, - "vault_client_key_file": { - "type": "string" - }, - "vault_enabled": { - "type": "boolean" - }, - "vault_mount_point": { - "type": "string" - }, - "vault_password_file": { - "type": "string" - }, - "vault_server": { - "type": "string" - } - }, - "type": "object" - }, - "Connection": { - "properties": { - "connectivity": { - "type": "boolean" - }, - "error": { - "properties": {}, - "type": "object" - } - }, - "required": [ - "connectivity" - ], - "type": "object" - }, - "DeletedMessage": { - "properties": { - "code": { - "format": "int32", - "type": "integer" - }, - "message": { - "type": "string" - } - }, - "required": [ - "code", - "message" - ], - "type": "object" - }, - "Device": { - "properties": { - "name": { - "minLength": "1", - "type": "string" - }, - "variables": { - "properties": {}, - "type": "object" - } - }, - "required": [ - "name", - "variables" - ], - "type": "object" - }, - "DeviceUpdateVariables": { - "properties": { - "ansible_network_os": { - "type": "string" - }, - "ansible_user": { - "type": "string" - } - }, - "type": "object" - }, - "Error": { - "properties": { - "code": { - "format": "int32", - "type": "integer" - }, - "message": { - "type": "string" - } - }, - "required": [ - "code", - "message" - ], - "type": "object" - }, - "GenericExecutionSuccessBody": { - "properties": { - "response": { - "properties": {}, - "type": "object" - }, - "status": { - "type": "string" - }, - "status_code": { - "type": "string" - } - }, - "required": [ - "response", - "status", - "status_code" - ], - "type": "object" - }, - "GetConfigParameters": { - "properties": { - "hosts": { - "items": { - "type": "string" - }, - "type": "array" - }, - "template": { - "type": "string" - } - }, - "required": [ - "hosts" - ], - "type": "object" - }, - "Group": { - "properties": { - "childGroups": { - "items": { - "type": "string" - }, - "type": "array" - }, - "devices": { - "items": { - "type": "string" - }, - "type": "array" - }, - "name": { - "minLength": "1", - "type": "string" - }, - "variables": { - "properties": {}, - "type": "object" - } - }, - "required": [ - "devices", - "name" - ], - "type": "object" - }, - "GroupChildren": { - "items": { - "type": "string" - }, - "type": "array" - }, - "GroupDevices": { - "items": { - "type": "string" - }, - "type": "array" - }, - "GrpcDevice": { - "additionalProperties": "false", - "properties": { - "name": { - "minLength": "1", - "type": "string" - }, - "variables": { - "additionalProperties": "true", - "properties": { - "debug": { - "description": "Debug grpc operations", - "type": "boolean" - }, - "grpc_options": { - "type": "array" - }, - "grpc_timeout": { - "description": "grpc timeout", - "type": "integer" - }, - "host": { - "type": "string" - }, - "insecure": { - "type": "boolean" - }, - "override": { - "description": "grpc override parameters (advanced)", - "type": "string" - }, - "password": { - "type": "string" - }, - "path_cert": { - "description": "Path to the client certificate", - "type": "string" - }, - "path_key": { - "description": "Path to the certificate key", - "type": "string" - }, - "path_root": { - "description": "Path to the CA root certificate store", - "type": "string" - }, - "port": { - "description": "grpc port", - "example": "57777", - "type": "integer" - }, - "show_diff": { - "type": "string" - }, - "skip_verify": { - "description": "Skip TLS verify", - "type": "boolean" - }, - "token": { - "type": "string" - }, - "username": { - "type": "string" - }, - "vault_path": { - "description": "Vault path and key for vault integration.", - "example": "path:key", - "type": "string" - } - }, - "required": [ - "host", - "port", - "username", - "insecure" - ], - "type": "object" - } - }, - "required": [ - "name", - "variables" - ], - "type": "object" - }, - "GrpcUpdateVariableParameters": { - "additionalProperties": "false", - "properties": { - "name": { - "description": "host or ip of device", - "minLength": "1", - "type": "string" - }, - "variables": { - "additionalProperties": "false", - "properties": { - "debug": { - "description": "Debug grpc operations", - "type": "boolean" - }, - "grpc_options": { - "type": "array" - }, - "grpc_timeout": { - "description": "grpc timeout", - "type": "integer" - }, - "host": { - "description": "hostname or IP address of the grpc device", - "minLength": "1", - "type": "string" - }, - "insecure": { - "description": "Enable TLS for GRPC communication", - "type": "boolean" - }, - "override": { - "description": "grpc override parameters (advanced)", - "type": "string" - }, - "password": { - "type": "string" - }, - "path_cert": { - "description": "Path to the client certificate", - "type": "string" - }, - "path_key": { - "description": "Path to the certificate key", - "type": "string" - }, - "path_root": { - "description": "Path to the CA root certificate store", - "type": "string" - }, - "port": { - "description": "grpc port", - "example": "57777", - "type": "integer" - }, - "show_diff": { - "type": "string" - }, - "skip_verify": { - "description": "Skip TLS verify", - "type": "boolean" - }, - "token": { - "type": "string" - }, - "username": { - "type": "string" - } - }, - "type": "object" - } - }, - "type": "object" - }, - "Health": { - "properties": { - "hostname": { - "type": "string" - }, - "serviceId": { - "type": "string" - }, - "success": { - "type": "boolean" - } - }, - "required": [ - "hostname", - "serviceId", - "success" - ], - "type": "object" - }, - "HttpRequestsDevice": { - "additionalProperties": "false", - "properties": { - "name": { - "example": "IOS", - "minLength": "1", - "type": "string" - }, - "variables": { - "additionalProperties": "true", - "properties": { - "base_url": { - "example": "jsonplaceholder.typicode.com", - "type": "string" - }, - "port": { - "example": "443", - "type": "integer" - }, - "protocol": { - "example": "https", - "type": "string" - } - }, - "required": [ - "base_url", - "protocol" - ], - "type": "object" - } - }, - "required": [ - "name", - "variables" - ], - "type": "object" - }, - "HttpRequestsPostBodyData": { - "additionalProperties": "false", - "properties": { - "allow_redirects": { - "default": "true", - "description": "A flag which enables or disables HTTP redirection.", - "example": "true", - "type": "boolean" - }, - "auth": { - "additionalProperties": "false", - "description": "Keys/values to send as the username and password for Basic Authentication.", - "example": { - "password": "password", - "username": "username" - }, - "properties": { - "password": { - "example": "password", - "type": "string" - }, - "username": { - "example": "username", - "type": "string" - } - }, - "required": [ - "password", - "username" - ], - "type": "object" - }, - "cookies": { - "description": "Keys/values to send as the request's cookies.", - "example": {}, - "properties": {}, - "type": "object" - }, - "data": { - "description": "Keys/values to send as the request's body.", - "example": {}, - "properties": {}, - "type": "object" - }, - "endpoint": { - "description": "The endpoint to append to the url built from your inventory/host.", - "example": "/api/v2/todos", - "type": "string" - }, - "headers": { - "description": "Keys/values to send as the request's HTTP headers.", - "example": { - "content-type": "application/json" - }, - "properties": {}, - "type": "object" - }, - "host": { - "description": "The name of a host to execute against.", - "example": "IOS", - "type": "string" - }, - "method": { - "description": "Request method - one of GET, OPTIONS, HEAD, POST, PUT, PATCH, DELETE", - "enum": [ - "get", - "GET", - "options", - "OPTIONS", - "head", - "HEAD", - "post", - "POST", - "put", - "PUT", - "patch", - "PATCH", - "delete", - "DELETE" - ], - "example": "GET", - "type": "string" - }, - "params": { - "description": "Keys/values to convert into the request's query string.", - "example": { - "id": "1" - }, - "properties": {}, - "type": "object" - }, - "proxies": { - "description": "The keys/values which describe proxies to use for the request.", - "example": { - "http": "http://10.0.0.1:8080", - "https": "http://10.0.0.1:4343" - }, - "properties": {}, - "type": "object" - }, - "timeout": { - "additionalProperties": "false", - "description": "The connect and read timeouts for the request. See: https://docs.python-requests.org/en/latest/user/advanced/#timeouts", - "example": { - "connect": "3.05", - "read": "27" - }, - "properties": { - "connect": { - "example": "3.05", - "type": "string" - }, - "read": { - "example": "27", - "type": "string" - } - }, - "type": "object" - }, - "verify": { - "default": "true", - "description": "A flag which enables or disables TLS certificate verification.", - "example": "false", - "type": "boolean" - } - }, - "required": [ - "endpoint", - "host", - "method" - ], - "type": "object" - }, - "HttpRequestsUpdateVariableParameters": { - "additionalProperties": "false", - "properties": { - "name": { - "example": "IOS", - "minLength": "1", - "type": "string" - }, - "variables": { - "additionalProperties": "true", - "properties": { - "base_url": { - "example": "jsonplaceholder.typicode.com", - "type": "string" - }, - "port": { - "example": "443", - "type": "integer" - }, - "protocol": { - "example": "https", - "type": "string" - } - }, - "type": "object" - } - }, - "type": "object" - }, - "InventoryRefresh": { - "properties": { - "code": { - "type": "integer" - }, - "message": { - "type": "string" - } - }, - "required": [ - "code", - "message" - ], - "type": "object" - }, - "LoginCredentials": { - "properties": { - "password": { - "type": "string" - }, - "username": { - "type": "string" - } - }, - "required": [ - "password", - "username" - ], - "type": "object" - }, - "Meta": { - "properties": { - "count": { - "type": "integer" - }, - "queryObject": { - "$ref": "#/components/schemas/QueryObject" - } - }, - "required": [ - "count", - "queryObject" - ], - "type": "object" - }, - "Module": { - "properties": { - "author": { - "type": "string" - }, - "description": { - "items": { - "type": "string" - }, - "type": "array" - }, - "extends_documentation_fragment": { - "type": "string" - }, - "itential_modified": { - "type": "boolean" - }, - "module": { - "type": "string" - }, - "notes": { - "items": { - "type": "string" - }, - "type": "array" - }, - "schema": { - "properties": {}, - "type": "object" - }, - "short_description": { - "type": "string" - }, - "version_added": { - "type": "string" - } - }, - "required": [ - "module", - "schema" - ], - "type": "object" - }, - "ModuleFamily": { - "properties": { - "family": { - "type": "string" - }, - "modules": { - "items": { - "$ref": "#/components/schemas/ModuleSummary" - }, - "type": "array" - } - }, - "required": [ - "family", - "modules" - ], - "type": "object" - }, - "ModuleParameters": { - "example": { - "args": { - "commands": [ - "show version" - ] - }, - "hosts": [ - "sample_host" - ] - }, - "properties": { - "args": { - "properties": {}, - "type": "object" - }, - "groups": { - "items": { - "type": "string" - }, - "type": "array" - }, - "hosts": { - "items": { - "type": "string" - }, - "type": "array" - }, - "provider_required": { - "description": "Enable/disable automation of provider object", - "type": "boolean" - }, - "strict_args": { - "description": "Override global strict args setting", - "type": "boolean" - }, - "template": { - "description": "TextFSM template", - "type": "string" - } - }, - "required": [ - "args" - ], - "type": "object" - }, - "ModuleRefresh": { - "properties": { - "code": { - "type": "integer" - }, - "message": { - "type": "string" - } - }, - "required": [ - "code", - "message" - ], - "type": "object" - }, - "ModuleSummary": { - "properties": { - "effective_schema_type": { - "type": "string" - }, - "family": { - "type": "string" - }, - "itential_modified": { - "type": "boolean" - }, - "name": { - "type": "string" - }, - "short_description": { - "type": "string" - }, - "version_added": { - "type": "string" - } - }, - "required": [ - "family", - "name" - ], - "type": "object" - }, - "NetconfDevice": { - "additionalProperties": "false", - "properties": { - "name": { - "minLength": "1", - "type": "string" - }, - "variables": { - "additionalProperties": "true", - "properties": { - "host": { - "type": "string" - }, - "password": { - "type": "string" - }, - "platform": { - "enum": [ - "default", - "alu", - "csr", - "ericsson", - "h3c", - "huawei", - "huaweiyang", - "iosxe", - "iosxr", - "junos", - "nexus", - "sros" - ], - "type": "string" - }, - "port": { - "type": "integer" - }, - "timeout": { - "type": "integer" - }, - "username": { - "type": "string" - }, - "vault_path": { - "description": "Vault path and key for vault integration.", - "example": "path:key", - "type": "string" - } - }, - "required": [ - "host", - "password", - "platform", - "username" - ], - "type": "object" - } - }, - "required": [ - "name", - "variables" - ], - "type": "object" - }, - "NetconfGetConfigParameters": { - "properties": { - "filter": { - "description": "An xml string which acts as a filter to restrict the data retrieved from the device", - "type": "string" - }, - "host": { - "description": "Either hostname or ip address accepted", - "example": "10.0.0.1", - "type": "string" - }, - "lock": { - "default": "false", - "description": "Lock the datastore specified in 'target_datastore'", - "type": "boolean" - }, - "target_datastore": { - "default": "running", - "description": "Name of the datastore from which to retrieve configuration data", - "enum": [ - "candidate", - "running", - "startup" - ], - "type": "string" - } - }, - "required": [ - "host" - ], - "type": "object" - }, - "NetconfRpcParameters": { - "properties": { - "host": { - "description": "Name of device in netconf inventory to execute against.", - "type": "string" - }, - "rpc": { - "description": "Name of RPC operation to be executed on the remote device.", - "type": "string" - } - }, - "required": [ - "host", - "rpc" - ], - "type": "object" - }, - "NetconfSetConfigParameters": { - "properties": { - "config_content": { - "description": "The configuration data in xml string format", - "type": "string" - }, - "host": { - "description": "Either hostname or ip address accepted", - "example": "10.0.0.1", - "type": "string" - }, - "lock": { - "default": "true", - "description": "Lock the datastore specified in 'target_datastore'", - "type": "boolean" - }, - "save_to_startup": { - "default": "false", - "description": "Save the config updates of the datastore specified in 'target_datastore' to the startup-config", - "type": "boolean" - }, - "target_datastore": { - "default": "candidate", - "description": "Name of the configuration datastore to be updated", - "enum": [ - "candidate", - "running" - ], - "type": "string" - }, - "validate": { - "default": "false", - "description": "Validate the config updates of the datastore specified in 'target_datastore'", - "type": "boolean" - } - }, - "required": [ - "config_content", - "host" - ], - "type": "object" - }, - "NetconfUpdateVariableParameters": { - "additionalProperties": "false", - "properties": { - "name": { - "minLength": "1", - "type": "string" - }, - "variables": { - "additionalProperties": "false", - "properties": { - "host": { - "type": "string" - }, - "password": { - "type": "string" - }, - "platform": { - "enum": [ - "default", - "alu", - "csr", - "ericsson", - "h3c", - "huawei", - "huaweiyang", - "iosxe", - "iosxr", - "junos", - "nexus", - "sros" - ], - "type": "string" - }, - "port": { - "type": "integer" - }, - "timeout": { - "type": "integer" - }, - "username": { - "type": "string" - } - }, - "type": "object" - } - }, - "type": "object" - }, - "NetmikoDevice": { - "additionalProperties": "false", - "properties": { - "name": { - "description": "host or ip of device", - "minLength": "1", - "type": "string" - }, - "variables": { - "additionalProperties": "false", - "properties": { - "allow_agent": { - "description": "Enable use of SSH key-agent.", - "type": "boolean" - }, - "allow_auto_change": { - "description": "Allow automatic configuration changes for terminal settings. (default to False)", - "type": "boolean" - }, - "alt_host_keys": { - "description": "If `True` host keys will be loaded from the file specified in", - "type": "boolean" - }, - "alt_key_file": { - "description": "SSH host key file to use (if alt_host_keys=True).", - "type": "string" - }, - "auth_timeout": { - "description": "Set a timeout (in seconds) to wait for an authentication response.", - "type": "number" - }, - "auto_connect": { - "description": "Control whether Netmiko automatically establishes the connection as part of the object creation (default to True).", - "type": "boolean" - }, - "banner_timeout": { - "description": "Set a timeout to wait for the SSH banner (pass to Paramiko).", - "type": "number" - }, - "default_enter": { - "description": "Character(s) to send to correspond to enter key (default to \\n).", - "type": "string" - }, - "device_type": { - "description": "Netmiko supported device type", - "enum": [ - "a10", - "accedian", - "adtran_os", - "alcatel_aos", - "alcatel_sros", - "allied_telesis_awplus", - "apresia_aeos", - "arista_eos", - "aruba_os", - "aruba_osswitch", - "aruba_procurve", - "avaya_ers", - "avaya_vsp", - "broadcom_icos", - "brocade_fastiron", - "brocade_fos", - "brocade_netiron", - "brocade_nos", - "brocade_vdx", - "brocade_vyos", - "calix_b6", - "cdot_cros", - "centec_os", - "checkpoint_gaia", - "ciena_saos", - "cisco_asa", - "cisco_ftd", - "cisco_ios", - "cisco_ios_telnet", - "cisco_nxos", - "cisco_s300", - "cisco_tp", - "cisco_wlc", - "cisco_xe", - "cisco_xr", - "cloudgenix_ion", - "coriant", - "dell_dnos9", - "dell_force10", - "dell_isilon", - "dell_os10", - "dell_os6", - "dell_os9", - "dell_powerconnect", - "dlink_ds", - "eltex", - "eltex_esr", - "endace", - "enterasys", - "ericsson_ipos", - "extreme", - "extreme_ers", - "extreme_exos", - "extreme_netiron", - "extreme_nos", - "extreme_slx", - "extreme_vdx", - "extreme_vsp", - "extreme_wing", - "f5_linux", - "f5_ltm", - "f5_tmsh", - "flexvnf", - "fortinet", - "generic", - "generic_telnet", - "generic_termserver", - "hp_comware", - "hp_procurve", - "huawei", - "huawei_olt", - "huawei_smartax", - "huawei_vrpv8", - "ipinfusion_ocnos", - "juniper", - "juniper_junos", - "juniper_screenos", - "keymile", - "keymile_nos", - "linux", - "mellanox", - "mellanox_mlnxos", - "mikrotik_routeros", - "mikrotik_switchos", - "mrv_lx", - "mrv_optiswitch", - "netapp_cdot", - "netgear_prosafe", - "netscaler", - "nokia_sros", - "oneaccess_oneos", - "ovs_linux", - "paloalto_panos", - "pluribus", - "quanta_mesh", - "rad_etx", - "raisecom_roap", - "ruckus_fastiron", - "ruijie_os", - "sixwind_os", - "sophos_sfos", - "supermicro_smis", - "tplink_jetstream", - "ubiquiti_edge", - "ubiquiti_edgerouter", - "ubiquiti_edgeswitch", - "ubiquiti_unifiswitch", - "vyatta_vyos", - "vyos", - "watchguard_fireware", - "yamaha", - "zte_zxros" - ], - "example": "cisco_ios", - "type": "string" - }, - "enable": { - "default": "false", - "description": "Enter enable mode.", - "type": "boolean" - }, - "encoding": { - "description": "Encoding to be used when writing bytes to the output channel. (default to ascii)", - "type": "string" - }, - "fast_cli": { - "description": "Provide a way to optimize for performance. Converts select_delay_factor to select smallest of global and specific. Sets default global_delay_factor to .1 (default to False)", - "type": "boolean" - }, - "global_delay_factor": { - "description": "Multiplication factor affecting Netmiko delays (default to 1).", - "type": "integer" - }, - "host": { - "description": "hostname or IP address of the netmiko device", - "minLength": "1", - "type": "string" - }, - "keepalive": { - "description": "Send SSH keepalive packets at a specific interval, in seconds. Currently defaults to 0, for backwards compatibility (it will not attempt to keep the connection alive).", - "type": "integer" - }, - "key_file": { - "description": "Filename path of the SSH key file to use.", - "type": "string" - }, - "passphrase": { - "description": "Passphrase to use for encrypted key; password will be used for key decryption if not specified.", - "type": "string" - }, - "password": { - "description": "Password to authenticate against target device if required.", - "example": "password", - "type": "string" - }, - "port": { - "description": "The destination port used to connect to the target device.", - "example": "22", - "type": "integer" - }, - "response_return": { - "description": "Character(s) to use in normalized return data to represent enter key (default to \\n)", - "type": "string" - }, - "secret": { - "description": "The enable password if target device requires one.", - "type": "string" - }, - "session_log": { - "description": "File path or BufferedIOBase subclass object to write the session log to.", - "type": "string" - }, - "session_log_file_mode": { - "description": "write or append for session_log file mode (default to write)", - "type": "string" - }, - "session_log_record_writes": { - "description": "The session log generally only records channel reads due to eliminate command duplication due to command echo. You can enable this if you want to record both channel reads and channel writes in the log (default to False).", - "type": "boolean" - }, - "session_timeout": { - "description": "Set a timeout for parallel requests.", - "type": "number" - }, - "ssh_config_file": { - "description": "File name of OpenSSH configuration file.", - "type": "string" - }, - "ssh_strict": { - "description": "Automatically reject unknown SSH host keys (default to False, which means unknown SSH host keys will be accepted)", - "type": "boolean" - }, - "system_host_keys": { - "description": "Load host keys from the users known_hosts file.", - "type": "boolean" - }, - "timeout": { - "description": "Connection timeout.", - "type": "number" - }, - "use_keys": { - "description": "Connect to target device using SSH keys.", - "type": "boolean" - }, - "username": { - "description": "Username to authenticate against target device if required.", - "example": "username", - "type": "string" - }, - "vault_path": { - "description": "Vault path and key for vault integration.", - "example": "path:key", - "type": "string" - }, - "verbose": { - "description": "Enable additional messages to standard output.", - "type": "boolean" - } - }, - "required": [ - "device_type", - "host" - ], - "type": "object" - } - }, - "required": [ - "name", - "variables" - ], - "type": "object" - }, - "NetmikoSendCommand": { - "properties": { - "commands": { - "example": [ - "show version", - "show ip int brief" - ], - "items": { - "type": "string" - }, - "type": "array" - }, - "connection_options": { - "properties": { - "device_type": { - "example": "cisco_ios", - "type": "string" - }, - "password": { - "example": "password", - "type": "string" - }, - "port": { - "example": "22", - "type": "integer" - }, - "username": { - "example": "username", - "type": "string" - } - }, - "required": [ - "device_type" - ], - "type": "object" - }, - "host": { - "example": "10.0.0.1", - "type": "string" - } - }, - "required": [ - "commands", - "connection_options", - "host" - ], - "type": "object" - }, - "NetmikoSendCommandExecuteBody": { - "properties": { - "cmd_verify": { - "description": "Verify command echo before proceeding (default to True).", - "type": "boolean" - }, - "command_string": { - "description": "The command to be executed on the remote device", - "example": "show version", - "type": "string" - }, - "delay_factor": { - "description": "Multiplying factor used to adjust delays (default to 1).", - "type": "integer" - }, - "expect_string": { - "description": "Regular expression pattern to use for determining end of output. If left blank will default to being based on router prompt.", - "type": "string" - }, - "host": { - "description": "netmiko device name", - "example": "cisco_device", - "type": "string" - }, - "max_loops": { - "description": "Controls wait time in conjunction with delay_factor. Will default to be based upon the timeout in netmiko device", - "type": "integer" - }, - "normalize": { - "description": "Ensure the proper enter is sent at end of command (default to True).", - "type": "boolean" - }, - "strip_command": { - "description": "Remove the echo of the command from the output (default to True).", - "type": "boolean" - }, - "strip_prompt": { - "description": "Remove the trailing router prompt from the output (default to True).", - "type": "boolean" - }, - "textfsm_template": { - "description": "Name of template to parse output with; can be fully qualified path, relative path, or name of file in current directory. (default to None).", - "type": "string" - }, - "ttp_template": { - "description": "Name of template to parse output with; can be fully qualified path, relative path, or name of file in current directory. (default to None).", - "type": "string" - }, - "use_genie": { - "description": "Process command output through PyATS/Genie parser (default to False).", - "type": "boolean" - }, - "use_textfsm": { - "description": "Process command output through TextFSM template (default to False).", - "type": "boolean" - }, - "use_ttp": { - "description": "Process command output through TTP template (default to False).", - "type": "boolean" - } - }, - "required": [ - "command_string", - "host" - ], - "type": "object" - }, - "NetmikoSendCommandResponse": { - "properties": { - "command_string": { - "description": "The command to be executed on the remote device", - "type": "string" - }, - "error_msg": { - "description": "execution error message", - "type": "string" - }, - "host": { - "description": "netmiko device name", - "type": "string" - }, - "response": { - "description": "execution result", - "type": "string" - }, - "status": { - "description": "execution status", - "enum": [ - "SUCCESS", - "FAILURE" - ], - "type": "string" - } - }, - "title": "NetmikoSendCommandResponse", - "type": "object" - }, - "NetmikoSendConfig": { - "properties": { - "config_commands": { - "example": [ - "hostname ROUTER1", - "interface Ethernet 1/1", - " description ROUTER1 Uplink" - ], - "items": { - "type": "string" - }, - "type": "array" - }, - "connection_options": { - "properties": { - "device_type": { - "example": "cisco_ios", - "type": "string" - }, - "password": { - "example": "password", - "type": "string" - }, - "port": { - "example": "22", - "type": "integer" - }, - "username": { - "example": "username", - "type": "string" - } - }, - "required": [ - "device_type" - ], - "type": "object" - }, - "host": { - "example": "10.0.0.1", - "type": "string" - } - }, - "required": [ - "config_commands", - "connection_options", - "host" - ], - "type": "object" - }, - "NetmikoSendConfigSetExecuteBody": { - "properties": { - "cmd_verify": { - "description": "Whether or not to verify command echo for each command in config_set", - "type": "boolean" - }, - "config_commands": { - "description": "Multiple configuration commands to be sent to the device", - "example": [ - "hostname ROUTER1", - "interface Ethernet 1/1", - " description ROUTER1 Uplink" - ], - "items": { - "type": "string" - }, - "type": "array" - }, - "config_mode_command": { - "description": "The command to enter into config mode", - "type": "string" - }, - "delay_factor": { - "description": "Factor to adjust delays", - "type": "integer" - }, - "enter_config_mode": { - "description": "Do you enter config mode before sending config commands", - "type": "boolean" - }, - "error_pattern": { - "description": "Regular expression pattern to detect config errors in the output.", - "type": "string" - }, - "exit_config_mode": { - "description": "Determines whether or not to exit config mode after complete", - "type": "boolean" - }, - "host": { - "description": "Either hostname or ip accepted", - "example": "device_name", - "type": "string" - }, - "max_loops": { - "description": "Controls wait time in conjunction with delay_factor (default to 150)", - "type": "integer" - }, - "strip_command": { - "description": "Determines whether or not to strip the command", - "type": "boolean" - }, - "strip_prompt": { - "description": "Determines whether or not to strip the prompt", - "type": "boolean" - } - }, - "required": [ - "config_commands", - "host" - ], - "type": "object" - }, - "NetmikoSendConfigSetResponse": { - "properties": { - "config_commands": { - "description": "Multiple configuration commands to be sent to the device", - "items": { - "type": "string" - }, - "type": "array" - }, - "error_msg": { - "description": "execution error message", - "type": "string" - }, - "host": { - "description": "Netmiko device name", - "type": "string" - }, - "response": { - "description": "execution result", - "type": "string" - }, - "status": { - "description": "execution status", - "enum": [ - "SUCCESS", - "FAILURE" - ], - "type": "string" - } - }, - "title": "NetmikoSendConfigSetResponse", - "type": "object" - }, - "NetmikoUpdateVariableParameters": { - "additionalProperties": "false", - "properties": { - "name": { - "description": "host or ip of device", - "minLength": "1", - "type": "string" - }, - "variables": { - "additionalProperties": "false", - "properties": { - "allow_agent": { - "description": "Enable use of SSH key-agent.", - "type": "boolean" - }, - "allow_auto_change": { - "description": "Allow automatic configuration changes for terminal settings. (default to False)", - "type": "boolean" - }, - "alt_host_keys": { - "description": "If `True` host keys will be loaded from the file specified in", - "type": "boolean" - }, - "alt_key_file": { - "description": "SSH host key file to use (if alt_host_keys=True).", - "type": "string" - }, - "auth_timeout": { - "description": "Set a timeout (in seconds) to wait for an authentication response.", - "type": "number" - }, - "auto_connect": { - "description": "Control whether Netmiko automatically establishes the connection as part of the object creation (default to True).", - "type": "boolean" - }, - "banner_timeout": { - "description": "Set a timeout to wait for the SSH banner (pass to Paramiko).", - "type": "number" - }, - "default_enter": { - "description": "Character(s) to send to correspond to enter key (default to \\n).", - "type": "string" - }, - "device_type": { - "description": "Netmiko supported device type", - "enum": [ - "a10", - "accedian", - "adtran_os", - "alcatel_aos", - "alcatel_sros", - "allied_telesis_awplus", - "apresia_aeos", - "arista_eos", - "aruba_os", - "aruba_osswitch", - "aruba_procurve", - "avaya_ers", - "avaya_vsp", - "broadcom_icos", - "brocade_fastiron", - "brocade_fos", - "brocade_netiron", - "brocade_nos", - "brocade_vdx", - "brocade_vyos", - "calix_b6", - "cdot_cros", - "centec_os", - "checkpoint_gaia", - "ciena_saos", - "cisco_asa", - "cisco_ftd", - "cisco_ios", - "cisco_ios_telnet", - "cisco_nxos", - "cisco_s300", - "cisco_tp", - "cisco_wlc", - "cisco_xe", - "cisco_xr", - "cloudgenix_ion", - "coriant", - "dell_dnos9", - "dell_force10", - "dell_isilon", - "dell_os10", - "dell_os6", - "dell_os9", - "dell_powerconnect", - "dlink_ds", - "eltex", - "eltex_esr", - "endace", - "enterasys", - "ericsson_ipos", - "extreme", - "extreme_ers", - "extreme_exos", - "extreme_netiron", - "extreme_nos", - "extreme_slx", - "extreme_vdx", - "extreme_vsp", - "extreme_wing", - "f5_linux", - "f5_ltm", - "f5_tmsh", - "flexvnf", - "fortinet", - "generic", - "generic_telnet", - "generic_termserver", - "hp_comware", - "hp_procurve", - "huawei", - "huawei_olt", - "huawei_smartax", - "huawei_vrpv8", - "ipinfusion_ocnos", - "juniper", - "juniper_junos", - "juniper_screenos", - "keymile", - "keymile_nos", - "linux", - "mellanox", - "mellanox_mlnxos", - "mikrotik_routeros", - "mikrotik_switchos", - "mrv_lx", - "mrv_optiswitch", - "netapp_cdot", - "netgear_prosafe", - "netscaler", - "nokia_sros", - "oneaccess_oneos", - "ovs_linux", - "paloalto_panos", - "pluribus", - "quanta_mesh", - "rad_etx", - "raisecom_roap", - "ruckus_fastiron", - "ruijie_os", - "sixwind_os", - "sophos_sfos", - "supermicro_smis", - "tplink_jetstream", - "ubiquiti_edge", - "ubiquiti_edgerouter", - "ubiquiti_edgeswitch", - "ubiquiti_unifiswitch", - "vyatta_vyos", - "vyos", - "watchguard_fireware", - "yamaha", - "zte_zxros" - ], - "example": "cisco_ios", - "type": "string" - }, - "enable": { - "default": "false", - "description": "Enter enable mode.", - "type": "boolean" - }, - "encoding": { - "description": "Encoding to be used when writing bytes to the output channel. (default to ascii)", - "type": "string" - }, - "fast_cli": { - "description": "Provide a way to optimize for performance. Converts select_delay_factor to select smallest of global and specific. Sets default global_delay_factor to .1 (default to False)", - "type": "boolean" - }, - "global_delay_factor": { - "description": "Multiplication factor affecting Netmiko delays (default to 1).", - "type": "integer" - }, - "host": { - "description": "hostname or IP address of the netmiko device", - "minLength": "1", - "type": "string" - }, - "keepalive": { - "description": "Send SSH keepalive packets at a specific interval, in seconds. Currently defaults to 0, for backwards compatibility (it will not attempt to keep the connection alive).", - "type": "integer" - }, - "key_file": { - "description": "Filename path of the SSH key file to use.", - "type": "string" - }, - "passphrase": { - "description": "Passphrase to use for encrypted key; password will be used for key decryption if not specified.", - "type": "string" - }, - "password": { - "description": "Password to authenticate against target device if required.", - "example": "password", - "type": "string" - }, - "port": { - "description": "The destination port used to connect to the target device.", - "example": "22", - "type": "integer" - }, - "response_return": { - "description": "Character(s) to use in normalized return data to represent enter key (default to \\n)", - "type": "string" - }, - "secret": { - "description": "The enable password if target device requires one.", - "type": "string" - }, - "session_log": { - "description": "File path or BufferedIOBase subclass object to write the session log to.", - "type": "string" - }, - "session_log_file_mode": { - "description": "write or append for session_log file mode (default to write)", - "type": "string" - }, - "session_log_record_writes": { - "description": "The session log generally only records channel reads due to eliminate command duplication due to command echo. You can enable this if you want to record both channel reads and channel writes in the log (default to False).", - "type": "boolean" - }, - "session_timeout": { - "description": "Set a timeout for parallel requests.", - "type": "number" - }, - "ssh_config_file": { - "description": "File name of OpenSSH configuration file.", - "type": "string" - }, - "ssh_strict": { - "description": "Automatically reject unknown SSH host keys (default to False, which means unknown SSH host keys will be accepted)", - "type": "boolean" - }, - "system_host_keys": { - "description": "Load host keys from the users known_hosts file.", - "type": "boolean" - }, - "timeout": { - "description": "Connection timeout.", - "type": "number" - }, - "use_keys": { - "description": "Connect to target device using SSH keys.", - "type": "boolean" - }, - "username": { - "description": "Username to authenticate against target device if required.", - "example": "username", - "type": "string" - }, - "vault_path": { - "description": "Vault path and key for vault integration.", - "example": "path:key", - "type": "string" - }, - "verbose": { - "description": "Enable additional messages to standard output.", - "type": "boolean" - } - }, - "type": "object" - } - }, - "type": "object" - }, - "NornirModuleParameters": { - "example": { - "args": { - "argument_list": [ - "first_arg", - "second_arg" - ] - } - }, - "properties": { - "args": { - "properties": {}, - "type": "object" - }, - "env": { - "properties": {}, - "type": "object" - }, - "groups": { - "items": { - "type": "string" - }, - "type": "array" - }, - "hosts": { - "items": { - "type": "string" - }, - "type": "array" - }, - "strict_args": { - "description": "Override global strict args setting", - "type": "boolean" - } - }, - "required": [ - "args" - ], - "type": "object" - }, - "NotFoundError": { - "properties": { - "code": { - "type": "integer" - }, - "status_code": { - "type": "string" - } - }, - "required": [ - "code" - ], - "type": "object" - }, - "PasswordChange": { - "properties": { - "new_password": { - "type": "string" - }, - "old_password": { - "type": "string" - } - }, - "required": [ - "new_password", - "old_password" - ], - "type": "object" - }, - "PasswordResetParameters": { - "properties": { - "email": { - "type": "string" - }, - "new_password": { - "type": "string" - }, - "security_ques1": { - "type": "string" - }, - "security_ques1_ans": { - "type": "string" - }, - "security_ques2": { - "type": "string" - }, - "security_ques2_ans": { - "type": "string" - }, - "temp_password": { - "minLength": "1", - "type": "string" - }, - "username": { - "type": "string" - } - }, - "required": [ - "email", - "new_password", - "security_ques1", - "security_ques1_ans", - "security_ques2", - "security_ques2_ans", - "temp_password", - "username" - ], - "type": "object" - }, - "PasswordUpdateParameters": { - "properties": { - "email": { - "type": "string" - }, - "password": { - "type": "string" - }, - "security_ques1": { - "type": "string" - }, - "security_ques1_ans": { - "type": "string" - }, - "security_ques2": { - "type": "string" - }, - "security_ques2_ans": { - "type": "string" - }, - "username": { - "type": "string" - } - }, - "required": [ - "email", - "password", - "username" - ], - "type": "object" - }, - "PlaybookParameters": { - "example": { - "args": {}, - "hosts": [ - "sample_host" - ] - }, - "properties": { - "args": { - "properties": {}, - "type": "object" - }, - "groups": { - "items": { - "type": "string" - }, - "type": "array" - }, - "hosts": { - "items": { - "type": "string" - }, - "type": "array" - }, - "strict_args": { - "description": "Override global strict args setting", - "type": "boolean" - }, - "syntax_check": { - "description": "perform a syntax check on the playbook, but do not execute it", - "type": "boolean" - }, - "template": { - "description": "TextFSM template", - "type": "string" - }, - "verbosity": { - "description": "Control how verbose the output of ansible-playbook is", - "maximum": "4", - "minimum": "1", - "type": "integer" - } - }, - "required": [ - "args" - ], - "type": "object" - }, - "PlaybookRefresh": { - "properties": { - "code": { - "type": "integer" - }, - "message": { - "type": "string" - } - }, - "required": [ - "code", - "message" - ], - "type": "object" - }, - "PlaybookSummary": { - "properties": { - "effective_schema_type": { - "type": "string" - }, - "file": { - "type": "string" - }, - "name": { - "type": "string" - } - }, - "required": [ - "name" - ], - "type": "object" - }, - "Problem": { - "properties": { - "detail": { - "type": "string" - }, - "status": { - "example": "401", - "type": "integer" - }, - "title": { - "type": "string" - }, - "type": { - "type": "string" - } - }, - "type": "object" - }, - "PythonVenv": { - "properties": { - "name": { - "type": "string" - }, - "path": { - "type": "string" - }, - "version": { - "type": "string" - } - }, - "type": "object" - }, - "QueryObject": { - "properties": { - "detail": { - "type": "string" - }, - "filter": { - "properties": {}, - "type": "object" - }, - "limit": { - "type": "integer" - }, - "offset": { - "type": "integer" - }, - "order": { - "type": "string" - } - }, - "required": [ - "filter", - "limit", - "offset", - "order" - ], - "type": "object" - }, - "RbacGroup": { - "additionalProperties": "false", - "properties": { - "description": { - "minLength": "1", - "type": "string" - }, - "name": { - "minLength": "1", - "type": "string" - }, - "roles": { - "items": { - "type": "string" - }, - "minItems": "1", - "type": "array" - }, - "users": { - "items": { - "type": "string" - }, - "minItems": "1", - "type": "array" - } - }, - "required": [ - "name", - "roles" - ], - "type": "object" - }, - "RbacGroupRoles": { - "additionalProperties": "false", - "properties": { - "roles": { - "items": { - "type": "string" - }, - "minItems": "1", - "type": "array" - } - }, - "required": [ - "roles" - ], - "type": "object" - }, - "RbacGroupUsers": { - "additionalProperties": "false", - "properties": { - "users": { - "items": { - "type": "string" - }, - "minItems": "1", - "type": "array" - } - }, - "required": [ - "users" - ], - "type": "object" - }, - "RbacRole": { - "properties": { - "name": { - "type": "string" - }, - "origin": { - "type": "string" - }, - "resource": { - "type": "string" - }, - "routes": { - "items": { - "properties": {}, - "type": "object" - }, - "minItems": "1", - "type": "array" - }, - "tag": { - "type": "string" - } - }, - "type": "object" - }, - "RoleParameters": { - "example": { - "args": {}, - "hosts": [ - "sample_host" - ] - }, - "properties": { - "args": { - "properties": {}, - "type": "object" - }, - "groups": { - "items": { - "type": "string" - }, - "type": "array" - }, - "hosts": { - "items": { - "type": "string" - }, - "type": "array" - }, - "strict_args": { - "description": "Override global strict args setting", - "type": "boolean" - }, - "template": { - "description": "TextFSM template", - "type": "string" - } - }, - "required": [ - "args" - ], - "type": "object" - }, - "RoleRefresh": { - "properties": { - "code": { - "type": "integer" - }, - "message": { - "type": "string" - } - }, - "required": [ - "code", - "message" - ], - "type": "object" - }, - "RoleSummary": { - "properties": { - "author": { - "type": "string" - }, - "company": { - "type": "string" - }, - "description": { - "type": "string" - }, - "effective_schema_type": { - "type": "string" - }, - "galaxy_tags": { - "items": { - "type": "string" - }, - "type": "array" - }, - "itential_modified": { - "type": "boolean" - }, - "min_ansible_version": { - "type": "string" - }, - "name": { - "type": "string" - } - }, - "required": [ - "name" - ], - "type": "object" - }, - "RunCommandParameters": { - "properties": { - "command": { - "items": { - "type": "string" - }, - "type": "array" - }, - "hosts": { - "items": { - "type": "string" - }, - "type": "array" - }, - "template": { - "type": "string" - } - }, - "required": [ - "command", - "hosts" - ], - "type": "object" - }, - "Script": { - "properties": { - "name": { - "type": "string" - } - }, - "required": [ - "name" - ], - "type": "object" - }, - "ScriptParameters": { - "example": { - "args": { - "argument_list": [ - "first_arg", - "second_arg" - ] - } - }, - "properties": { - "args": { - "properties": {}, - "type": "object" - }, - "env": { - "properties": {}, - "type": "object" - }, - "hosts": { - "items": { - "type": "string" - }, - "type": "array" - }, - "python_venv": { - "description": "The name of the python venv to use", - "type": "string" - }, - "strict_args": { - "description": "Override global strict args setting", - "type": "boolean" - }, - "template": { - "description": "TextFSM template", - "type": "string" - } - }, - "required": [ - "args" - ], - "type": "object" - }, - "ScriptRefresh": { - "properties": { - "code": { - "type": "integer" - }, - "message": { - "type": "string" - } - }, - "required": [ - "code", - "message" - ], - "type": "object" - }, - "ScriptSummary": { - "properties": { - "effective_schema_type": { - "type": "string" - }, - "file": { - "type": "string" - }, - "name": { - "type": "string" - } - }, - "required": [ - "name" - ], - "type": "object" - }, - "Secret": { - "properties": { - "path": { - "type": "string" - }, - "secret_data": { - "properties": {}, - "type": "object" - } - }, - "required": [ - "path", - "secret_data" - ], - "type": "object" - }, - "SecretSummary": { - "properties": { - "path": { - "type": "string" - }, - "secret_keys": { - "items": { - "type": "string" - }, - "type": "array" - } - }, - "required": [ - "path", - "secret_keys" - ], - "type": "object" - }, - "SecurityQuesUpdateParameters": { - "properties": { - "security_ques1": { - "type": "string" - }, - "security_ques1_ans": { - "type": "string" - }, - "security_ques2": { - "type": "string" - }, - "security_ques2_ans": { - "type": "string" - }, - "username": { - "type": "string" - } - }, - "required": [ - "security_ques1", - "security_ques1_ans", - "security_ques2", - "security_ques2_ans", - "username" - ], - "type": "object" - }, - "TerraformParameters": { - "example": { - "args": {} - }, - "properties": { - "args": { - "properties": {}, - "type": "object" - }, - "strict_args": { - "description": "Override global strict args setting", - "type": "boolean" - } - }, - "required": [ - "args" - ], - "type": "object" - }, - "TerraformRefresh": { - "properties": { - "code": { - "type": "integer" - }, - "message": { - "type": "string" - } - }, - "required": [ - "code", - "message" - ], - "type": "object" - }, - "TerraformSummary": { - "properties": { - "effective_schema_type": { - "type": "string" - }, - "file": { - "type": "string" - }, - "name": { - "type": "string" - } - }, - "required": [ - "name" - ], - "type": "object" - }, - "UserSchema": { - "properties": { - "schema": { - "properties": { - "properties": { - "properties": {}, - "type": "object" - }, - "required": { - "items": { - "type": "string" - }, - "type": "array" - }, - "title": { - "type": "string" - }, - "type": { - "type": "string" - } - }, - "type": "object" - } - }, - "required": [ - "schema" - ], - "type": "object" - }, - "ValidateSecurityParameters": { - "properties": { - "email": { - "type": "string" - }, - "security_ques1": { - "type": "string" - }, - "security_ques1_ans": { - "type": "string" - }, - "security_ques2": { - "type": "string" - }, - "security_ques2_ans": { - "type": "string" - } - }, - "required": [ - "email", - "security_ques1", - "security_ques1_ans", - "security_ques2", - "security_ques2_ans" - ], - "type": "object" - }, - "grpcCancelRebootParameters": { - "properties": { - "host": { - "type": "string" - }, - "message": { - "type": "string" - }, - "subcomponents": { - "type": "array" - } - }, - "required": [ - "host", - "message" - ], - "type": "object" - }, - "grpcClearBGPNeighborParameters": { - "properties": { - "address": { - "type": "string" - }, - "host": { - "type": "string" - }, - "mode": { - "description": "0:SOFT, 1:SOFTIN, 2:HARD", - "enum": [ - "0", - "1", - "2" - ], - "type": "integer" - }, - "routing_instance": { - "type": "string" - } - }, - "required": [ - "host", - "address", - "routing_instance", - "mode" - ], - "type": "object" - }, - "grpcClearLLDPParameters": { - "properties": { - "host": { - "type": "string" - }, - "interface": { - "type": "object" - } - }, - "required": [ - "host", - "interface" - ], - "type": "object" - }, - "grpcClearSTPParameters": { - "properties": { - "host": { - "type": "string" - }, - "interface": { - "type": "object" - } - }, - "required": [ - "host", - "interface" - ], - "type": "object" - }, - "grpcDeviceInterfaceParameters": { - "properties": { - "host": { - "type": "string" - }, - "interface": { - "type": "array" - } - }, - "required": [ - "host", - "interface" - ], - "type": "object" - }, - "grpcGetParameters": { - "properties": { - "host": { - "type": "string" - }, - "options": { - "properties": { - "datatype": { - "enum": [ - "all", - "config", - "state", - "operational" - ], - "type": "string" - }, - "encoding": { - "enum": [ - "json", - "bytes", - "proto", - "ascii", - "json_ietf" - ], - "type": "string" - }, - "prefix": { - "type": "string" - }, - "target": { - "type": "string" - } - }, - "type": "object" - }, - "path": { - "items": { - "type": "string" - }, - "type": "array" - } - }, - "required": [ - "host", - "path" - ], - "type": "object" - }, - "grpcNeighborDiscoveryParameters": { - "properties": { - "address": { - "type": "string" - }, - "host": { - "type": "string" - }, - "protocol": { - "type": "string" - } - }, - "required": [ - "host", - "protocol", - "address" - ], - "type": "object" - }, - "grpcPingParameters": { - "properties": { - "count": { - "type": "integer" - }, - "destination": { - "type": "string" - }, - "do_not_fragment": { - "type": "boolean" - }, - "do_not_resolve": { - "type": "boolean" - }, - "host": { - "type": "string" - }, - "interval": { - "type": "integer" - }, - "l3protocol": { - "type": "string" - }, - "size": { - "type": "integer" - }, - "source": { - "type": "string" - }, - "wait": { - "type": "integer" - } - }, - "required": [ - "host", - "destination", - "count" - ], - "type": "object" - }, - "grpcRebootParameters": { - "properties": { - "delay": { - "type": "number" - }, - "force": { - "type": "boolean" - }, - "host": { - "type": "string" - }, - "message": { - "type": "string" - }, - "method": { - "type": "string" - }, - "subcomponents": { - "type": "array" - } - }, - "required": [ - "host", - "method" - ], - "type": "object" - }, - "grpcRebootStatusParameters": { - "properties": { - "host": { - "type": "string" - }, - "subcomponents": { - "type": "array" - } - }, - "required": [ - "host" - ], - "type": "object" - }, - "grpcSetPackageParameters": { - "properties": { - "contents": { - "type": "string" - }, - "hash": { - "properties": { - "hash": { - "type": "string" - }, - "method": { - "type": "string" - } - }, - "type": "object" - }, - "host": { - "type": "string" - }, - "package": { - "properties": { - "activate": { - "type": "boolean" - }, - "filename": { - "type": "string" - }, - "remote_download": { - "properties": { - "credentials": { - "properties": { - "cleartext": { - "type": "string" - }, - "hashed": { - "properties": { - "hash": { - "type": "string" - }, - "method": { - "type": "string" - } - }, - "type": "object" - }, - "username": { - "type": "string" - } - }, - "type": "object" - }, - "path": { - "type": "string" - }, - "protocol": { - "type": "string" - } - }, - "type": "object" - }, - "version": { - "type": "string" - } - }, - "type": "object" - } - }, - "required": [ - "host", - "package" - ], - "type": "object" - }, - "grpcSetParameters": { - "properties": { - "delete": { - "items": { - "type": "string" - }, - "type": "array" - }, - "host": { - "type": "string" - }, - "options": { - "properties": { - "encoding": { - "enum": [ - "json", - "bytes", - "proto", - "ascii", - "json_ietf" - ], - "type": "string" - } - }, - "type": "object" - }, - "replace": { - "items": { - "items": { - "oneOf": [ - { - "type": "string" - }, - { - "type": "object" - } - ] - }, - "type": "array" - }, - "type": "array" - }, - "update": { - "items": { - "items": { - "minItems": "2", - "oneOf": [ - { - "type": "string" - }, - { - "type": "object" - } - ] - }, - "type": "array" - }, - "type": "array" - } - }, - "required": [ - "host" - ], - "type": "object" - }, - "grpcSwitchCPUParameters": { - "properties": { - "control_processor": { - "type": "string" - }, - "host": { - "type": "string" - } - }, - "required": [ - "host", - "control_processor" - ], - "type": "object" - }, - "grpcTimeParameters": { - "properties": { - "host": { - "type": "string" - } - }, - "required": [ - "host" - ], - "type": "object" - }, - "grpcTracerouteParameters": { - "properties": { - "destination": { - "type": "string" - }, - "do_not_fragment": { - "type": "boolean" - }, - "do_not_resolve": { - "type": "boolean" - }, - "host": { - "type": "string" - }, - "initial_ttl": { - "type": "number" - }, - "l3protocol": { - "type": "string" - }, - "max_ttl": { - "type": "number" - }, - "source": { - "type": "string" - }, - "wait": { - "type": "number" - } - }, - "required": [ - "host", - "destination" - ], - "type": "object" - }, - "grpcWakeOnLANParameters": { - "properties": { - "address": { - "type": "string" - }, - "host": { - "type": "string" - }, - "interface": { - "type": "object" - }, - "mac_address": { - "type": "string" - } - }, - "required": [ - "host", - "address", - "interface", - "mac_address" - ], - "type": "object" - }, - "listOfSecurityQuestions": { - "example": [ - "Where did you go on your favorite vacation as a child?", - "If you could be a character out of any novel, who would you be?" - ], - "items": { - "type": "string" - }, - "type": "array" - }, - "securityQuestionsByEmail": { - "properties": { - "code": { - "example": "200", - "format": "int32", - "type": "integer" - }, - "email": { - "example": "john.doe@itential.com", - "type": "string" - }, - "security_ques1": { - "example": "Where did you go on your favorite vacation as a child?", - "type": "string" - }, - "security_ques2": { - "example": "In what city or town did your mother and father meet?", - "type": "string" - } - }, - "type": "object" - } - } - }, - "info": { - "title": "Automation Gateway Version 2.0 API", - "version": "2.0" - }, - "openapi": "3.0.3", - "paths": { - "/account/{account_name}/change_password": { - "post": { - "description": "Update user login credentials.", - "operationId": "automation_gateway.api_v2.account.post", - "parameters": [ - { - "description": "Name of account", - "in": "path", - "name": "account_name", - "required": "true", - "schema": { - "type": "string" - } - } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/PasswordChange" - } - } - }, - "description": "Old/New Passwords", - "required": "true", - "x-body-name": "password_change" - }, - "responses": { - "200": { - "description": "password change response" - }, - "401": { - "content": { - "application/json": { - "examples": { - "AuthenticationError": { - "$ref": "#/components/examples/AuthenticationError" - } - }, - "schema": { - "$ref": "#/components/schemas/Error" - } - } - }, - "description": "Authentication Error" - } - }, - "summary": "Update user login credentials", - "tags": [ - "Authentication" - ] - } - }, - "/accounts": { - "get": { - "description": "Get a list of user accounts.", - "parameters": [ - { - "description": "The number of items to skip before starting to collect the result set", - "in": "query", - "name": "offset", - "schema": { - "type": "integer" - } - }, - { - "description": "The number of items to return", - "in": "query", - "name": "limit", - "schema": { - "type": "integer" - } - }, - { - "description": "Response filter function with JSON name/value pair argument, i.e., contains({\"username\":\"admin\"})\nValid filter functions - contains, equals, startswith, endswith\n", - "in": "query", - "name": "filter", - "schema": { - "type": "string" - } - }, - { - "description": "Ascending/Descending sort indication", - "in": "query", - "name": "order", - "schema": { - "default": "ascending", - "enum": [ - "ascending", - "descending" - ], - "type": "string" - } - } - ], - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "properties": { - "data": { - "items": { - "$ref": "#/components/schemas/Account" - }, - "type": "array" - }, - "meta": { - "$ref": "#/components/schemas/Meta" - } - }, - "required": [ - "data", - "meta" - ], - "type": "object" - } - } - }, - "description": "get accounts response" - }, - "400": { - "content": { - "application/json": { - "example": { - "code": "400", - "message": "Invalid JSON in account filter" - }, - "schema": { - "type": "object" - } - } - }, - "description": "Bad Request Errors" - } - }, - "summary": "Get list of user accounts", - "tags": [ - "Accounts" - ] - }, - "post": { - "description": "Add a new user account.", - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/AccountParameters" - } - } - }, - "description": "Account definition", - "required": "true", - "x-body-name": "account" - }, - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Account" - } - } - }, - "description": "Returns user account that was created." - }, - "409": { - "content": { - "application/json": { - "examples": { - "Duplicate": { - "$ref": "#/components/examples/Duplicate" - } - }, - "schema": { - "$ref": "#/components/schemas/Error" - } - } - }, - "description": "Duplicate Name Error (resource with same name already exists)" - } - }, - "summary": "Add a new user account", - "tags": [ - "Accounts" - ] - } - }, - "/accounts/{account_name}": { - "delete": { - "description": "Delete a user account.", - "responses": { - "200": { - "content": { - "application/json": { - "examples": { - "Deleted": { - "$ref": "#/components/examples/Deleted" - } - }, - "schema": { - "$ref": "#/components/schemas/DeletedMessage" - } - } - }, - "description": "Message indicating account has been deleted." - } - }, - "summary": "Delete a user account", - "tags": [ - "Accounts" - ] - }, - "get": { - "description": "Get information for a user account.", - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Account" - } - } - }, - "description": "Account information" - }, - "404": { - "content": { - "application/json": { - "examples": { - "NotFoundError": { - "$ref": "#/components/examples/NotFoundError" - } - }, - "schema": { - "$ref": "#/components/schemas/Error" - } - } - }, - "description": "404 Not Found Error" - } - }, - "summary": "Get user account information", - "tags": [ - "Accounts" - ] - }, - "parameters": [ - { - "description": "Name of user account", - "in": "path", - "name": "account_name", - "required": "true", - "schema": { - "type": "string" - } - } - ], - "put": { - "description": "Update details of a user account.", - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/AccountUpdateParameters" - } - } - }, - "description": "Account Details", - "required": "true", - "x-body-name": "account_info" - }, - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Account" - } - } - }, - "description": "Account information" - }, - "404": { - "content": { - "application/json": { - "examples": { - "NotFoundError": { - "$ref": "#/components/examples/NotFoundError" - } - }, - "schema": { - "$ref": "#/components/schemas/Error" - } - } - }, - "description": "404 Not Found Error" - } - }, - "summary": "Update user account information", - "tags": [ - "Accounts" - ] - } - }, - "/accounts/{account_name}/confirm_eula": { - "post": { - "description": "Confirm EULA for account.", - "operationId": "automation_gateway.api_v2.accounts.confirm_eula", - "parameters": [ - { - "description": "Name of user account", - "in": "path", - "name": "account_name", - "required": "true", - "schema": { - "type": "string" - } - } - ], - "responses": { - "200": { - "description": "EULA confirmation response" - }, - "401": { - "content": { - "application/json": { - "examples": { - "AuthenticationError": { - "$ref": "#/components/examples/AuthenticationError" - } - }, - "schema": { - "$ref": "#/components/schemas/Error" - } - } - }, - "description": "Authentication Error" - } - }, - "summary": "Confirm EULA for account", - "tags": [ - "Accounts" - ] - } - }, - "/accounts/{account_name}/update_password": { - "post": { - "description": "Update user login credentials.", - "operationId": "automation_gateway.api_v2.accounts.update_password", - "parameters": [ - { - "description": "Name of user account", - "in": "path", - "name": "account_name", - "required": "true", - "schema": { - "type": "string" - } - } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/PasswordChange" - } - } - }, - "description": "Old/New Passwords", - "required": "true", - "x-body-name": "password_update" - }, - "responses": { - "200": { - "description": "password change response" - }, - "401": { - "content": { - "application/json": { - "examples": { - "AuthenticationError": { - "$ref": "#/components/examples/AuthenticationError" - } - }, - "schema": { - "$ref": "#/components/schemas/Error" - } - } - }, - "description": "Authentication Error" - } - }, - "summary": "Update user login credentials", - "tags": [ - "Accounts" - ] - } - }, - "/audit": { - "get": { - "description": "Retrieve execution audit log persisted in the database.", - "parameters": [ - { - "description": "The number of items to skip before starting to collect the result set", - "in": "query", - "name": "offset", - "schema": { - "type": "integer" - } - }, - { - "description": "The number of items to return", - "in": "query", - "name": "limit", - "schema": { - "type": "integer" - } - }, - { - "description": "Most recent execution on top of returned results unless user specifies ascending", - "in": "query", - "name": "order", - "schema": { - "default": "descending", - "enum": [ - "ascending", - "descending" - ], - "type": "string" - } - } - ], - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "properties": { - "data": { - "items": { - "$ref": "#/components/schemas/Audit" - }, - "type": "array" - }, - "meta": { - "$ref": "#/components/schemas/Meta" - } - }, - "required": [ - "data", - "meta" - ], - "type": "object" - } - } - }, - "description": "audit log results" - }, - "404": { - "content": { - "application/json": { - "examples": { - "NotFoundError": { - "$ref": "#/components/examples/NotFoundError" - } - }, - "schema": { - "$ref": "#/components/schemas/Error" - } - } - }, - "description": "Not Found Error" - } - }, - "summary": "Retrieve execution audit log", - "tags": [ - "System" - ] - } - }, - "/collections": { - "get": { - "description": "Get list of installed Ansible collections.", - "parameters": [ - { - "description": "The number of items to skip before starting to collect the result set", - "in": "query", - "name": "offset", - "schema": { - "type": "integer" - } - }, - { - "description": "The number of items to return", - "in": "query", - "name": "limit", - "schema": { - "type": "integer" - } - }, - { - "description": "Response filter function with JSON name/value pair argument, i.e., contains({\"username\":\"admin\"})\nValid filter functions - contains, equals, startswith, endswith\n", - "in": "query", - "name": "filter", - "schema": { - "type": "string" - } - }, - { - "description": "Ascending/Descending sort indication", - "in": "query", - "name": "order", - "schema": { - "default": "ascending", - "enum": [ - "ascending", - "descending" - ], - "type": "string" - } - }, - { - "description": "Select between full detail or summary for each item", - "in": "query", - "name": "detail", - "schema": { - "default": "summary", - "enum": [ - "full", - "summary" - ], - "type": "string" - } - } - ], - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "properties": { - "data": { - "items": { - "$ref": "#/components/schemas/Collection" - }, - "type": "array" - }, - "meta": { - "$ref": "#/components/schemas/Meta" - } - }, - "required": [ - "data", - "meta" - ], - "type": "object" - } - } - }, - "description": "get collections response" - }, - "400": { - "content": { - "application/json": { - "example": { - "code": "400", - "message": "Invalid JSON in collection filter" - }, - "schema": { - "type": "object" - } - } - }, - "description": "Bad Request Error" - } - }, - "summary": "Get list of installed Ansible collections", - "tags": [ - "Collections" - ] - } - }, - "/collections/install": { - "post": { - "description": "Install an Ansible collection from a Galaxy server or from a tarball.", - "operationId": "automation_gateway.api_v2.collections.install", - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/CollectionInstallParameters" - } - } - }, - "description": "Parameters for collection name and Galaxy server authentication.", - "required": "false", - "x-body-name": "collection_install_params" - }, - "responses": { - "200": { - "description": "install collection response" - }, - "400": { - "description": "Bad Request Error" - } - }, - "summary": "Install an Ansible collection", - "tags": [ - "Collections" - ] - } - }, - "/collections/refresh": { - "post": { - "description": "Perform Ansible collection discovery and update internal cache.", - "operationId": "automation_gateway.api_v2.collections.refresh", - "responses": { - "200": { - "content": { - "application/json": { - "example": { - "code": "200", - "message": "Collection refresh succeeded" - }, - "schema": { - "$ref": "#/components/schemas/CollectionRefresh" - } - } - }, - "description": "display success or failure" - } - }, - "summary": "Refresh Ansible collection cache", - "tags": [ - "Collections" - ] - } - }, - "/collections/{collection_name}": { - "get": { - "description": "Get details for an Ansible collection.", - "parameters": [ - { - "description": "Name of collection to retrieve detail for.", - "in": "path", - "name": "collection_name", - "required": "true", - "schema": { - "type": "string" - } - } - ], - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "type": "object" - } - } - }, - "description": "get collection response" - }, - "404": { - "content": { - "application/json": { - "examples": { - "NotFoundError": { - "$ref": "#/components/examples/NotFoundError" - } - }, - "schema": { - "$ref": "#/components/schemas/Error" - } - } - }, - "description": "Not Found Error" - } - }, - "summary": "Get details for an Ansible collection", - "tags": [ - "Collections" - ] - } - }, - "/collections/{collection_name}/modules": { - "get": { - "description": "Get module list for an Ansible collection.", - "operationId": "automation_gateway.api_v2.collections.module_list", - "parameters": [ - { - "description": "Name of collection to retrieve module list for.", - "in": "path", - "name": "collection_name", - "required": "true", - "schema": { - "type": "string" - } - }, - { - "description": "The number of items to skip before starting to collect the result set", - "in": "query", - "name": "offset", - "schema": { - "type": "integer" - } - }, - { - "description": "The number of items to return", - "in": "query", - "name": "limit", - "schema": { - "type": "integer" - } - }, - { - "description": "Response filter function with JSON name/value pair argument, i.e., contains({\"username\":\"admin\"})\nValid filter functions - contains, equals, startswith, endswith\n", - "in": "query", - "name": "filter", - "schema": { - "type": "string" - } - }, - { - "description": "Ascending/Descending sort indication", - "in": "query", - "name": "order", - "schema": { - "default": "ascending", - "enum": [ - "ascending", - "descending" - ], - "type": "string" - } - }, - { - "description": "Select between full detail or summary for each item", - "in": "query", - "name": "detail", - "schema": { - "default": "summary", - "enum": [ - "full", - "summary" - ], - "type": "string" - } - } - ], - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "type": "object" - } - } - }, - "description": "get collection modules response" - }, - "404": { - "content": { - "application/json": { - "examples": { - "NotFoundError": { - "$ref": "#/components/examples/NotFoundError" - } - }, - "schema": { - "$ref": "#/components/schemas/Error" - } - } - }, - "description": "Not Found Error" - } - }, - "summary": "Get module list for an Ansible collection", - "tags": [ - "Collections" - ] - } - }, - "/collections/{collection_name}/modules/{module_name}": { - "get": { - "description": "Get details for a module in the Ansible collection.", - "operationId": "automation_gateway.api_v2.collections.module_detail", - "parameters": [ - { - "description": "Name of collection to retrieve detail for.", - "in": "path", - "name": "collection_name", - "required": "true", - "schema": { - "type": "string" - } - }, - { - "description": "Name of module to retrieve detail for.", - "in": "path", - "name": "module_name", - "required": "true", - "schema": { - "type": "string" - } - } - ], - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "type": "object" - } - } - }, - "description": "get collection module detail response" - }, - "404": { - "content": { - "application/json": { - "examples": { - "NotFoundError": { - "$ref": "#/components/examples/NotFoundError" - } - }, - "schema": { - "$ref": "#/components/schemas/Error" - } - } - }, - "description": "Not Found Error" - } - }, - "summary": "Get details for module in the Ansible collection", - "tags": [ - "Collections" - ] - } - }, - "/collections/{collection_name}/modules/{module_name}/execute": { - "post": { - "description": "Execute a module contained within the Ansible collection.", - "operationId": "automation_gateway.api_v2.collections.execute_module", - "parameters": [ - { - "description": "Name of collection", - "in": "path", - "name": "collection_name", - "required": "true", - "schema": { - "type": "string" - } - }, - { - "description": "Name of module within collection", - "in": "path", - "name": "module_name", - "required": "true", - "schema": { - "type": "string" - } - } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ModuleParameters" - } - } - }, - "description": "Module Execution Parameters", - "required": "true", - "x-body-name": "execution_parameters" - }, - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "type": "object" - } - } - }, - "description": "execute module response" - }, - "400": { - "content": { - "application/json": { - "examples": { - "BadParameter": { - "$ref": "#/components/examples/BadParameter" - }, - "MissingParameter": { - "$ref": "#/components/examples/MissingParameter" - } - }, - "schema": { - "$ref": "#/components/schemas/Error" - } - } - }, - "description": "Bad Request Error" - }, - "404": { - "content": { - "application/json": { - "examples": { - "NotFoundError": { - "$ref": "#/components/examples/NotFoundError" - } - }, - "schema": { - "$ref": "#/components/schemas/Error" - } - } - }, - "description": "Not Found Error" - }, - "500": { - "content": { - "application/json": { - "examples": { - "ServerError": { - "$ref": "#/components/examples/ServerError" - } - }, - "schema": { - "$ref": "#/components/schemas/Error" - } - } - }, - "description": "Internal Error" - } - }, - "summary": "Execute a module in the Ansible collection", - "tags": [ - "Collections" - ] - } - }, - "/collections/{collection_name}/modules/{module_name}/history": { - "get": { - "description": "Get execution log events for an Ansible collection module.", - "operationId": "automation_gateway.api_v2.collections.get_module_execution_log", - "parameters": [ - { - "description": "Name of collection", - "in": "path", - "name": "collection_name", - "required": "true", - "schema": { - "type": "string" - } - }, - { - "description": "Name of module within collection", - "in": "path", - "name": "module_name", - "required": "true", - "schema": { - "type": "string" - } - }, - { - "description": "The number of items to skip before starting to collect the result set", - "in": "query", - "name": "offset", - "schema": { - "type": "integer" - } - }, - { - "description": "The number of items to return", - "in": "query", - "name": "limit", - "schema": { - "type": "integer" - } - }, - { - "description": "Most recent execution on top of returned results unless user specifies ascending", - "in": "query", - "name": "order", - "schema": { - "default": "descending", - "enum": [ - "ascending", - "descending" - ], - "type": "string" - } - } - ], - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "type": "object" - } - } - }, - "description": "collection module execution log events response" - }, - "400": { - "content": { - "application/json": { - "examples": { - "BadParameter": { - "$ref": "#/components/examples/BadParameter" - }, - "MissingParameter": { - "$ref": "#/components/examples/MissingParameter" - } - }, - "schema": { - "$ref": "#/components/schemas/Error" - } - } - }, - "description": "Bad Request Error" - }, - "404": { - "content": { - "application/json": { - "examples": { - "NotFoundError": { - "$ref": "#/components/examples/NotFoundError" - } - }, - "schema": { - "$ref": "#/components/schemas/Error" - } - } - }, - "description": "Not Found Error" - }, - "500": { - "content": { - "application/json": { - "examples": { - "ServerError": { - "$ref": "#/components/examples/ServerError" - } - }, - "schema": { - "$ref": "#/components/schemas/Error" - } - } - }, - "description": "Internal Error" - } - }, - "summary": "Get Ansible collection module execution log", - "tags": [ - "Collections" - ] - } - }, - "/collections/{collection_name}/modules/{module_name}/schema": { - "delete": { - "description": "Remove a schema for a module in the Ansible collection.", - "operationId": "automation_gateway.api_v2.collections.delete_module_schema", - "responses": { - "200": { - "content": { - "application/json": { - "examples": { - "Deleted": { - "$ref": "#/components/examples/Deleted" - } - }, - "schema": { - "$ref": "#/components/schemas/DeletedMessage" - } - } - }, - "description": "Message indicating schema has been deleted." - }, - "404": { - "content": { - "application/json": { - "examples": { - "NotFoundError": { - "$ref": "#/components/examples/NotFoundError" - } - }, - "schema": { - "$ref": "#/components/schemas/Error" - } - } - }, - "description": "Not Found Error" - } - }, - "summary": "Remove a schema for a module in the Ansible collection", - "tags": [ - "Collections" - ] - }, - "get": { - "description": "Get the schema for a module in the Ansible collection.", - "operationId": "automation_gateway.api_v2.collections.get_module_schema", - "responses": { - "200": { - "content": { - "application/json": { - "example": { - "schema": { - "properties": { - "destination": { - "description": "property2", - "type": "string" - }, - "source": { - "description": "property1", - "type": "string" - } - }, - "required": [ - "property1", - "property2" - ], - "title": "sample.collection.module", - "type": "object" - } - }, - "schema": { - "$ref": "#/components/schemas/UserSchema" - } - } - }, - "description": "object with schema for module" - }, - "404": { - "content": { - "application/json": { - "examples": { - "NotFoundError": { - "$ref": "#/components/examples/NotFoundError" - } - }, - "schema": { - "$ref": "#/components/schemas/Error" - } - } - }, - "description": "Not Found Error" - } - }, - "summary": "Get schema for a module in the Ansible collection", - "tags": [ - "Collections" - ] - }, - "parameters": [ - { - "description": "Name of collection", - "in": "path", - "name": "collection_name", - "required": "true", - "schema": { - "type": "string" - } - }, - { - "description": "Name of module", - "in": "path", - "name": "module_name", - "required": "true", - "schema": { - "type": "string" - } - } - ], - "put": { - "description": "Update/Insert a schema document for module in the Ansible collection.", - "operationId": "automation_gateway.api_v2.collections.put_module_schema", - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/UserSchema" - } - } - }, - "description": "Schema to apply to module identified in path", - "required": "true", - "x-body-name": "schema" - }, - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "type": "object" - } - } - }, - "description": "Update schema response" - } - }, - "summary": "Update schema for a module in the Ansible collection", - "tags": [ - "Collections" - ] - } - }, - "/collections/{collection_name}/roles": { - "get": { - "description": "Get role list for an Ansible collection.", - "operationId": "automation_gateway.api_v2.collections.role_list", - "parameters": [ - { - "description": "Name of collection to retrieve role list for.", - "in": "path", - "name": "collection_name", - "required": "true", - "schema": { - "type": "string" - } - }, - { - "description": "The number of items to skip before starting to collect the result set", - "in": "query", - "name": "offset", - "schema": { - "type": "integer" - } - }, - { - "description": "The number of items to return", - "in": "query", - "name": "limit", - "schema": { - "type": "integer" - } - }, - { - "description": "Response filter function with JSON name/value pair argument, i.e., contains({\"username\":\"admin\"})\nValid filter functions - contains, equals, startswith, endswith\n", - "in": "query", - "name": "filter", - "schema": { - "type": "string" - } - }, - { - "description": "Ascending/Descending sort indication", - "in": "query", - "name": "order", - "schema": { - "default": "ascending", - "enum": [ - "ascending", - "descending" - ], - "type": "string" - } - }, - { - "description": "Select between full detail or summary for each item", - "in": "query", - "name": "detail", - "schema": { - "default": "summary", - "enum": [ - "full", - "summary" - ], - "type": "string" - } - } - ], - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "type": "object" - } - } - }, - "description": "get collection roles" - }, - "404": { - "content": { - "application/json": { - "examples": { - "NotFoundError": { - "$ref": "#/components/examples/NotFoundError" - } - }, - "schema": { - "$ref": "#/components/schemas/Error" - } - } - }, - "description": "Not Found Error" - } - }, - "summary": "Get role list for an Ansible collection", - "tags": [ - "Collections" - ] - } - }, - "/collections/{collection_name}/roles/{role_name}": { - "get": { - "description": "Get details for a role in the Ansible collection.", - "operationId": "automation_gateway.api_v2.collections.role_detail", - "parameters": [ - { - "description": "Name of collection to retrieve detail for.", - "in": "path", - "name": "collection_name", - "required": "true", - "schema": { - "type": "string" - } - }, - { - "description": "Name of role to retrieve detail for.", - "in": "path", - "name": "role_name", - "required": "true", - "schema": { - "type": "string" - } - } - ], - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "type": "object" - } - } - }, - "description": "get collection role detail response" - }, - "404": { - "content": { - "application/json": { - "examples": { - "NotFoundError": { - "$ref": "#/components/examples/NotFoundError" - } - }, - "schema": { - "$ref": "#/components/schemas/Error" - } - } - }, - "description": "Not Found Error" - } - }, - "summary": "Get details for role in the Ansible collection", - "tags": [ - "Collections" - ] - } - }, - "/collections/{collection_name}/roles/{role_name}/execute": { - "post": { - "description": "Execute a role which is contained within the Ansible collection.", - "operationId": "automation_gateway.api_v2.collections.execute_role", - "parameters": [ - { - "description": "Name of collection", - "in": "path", - "name": "collection_name", - "required": "true", - "schema": { - "type": "string" - } - }, - { - "description": "Name of role within collection", - "in": "path", - "name": "role_name", - "required": "true", - "schema": { - "type": "string" - } - } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/RoleParameters" - } - } - }, - "description": "Role Execution Parameters", - "required": "true", - "x-body-name": "execution_parameters" - }, - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "type": "object" - } - } - }, - "description": "execute role" - }, - "400": { - "content": { - "application/json": { - "examples": { - "BadParameter": { - "$ref": "#/components/examples/BadParameter" - }, - "MissingParameter": { - "$ref": "#/components/examples/MissingParameter" - } - }, - "schema": { - "$ref": "#/components/schemas/Error" - } - } - }, - "description": "Bad Request Error" - }, - "404": { - "content": { - "application/json": { - "examples": { - "NotFoundError": { - "$ref": "#/components/examples/NotFoundError" - } - }, - "schema": { - "$ref": "#/components/schemas/Error" - } - } - }, - "description": "Not Found Error" - }, - "500": { - "content": { - "application/json": { - "examples": { - "ServerError": { - "$ref": "#/components/examples/ServerError" - } - }, - "schema": { - "$ref": "#/components/schemas/Error" - } - } - }, - "description": "Internal Error" - } - }, - "summary": "Execute a role in the Ansible collection", - "tags": [ - "Collections" - ] - } - }, - "/collections/{collection_name}/roles/{role_name}/history": { - "get": { - "description": "Get execution log events for an Ansible collection role.", - "operationId": "automation_gateway.api_v2.collections.get_role_execution_log", - "parameters": [ - { - "description": "Name of collection", - "in": "path", - "name": "collection_name", - "required": "true", - "schema": { - "type": "string" - } - }, - { - "description": "Name of role within collection", - "in": "path", - "name": "role_name", - "required": "true", - "schema": { - "type": "string" - } - }, - { - "description": "The number of items to skip before starting to collect the result set", - "in": "query", - "name": "offset", - "schema": { - "type": "integer" - } - }, - { - "description": "The number of items to return", - "in": "query", - "name": "limit", - "schema": { - "type": "integer" - } - }, - { - "description": "Most recent execution on top of returned results unless user specifies ascending", - "in": "query", - "name": "order", - "schema": { - "default": "descending", - "enum": [ - "ascending", - "descending" - ], - "type": "string" - } - } - ], - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "type": "object" - } - } - }, - "description": "collection role execution log events" - }, - "400": { - "content": { - "application/json": { - "examples": { - "BadParameter": { - "$ref": "#/components/examples/BadParameter" - }, - "MissingParameter": { - "$ref": "#/components/examples/MissingParameter" - } - }, - "schema": { - "$ref": "#/components/schemas/Error" - } - } - }, - "description": "Bad Request Error" - }, - "404": { - "content": { - "application/json": { - "examples": { - "NotFoundError": { - "$ref": "#/components/examples/NotFoundError" - } - }, - "schema": { - "$ref": "#/components/schemas/Error" - } - } - }, - "description": "Not Found Error" - }, - "500": { - "content": { - "application/json": { - "examples": { - "ServerError": { - "$ref": "#/components/examples/ServerError" - } - }, - "schema": { - "$ref": "#/components/schemas/Error" - } - } - }, - "description": "Internal Error" - } - }, - "summary": "Get Ansible collection role execution log", - "tags": [ - "Collections" - ] - } - }, - "/collections/{collection_name}/roles/{role_name}/schema": { - "delete": { - "description": "Remove a schema for a role in the Ansible collection.", - "operationId": "automation_gateway.api_v2.collections.delete_role_schema", - "responses": { - "200": { - "content": { - "application/json": { - "examples": { - "Deleted": { - "$ref": "#/components/examples/Deleted" - } - }, - "schema": { - "$ref": "#/components/schemas/DeletedMessage" - } - } - }, - "description": "Message indicating schema has been deleted." - }, - "404": { - "content": { - "application/json": { - "examples": { - "NotFoundError": { - "$ref": "#/components/examples/NotFoundError" - } - }, - "schema": { - "$ref": "#/components/schemas/Error" - } - } - }, - "description": "Not Found Error" - } - }, - "summary": "Remove a schema for a role in the Ansible collection", - "tags": [ - "Collections" - ] - }, - "get": { - "description": "Get the schema for a role in the Ansible collection.", - "operationId": "automation_gateway.api_v2.collections.get_role_schema", - "responses": { - "200": { - "content": { - "application/json": { - "example": { - "schema": { - "properties": { - "destination": { - "description": "property2", - "type": "string" - }, - "source": { - "description": "property1", - "type": "string" - } - }, - "required": [ - "property1", - "property2" - ], - "title": "sample.collection.role", - "type": "object" - } - }, - "schema": { - "$ref": "#/components/schemas/UserSchema" - } - } - }, - "description": "object with schema for role" - }, - "404": { - "content": { - "application/json": { - "examples": { - "NotFoundError": { - "$ref": "#/components/examples/NotFoundError" - } - }, - "schema": { - "$ref": "#/components/schemas/Error" - } - } - }, - "description": "Not Found Error" - } - }, - "summary": "Get schema for a role in the Ansible collection", - "tags": [ - "Collections" - ] - }, - "parameters": [ - { - "description": "Name of collection", - "in": "path", - "name": "collection_name", - "required": "true", - "schema": { - "type": "string" - } - }, - { - "description": "Name of role", - "in": "path", - "name": "role_name", - "required": "true", - "schema": { - "type": "string" - } - } - ], - "put": { - "description": "Update/Insert a schema document for role in the Ansible collection.", - "operationId": "automation_gateway.api_v2.collections.put_role_schema", - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/UserSchema" - } - } - }, - "description": "Schema to apply to role identified in path", - "required": "true", - "x-body-name": "schema" - }, - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "type": "object" - } - } - }, - "description": "Update schema response" - } - }, - "summary": "Update schema for a role in the Ansible collection", - "tags": [ - "Collections" - ] - } - }, - "/config": { - "get": { - "description": "Fetch config value from AG server database.", - "operationId": "automation_gateway.api_v2.config.get", - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "type": "object" - } - } - }, - "description": "Fetch the entire config object" - }, - "404": { - "content": { - "application/json": { - "examples": { - "NotFoundError": { - "$ref": "#/components/examples/NotFoundError" - } - }, - "schema": { - "$ref": "#/components/schemas/Error" - } - } - }, - "description": "Not Found Error" - } - }, - "summary": "Fetch config value from AG server database", - "tags": [ - "config" - ] - }, - "put": { - "description": "Update config to AG server database.", - "operationId": "automation_gateway.api_v2.config.put", - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ConfigParameters" - } - } - }, - "description": "Config object", - "required": "true", - "x-body-name": "config_object" - }, - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "type": "object" - } - } - }, - "description": "Update the config in database" - }, - "400": { - "content": { - "application/json": { - "example": { - "code": "400", - "message": "Invalid config object to update" - }, - "schema": { - "type": "object" - } - } - }, - "description": "Bad Request Error - Invalid config object to update" - } - }, - "summary": "Update config to AG server database", - "tags": [ - "config" - ] - } - }, - "/devices": { - "get": { - "description": "Get a list of Ansible devices.", - "parameters": [ - { - "description": "The number of items to skip before starting to collect the result set", - "in": "query", - "name": "offset", - "schema": { - "type": "integer" - } - }, - { - "description": "The number of items to return", - "in": "query", - "name": "limit", - "schema": { - "type": "integer" - } - }, - { - "description": "Response filter function with JSON name/value pair argument, i.e., contains({\"name\":\"ios\"})\nValid filter functions - contains, equals, startswith, endswith\n", - "in": "query", - "name": "filter", - "schema": { - "type": "string" - } - }, - { - "description": "Ascending/Descending sort indication", - "in": "query", - "name": "order", - "schema": { - "default": "ascending", - "enum": [ - "ascending", - "descending" - ], - "type": "string" - } - } - ], - "responses": { - "200": { - "content": { - "application/json": { - "example": { - "data": [ - { - "name": "ios_host", - "variables": { - "ansible_connection": "network_cli", - "ansible_host": "192.168.32.79", - "ansible_network_os": "ios" - } - }, - { - "name": "junos_host", - "variables": { - "ansible_connection": "network_cli", - "ansible_host": "192.168.32.80", - "ansible_network_os": "junos" - } - } - ], - "meta": { - "count": "2", - "queryObject": { - "filter": {}, - "order": "ascending" - }, - "total_count": "5000" - } - }, - "schema": { - "properties": { - "data": { - "items": { - "$ref": "#/components/schemas/Device" - }, - "type": "array" - }, - "meta": { - "$ref": "#/components/schemas/Meta" - } - }, - "required": [ - "data", - "meta" - ], - "type": "object" - } - } - }, - "description": "get devices response" - }, - "400": { - "content": { - "application/json": { - "example": { - "code": "400", - "message": "Invalid JSON in device filter" - }, - "schema": { - "type": "object" - } - } - }, - "description": "Bad Request Error" - } - }, - "summary": "Get list of Ansible devices", - "tags": [ - "Devices" - ] - }, - "post": { - "description": "Add a new device to Ansible inventory.", - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Device" - } - } - }, - "description": "Device definition", - "required": "true", - "x-body-name": "device" - }, - "responses": { - "200": { - "content": { - "application/json": { - "example": { - "name": "eos_host", - "variables": { - "ansible_connection": "network_cli", - "ansible_host": "192.168.32.79", - "ansible_network_os": "eos" - } - }, - "schema": { - "$ref": "#/components/schemas/Device" - } - } - }, - "description": "Returns device that was created." - }, - "409": { - "content": { - "application/json": { - "examples": { - "Duplicate": { - "$ref": "#/components/examples/Duplicate" - } - }, - "schema": { - "$ref": "#/components/schemas/Error" - } - } - }, - "description": "Duplicate Name Error" - } - }, - "summary": "Add a new device to Ansible inventory", - "tags": [ - "Devices" - ] - } - }, - "/devices/{device_name}": { - "delete": { - "description": "Delete a device from Ansible inventory.", - "parameters": [ - { - "description": "Name of device", - "in": "path", - "name": "device_name", - "required": "true", - "schema": { - "type": "string" - } - } - ], - "responses": { - "200": { - "content": { - "application/json": { - "examples": { - "Deleted": { - "$ref": "#/components/examples/Deleted" - } - }, - "schema": { - "$ref": "#/components/schemas/DeletedMessage" - } - } - }, - "description": "Message indicating device has been deleted." - } - }, - "summary": "Delete a device from Ansible inventory", - "tags": [ - "Devices" - ] - }, - "get": { - "description": "Get information for an Ansible device.", - "parameters": [ - { - "description": "Name of device", - "in": "path", - "name": "device_name", - "required": "true", - "schema": { - "type": "string" - } - }, - { - "description": "Return a list of this device name if device exists.", - "in": "query", - "name": "output", - "schema": { - "enum": [ - "list" - ], - "type": "string" - } - } - ], - "responses": { - "200": { - "content": { - "application/json": { - "example": { - "name": "eos_host", - "variables": { - "ansible_connection": "network_cli", - "ansible_host": "192.168.32.79", - "ansible_network_os": "eos" - } - }, - "schema": { - "$ref": "#/components/schemas/Device" - } - } - }, - "description": "Device information" - }, - "404": { - "content": { - "application/json": { - "examples": { - "NotFoundError": { - "$ref": "#/components/examples/NotFoundError" - } - }, - "schema": { - "$ref": "#/components/schemas/Error" - } - } - }, - "description": "Not Found Error" - } - }, - "summary": "Get information for an Ansible device", - "tags": [ - "Devices" - ] - }, - "patch": { - "description": "Merge the variables for a device in the Ansible inventory.", - "parameters": [ - { - "description": "Name of device", - "in": "path", - "name": "device_name", - "required": "true", - "schema": { - "type": "string" - } - } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/DeviceUpdateVariables" - } - } - }, - "description": "Device variables", - "required": "true", - "x-body-name": "device_variables" - }, - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Device" - } - } - }, - "description": "object with variables for device" - }, - "404": { - "content": { - "application/json": { - "examples": { - "NotFoundError": { - "$ref": "#/components/examples/NotFoundError" - } - }, - "schema": { - "$ref": "#/components/schemas/Error" - } - } - }, - "description": "Not Found Error" - } - }, - "summary": "Merge variables for a device in Ansible inventory", - "tags": [ - "Devices" - ] - }, - "put": { - "description": "Replace the variables for a device in the Ansible inventory.", - "parameters": [ - { - "description": "Name of device", - "in": "path", - "name": "device_name", - "required": "true", - "schema": { - "type": "string" - } - } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "type": "object" - } - } - }, - "description": "Device variables", - "required": "true", - "x-body-name": "device_variables" - }, - "responses": { - "200": { - "content": { - "application/json": { - "example": { - "name": "eos_host", - "variables": { - "ansible_connection": "network_cli", - "ansible_host": "192.168.32.79", - "ansible_network_os": "eos" - } - }, - "schema": { - "$ref": "#/components/schemas/Device" - } - } - }, - "description": "Device information" - }, - "404": { - "content": { - "application/json": { - "examples": { - "NotFoundError": { - "$ref": "#/components/examples/NotFoundError" - } - }, - "schema": { - "$ref": "#/components/schemas/Error" - } - } - }, - "description": "Not Found Error" - } - }, - "summary": "Replace variables for a device in Ansible inventory", - "tags": [ - "Devices" - ] - } - }, - "/devices/{device_name}/state": { - "get": { - "description": "Get the connectivity state for an Ansible device.", - "operationId": "automation_gateway.api_v2.devices.get_state", - "parameters": [ - { - "description": "Name of device", - "in": "path", - "name": "device_name", - "required": "true", - "schema": { - "type": "string" - } - } - ], - "responses": { - "200": { - "content": { - "application/json": { - "examples": { - "connected": { - "value": { - "connectivity": "true" - } - }, - "connection error": { - "value": { - "connectivity": "false", - "error": { - "msg": "Could not open socket to 192.168.32.99:830" - } - } - } - }, - "schema": { - "$ref": "#/components/schemas/Connection" - } - } - }, - "description": "Object with connectivity state for device" - }, - "404": { - "content": { - "application/json": { - "examples": { - "NotFoundError": { - "$ref": "#/components/examples/NotFoundError" - } - }, - "schema": { - "$ref": "#/components/schemas/Error" - } - } - }, - "description": "Not Found Error" - }, - "500": { - "content": { - "application/json": { - "examples": { - "ServerError": { - "$ref": "#/components/examples/ServerError" - } - }, - "schema": { - "$ref": "#/components/schemas/Error" - } - } - }, - "description": "Internal Error" - } - }, - "summary": "Get connectivity state for an Ansible device", - "tags": [ - "Devices" - ] - } - }, - "/devices/{device_name}/variables": { - "get": { - "description": "Get the connection variables for an Ansible device.", - "operationId": "automation_gateway.api_v2.devices.get_variables", - "parameters": [ - { - "description": "Name of device", - "in": "path", - "name": "device_name", - "required": "true", - "schema": { - "type": "string" - } - } - ], - "responses": { - "200": { - "content": { - "application/json": { - "example": { - "ansible_connection": "network_cli", - "ansible_host": "192.168.32.79", - "ansible_network_os": "eos" - }, - "schema": { - "type": "object" - } - } - }, - "description": "object with variables for device" - }, - "404": { - "content": { - "application/json": { - "examples": { - "NotFoundError": { - "$ref": "#/components/examples/NotFoundError" - } - }, - "schema": { - "$ref": "#/components/schemas/Error" - } - } - }, - "description": "Not Found Error" - } - }, - "summary": "Get variables for an Ansible device", - "tags": [ - "Devices" - ] - } - }, - "/devices/{device_name}/variables/{variable_name}": { - "get": { - "description": "Get the value of a connection variable for an Ansible device.", - "operationId": "automation_gateway.api_v2.devices.get_variable", - "parameters": [ - { - "description": "Name of device", - "in": "path", - "name": "device_name", - "required": "true", - "schema": { - "type": "string" - } - }, - { - "description": "Name of variable", - "in": "path", - "name": "variable_name", - "required": "true", - "schema": { - "type": "string" - } - } - ], - "responses": { - "200": { - "content": { - "text/plain": { - "example": "192.168.32.79", - "schema": { - "type": "string" - } - } - }, - "description": "requested variable" - }, - "404": { - "content": { - "application/json": { - "examples": { - "NotFoundError": { - "$ref": "#/components/examples/NotFoundError" - } - }, - "schema": { - "$ref": "#/components/schemas/Error" - } - } - }, - "description": "Not Found Error" - } - }, - "summary": "Get a variable for an Ansible device", - "tags": [ - "Devices" - ] - } - }, - "/exec_history/{audit_id}": { - "get": { - "description": "Get execution history payload.", - "parameters": [ - { - "description": "audit id of execution", - "in": "path", - "name": "audit_id", - "required": "true", - "schema": { - "type": "string" - } - } - ], - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "type": "object" - } - } - }, - "description": "execution log event payload" - }, - "404": { - "content": { - "application/json": { - "examples": { - "NotFoundError": { - "$ref": "#/components/examples/NotFoundError" - } - }, - "schema": { - "$ref": "#/components/schemas/Error" - } - } - }, - "description": "Not Found Error" - } - }, - "summary": "Get execution history payload", - "tags": [ - "System" - ] - } - }, - "/git/integration": { - "get": { - "description": "Get a list of git integrations.", - "operationId": "automation_gateway.git.view.search_integrations", - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "type": "array" - } - } - }, - "description": "List of git integrations." - } - }, - "summary": "Get a list of git integrations.", - "tags": [ - "Git" - ] - }, - "post": { - "description": "Create a new git integration.", - "operationId": "automation_gateway.git.view.create_integration", - "requestBody": { - "content": { - "application/json": { - "schema": { - "properties": { - "name": { - "pattern": "^[a-zA-Z0-9_\\-]*$", - "type": "string" - }, - "ssh_key_id": { - "type": "integer" - } - }, - "required": [ - "name", - "ssh_key_id" - ], - "type": "object" - } - } - }, - "x-body-name": "options" - }, - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "properties": { - "name": { - "type": "string" - }, - "ssh_key_id": { - "type": "integer" - } - }, - "type": "object" - } - } - }, - "description": "Created a new git integration." - } - }, - "summary": "Create a new git integration.", - "tags": [ - "Git" - ] - } - }, - "/git/integration/{id}": { - "delete": { - "description": "Delete a ssh integration.", - "operationId": "automation_gateway.git.view.delete_integration", - "parameters": [ - { - "description": "Git integration id", - "in": "path", - "name": "id", - "required": "true", - "schema": { - "type": "string" - } - } - ], - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "type": "string" - } - } - }, - "description": "Delete a git integration" - } - }, - "summary": "Delete a ssh integration.", - "tags": [ - "Git" - ] - }, - "get": { - "description": "Get information on a single git integration.", - "operationId": "automation_gateway.git.view.get_integration", - "parameters": [ - { - "description": "Git integration id", - "in": "path", - "name": "id", - "required": "true", - "schema": { - "type": "string" - } - } - ], - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "properties": { - "id": { - "type": "integer" - }, - "name": { - "type": "string" - }, - "ssh_key": { - "description": "name of the ssh key referenced by ssh_key_id", - "type": "string" - }, - "ssh_key_id": { - "type": "integer" - } - }, - "type": "object" - } - } - }, - "description": "Git integration" - } - }, - "summary": "Get information on a single git integration.", - "tags": [ - "Git" - ] - }, - "put": { - "description": "Update a git integration.", - "operationId": "automation_gateway.git.view.update_integration", - "parameters": [ - { - "description": "Git integration id", - "in": "path", - "name": "id", - "required": "true", - "schema": { - "type": "string" - } - } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "properties": { - "name": { - "type": "string" - }, - "ssh_key_id": { - "type": "integer" - } - }, - "required": [ - "name", - "ssh_key_id" - ], - "type": "object" - } - } - }, - "x-body-name": "options" - }, - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "properties": { - "name": { - "type": "string" - }, - "ssh_key_id": { - "type": "integer" - } - }, - "type": "object" - } - } - }, - "description": "Git integration" - } - }, - "summary": "Update a git integration.", - "tags": [ - "Git" - ] - } - }, - "/git/keys": { - "get": { - "description": "Get a list of git ssh keys.", - "operationId": "automation_gateway.git.view.search", - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "type": "array" - } - } - }, - "description": "List of SSH keys." - } - }, - "summary": "Get a list of git ssh keys.", - "tags": [ - "Git" - ] - }, - "post": { - "description": "Generate a new ssh key pair.", - "operationId": "automation_gateway.git.view.generate_ssh_key", - "requestBody": { - "content": { - "application/json": { - "schema": { - "properties": { - "name": { - "pattern": "^[a-zA-Z0-9_\\-]*$", - "type": "string" - } - }, - "required": [ - "name" - ], - "type": "object" - } - } - }, - "x-body-name": "options" - }, - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "properties": { - "fingerprint": { - "type": "string" - }, - "id": { - "type": "number" - }, - "name": { - "type": "string" - }, - "path": { - "description": "Local path to ssh key directory.", - "type": "string" - }, - "public_key": { - "description": "The RSA public key.", - "type": "string" - }, - "uuid": { - "description": "uuid for the ssh key", - "type": "string" - } - }, - "type": "object" - } - } - }, - "description": "Generated new ssh key pair." - } - }, - "summary": "Generate a new ssh key pair.", - "tags": [ - "Git" - ] - }, - "put": { - "description": "Upload an ssh key pair.", - "operationId": "automation_gateway.git.view.upload_ssh_key", - "requestBody": { - "content": { - "application/json": { - "schema": { - "properties": { - "name": { - "pattern": "^[a-zA-Z0-9_\\-]*$", - "type": "string" - }, - "private_key": { - "type": "string" - } - }, - "required": [ - "name", - "private_key" - ], - "type": "object" - } - } - }, - "x-body-name": "options" - }, - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "properties": { - "fingerprint": { - "type": "string" - }, - "id": { - "type": "number" - }, - "name": { - "type": "string" - }, - "path": { - "description": "Local path to ssh key directory.", - "type": "string" - }, - "public_key": { - "description": "The RSA public key.", - "type": "string" - }, - "uuid": { - "description": "uuid for the ssh key", - "type": "string" - } - }, - "type": "object" - } - } - }, - "description": "Uploaded ssh key pair." - } - }, - "summary": "Upload an ssh key pair.", - "tags": [ - "Git" - ] - } - }, - "/git/keys/{id}": { - "delete": { - "description": "Delete an ssh key pair.", - "operationId": "automation_gateway.git.view.delete_ssh_key", - "parameters": [ - { - "description": "SSH key id", - "in": "path", - "name": "id", - "required": "true", - "schema": { - "type": "string" - } - } - ], - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "type": "string" - } - } - }, - "description": "Delete an SSH key pair." - } - }, - "summary": "Delete an ssh key pair.", - "tags": [ - "Git" - ] - }, - "get": { - "description": "Get information on an ssh key based on id.", - "operationId": "automation_gateway.git.view.get", - "parameters": [ - { - "description": "SSH key id", - "in": "path", - "name": "id", - "required": "true", - "schema": { - "type": "string" - } - } - ], - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "properties": { - "fingerprint": { - "type": "string" - }, - "id": { - "type": "number" - }, - "name": { - "type": "string" - }, - "path": { - "description": "Local path to ssh key directory.", - "type": "string" - }, - "public_key": { - "description": "The RSA public key.", - "type": "string" - }, - "uuid": { - "description": "uuid for the ssh key", - "type": "string" - } - }, - "type": "object" - } - } - }, - "description": "SSH key." - } - }, - "summary": "Get information on an ssh key based on id.", - "tags": [ - "Git" - ] - }, - "patch": { - "description": "Update an ssh key.", - "operationId": "automation_gateway.git.view.update_ssh_key", - "parameters": [ - { - "description": "Git ssh key id", - "in": "path", - "name": "id", - "required": "true", - "schema": { - "type": "string" - } - } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "properties": { - "name": { - "pattern": "^[a-zA-Z0-9_\\-]*$", - "type": "string" - } - }, - "required": [ - "name" - ], - "type": "object" - } - } - }, - "x-body-name": "options" - }, - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "properties": { - "fingerprint": { - "type": "string" - }, - "id": { - "type": "number" - }, - "name": { - "type": "string" - }, - "path": { - "description": "Local path to ssh key directory.", - "type": "string" - }, - "public_key": { - "description": "The RSA public key.", - "type": "string" - }, - "uuid": { - "description": "uuid for the ssh key", - "type": "string" - } - }, - "type": "object" - } - } - }, - "description": "SSH key." - } - }, - "summary": "Update an ssh key.", - "tags": [ - "Git" - ] - } - }, - "/git/repository": { - "get": { - "description": "Get a list of git repositories.", - "operationId": "automation_gateway.git.view.search_repo", - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "type": "array" - } - } - }, - "description": "List of git integrations." - } - }, - "summary": "Get a list of git repositories.", - "tags": [ - "Git" - ] - }, - "post": { - "description": "Create a new git integration.", - "operationId": "automation_gateway.git.view.create_repo", - "requestBody": { - "content": { - "application/json": { - "schema": { - "properties": { - "branch": { - "type": "string" - }, - "integration_id": { - "type": "integer" - }, - "name": { - "pattern": "^[a-zA-Z0-9_\\-]*$", - "type": "string" - }, - "path": { - "description": "The full local path to the destination folder.", - "type": "string" - }, - "repository": { - "type": "string" - } - }, - "required": [ - "name", - "path", - "repository" - ], - "type": "object" - } - } - }, - "x-body-name": "options" - }, - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "properties": { - "branch": { - "type": "string" - }, - "integration_id": { - "type": "integer" - }, - "name": { - "type": "string" - }, - "path": { - "description": "The full local path to the destination folder.", - "type": "string" - }, - "repository": { - "type": "string" - } - }, - "type": "object" - } - } - }, - "description": "Created a new git repository." - } - }, - "summary": "Create a new git repository.", - "tags": [ - "Git" - ] - } - }, - "/git/repository/{id}": { - "delete": { - "description": "Delete a git repository.", - "operationId": "automation_gateway.git.view.delete_repo", - "parameters": [ - { - "description": "Git repository id", - "in": "path", - "name": "id", - "required": "true", - "schema": { - "type": "string" - } - } - ], - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "type": "string" - } - } - }, - "description": "Deleted a git repository." - } - }, - "summary": "Delete a git repository.", - "tags": [ - "Git" - ] - }, - "get": { - "description": "Get information on a single git integration.", - "operationId": "automation_gateway.git.view.get_repo", - "parameters": [ - { - "description": "Git repository id", - "in": "path", - "name": "id", - "required": "true", - "schema": { - "type": "string" - } - } - ], - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "properties": { - "branch": { - "type": "string" - }, - "integration_id": { - "type": "integer" - }, - "name": { - "type": "string" - }, - "path": { - "description": "The full local path to the destination folder.", - "type": "string" - }, - "repository": { - "type": "string" - } - }, - "type": "object" - } - } - }, - "description": "Git repository" - } - }, - "summary": "Get information on a single git integration.", - "tags": [ - "Git" - ] - }, - "put": { - "description": "Update a git repository.", - "operationId": "automation_gateway.git.view.update_repo", - "parameters": [ - { - "description": "Git repository id", - "in": "path", - "name": "id", - "required": "true", - "schema": { - "type": "string" - } - } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "properties": { - "branch": { - "type": "string" - }, - "integration_id": { - "type": "integer" - }, - "name": { - "type": "string" - }, - "path": { - "description": "The full local path to the destination folder.", - "type": "string" - }, - "repository": { - "type": "string" - } - }, - "required": [ - "name", - "path", - "repository" - ], - "type": "object" - } - } - }, - "x-body-name": "options" - }, - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "properties": { - "branch": { - "type": "string" - }, - "integration_id": { - "type": "integer" - }, - "name": { - "type": "string" - }, - "path": { - "description": "The full local path to the destination folder.", - "type": "string" - }, - "repository": { - "type": "string" - } - }, - "type": "object" - } - } - }, - "description": "Git repository" - } - }, - "summary": "Update a git repository.", - "tags": [ - "Git" - ] - } - }, - "/git/repository/{id}/pull": { - "get": { - "description": "Perform a git pull inside the repository.", - "operationId": "automation_gateway.git.view.pull_repo", - "parameters": [ - { - "description": "Git repository id", - "in": "path", - "name": "id", - "required": "true", - "schema": { - "type": "string" - } - } - ], - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "type": "string" - } - } - }, - "description": "Output from `git pull`" - } - }, - "summary": "Perform a git pull inside the repository.", - "tags": [ - "Git" - ] - } - }, - "/git/repository/{id}/reset": { - "get": { - "description": "Reset the current repository discarding any local changes.", - "operationId": "automation_gateway.git.view.reset_repo", - "parameters": [ - { - "description": "Git repository id", - "in": "path", - "name": "id", - "required": "true", - "schema": { - "type": "string" - } - } - ], - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "type": "string" - } - } - }, - "description": "The result of the `git reset --hard HEAD` command." - } - }, - "summary": "Reset the current repository discarding any local changes.", - "tags": [ - "Git" - ] - } - }, - "/git/repository/{id}/reset_ssh_key": { - "get": { - "description": "Readd SSH key for the remote host to known_hosts.", - "operationId": "automation_gateway.git.view.reset_repo_remote_key", - "parameters": [ - { - "description": "Git repository id", - "in": "path", - "name": "id", - "required": "true", - "schema": { - "type": "string" - } - } - ], - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "type": "string" - } - } - }, - "description": "Delete and re-add ssh remote key to known_hosts." - } - }, - "summary": "Readd SSH key for the remote host to known_hosts.", - "tags": [ - "Git" - ] - } - }, - "/git/repository/{id}/status": { - "get": { - "description": "Get the `git status` output for an repo.", - "operationId": "automation_gateway.git.view.status_repo", - "parameters": [ - { - "description": "Git repository id", - "in": "path", - "name": "id", - "required": "true", - "schema": { - "type": "string" - } - } - ], - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "type": "array" - } - } - }, - "description": "List of git integrations." - } - }, - "summary": "Get the `git status` output for an repo.", - "tags": [ - "Git" - ] - } - }, - "/gnmi/get/execute": { - "post": { - "description": "Send a gNMI get command for the list of provided paths.", - "operationId": "automation_gateway.api_v2.gnmi.get_gnmi", - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/grpcGetParameters" - } - } - }, - "required": "true", - "x-body-name": "options" - }, - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "type": "object" - } - } - }, - "description": "gNMI response." - } - }, - "summary": "Send a gNMI get command for the list of provided paths.", - "tags": [ - "gNMI" - ] - } - }, - "/gnmi/set/execute": { - "post": { - "description": "Send a gNMI set command for updates, deletes and replaces.", - "operationId": "automation_gateway.api_v2.gnmi.set_gnmi", - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/grpcSetParameters" - } - } - }, - "required": "true", - "x-body-name": "options" - }, - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "type": "object" - } - } - }, - "description": "gNMI response." - } - }, - "summary": "Send a gNMI set command for updates, deletes and replaces.", - "tags": [ - "gNMI" - ] - } - }, - "/gnmi/{gnmi_command}/history": { - "get": { - "description": "Get gNMI execution log events.", - "operationId": "automation_gateway.api_v2.gnmi.get_execution_log", - "parameters": [ - { - "description": "Name of gnmi command", - "in": "path", - "name": "gnmi_command", - "required": "true", - "schema": { - "enum": [ - "set", - "get" - ], - "type": "string" - } - }, - { - "description": "The number of items to skip before starting to collect the result set", - "in": "query", - "name": "offset", - "schema": { - "type": "integer" - } - }, - { - "description": "The number of items to return", - "in": "query", - "name": "limit", - "schema": { - "type": "integer" - } - }, - { - "description": "Most recent execution on top of returned results unless user specifies ascending", - "in": "query", - "name": "order", - "schema": { - "default": "descending", - "enum": [ - "ascending", - "descending" - ], - "type": "string" - } - } - ], - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "type": "object" - } - } - }, - "description": "gNMI command execution log events response" - }, - "400": { - "content": { - "application/json": { - "examples": { - "BadParameter": { - "$ref": "#/components/examples/BadParameter" - }, - "MissingParameter": { - "$ref": "#/components/examples/MissingParameter" - } - }, - "schema": { - "$ref": "#/components/schemas/Error" - } - } - }, - "description": "Bad Request Error" - }, - "404": { - "content": { - "application/json": { - "examples": { - "NotFoundError": { - "$ref": "#/components/examples/NotFoundError" - } - }, - "schema": { - "$ref": "#/components/schemas/Error" - } - } - }, - "description": "Not Found Error" - }, - "500": { - "content": { - "application/json": { - "examples": { - "ServerError": { - "$ref": "#/components/examples/ServerError" - } - }, - "schema": { - "$ref": "#/components/schemas/Error" - } - } - }, - "description": "Internal Error" - } - }, - "summary": "Get gNMI execution log events.", - "tags": [ - "gNMI" - ] - } - }, - "/gnoi/cancel_reboot/execute": { - "post": { - "description": "Cancel a pending reboot.", - "operationId": "automation_gateway.api_v2.gnoi.cancel_reboot", - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/grpcCancelRebootParameters" - } - } - }, - "required": "true", - "x-body-name": "options" - }, - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "type": "object" - } - } - }, - "description": "gNOI response." - } - }, - "summary": "Send a cancel reboot message over gRPC gNOI to a device and return the results.", - "tags": [ - "gNOI" - ] - } - }, - "/gnoi/clear_bgp_neighbor/execute": { - "post": { - "description": "Clear a BGP neighbor using mode 0:SOFT, 1:SOFTIN, 2:HARD.", - "operationId": "automation_gateway.api_v2.gnoi.clear_bgp_neighbor", - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/grpcClearBGPNeighborParameters" - } - } - }, - "required": "true", - "x-body-name": "options" - }, - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "type": "object" - } - } - }, - "description": "gNOI response." - } - }, - "summary": "Send a clear BGP neighbor message over gRPC gNOI.", - "tags": [ - "gNOI" - ] - } - }, - "/gnoi/clear_interface_counters/execute": { - "post": { - "description": "Clear interface counters.", - "operationId": "automation_gateway.api_v2.gnoi.clear_interface_counters", - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/grpcDeviceInterfaceParameters" - } - } - }, - "required": "true", - "x-body-name": "options" - }, - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "type": "object" - } - } - }, - "description": "gNOI response." - } - }, - "summary": "Send a clear interface counters gRPC message.", - "tags": [ - "gNOI" - ] - } - }, - "/gnoi/clear_lldp_interface/execute": { - "post": { - "description": "Clear an LLDP interface.", - "operationId": "automation_gateway.api_v2.gnoi.clear_lldp_interface", - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/grpcClearLLDPParameters" - } - } - }, - "required": "true", - "x-body-name": "options" - }, - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "type": "object" - } - } - }, - "description": "gNOI response." - } - }, - "summary": "Send a clear LLDP interface message over gRPC gNOI.", - "tags": [ - "gNOI" - ] - } - }, - "/gnoi/clear_neighbor_discovery/execute": { - "post": { - "description": "Clear neighbor discovery.", - "operationId": "automation_gateway.api_v2.gnoi.clear_neighbor_discovery", - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/grpcNeighborDiscoveryParameters" - } - } - }, - "required": "true", - "x-body-name": "options" - }, - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "type": "object" - } - } - }, - "description": "gNOI response." - } - }, - "summary": "Send a clear neighbor discovery gRPC message.", - "tags": [ - "gNOI" - ] - } - }, - "/gnoi/clear_spanning_tree/execute": { - "post": { - "description": "Clear spanning tree.", - "operationId": "automation_gateway.api_v2.gnoi.clear_spanning_tree", - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/grpcClearSTPParameters" - } - } - }, - "required": "true", - "x-body-name": "options" - }, - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "type": "object" - } - } - }, - "description": "gNOI response." - } - }, - "summary": "Send a clear spanning-tree gRPC message.", - "tags": [ - "gNOI" - ] - } - }, - "/gnoi/ping/execute": { - "post": { - "description": "Ping a device.", - "operationId": "automation_gateway.api_v2.gnoi.ping", - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/grpcPingParameters" - } - } - }, - "required": "true", - "x-body-name": "options" - }, - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "type": "object" - } - } - }, - "description": "gNOI response." - } - }, - "summary": "Send a ping command over gRPC gNOI to a device and return the results.", - "tags": [ - "gNOI" - ] - } - }, - "/gnoi/reboot/execute": { - "post": { - "description": "Reboot a device.", - "operationId": "automation_gateway.api_v2.gnoi.reboot", - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/grpcRebootParameters" - } - } - }, - "required": "true", - "x-body-name": "options" - }, - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "type": "object" - } - } - }, - "description": "gNOI response." - } - }, - "summary": "Send a reboot command over gRPC gNOI to a device and return the results.", - "tags": [ - "gNOI" - ] - } - }, - "/gnoi/reboot_status/execute": { - "post": { - "description": "Get the status of a reboot.", - "operationId": "automation_gateway.api_v2.gnoi.reboot_status", - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/grpcRebootStatusParameters" - } - } - }, - "required": "true", - "x-body-name": "options" - }, - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "type": "object" - } - } - }, - "description": "gNOI response." - } - }, - "summary": "Send a reboot status command over gRPC gNOI to a device and return the results.", - "tags": [ - "gNOI" - ] - } - }, - "/gnoi/set_package/execute": { - "post": { - "description": "Set the system package.", - "operationId": "automation_gateway.api_v2.gnoi.set_package", - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/grpcSetPackageParameters" - } - } - }, - "required": "true", - "x-body-name": "options" - }, - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "type": "object" - } - } - }, - "description": "gNOI response." - } - }, - "summary": "Send a set package command over gRPC gNOI to a device and return the results.", - "tags": [ - "gNOI" - ] - } - }, - "/gnoi/switch_cpu/execute": { - "post": { - "description": "Switch the active control processor unit.", - "operationId": "automation_gateway.api_v2.gnoi.switch_control_processor", - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/grpcSwitchCPUParameters" - } - } - }, - "required": "true", - "x-body-name": "options" - }, - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "type": "object" - } - } - }, - "description": "gNOI response." - } - }, - "summary": "Switch the active control processor unit.", - "tags": [ - "gNOI" - ] - } - }, - "/gnoi/time/execute": { - "post": { - "description": "Get the system time.", - "operationId": "automation_gateway.api_v2.gnoi.time", - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/grpcTimeParameters" - } - } - }, - "required": "true", - "x-body-name": "options" - }, - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "type": "object" - } - } - }, - "description": "gNOI response." - } - }, - "summary": "Send a time command over gRPC gNOI to a device and return the results.", - "tags": [ - "gNOI" - ] - } - }, - "/gnoi/traceroute/execute": { - "post": { - "description": "Send a traceroute command.", - "operationId": "automation_gateway.api_v2.gnoi.traceroute", - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/grpcTracerouteParameters" - } - } - }, - "required": "true", - "x-body-name": "options" - }, - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "type": "object" - } - } - }, - "description": "gNOI response." - } - }, - "summary": "Send a traceroute command over gRPC gNOI to a device and return the results.", - "tags": [ - "gNOI" - ] - } - }, - "/gnoi/wake_on_lan/execute": { - "post": { - "description": "Send Wake-on-LAN", - "operationId": "automation_gateway.api_v2.gnoi.wake_on_lan", - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/grpcWakeOnLANParameters" - } - } - }, - "required": "true", - "x-body-name": "options" - }, - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "type": "object" - } - } - }, - "description": "gNOI response." - } - }, - "summary": "Send a Wake-on-LAN gRPC message.", - "tags": [ - "gNOI" - ] - } - }, - "/gnoi/{gnoi_command}/history": { - "get": { - "description": "Get gNOI execution log events.", - "operationId": "automation_gateway.api_v2.gnoi.get_execution_log", - "parameters": [ - { - "description": "Name of gnoi command", - "in": "path", - "name": "gnoi_command", - "required": "true", - "schema": { - "enum": [ - "ping", - "time", - "switch_cpu", - "traceroute", - "reboot", - "cancel_reboot", - "reboot_status", - "set_package", - "clear_lldp_interface", - "clear_bgp_neighbor", - "clear_interface_counters", - "clear_neighbor_discovery", - "clear_spanning_tree", - "wake_on_lan" - ], - "type": "string" - } - }, - { - "description": "The number of items to skip before starting to collect the result set", - "in": "query", - "name": "offset", - "schema": { - "type": "integer" - } - }, - { - "description": "The number of items to return", - "in": "query", - "name": "limit", - "schema": { - "type": "integer" - } - }, - { - "description": "Most recent execution on top of returned results unless user specifies ascending", - "in": "query", - "name": "order", - "schema": { - "default": "descending", - "enum": [ - "ascending", - "descending" - ], - "type": "string" - } - } - ], - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "type": "object" - } - } - }, - "description": "gNOI command execution log events response" - }, - "400": { - "content": { - "application/json": { - "examples": { - "BadParameter": { - "$ref": "#/components/examples/BadParameter" - }, - "MissingParameter": { - "$ref": "#/components/examples/MissingParameter" - } - }, - "schema": { - "$ref": "#/components/schemas/Error" - } - } - }, - "description": "Bad Request Error" - }, - "404": { - "content": { - "application/json": { - "examples": { - "NotFoundError": { - "$ref": "#/components/examples/NotFoundError" - } - }, - "schema": { - "$ref": "#/components/schemas/Error" - } - } - }, - "description": "Not Found Error" - }, - "500": { - "content": { - "application/json": { - "examples": { - "ServerError": { - "$ref": "#/components/examples/ServerError" - } - }, - "schema": { - "$ref": "#/components/schemas/Error" - } - } - }, - "description": "Internal Error" - } - }, - "summary": "Get gNOI execution log events.", - "tags": [ - "gNOI" - ] - } - }, - "/groups": { - "get": { - "description": "Get a list of Ansible device groups.", - "parameters": [ - { - "description": "The number of items to skip before starting to collect the result set", - "in": "query", - "name": "offset", - "schema": { - "type": "integer" - } - }, - { - "description": "The number of items to return", - "in": "query", - "name": "limit", - "schema": { - "type": "integer" - } - }, - { - "description": "Response filter function with JSON name/value pair argument, i.e., contains({\"name\":\"atlanta\"})\nValid filter functions - contains, equals, startswith, endswith\n", - "in": "query", - "name": "filter", - "schema": { - "type": "string" - } - }, - { - "description": "Ascending/Descending sort indication", - "in": "query", - "name": "order", - "schema": { - "default": "ascending", - "enum": [ - "ascending", - "descending" - ], - "type": "string" - } - } - ], - "responses": { - "200": { - "content": { - "application/json": { - "example": { - "data": [ - { - "childGroups": [ - "atlanta", - "concord" - ], - "devices": [ - "router_host1", - "router_host2" - ], - "name": "routers", - "variables": { - "ntp_server": "ntp.atlanta.example.com" - } - }, - { - "devices": [ - "vpn_host1", - "vpn_host2" - ], - "name": "vpns", - "variables": { - "proxy": "proxy.example.com" - } - } - ], - "meta": { - "count": "2", - "queryObject": { - "filter": {}, - "order": "ascending" - } - } - }, - "schema": { - "properties": { - "data": { - "items": { - "$ref": "#/components/schemas/Group" - }, - "type": "array" - }, - "meta": { - "$ref": "#/components/schemas/Meta" - } - }, - "required": [ - "data", - "meta" - ], - "type": "object" - } - } - }, - "description": "get groups response" - }, - "400": { - "content": { - "application/json": { - "example": { - "code": "400", - "message": "Invalid JSON in group filter" - }, - "schema": { - "type": "object" - } - } - }, - "description": "Bad Request Error" - } - }, - "summary": "Get list of Ansible device groups", - "tags": [ - "Groups" - ] - }, - "post": { - "description": "Add a new Ansible device group.", - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Group" - } - } - }, - "description": "Group definition.", - "required": "true", - "x-body-name": "group" - }, - "responses": { - "200": { - "content": { - "application/json": { - "example": { - "childGroups": [ - "atlanta", - "concord" - ], - "devices": [ - "router_host1", - "router_host2" - ], - "name": "routers", - "variables": { - "ntp_server": "ntp.atlanta.example.com" - } - }, - "schema": { - "$ref": "#/components/schemas/Group" - } - } - }, - "description": "Returns group that was created." - }, - "409": { - "content": { - "application/json": { - "examples": { - "Duplicate": { - "$ref": "#/components/examples/Duplicate" - }, - "InvalidDevice": { - "value": { - "code": "409", - "message": "Unable to find devices: sample1, sample2" - } - }, - "InvalidGroup": { - "$ref": "#/components/examples/InvalidGroup" - } - }, - "schema": { - "type": "object" - } - } - }, - "description": "Duplicate Name Error (resource with same name already exists)" - } - }, - "summary": "Add a new Ansible device group", - "tags": [ - "Groups" - ] - } - }, - "/groups/{group_name}": { - "delete": { - "description": "Delete an Ansible device group.", - "parameters": [ - { - "description": "Name of group", - "in": "path", - "name": "group_name", - "required": "true", - "schema": { - "type": "string" - } - } - ], - "responses": { - "200": { - "content": { - "application/json": { - "examples": { - "Deleted": { - "$ref": "#/components/examples/Deleted" - } - }, - "schema": { - "$ref": "#/components/schemas/DeletedMessage" - } - } - }, - "description": "Message indicating group has been deleted." - } - }, - "summary": "Delete an Ansible device group", - "tags": [ - "Groups" - ] - }, - "get": { - "description": "Get information for an Ansible device group.", - "parameters": [ - { - "description": "Name of group", - "in": "path", - "name": "group_name", - "required": "true", - "schema": { - "type": "string" - } - } - ], - "responses": { - "200": { - "content": { - "application/json": { - "example": { - "childGroups": [ - "atlanta", - "concord" - ], - "devices": [ - "router_host1", - "router_host2" - ], - "name": "routers", - "variables": { - "ntp_server": "ntp.atlanta.example.com" - } - }, - "schema": { - "$ref": "#/components/schemas/Group" - } - } - }, - "description": "Group information" - }, - "404": { - "content": { - "application/json": { - "examples": { - "NotFoundError": { - "$ref": "#/components/examples/NotFoundError" - } - }, - "schema": { - "$ref": "#/components/schemas/Error" - } - } - }, - "description": "Not Found Error" - } - }, - "summary": "Get an Ansible device group", - "tags": [ - "Groups" - ] - }, - "put": { - "description": "Update the variables in an Ansbile device group.", - "parameters": [ - { - "description": "Name of group", - "in": "path", - "name": "group_name", - "required": "true", - "schema": { - "type": "string" - } - } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "type": "object" - } - } - }, - "description": "Group variables", - "required": "true", - "x-body-name": "group_variables" - }, - "responses": { - "200": { - "content": { - "application/json": { - "example": { - "name": "routers", - "variables": { - "ntp_server": "ntp.atlanta.example.com", - "proxy": "proxy.example.com" - } - }, - "schema": { - "$ref": "#/components/schemas/Group" - } - } - }, - "description": "Group information" - }, - "404": { - "content": { - "application/json": { - "examples": { - "NotFoundError": { - "$ref": "#/components/examples/NotFoundError" - } - }, - "schema": { - "$ref": "#/components/schemas/Error" - } - } - }, - "description": "Not Found Error" - } - }, - "summary": "Update variables in an Ansible device group", - "tags": [ - "Groups" - ] - } - }, - "/groups/{group_name}/children": { - "get": { - "description": "Get a list of child groups for an Ansible device group.", - "operationId": "automation_gateway.api_v2.groups.get_children", - "parameters": [ - { - "description": "Name of group", - "in": "path", - "name": "group_name", - "required": "true", - "schema": { - "type": "string" - } - } - ], - "responses": { - "200": { - "content": { - "application/json": { - "example": [ - "atlanta", - "concord" - ], - "schema": { - "items": { - "type": "string" - }, - "type": "array" - } - } - }, - "description": "List with child groups for group" - }, - "404": { - "content": { - "application/json": { - "examples": { - "NotFoundError": { - "$ref": "#/components/examples/NotFoundError" - } - }, - "schema": { - "$ref": "#/components/schemas/Error" - } - } - }, - "description": "Not Found Error" - } - }, - "summary": "Get child groups for an Ansible device group", - "tags": [ - "Groups" - ] - }, - "post": { - "description": "Add new child groups to an Ansible device group.", - "operationId": "automation_gateway.api_v2.groups.add_children", - "parameters": [ - { - "description": "Name of group", - "in": "path", - "name": "group_name", - "required": "true", - "schema": { - "type": "string" - } - } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/GroupChildren" - } - } - }, - "description": "Child Group List.", - "required": "true", - "x-body-name": "children" - }, - "responses": { - "200": { - "content": { - "application/json": { - "example": [ - "atlanta", - "concord" - ], - "schema": { - "$ref": "#/components/schemas/GroupChildren" - } - } - }, - "description": "Returns child grups added." - }, - "409": { - "content": { - "application/json": { - "examples": { - "Duplicate": { - "$ref": "#/components/examples/Duplicate" - }, - "InvalidGroup": { - "$ref": "#/components/examples/InvalidGroup" - } - }, - "schema": { - "type": "object" - } - } - }, - "description": "Duplicate Name Error (resource with same name already exists)" - } - }, - "summary": "Add new child groups to an Ansible device group", - "tags": [ - "Groups" - ] - } - }, - "/groups/{group_name}/children/{child_group}": { - "delete": { - "description": "Delete a child group from an Ansible device group.", - "operationId": "automation_gateway.api_v2.groups.delete_child", - "parameters": [ - { - "description": "Name of group.", - "in": "path", - "name": "group_name", - "required": "true", - "schema": { - "type": "string" - } - }, - { - "description": "Name of child group to delete.", - "in": "path", - "name": "child_group", - "required": "true", - "schema": { - "type": "string" - } - } - ], - "responses": { - "200": { - "content": { - "application/json": { - "examples": { - "Deleted": { - "$ref": "#/components/examples/Deleted" - } - }, - "schema": { - "$ref": "#/components/schemas/DeletedMessage" - } - } - }, - "description": "Message indicating child group is no longer in the group." - }, - "404": { - "content": { - "application/json": { - "examples": { - "NotFoundError": { - "$ref": "#/components/examples/NotFoundError" - } - }, - "schema": { - "$ref": "#/components/schemas/Error" - } - } - }, - "description": "Not Found Error returned when parent group is not found" - } - }, - "summary": "Delete a child group from an Ansible device group", - "tags": [ - "Groups" - ] - } - }, - "/groups/{group_name}/devices": { - "get": { - "description": "Get the devices for an Ansible device group.", - "operationId": "automation_gateway.api_v2.groups.get_devices", - "parameters": [ - { - "description": "Name of group", - "in": "path", - "name": "group_name", - "required": "true", - "schema": { - "type": "string" - } - } - ], - "responses": { - "200": { - "content": { - "application/json": { - "example": [ - "router_host1", - "router_host2", - "router_host3" - ], - "schema": { - "items": { - "type": "string" - }, - "type": "array" - } - } - }, - "description": "List with devices for group" - }, - "404": { - "content": { - "application/json": { - "examples": { - "NotFoundError": { - "$ref": "#/components/examples/NotFoundError" - } - }, - "schema": { - "$ref": "#/components/schemas/Error" - } - } - }, - "description": "Not Found Error" - } - }, - "summary": "Get devices for an Ansible device group", - "tags": [ - "Groups" - ] - }, - "post": { - "description": "Add new devices to an Ansible device group.", - "operationId": "automation_gateway.api_v2.groups.add_devices", - "parameters": [ - { - "description": "Name of group", - "in": "path", - "name": "group_name", - "required": "true", - "schema": { - "type": "string" - } - } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/GroupDevices" - } - } - }, - "description": "Device List.", - "required": "true", - "x-body-name": "devices" - }, - "responses": { - "200": { - "content": { - "application/json": { - "example": [ - "router_host1", - "router_host2" - ], - "schema": { - "$ref": "#/components/schemas/GroupDevices" - } - } - }, - "description": "Returns devices added." - }, - "409": { - "content": { - "application/json": { - "examples": { - "Duplicate": { - "$ref": "#/components/examples/Duplicate" - }, - "InvalidGroup": { - "$ref": "#/components/examples/InvalidGroup" - } - }, - "schema": { - "type": "object" - } - } - }, - "description": "Conflict" - } - }, - "summary": "Add new devices to an Ansible device group", - "tags": [ - "Groups" - ] - } - }, - "/groups/{group_name}/devices/{device_name}": { - "delete": { - "description": "Delete a device from an Ansible device group.", - "operationId": "automation_gateway.api_v2.groups.delete_device", - "parameters": [ - { - "description": "Name of group", - "in": "path", - "name": "group_name", - "required": "true", - "schema": { - "type": "string" - } - }, - { - "description": "Name of device", - "in": "path", - "name": "device_name", - "required": "true", - "schema": { - "type": "string" - } - } - ], - "responses": { - "200": { - "content": { - "application/json": { - "examples": { - "Deleted": { - "$ref": "#/components/examples/Deleted" - } - }, - "schema": { - "$ref": "#/components/schemas/DeletedMessage" - } - } - }, - "description": "Message indicating device has been deleted from group." - }, - "404": { - "content": { - "application/json": { - "examples": { - "NotFoundError": { - "$ref": "#/components/examples/NotFoundError" - } - }, - "schema": { - "$ref": "#/components/schemas/Error" - } - } - }, - "description": "Not Found Error" - } - }, - "summary": "Delete a device from an Ansible device group", - "tags": [ - "Groups" - ] - } - }, - "/groups/{group_name}/variables": { - "get": { - "description": "Get the variables for an Ansible device group.", - "operationId": "automation_gateway.api_v2.groups.get_variables", - "parameters": [ - { - "description": "Name of group", - "in": "path", - "name": "group_name", - "required": "true", - "schema": { - "type": "string" - } - } - ], - "responses": { - "200": { - "content": { - "application/json": { - "example": { - "ntp_server": "ntp.atlanta.example.com", - "proxy": "proxy.example.com" - }, - "schema": { - "type": "object" - } - } - }, - "description": "object with variables for group" - }, - "404": { - "content": { - "application/json": { - "examples": { - "NotFoundError": { - "$ref": "#/components/examples/NotFoundError" - } - }, - "schema": { - "$ref": "#/components/schemas/Error" - } - } - }, - "description": "Not Found Error" - } - }, - "summary": "Get variables for an Ansible device group", - "tags": [ - "Groups" - ] - } - }, - "/groups/{group_name}/variables/{variable_name}": { - "get": { - "description": "Get the contents of a variable for an Ansible device group.", - "operationId": "automation_gateway.api_v2.groups.get_variable", - "parameters": [ - { - "description": "Name of group", - "in": "path", - "name": "group_name", - "required": "true", - "schema": { - "type": "string" - } - }, - { - "description": "Name of variable", - "in": "path", - "name": "variable_name", - "required": "true", - "schema": { - "type": "string" - } - } - ], - "responses": { - "200": { - "content": { - "text/plain": { - "example": "ntp.atlanta.example.com", - "schema": { - "type": "string" - } - } - }, - "description": "requested variable" - }, - "404": { - "content": { - "application/json": { - "examples": { - "NotFoundError": { - "$ref": "#/components/examples/NotFoundError" - } - }, - "schema": { - "$ref": "#/components/schemas/Error" - } - } - }, - "description": "Not Found Error" - } - }, - "summary": "Get a variable for an Ansible device group", - "tags": [ - "Groups" - ] - } - }, - "/http_requests/request/execute": { - "post": { - "description": "Send an HTTP/1.1 request to an inventory device.", - "operationId": "automation_gateway.api_v2.http_requests.request_execute_post", - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HttpRequestsPostBodyData" - } - } - }, - "description": "Parameters required to send your request.\nSee the Requests library for all other supported parameters:\nhttps://docs.python-requests.org/en/latest/api/\n", - "required": "true", - "x-body-name": "data" - }, - "responses": { - "200": { - "content": { - "application/json": { - "example": { - "code": "200", - "message": "This is an example of a text response string.", - "status": "SUCCESS" - }, - "schema": { - "$ref": "#/components/schemas/GenericExecutionSuccessBody" - } - } - }, - "description": "Successful Requests Response" - }, - "400": { - "content": { - "application/json": { - "examples": { - "BadParameter": { - "$ref": "#/components/examples/BadParameter" - }, - "MissingParameter": { - "$ref": "#/components/examples/MissingParameter" - } - }, - "schema": { - "$ref": "#/components/schemas/Error" - } - } - }, - "description": "Bad Request Error" - }, - "401": { - "content": { - "application/json": { - "examples": { - "AuthenticationError": { - "$ref": "#/components/examples/AuthenticationError" - } - }, - "schema": { - "$ref": "#/components/schemas/Error" - } - } - }, - "description": "Authentication Error" - }, - "404": { - "content": { - "application/json": { - "examples": { - "NotFoundError": { - "$ref": "#/components/examples/NotFoundError" - } - }, - "schema": { - "$ref": "#/components/schemas/Error" - } - } - }, - "description": "Not Found Error" - }, - "500": { - "content": { - "application/json": { - "examples": { - "ServerError": { - "$ref": "#/components/examples/ServerError" - } - }, - "schema": { - "$ref": "#/components/schemas/Error" - } - } - }, - "description": "Internal Error" - } - }, - "tags": [ - "HTTP Requests" - ] - } - }, - "/http_requests/request/history": { - "get": { - "description": "Get execution log events for an HTTP request.", - "operationId": "automation_gateway.api_v2.http_requests.get_execution_log", - "parameters": [ - { - "description": "The number of items to skip before starting to collect the result set", - "in": "query", - "name": "offset", - "schema": { - "type": "integer" - } - }, - { - "description": "The number of items to return", - "in": "query", - "name": "limit", - "schema": { - "type": "integer" - } - }, - { - "description": "Most recent execution on top of returned results unless user specifies ascending", - "in": "query", - "name": "order", - "schema": { - "default": "descending", - "enum": [ - "ascending", - "descending" - ], - "type": "string" - } - } - ], - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "type": "object" - } - } - }, - "description": "request execution log response" - }, - "400": { - "content": { - "application/json": { - "examples": { - "BadParameter": { - "$ref": "#/components/examples/BadParameter" - }, - "MissingParameter": { - "$ref": "#/components/examples/MissingParameter" - } - }, - "schema": { - "$ref": "#/components/schemas/Error" - } - } - }, - "description": "Bad Request Error" - }, - "401": { - "content": { - "application/json": { - "examples": { - "AuthenticationError": { - "$ref": "#/components/examples/AuthenticationError" - } - }, - "schema": { - "$ref": "#/components/schemas/Error" - } - } - }, - "description": "Authentication Error" - }, - "404": { - "content": { - "application/json": { - "examples": { - "NotFoundError": { - "$ref": "#/components/examples/NotFoundError" - } - }, - "schema": { - "$ref": "#/components/schemas/Error" - } - } - }, - "description": "Not Found Error" - }, - "500": { - "content": { - "application/json": { - "examples": { - "ServerError": { - "$ref": "#/components/examples/ServerError" - } - }, - "schema": { - "$ref": "#/components/schemas/Error" - } - } - }, - "description": "Internal Error" - } - }, - "summary": "Get HTTP Request execution log", - "tags": [ - "HTTP Requests" - ] - } - }, - "/http_requests/request/schema": { - "get": { - "description": "Get the json schema for http_requests' request endpoint.", - "operationId": "automation_gateway.api_v2.http_requests.request_schema_get", - "responses": { - "200": { - "content": { - "application/json": { - "example": { - "code": "200", - "message": "This is an example of a text response string.", - "status": "SUCCESS" - }, - "schema": { - "$ref": "#/components/schemas/GenericExecutionSuccessBody" - } - } - }, - "description": "Successful Requests Response" - }, - "400": { - "content": { - "application/json": { - "examples": { - "BadParameter": { - "$ref": "#/components/examples/BadParameter" - }, - "MissingParameter": { - "$ref": "#/components/examples/MissingParameter" - } - }, - "schema": { - "$ref": "#/components/schemas/Error" - } - } - }, - "description": "Bad Request Error" - }, - "401": { - "content": { - "application/json": { - "examples": { - "AuthenticationError": { - "$ref": "#/components/examples/AuthenticationError" - } - }, - "schema": { - "$ref": "#/components/schemas/Error" - } - } - }, - "description": "Authentication Error" - } - }, - "tags": [ - "HTTP Requests" - ] - } - }, - "/inventories/grpc/{inventory_name}/devices": { - "post": { - "description": "Create a device in the grpc inventory.", - "operationId": "automation_gateway.api_v2.inventory_devices.create_grpc_device", - "parameters": [ - { - "description": "Name of inventory", - "in": "path", - "name": "inventory_name", - "required": "true", - "schema": { - "enum": [ - "default" - ], - "type": "string" - } - } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/GrpcDevice" - } - } - }, - "description": "Device definition", - "required": "true", - "x-body-name": "device" - }, - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/GrpcDevice" - } - } - }, - "description": "Returns device that was created." - } - }, - "summary": "Create a device in the grpc inventory", - "tags": [ - "inventory" - ] - } - }, - "/inventories/grpc/{inventory_name}/devices/{device_name}": { - "patch": { - "description": "Merge the variables for a device in the grpc inventory.", - "operationId": "automation_gateway.api_v2.inventory_devices.merge_grpc_device_variables", - "parameters": [ - { - "description": "Name of inventory", - "in": "path", - "name": "inventory_name", - "required": "true", - "schema": { - "enum": [ - "default" - ], - "type": "string" - } - }, - { - "description": "Name of inventory", - "in": "path", - "name": "device_name", - "required": "true", - "schema": { - "type": "string" - } - } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/GrpcUpdateVariableParameters" - } - } - }, - "description": "Device definition", - "required": "true", - "x-body-name": "device" - }, - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/GrpcDevice" - } - } - }, - "description": "Returns the device that was updated." - } - }, - "summary": "Merge variables for a device in grpc inventory", - "tags": [ - "inventory" - ] - }, - "put": { - "description": "Update a device in the grpc inventory.", - "operationId": "automation_gateway.api_v2.inventory_devices.update_grpc_device", - "parameters": [ - { - "description": "Name of inventory", - "in": "path", - "name": "inventory_name", - "required": "true", - "schema": { - "enum": [ - "default" - ], - "type": "string" - } - }, - { - "description": "Name of inventory", - "in": "path", - "name": "device_name", - "required": "true", - "schema": { - "type": "string" - } - } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/GrpcDevice" - } - } - }, - "description": "Device definition", - "required": "true", - "x-body-name": "device" - }, - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/GrpcDevice" - } - } - }, - "description": "Returns the device that was updated." - } - }, - "summary": "Update a device in the grpc inventory", - "tags": [ - "inventory" - ] - } - }, - "/inventories/http_requests/{inventory_name}/devices": { - "post": { - "description": "Create a device in the http_requests inventory.", - "operationId": "automation_gateway.api_v2.inventory_devices.create_http_requests_device", - "parameters": [ - { - "description": "Name of inventory", - "in": "path", - "name": "inventory_name", - "required": "true", - "schema": { - "enum": [ - "default" - ], - "type": "string" - } - } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HttpRequestsDevice" - } - } - }, - "description": "Device definition", - "required": "true", - "x-body-name": "device" - }, - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HttpRequestsDevice" - } - } - }, - "description": "Returns device that was created." - } - }, - "summary": "Create a device in the http_requests inventory", - "tags": [ - "inventory" - ] - } - }, - "/inventories/http_requests/{inventory_name}/devices/{device_name}": { - "patch": { - "description": "Merge the variables for a device in the http_requests inventory.", - "operationId": "automation_gateway.api_v2.inventory_devices.merge_http_requests_device_variables", - "parameters": [ - { - "description": "Name of inventory", - "in": "path", - "name": "inventory_name", - "required": "true", - "schema": { - "enum": [ - "default" - ], - "type": "string" - } - }, - { - "description": "Name of device", - "in": "path", - "name": "device_name", - "required": "true", - "schema": { - "type": "string" - } - } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HttpRequestsUpdateVariableParameters" - } - } - }, - "description": "Device definition", - "required": "true", - "x-body-name": "device" - }, - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HttpRequestsDevice" - } - } - }, - "description": "Returns the device that was updated." - } - }, - "summary": "Merge variables for a device in the http_requests inventory", - "tags": [ - "inventory" - ] - }, - "put": { - "description": "Update a device in the http_requests inventory.", - "operationId": "automation_gateway.api_v2.inventory_devices.update_http_requests_device", - "parameters": [ - { - "description": "Name of inventory", - "in": "path", - "name": "inventory_name", - "required": "true", - "schema": { - "enum": [ - "default" - ], - "type": "string" - } - }, - { - "description": "Name of device", - "in": "path", - "name": "device_name", - "required": "true", - "schema": { - "type": "string" - } - } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HttpRequestsDevice" - } - } - }, - "description": "Device definition", - "required": "true", - "x-body-name": "device" - }, - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HttpRequestsDevice" - } - } - }, - "description": "Returns the device that was updated." - } - }, - "summary": "Update a device in the http_requests inventory", - "tags": [ - "inventory" - ] - } - }, - "/inventories/netconf/{inventory_name}/devices": { - "post": { - "description": "Create a device in the netconf inventory.", - "operationId": "automation_gateway.api_v2.inventory_devices.create_netconf_device", - "parameters": [ - { - "description": "Name of inventory", - "in": "path", - "name": "inventory_name", - "required": "true", - "schema": { - "enum": [ - "default" - ], - "type": "string" - } - } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/NetconfDevice" - } - } - }, - "description": "Device definition", - "required": "true", - "x-body-name": "device" - }, - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/NetconfDevice" - } - } - }, - "description": "Returns device that was created." - } - }, - "summary": "Create a device in the netconf inventory", - "tags": [ - "inventory" - ] - } - }, - "/inventories/netconf/{inventory_name}/devices/{device_name}": { - "patch": { - "description": "Merge the variables for a device in the netconf inventory.", - "operationId": "automation_gateway.api_v2.inventory_devices.merge_netconf_device_variables", - "parameters": [ - { - "description": "Name of inventory", - "in": "path", - "name": "inventory_name", - "required": "true", - "schema": { - "enum": [ - "default" - ], - "type": "string" - } - }, - { - "description": "Name of inventory", - "in": "path", - "name": "device_name", - "required": "true", - "schema": { - "type": "string" - } - } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/NetconfUpdateVariableParameters" - } - } - }, - "description": "Device definition", - "required": "true", - "x-body-name": "device" - }, - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/NetconfDevice" - } - } - }, - "description": "Returns the device that was updated." - } - }, - "summary": "Merge variables for a device in the netconf inventory", - "tags": [ - "inventory" - ] - }, - "put": { - "description": "Update variables for a device in the netconf inventory.", - "operationId": "automation_gateway.api_v2.inventory_devices.update_netconf_device", - "parameters": [ - { - "description": "Name of inventory", - "in": "path", - "name": "inventory_name", - "required": "true", - "schema": { - "enum": [ - "default" - ], - "type": "string" - } - }, - { - "description": "Name of inventory", - "in": "path", - "name": "device_name", - "required": "true", - "schema": { - "type": "string" - } - } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/NetconfDevice" - } - } - }, - "description": "Device definition", - "required": "true", - "x-body-name": "device" - }, - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/NetconfDevice" - } - } - }, - "description": "Returns the device that was updated." - } - }, - "summary": "Update variables for a device in the netconf inventory", - "tags": [ - "inventory" - ] - } - }, - "/inventories/netmiko/{inventory_name}/devices": { - "post": { - "description": "Create a device in the netmiko inventory", - "operationId": "automation_gateway.api_v2.inventory_devices.create_netmiko_device", - "parameters": [ - { - "description": "Name of inventory", - "in": "path", - "name": "inventory_name", - "required": "true", - "schema": { - "enum": [ - "default" - ], - "type": "string" - } - } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/NetmikoDevice" - } - } - }, - "description": "Device definition", - "required": "true", - "x-body-name": "device" - }, - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/NetmikoDevice" - } - } - }, - "description": "Returns device that was created." - } - }, - "summary": "Create a device in the netmiko inventory", - "tags": [ - "inventory" - ] - } - }, - "/inventories/netmiko/{inventory_name}/devices/{device_name}": { - "patch": { - "description": "Merge the variables for a device in the netmiko inventory.", - "operationId": "automation_gateway.api_v2.inventory_devices.merge_netmiko_device_variables", - "parameters": [ - { - "description": "Name of inventory", - "in": "path", - "name": "inventory_name", - "required": "true", - "schema": { - "enum": [ - "default" - ], - "type": "string" - } - }, - { - "description": "Name of inventory", - "in": "path", - "name": "device_name", - "required": "true", - "schema": { - "type": "string" - } - } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/NetmikoUpdateVariableParameters" - } - } - }, - "description": "Device definition", - "required": "true", - "x-body-name": "device" - }, - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/NetmikoDevice" - } - } - }, - "description": "Returns the device that was updated." - } - }, - "summary": "Merge variables for a device in netmiko inventory", - "tags": [ - "inventory" - ] - }, - "put": { - "description": "Update a device in the netmiko inventory.", - "operationId": "automation_gateway.api_v2.inventory_devices.update_netmiko_device", - "parameters": [ - { - "description": "Name of inventory", - "in": "path", - "name": "inventory_name", - "required": "true", - "schema": { - "enum": [ - "default" - ], - "type": "string" - } - }, - { - "description": "Name of inventory", - "in": "path", - "name": "device_name", - "required": "true", - "schema": { - "type": "string" - } - } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/NetmikoDevice" - } - } - }, - "description": "Device definition", - "required": "true", - "x-body-name": "device" - }, - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/NetmikoDevice" - } - } - }, - "description": "Returns the device that was updated." - } - }, - "summary": "Update a device in the netmiko inventory", - "tags": [ - "inventory" - ] - } - }, - "/inventories/{integration_type}/{inventory_name}/devices": { - "get": { - "description": "Get a list of devices in the specified inventory.", - "operationId": "automation_gateway.api_v2.inventory_devices.get_devices", - "parameters": [ - { - "description": "Name of integration_type", - "in": "path", - "name": "integration_type", - "required": "true", - "schema": { - "enum": [ - "http_requests", - "netconf", - "netmiko", - "nornir", - "grpc" - ], - "type": "string" - } - }, - { - "description": "Name of inventory", - "in": "path", - "name": "inventory_name", - "required": "true", - "schema": { - "enum": [ - "default" - ], - "type": "string" - } - }, - { - "description": "The number of items to skip before starting to collect the result set", - "in": "query", - "name": "offset", - "schema": { - "type": "integer" - } - }, - { - "description": "The number of items to return", - "in": "query", - "name": "limit", - "schema": { - "type": "integer" - } - }, - { - "description": "Response filter function with JSON name/value pair argument, i.e., contains({\"name\":\"ios\"})\nValid filter functions - contains, equals, startswith, endswith\n", - "in": "query", - "name": "filter", - "schema": { - "type": "string" - } - }, - { - "description": "Ascending/Descending sort indication", - "in": "query", - "name": "order", - "schema": { - "default": "ascending", - "enum": [ - "ascending", - "descending" - ], - "type": "string" - } - } - ], - "responses": { - "200": { - "content": { - "application/json": { - "example": { - "data": [ - { - "name": "ios_host", - "variables": { - "ansible_connection": "network_cli", - "ansible_host": "192.168.32.79", - "ansible_network_os": "ios" - } - }, - { - "name": "junos_host", - "variables": { - "ansible_connection": "network_cli", - "ansible_host": "192.168.32.80", - "ansible_network_os": "junos" - } - } - ], - "meta": { - "count": "2", - "queryObject": { - "filter": {}, - "order": "ascending" - }, - "total_count": "5000" - } - }, - "schema": { - "properties": { - "data": { - "items": { - "$ref": "#/components/schemas/Device" - }, - "type": "array" - }, - "meta": { - "$ref": "#/components/schemas/Meta" - } - }, - "required": [ - "data", - "meta" - ], - "type": "object" - } - } - }, - "description": "get devices response" - }, - "400": { - "content": { - "application/json": { - "example": { - "code": "400", - "message": "Invalid JSON in device filter" - }, - "schema": { - "type": "object" - } - } - }, - "description": "Bad Request Error" - } - }, - "summary": "Get list of devices in the specified inventory", - "tags": [ - "inventory" - ] - } - }, - "/inventories/{integration_type}/{inventory_name}/devices/{device_name}": { - "delete": { - "description": "Delete a device from the specified inventory.", - "operationId": "automation_gateway.api_v2.inventory_devices.delete", - "responses": { - "200": { - "content": { - "application/json": { - "examples": { - "Deleted": { - "$ref": "#/components/examples/Deleted" - } - }, - "schema": { - "$ref": "#/components/schemas/DeletedMessage" - } - } - }, - "description": "Message indicating device has been deleted." - } - }, - "summary": "Delete a device from the specified inventory", - "tags": [ - "inventory" - ] - }, - "get": { - "description": "Get information for a device in the specified inventory.", - "operationId": "automation_gateway.api_v2.inventory_devices.get_device", - "responses": { - "200": { - "content": { - "application/json": { - "example": { - "value": { - "name": "eos_host", - "variables": { - "ansible_connection": "network_cli", - "ansible_host": "192.168.32.79", - "ansible_network_os": "eos" - } - } - }, - "schema": { - "$ref": "#/components/schemas/Device" - } - } - }, - "description": "Device information" - }, - "404": { - "content": { - "application/json": { - "examples": { - "NotFoundError": { - "$ref": "#/components/examples/NotFoundError" - } - }, - "schema": { - "$ref": "#/components/schemas/Error" - } - } - }, - "description": "Not Found Error" - } - }, - "summary": "Get information for a device in the specified inventory", - "tags": [ - "inventory" - ] - }, - "parameters": [ - { - "description": "Name of integration_type", - "in": "path", - "name": "integration_type", - "required": "true", - "schema": { - "enum": [ - "http_requests", - "netconf", - "netmiko", - "nornir", - "grpc" - ], - "type": "string" - } - }, - { - "description": "Name of inventory", - "in": "path", - "name": "inventory_name", - "required": "true", - "schema": { - "enum": [ - "default" - ], - "type": "string" - } - }, - { - "description": "Name of device", - "in": "path", - "name": "device_name", - "required": "true", - "schema": { - "type": "string" - } - }, - { - "description": "Return a list of this device name if device exists.", - "in": "query", - "name": "output", - "schema": { - "enum": [ - "list" - ], - "type": "string" - } - } - ] - }, - "/inventories/{integration_type}/{inventory_name}/groups": { - "get": { - "description": "Get a list of device groups in specified inventory.", - "operationId": "automation_gateway.api_v2.inventory_devices.get_groups", - "parameters": [ - { - "description": "Name of integration_type", - "in": "path", - "name": "integration_type", - "required": "true", - "schema": { - "enum": [ - "nornir" - ], - "type": "string" - } - }, - { - "description": "Name of inventory", - "in": "path", - "name": "inventory_name", - "required": "true", - "schema": { - "enum": [ - "default" - ], - "type": "string" - } - }, - { - "description": "The number of items to skip before starting to collect the result set", - "in": "query", - "name": "offset", - "schema": { - "type": "integer" - } - }, - { - "description": "The number of items to return", - "in": "query", - "name": "limit", - "schema": { - "type": "integer" - } - }, - { - "description": "Response filter function with JSON name/value pair argument, i.e., contains({\"name\":\"atlanta\"})\nValid filter functions - contains, equals, startswith, endswith\n", - "in": "query", - "name": "filter", - "schema": { - "type": "string" - } - }, - { - "description": "Ascending/Descending sort indication", - "in": "query", - "name": "order", - "schema": { - "default": "ascending", - "enum": [ - "ascending", - "descending" - ], - "type": "string" - } - } - ], - "responses": { - "200": { - "content": { - "application/json": { - "example": { - "data": [ - { - "childGroups": [ - "atlanta", - "concord" - ], - "devices": [ - "router_host1", - "router_host2" - ], - "name": "routers", - "variables": { - "ntp_server": "ntp.atlanta.example.com" - } - }, - { - "devices": [ - "vpn_host1", - "vpn_host2" - ], - "name": "vpns", - "variables": { - "proxy": "proxy.example.com" - } - } - ], - "meta": { - "count": "2", - "queryObject": { - "filter": {}, - "order": "ascending" - } - } - }, - "schema": { - "properties": { - "data": { - "items": { - "$ref": "#/components/schemas/Group" - }, - "type": "array" - }, - "meta": { - "$ref": "#/components/schemas/Meta" - } - }, - "required": [ - "data", - "meta" - ], - "type": "object" - } - } - }, - "description": "get groups response" - }, - "400": { - "content": { - "application/json": { - "example": { - "code": "400", - "message": "Invalid JSON in group filter" - }, - "schema": { - "type": "object" - } - } - }, - "description": "Bad Request Error" - } - }, - "summary": "Get list of device groups in specified inventory", - "tags": [ - "inventory" - ] - } - }, - "/inventories/{integration_type}/{inventory_name}/groups/{group_name}": { - "get": { - "description": "Get information for a device group in the specified inventory.", - "operationId": "automation_gateway.api_v2.inventory_devices.get_group", - "parameters": [ - { - "description": "Name of integration_type", - "in": "path", - "name": "integration_type", - "required": "true", - "schema": { - "enum": [ - "nornir" - ], - "type": "string" - } - }, - { - "description": "Name of inventory", - "in": "path", - "name": "inventory_name", - "required": "true", - "schema": { - "enum": [ - "default" - ], - "type": "string" - } - }, - { - "description": "Name of group", - "in": "path", - "name": "group_name", - "required": "true", - "schema": { - "type": "string" - } - } - ], - "responses": { - "200": { - "content": { - "application/json": { - "example": { - "childGroups": [ - "atlanta", - "concord" - ], - "devices": [ - "router_host1", - "router_host2" - ], - "name": "routers", - "variables": { - "ntp_server": "ntp.atlanta.example.com" - } - }, - "schema": { - "$ref": "#/components/schemas/Group" - } - } - }, - "description": "Group information" - }, - "404": { - "content": { - "application/json": { - "examples": { - "NotFoundError": { - "$ref": "#/components/examples/NotFoundError" - } - }, - "schema": { - "$ref": "#/components/schemas/Error" - } - } - }, - "description": "Not Found Error" - } - }, - "summary": "Get a device group in the specified inventory", - "tags": [ - "inventory" - ] - } - }, - "/inventories/{integration_type}/{inventory_name}/groups/{group_name}/children": { - "get": { - "description": "Get a list of child groups in the specified inventory device group.", - "operationId": "automation_gateway.api_v2.inventory_devices.get_group_children", - "parameters": [ - { - "description": "Name of integration_type", - "in": "path", - "name": "integration_type", - "required": "true", - "schema": { - "enum": [ - "nornir" - ], - "type": "string" - } - }, - { - "description": "Name of inventory", - "in": "path", - "name": "inventory_name", - "required": "true", - "schema": { - "enum": [ - "default" - ], - "type": "string" - } - }, - { - "description": "Name of group", - "in": "path", - "name": "group_name", - "required": "true", - "schema": { - "type": "string" - } - } - ], - "responses": { - "200": { - "content": { - "application/json": { - "example": [ - "atlanta", - "concord" - ], - "schema": { - "items": { - "type": "string" - }, - "type": "array" - } - } - }, - "description": "List with child groups for group" - }, - "404": { - "content": { - "application/json": { - "examples": { - "NotFoundError": { - "$ref": "#/components/examples/NotFoundError" - } - }, - "schema": { - "$ref": "#/components/schemas/Error" - } - } - }, - "description": "Not Found Error" - } - }, - "summary": "Get child groups for a specified inventory device group", - "tags": [ - "inventory" - ] - } - }, - "/inventories/{integration_type}/{inventory_name}/groups/{group_name}/devices": { - "get": { - "description": "Get a list of devices in the specified inventory device group.", - "operationId": "automation_gateway.api_v2.inventory_devices.get_group_devices", - "parameters": [ - { - "description": "Name of integration_type", - "in": "path", - "name": "integration_type", - "required": "true", - "schema": { - "enum": [ - "nornir" - ], - "type": "string" - } - }, - { - "description": "Name of inventory", - "in": "path", - "name": "inventory_name", - "required": "true", - "schema": { - "enum": [ - "default" - ], - "type": "string" - } - }, - { - "description": "Name of group", - "in": "path", - "name": "group_name", - "required": "true", - "schema": { - "type": "string" - } - } - ], - "responses": { - "200": { - "content": { - "application/json": { - "example": [ - "router_host1", - "router_host2", - "router_host3" - ], - "schema": { - "items": { - "type": "string" - }, - "type": "array" - } - } - }, - "description": "List with devices for group" - }, - "404": { - "content": { - "application/json": { - "examples": { - "NotFoundError": { - "$ref": "#/components/examples/NotFoundError" - } - }, - "schema": { - "$ref": "#/components/schemas/Error" - } - } - }, - "description": "Not Found Error" - } - }, - "summary": "Get devices for the specified inventory device group", - "tags": [ - "inventory" - ] - } - }, - "/inventory/refresh": { - "post": { - "description": "Perform external inventory discovery and update internal cache.", - "operationId": "automation_gateway.api_v2.inventory.refresh", - "responses": { - "200": { - "content": { - "application/json": { - "example": { - "code": "200", - "message": "Inventory refresh succeeded" - }, - "schema": { - "$ref": "#/components/schemas/InventoryRefresh" - } - } - }, - "description": "display success or failure" - }, - "404": { - "content": { - "application/json": { - "example": { - "code": "404", - "message": "External Ansible inventory file not found" - }, - "schema": { - "$ref": "#/components/schemas/Error" - } - } - }, - "description": "Not Found Error" - } - }, - "summary": "Refresh the cache of external inventory", - "tags": [ - "inventory" - ] - } - }, - "/ldap/test_bind": { - "post": { - "description": "test LDAP connection", - "operationId": "automation_gateway.api_v2.ldap.test_bind", - "responses": { - "200": { - "description": "returns ldap successfully bind" - }, - "400": { - "description": "BadRequest Error" - } - }, - "tags": [ - "LDAP" - ] - } - }, - "/login": { - "post": { - "description": "Log in to the AG server.", - "operationId": "automation_gateway.api_v2.auth.login", - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/LoginCredentials" - } - } - }, - "description": "Login Credentials", - "required": "true", - "x-body-name": "credentials" - }, - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "type": "object" - } - } - }, - "description": "login response" - }, - "401": { - "content": { - "application/json": { - "example": { - "code": "401", - "message": "Invalid username or password" - }, - "schema": { - "type": "object" - } - } - }, - "description": "Invalid username or password." - } - }, - "summary": "Log in to the AG server", - "tags": [ - "Authentication" - ] - } - }, - "/logout": { - "post": { - "description": "Log out of the AG server.", - "operationId": "automation_gateway.api_v2.auth.logout", - "responses": { - "200": { - "content": { - "text/plain": { - "schema": { - "type": "string" - } - } - }, - "description": "logout response" - } - }, - "summary": "Log out of the AG server", - "tags": [ - "Authentication" - ] - } - }, - "/modules": { - "get": { - "description": "Get a list of Ansible modules.", - "parameters": [ - { - "description": "The number of modules to skip before starting to collect the result set", - "in": "query", - "name": "offset", - "schema": { - "type": "integer" - } - }, - { - "description": "The number of modules to return", - "in": "query", - "name": "limit", - "schema": { - "type": "integer" - } - }, - { - "description": "Response filter function with JSON name/value pair argument, i.e., equals({\"family\":\"ios\"})\nValid filter functions - contains, equals, startswith, endswith\n", - "in": "query", - "name": "filter", - "schema": { - "type": "string" - } - }, - { - "description": "Ascending/Descending sort indication", - "in": "query", - "name": "order", - "schema": { - "default": "ascending", - "enum": [ - "ascending", - "descending" - ], - "type": "string" - } - }, - { - "description": "Select between full detail or summary for each item", - "in": "query", - "name": "detail", - "schema": { - "default": "summary", - "enum": [ - "full", - "summary" - ], - "type": "string" - } - } - ], - "responses": { - "200": { - "content": { - "application/json": { - "example": { - "data": [ - { - "effective_schema_type": "certified_schema", - "family": "ios", - "itential_modified": "false", - "name": "ios_command", - "short_description": "A short description", - "version_added": "1.2" - }, - { - "effective_schema_type": "certified_schema", - "family": "ios", - "itential_modified": "false", - "name": "ios_config", - "short_description": "A short description", - "version_added": "1.2" - } - ], - "meta": { - "count": "2", - "queryObject": { - "detail": "summary", - "filter": {}, - "order": "ascending" - } - } - }, - "schema": { - "properties": { - "data": { - "items": { - "$ref": "#/components/schemas/ModuleSummary" - }, - "type": "array" - }, - "meta": { - "$ref": "#/components/schemas/Meta" - } - }, - "required": [ - "data", - "meta" - ], - "type": "object" - } - } - }, - "description": "get modules response" - }, - "400": { - "content": { - "application/json": { - "examples": { - "SearchFilterError": { - "$ref": "#/components/examples/SearchFilterError" - } - }, - "schema": { - "type": "object" - } - } - }, - "description": "Bad Request Error" - } - }, - "summary": "Get a list of Ansible modules", - "tags": [ - "Modules" - ] - } - }, - "/modules/refresh": { - "post": { - "description": "Perform Ansible module discovery and update internal cache.", - "operationId": "automation_gateway.api_v2.modules.refresh", - "responses": { - "200": { - "content": { - "application/json": { - "example": { - "code": "200", - "message": "Module refresh succeeded" - }, - "schema": { - "$ref": "#/components/schemas/ModuleRefresh" - } - } - }, - "description": "display success or failure" - } - }, - "summary": "Refresh Ansible module cache", - "tags": [ - "Modules" - ] - } - }, - "/modules/{module_name}": { - "get": { - "description": "Get information for an Ansible module.", - "parameters": [ - { - "description": "Name of module to retrieve.", - "in": "path", - "name": "module_name", - "required": "true", - "schema": { - "type": "string" - } - } - ], - "responses": { - "200": { - "content": { - "application/json": { - "example": { - "author": "Sample Author", - "description": [ - "Longer description" - ], - "extends_documentation_fragment": "sample", - "itential_modified": "false", - "module": "sample_module", - "notes": [ - "Some notes" - ], - "schema": {}, - "short_description": "Short description", - "version_added": "2.1" - }, - "schema": { - "$ref": "#/components/schemas/Module" - } - } - }, - "description": "get module response" - }, - "404": { - "content": { - "application/json": { - "examples": { - "NotFoundError": { - "$ref": "#/components/examples/NotFoundError" - } - }, - "schema": { - "$ref": "#/components/schemas/Error" - } - } - }, - "description": "Not Found Error" - } - }, - "summary": "Get information for an Ansible module", - "tags": [ - "Modules" - ] - } - }, - "/modules/{module_name}/execute": { - "post": { - "description": "Execute an Ansible module.", - "operationId": "automation_gateway.api_v2.modules.execute", - "parameters": [ - { - "description": "Name of module", - "in": "path", - "name": "module_name", - "required": "true", - "schema": { - "type": "string" - } - } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ModuleParameters" - } - } - }, - "description": "Module Execution Parameters", - "required": "true", - "x-body-name": "module_parameters" - }, - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "type": "object" - } - } - }, - "description": "module execution log events response" - }, - "400": { - "content": { - "application/json": { - "examples": { - "BadParameter": { - "$ref": "#/components/examples/BadParameter" - }, - "MissingParameter": { - "$ref": "#/components/examples/MissingParameter" - } - }, - "schema": { - "$ref": "#/components/schemas/Error" - } - } - }, - "description": "Bad Request Error" - }, - "404": { - "content": { - "application/json": { - "examples": { - "NotFoundError": { - "$ref": "#/components/examples/NotFoundError" - } - }, - "schema": { - "$ref": "#/components/schemas/Error" - } - } - }, - "description": "Not Found Error" - }, - "500": { - "content": { - "application/json": { - "examples": { - "ServerError": { - "$ref": "#/components/examples/ServerError" - } - }, - "schema": { - "$ref": "#/components/schemas/Error" - } - } - }, - "description": "Internal Error" - } - }, - "summary": "Execute an Ansible module", - "tags": [ - "Modules" - ] - } - }, - "/modules/{module_name}/history": { - "get": { - "description": "Get execution log events for an Ansible module.", - "operationId": "automation_gateway.api_v2.modules.get_execution_log", - "parameters": [ - { - "description": "Name of module", - "in": "path", - "name": "module_name", - "required": "true", - "schema": { - "type": "string" - } - }, - { - "description": "The number of items to skip before starting to collect the result set", - "in": "query", - "name": "offset", - "schema": { - "type": "integer" - } - }, - { - "description": "The number of items to return", - "in": "query", - "name": "limit", - "schema": { - "type": "integer" - } - }, - { - "description": "Most recent execution on top of returned results unless user specifies ascending", - "in": "query", - "name": "order", - "schema": { - "default": "descending", - "enum": [ - "ascending", - "descending" - ], - "type": "string" - } - } - ], - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "type": "object" - } - } - }, - "description": "module execution log events response" - }, - "400": { - "content": { - "application/json": { - "examples": { - "BadParameter": { - "$ref": "#/components/examples/BadParameter" - }, - "MissingParameter": { - "$ref": "#/components/examples/MissingParameter" - } - }, - "schema": { - "$ref": "#/components/schemas/Error" - } - } - }, - "description": "Bad Request Error" - }, - "404": { - "content": { - "application/json": { - "examples": { - "NotFoundError": { - "$ref": "#/components/examples/NotFoundError" - } - }, - "schema": { - "$ref": "#/components/schemas/Error" - } - } - }, - "description": "Not Found Error" - }, - "500": { - "content": { - "application/json": { - "examples": { - "ServerError": { - "$ref": "#/components/examples/ServerError" - } - }, - "schema": { - "$ref": "#/components/schemas/Error" - } - } - }, - "description": "Internal Error" - } - }, - "summary": "Get execution log for an Ansible module", - "tags": [ - "Modules" - ] - } - }, - "/modules/{module_name}/schema": { - "delete": { - "description": "Remove an Ansible module schema.", - "operationId": "automation_gateway.api_v2.modules.delete", - "responses": { - "200": { - "content": { - "application/json": { - "examples": { - "Deleted": { - "$ref": "#/components/examples/Deleted" - } - }, - "schema": { - "$ref": "#/components/schemas/DeletedMessage" - } - } - }, - "description": "Message indicating module schema has been deleted." - }, - "404": { - "content": { - "application/json": { - "examples": { - "NotFoundError": { - "$ref": "#/components/examples/NotFoundError" - } - }, - "schema": { - "$ref": "#/components/schemas/Error" - } - } - }, - "description": "Not Found Error" - } - }, - "summary": "Remove an Ansible module schema", - "tags": [ - "Modules" - ] - }, - "get": { - "description": "Get the schema for an Ansible module.", - "operationId": "automation_gateway.api_v2.modules.get_schema", - "responses": { - "200": { - "content": { - "application/json": { - "example": { - "schema": { - "properties": { - "command": { - "description": "Command to send to device", - "type": "string" - } - }, - "required": [ - "command" - ], - "title": "sample_command", - "type": "object" - } - }, - "schema": { - "$ref": "#/components/schemas/UserSchema" - } - } - }, - "description": "object with schema for module" - }, - "404": { - "content": { - "application/json": { - "examples": { - "NotFoundError": { - "$ref": "#/components/examples/NotFoundError" - } - }, - "schema": { - "$ref": "#/components/schemas/Error" - } - } - }, - "description": "Not Found Error" - } - }, - "summary": "Get an Ansible module schema", - "tags": [ - "Modules" - ] - }, - "parameters": [ - { - "description": "Name of module", - "in": "path", - "name": "module_name", - "required": "true", - "schema": { - "type": "string" - } - } - ], - "put": { - "description": "Update/Insert an Ansible module schema document.", - "operationId": "automation_gateway.api_v2.modules.put", - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/UserSchema" - } - } - }, - "description": "Schema to apply to module identified in path", - "required": "true", - "x-body-name": "schema" - }, - "responses": { - "200": { - "content": { - "appication/json": { - "schema": { - "type": "object" - } - } - }, - "description": "Update schema response" - } - }, - "summary": "Update an Ansible module schema", - "tags": [ - "Modules" - ] - } - }, - "/netconf/exec_rpc/execute": { - "post": { - "description": "Execute proprietary operations on a device using the NETCONF protocol.", - "operationId": "automation_gateway.api_v2.netconf.exec_rpc", - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/NetconfRpcParameters" - } - } - }, - "description": "Netconf RPC Parameters", - "required": "true", - "x-body-name": "exec_rpc_parameters" - }, - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "type": "object" - } - } - }, - "description": "execute exec_rpc response" - }, - "400": { - "content": { - "application/json": { - "examples": { - "BadParameter": { - "$ref": "#/components/examples/BadParameter" - }, - "MissingParameter": { - "$ref": "#/components/examples/MissingParameter" - } - }, - "schema": { - "$ref": "#/components/schemas/Error" - } - } - }, - "description": "Bad Request Error" - }, - "404": { - "content": { - "application/json": { - "examples": { - "NotFoundError": { - "$ref": "#/components/examples/NotFoundError" - } - }, - "schema": { - "$ref": "#/components/schemas/Error" - } - } - }, - "description": "Not Found Error" - }, - "500": { - "content": { - "application/json": { - "examples": { - "ServerError": { - "$ref": "#/components/examples/ServerError" - } - }, - "schema": { - "$ref": "#/components/schemas/Error" - } - } - }, - "description": "Internal Error" - } - }, - "summary": "Execute Netconf Proprietary RPC Operation", - "tags": [ - "Netconf" - ] - } - }, - "/netconf/get_config/execute": { - "post": { - "description": "Retrieve configuration from a device using the NETCONF protocol", - "operationId": "automation_gateway.api_v2.netconf.get_config", - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/NetconfGetConfigParameters" - } - } - }, - "description": "Netconf Get Config Parameters", - "required": "true", - "x-body-name": "get_config_parameters" - }, - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "type": "object" - } - } - }, - "description": "execute exec_rpc response" - }, - "400": { - "content": { - "application/json": { - "examples": { - "BadParameter": { - "$ref": "#/components/examples/BadParameter" - }, - "MissingParameter": { - "$ref": "#/components/examples/MissingParameter" - } - }, - "schema": { - "$ref": "#/components/schemas/Error" - } - } - }, - "description": "Bad Request Error" - }, - "404": { - "content": { - "application/json": { - "examples": { - "NotFoundError": { - "$ref": "#/components/examples/NotFoundError" - } - }, - "schema": { - "$ref": "#/components/schemas/Error" - } - } - }, - "description": "Not Found Error" - }, - "500": { - "content": { - "application/json": { - "examples": { - "ServerError": { - "$ref": "#/components/examples/ServerError" - } - }, - "schema": { - "$ref": "#/components/schemas/Error" - } - } - }, - "description": "Internal Error" - } - }, - "summary": "Retrieve Device Configuration", - "tags": [ - "Netconf" - ] - } - }, - "/netconf/set_config/execute": { - "post": { - "description": "Configure a device using the NETCONF protocol", - "operationId": "automation_gateway.api_v2.netconf.set_config", - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/NetconfSetConfigParameters" - } - } - }, - "description": "Netconf Set Config Parameters", - "required": "true", - "x-body-name": "set_config_parameters" - }, - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "type": "object" - } - } - }, - "description": "execute set_config response" - }, - "400": { - "content": { - "application/json": { - "examples": { - "BadParameter": { - "$ref": "#/components/examples/BadParameter" - }, - "MissingParameter": { - "$ref": "#/components/examples/MissingParameter" - } - }, - "schema": { - "$ref": "#/components/schemas/Error" - } - } - }, - "description": "Bad Request Error" - }, - "404": { - "content": { - "application/json": { - "examples": { - "NotFoundError": { - "$ref": "#/components/examples/NotFoundError" - } - }, - "schema": { - "$ref": "#/components/schemas/Error" - } - } - }, - "description": "Not Found Error" - }, - "500": { - "content": { - "application/json": { - "examples": { - "ServerError": { - "$ref": "#/components/examples/ServerError" - } - }, - "schema": { - "$ref": "#/components/schemas/Error" - } - } - }, - "description": "Internal Error" - } - }, - "summary": "Edit Device Configuration", - "tags": [ - "Netconf" - ] - } - }, - "/netconf/{netconf_command}/history": { - "get": { - "description": "Get execution log events for Netconf command.", - "operationId": "automation_gateway.api_v2.netconf.get_execution_log", - "parameters": [ - { - "description": "Name of netconf command", - "in": "path", - "name": "netconf_command", - "required": "true", - "schema": { - "enum": [ - "set_config", - "get_config", - "exec_rpc" - ], - "type": "string" - } - }, - { - "description": "The number of items to skip before starting to collect the result set", - "in": "query", - "name": "offset", - "schema": { - "type": "integer" - } - }, - { - "description": "The number of items to return", - "in": "query", - "name": "limit", - "schema": { - "type": "integer" - } - }, - { - "description": "Most recent execution on top of returned results unless user specifies ascending", - "in": "query", - "name": "order", - "schema": { - "default": "descending", - "enum": [ - "ascending", - "descending" - ], - "type": "string" - } - } - ], - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "type": "object" - } - } - }, - "description": "netconf command execution log events response" - }, - "400": { - "content": { - "application/json": { - "examples": { - "BadParameter": { - "$ref": "#/components/examples/BadParameter" - }, - "MissingParameter": { - "$ref": "#/components/examples/MissingParameter" - } - }, - "schema": { - "$ref": "#/components/schemas/Error" - } - } - }, - "description": "Bad Request Error" - }, - "404": { - "content": { - "application/json": { - "examples": { - "NotFoundError": { - "$ref": "#/components/examples/NotFoundError" - } - }, - "schema": { - "$ref": "#/components/schemas/Error" - } - } - }, - "description": "Not Found Error" - }, - "500": { - "content": { - "application/json": { - "examples": { - "ServerError": { - "$ref": "#/components/examples/ServerError" - } - }, - "schema": { - "$ref": "#/components/schemas/Error" - } - } - }, - "description": "Internal Error" - } - }, - "summary": "Get Netconf command execution log events", - "tags": [ - "Netconf" - ] - } - }, - "/netmiko/send_command": { - "post": { - "description": "Wrapper of netmiko send_command", - "operationId": "automation_gateway.api_v2.netmiko.send_command", - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/NetmikoSendCommand" - } - } - }, - "description": "connection and command information\nhttps://ktbyers.github.io/netmiko/docs/netmiko/base_connection.html\n", - "required": "true", - "x-body-name": "netmiko_send_command_parameters" - }, - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "type": "object" - } - } - }, - "description": "netmiko send_command response" - }, - "400": { - "description": "Bad Request Error" - }, - "404": { - "content": { - "application/json": { - "examples": { - "NotFoundError": { - "$ref": "#/components/examples/NotFoundError" - } - }, - "schema": { - "$ref": "#/components/schemas/Error" - } - } - }, - "description": "Not Found Error" - }, - "500": { - "content": { - "application/json": { - "examples": { - "ServerError": { - "$ref": "#/components/examples/ServerError" - } - }, - "schema": { - "$ref": "#/components/schemas/Error" - } - } - }, - "description": "Internal Error" - } - }, - "summary": "Netmiko legacy send_command", - "tags": [ - "Netmiko" - ] - } - }, - "/netmiko/send_command/execute": { - "post": { - "description": "IAG Native Netmiko send_command.", - "operationId": "automation_gateway.api_v2.netmiko.exec_send_command", - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/NetmikoSendCommandExecuteBody" - } - } - }, - "description": "Netmiko's host/ip parameters are condensed to only host which allows hostname or ip.\nSee base_connection for all other supported connection parameters:\nhttps://ktbyers.github.io/netmiko/docs/netmiko/base_connection.html\nSee send_command for all supported command execution parameters:\nhttps://ktbyers.github.io/netmiko/docs/netmiko/index.html#netmiko.BaseConnection.send_command\n", - "required": "true", - "x-body-name": "data" - }, - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/NetmikoSendCommandResponse" - } - } - }, - "description": "netmiko send_command response" - }, - "400": { - "content": { - "application/json": { - "examples": { - "BadParameter": { - "$ref": "#/components/examples/BadParameter" - }, - "MissingParameter": { - "$ref": "#/components/examples/MissingParameter" - } - }, - "schema": { - "$ref": "#/components/schemas/Error" - } - } - }, - "description": "Bad Request Error" - }, - "404": { - "content": { - "application/json": { - "examples": { - "NotFoundError": { - "$ref": "#/components/examples/NotFoundError" - } - }, - "schema": { - "$ref": "#/components/schemas/Error" - } - } - }, - "description": "Not Found Error" - }, - "500": { - "content": { - "application/json": { - "examples": { - "ServerError": { - "$ref": "#/components/examples/ServerError" - } - }, - "schema": { - "$ref": "#/components/schemas/Error" - } - } - }, - "description": "Internal Error" - } - }, - "summary": "IAG Native Netmiko send_command", - "tags": [ - "Netmiko" - ] - } - }, - "/netmiko/send_command/history": { - "get": { - "description": "Get execution log events for the Netmiko send_command.", - "operationId": "automation_gateway.api_v2.netmiko.get_exec_send_command_log", - "parameters": [ - { - "description": "The number of items to skip before starting to collect the result set", - "in": "query", - "name": "offset", - "schema": { - "type": "integer" - } - }, - { - "description": "The number of items to return", - "in": "query", - "name": "limit", - "schema": { - "type": "integer" - } - }, - { - "description": "Most recent execution on top of returned results unless user specifies ascending", - "in": "query", - "name": "order", - "schema": { - "default": "descending", - "enum": [ - "ascending", - "descending" - ], - "type": "string" - } - } - ], - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "type": "object" - } - } - }, - "description": "script execution log events response" - }, - "400": { - "content": { - "application/json": { - "examples": { - "BadParameter": { - "$ref": "#/components/examples/BadParameter" - }, - "MissingParameter": { - "$ref": "#/components/examples/MissingParameter" - } - }, - "schema": { - "$ref": "#/components/schemas/Error" - } - } - }, - "description": "Bad Request Error" - }, - "404": { - "content": { - "application/json": { - "examples": { - "NotFoundError": { - "$ref": "#/components/examples/NotFoundError" - } - }, - "schema": { - "$ref": "#/components/schemas/Error" - } - } - }, - "description": "Not Found Error" - }, - "500": { - "content": { - "application/json": { - "examples": { - "ServerError": { - "$ref": "#/components/examples/ServerError" - } - }, - "schema": { - "$ref": "#/components/schemas/Error" - } - } - }, - "description": "Internal Error" - } - }, - "summary": "Get IAG Native Netmiko send_command execution log", - "tags": [ - "Netmiko" - ] - } - }, - "/netmiko/send_command/legacy_history": { - "get": { - "description": "Get execution log events for the Netmiko legacy send_command.", - "operationId": "automation_gateway.api_v2.netmiko.get_send_command_log", - "parameters": [ - { - "description": "The number of items to skip before starting to collect the result set", - "in": "query", - "name": "offset", - "schema": { - "type": "integer" - } - }, - { - "description": "The number of items to return", - "in": "query", - "name": "limit", - "schema": { - "type": "integer" - } - }, - { - "description": "Most recent execution on top of returned results unless user specifies ascending", - "in": "query", - "name": "order", - "schema": { - "default": "descending", - "enum": [ - "ascending", - "descending" - ], - "type": "string" - } - } - ], - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "type": "object" - } - } - }, - "description": "script execution log events response" - }, - "400": { - "content": { - "application/json": { - "examples": { - "BadParameter": { - "$ref": "#/components/examples/BadParameter" - }, - "MissingParameter": { - "$ref": "#/components/examples/MissingParameter" - } - }, - "schema": { - "$ref": "#/components/schemas/Error" - } - } - }, - "description": "Bad Request Error" - }, - "404": { - "content": { - "application/json": { - "examples": { - "NotFoundError": { - "$ref": "#/components/examples/NotFoundError" - } - }, - "schema": { - "$ref": "#/components/schemas/Error" - } - } - }, - "description": "Not Found Error" - }, - "500": { - "content": { - "application/json": { - "examples": { - "ServerError": { - "$ref": "#/components/examples/ServerError" - } - }, - "schema": { - "$ref": "#/components/schemas/Error" - } - } - }, - "description": "Internal Error" - } - }, - "summary": "Get Netmiko legacy send_command execution log", - "tags": [ - "Netmiko" - ] - } - }, - "/netmiko/send_config": { - "post": { - "description": "Wrapper of netmiko send_config_set", - "operationId": "automation_gateway.api_v2.netmiko.send_config", - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/NetmikoSendConfig" - } - } - }, - "description": "connection and config information\nhttps://ktbyers.github.io/netmiko/docs/netmiko/base_connection.html\n", - "required": "true", - "x-body-name": "netmiko_send_config_parameters" - }, - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "type": "object" - } - } - }, - "description": "netmiko send_config_set response" - }, - "400": { - "content": { - "application/json": { - "examples": { - "BadParameter": { - "$ref": "#/components/examples/BadParameter" - }, - "MissingParameter": { - "$ref": "#/components/examples/MissingParameter" - } - }, - "schema": { - "$ref": "#/components/schemas/Error" - } - } - }, - "description": "Bad Request Error" - }, - "404": { - "content": { - "application/json": { - "examples": { - "NotFoundError": { - "$ref": "#/components/examples/NotFoundError" - } - }, - "schema": { - "$ref": "#/components/schemas/Error" - } - } - }, - "description": "Not Found Error" - }, - "500": { - "content": { - "application/json": { - "examples": { - "ServerError": { - "$ref": "#/components/examples/ServerError" - } - }, - "schema": { - "$ref": "#/components/schemas/Error" - } - } - }, - "description": "Internal Error" - } - }, - "summary": "Netmiko legacy send_config", - "tags": [ - "Netmiko" - ] - } - }, - "/netmiko/send_config/legacy_history": { - "get": { - "description": "Get execution log events for Netmiko legacy send_config.", - "operationId": "automation_gateway.api_v2.netmiko.get_send_config_log", - "parameters": [ - { - "description": "The number of items to skip before starting to collect the result set", - "in": "query", - "name": "offset", - "schema": { - "type": "integer" - } - }, - { - "description": "The number of items to return", - "in": "query", - "name": "limit", - "schema": { - "type": "integer" - } - }, - { - "description": "Most recent execution on top of returned results unless user specifies ascending", - "in": "query", - "name": "order", - "schema": { - "default": "descending", - "enum": [ - "ascending", - "descending" - ], - "type": "string" - } - } - ], - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "type": "object" - } - } - }, - "description": "script execution log events response" - }, - "400": { - "content": { - "application/json": { - "examples": { - "BadParameter": { - "$ref": "#/components/examples/BadParameter" - }, - "MissingParameter": { - "$ref": "#/components/examples/MissingParameter" - } - }, - "schema": { - "$ref": "#/components/schemas/Error" - } - } - }, - "description": "Bad Request Error" - }, - "404": { - "content": { - "application/json": { - "examples": { - "NotFoundError": { - "$ref": "#/components/examples/NotFoundError" - } - }, - "schema": { - "$ref": "#/components/schemas/Error" - } - } - }, - "description": "Not Found Error" - }, - "500": { - "content": { - "application/json": { - "examples": { - "ServerError": { - "$ref": "#/components/examples/ServerError" - } - }, - "schema": { - "$ref": "#/components/schemas/Error" - } - } - }, - "description": "Internal Error" - } - }, - "summary": "Get Netmiko legacy send_config execution log", - "tags": [ - "Netmiko" - ] - } - }, - "/netmiko/send_config_set/execute": { - "post": { - "description": "IAG Native Netmiko send_config_set.", - "operationId": "automation_gateway.api_v2.netmiko.exec_send_config_set", - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/NetmikoSendConfigSetExecuteBody" - } - } - }, - "description": "Netmiko's host/ip parameters are condensed to only host which allows hostname or ip.\nSee base_connection for all other supported connection parameters:\nhttps://ktbyers.github.io/netmiko/docs/netmiko/base_connection.html\nSee send_config_set for all supported configuration parameters:\nhttps://ktbyers.github.io/netmiko/docs/netmiko/index.html#netmiko.BaseConnection.send_config_set\n", - "required": "true", - "x-body-name": "data" - }, - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/NetmikoSendConfigSetResponse" - } - } - }, - "description": "netmiko send_config_set response" - }, - "400": { - "content": { - "application/json": { - "examples": { - "BadParameter": { - "$ref": "#/components/examples/BadParameter" - }, - "MissingParameter": { - "$ref": "#/components/examples/MissingParameter" - } - }, - "schema": { - "$ref": "#/components/schemas/Error" - } - } - }, - "description": "Bad Request Error" - }, - "404": { - "content": { - "application/json": { - "examples": { - "NotFoundError": { - "$ref": "#/components/examples/NotFoundError" - } - }, - "schema": { - "$ref": "#/components/schemas/Error" - } - } - }, - "description": "Not Found Error" - }, - "500": { - "content": { - "application/json": { - "examples": { - "ServerError": { - "$ref": "#/components/examples/ServerError" - } - }, - "schema": { - "$ref": "#/components/schemas/Error" - } - } - }, - "description": "Internal Error" - } - }, - "summary": "IAG Native Netmiko send_config_set", - "tags": [ - "Netmiko" - ] - } - }, - "/netmiko/send_config_set/history": { - "get": { - "description": "Get execution log events for Netmiko send_config_set.", - "operationId": "automation_gateway.api_v2.netmiko.get_exec_send_config_set_log", - "parameters": [ - { - "description": "The number of items to skip before starting to collect the result set", - "in": "query", - "name": "offset", - "schema": { - "type": "integer" - } - }, - { - "description": "The number of items to return", - "in": "query", - "name": "limit", - "schema": { - "type": "integer" - } - }, - { - "description": "Most recent execution on top of returned results unless user specifies ascending", - "in": "query", - "name": "order", - "schema": { - "default": "descending", - "enum": [ - "ascending", - "descending" - ], - "type": "string" - } - } - ], - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "type": "object" - } - } - }, - "description": "script execution log events response" - }, - "400": { - "content": { - "application/json": { - "examples": { - "BadParameter": { - "$ref": "#/components/examples/BadParameter" - }, - "MissingParameter": { - "$ref": "#/components/examples/MissingParameter" - } - }, - "schema": { - "$ref": "#/components/schemas/Error" - } - } - }, - "description": "Bad Request Error" - }, - "404": { - "content": { - "application/json": { - "examples": { - "NotFoundError": { - "$ref": "#/components/examples/NotFoundError" - } - }, - "schema": { - "$ref": "#/components/schemas/Error" - } - } - }, - "description": "Not Found Error" - }, - "500": { - "content": { - "application/json": { - "examples": { - "ServerError": { - "$ref": "#/components/examples/ServerError" - } - }, - "schema": { - "$ref": "#/components/schemas/Error" - } - } - }, - "description": "Internal Error" - } - }, - "summary": "Get IAG Native Netmiko send_config_set execution log", - "tags": [ - "Netmiko" - ] - } - }, - "/netmiko/{netmiko_command}/schema": { - "get": { - "description": "Get IAG Native Netmiko command schema.", - "operationId": "automation_gateway.api_v2.netmiko.get_schema", - "parameters": [ - { - "description": "Name of netmiko command", - "in": "path", - "name": "netmiko_command", - "required": "true", - "schema": { - "enum": [ - "send_command", - "send_config_set" - ], - "type": "string" - } - } - ], - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "type": "object" - } - } - }, - "description": "successfully get the schema" - } - }, - "summary": "Get IAG Native Netmiko command schema", - "tags": [ - "Netmiko" - ] - } - }, - "/nornir": { - "get": { - "description": "Get a list of Nornir modules.", - "parameters": [ - { - "description": "The number of items to skip before starting to collect the result set", - "in": "query", - "name": "offset", - "schema": { - "type": "integer" - } - }, - { - "description": "The number of items to return", - "in": "query", - "name": "limit", - "schema": { - "type": "integer" - } - }, - { - "description": "Response filter function with JSON name/value pair argument, i.e., contains({\"name\":\"sample\"})\nValid filter functions - contains, equals, startswith, endswith\n", - "in": "query", - "name": "filter", - "schema": { - "type": "string" - } - }, - { - "description": "Ascending/Descending sort indication", - "in": "query", - "name": "order", - "schema": { - "default": "ascending", - "enum": [ - "ascending", - "descending" - ], - "type": "string" - } - }, - { - "description": "Select between full detail or summary for each item", - "in": "query", - "name": "detail", - "schema": { - "default": "summary", - "enum": [ - "full", - "summary" - ], - "type": "string" - } - } - ], - "responses": { - "200": { - "content": { - "application/json": { - "example": { - "data": [ - { - "effective_schema_type": "user_schema", - "file": "/usr/share/automation-gateway/nornir_modules/sample_nornir_module.py", - "name": "sample_nornir_module.py" - }, - { - "effective_schema_type": "user_schema", - "file": "/usr/share/automation-gateway/nornir_modules/test_module.py", - "name": "test_module.py" - } - ], - "meta": { - "count": "2", - "queryObject": { - "detail": "summary", - "filter": {}, - "order": "ascending" - } - } - }, - "schema": { - "properties": { - "data": { - "items": { - "$ref": "#/components/schemas/ScriptSummary" - }, - "type": "array" - }, - "meta": { - "$ref": "#/components/schemas/Meta" - } - }, - "required": [ - "data", - "meta" - ], - "type": "object" - } - } - }, - "description": "get nornir modules response" - }, - "400": { - "content": { - "application/json": { - "examples": { - "SearchFilterError": { - "$ref": "#/components/examples/SearchFilterError" - } - }, - "schema": { - "type": "object" - } - } - }, - "description": "Bad Request Error" - } - }, - "summary": "Get list of Nornir modules", - "tags": [ - "Nornir" - ] - } - }, - "/nornir/refresh": { - "post": { - "description": "Perform Nornir module discovery and update internal cache.", - "operationId": "automation_gateway.api_v2.nornir.refresh", - "responses": { - "200": { - "content": { - "application/json": { - "example": { - "code": "200", - "message": "Nornir module refresh succeeded" - }, - "schema": { - "$ref": "#/components/schemas/ScriptRefresh" - } - } - }, - "description": "display success or failure" - } - }, - "summary": "Refresh Nornir module cache", - "tags": [ - "Nornir" - ] - } - }, - "/nornir/{module_name}": { - "get": { - "description": "Get Nornir module information.", - "parameters": [ - { - "description": "Name of nornir module to retrieve.", - "in": "path", - "name": "module_name", - "required": "true", - "schema": { - "type": "string" - } - } - ], - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "type": "object" - } - } - }, - "description": "get nornir module response" - }, - "404": { - "content": { - "application/json": { - "examples": { - "NotFoundError": { - "$ref": "#/components/examples/NotFoundError" - } - }, - "schema": { - "$ref": "#/components/schemas/Error" - } - } - }, - "description": "Not Found Error" - } - }, - "summary": "Get Nornir module information", - "tags": [ - "Nornir" - ] - } - }, - "/nornir/{module_name}/execute": { - "post": { - "description": "Execute a Nornir module.", - "operationId": "automation_gateway.api_v2.nornir.execute", - "parameters": [ - { - "description": "Name of nornir module to execute.", - "in": "path", - "name": "module_name", - "required": "true", - "schema": { - "type": "string" - } - } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/NornirModuleParameters" - } - } - }, - "description": "Module Execution Parameters", - "required": "true", - "x-body-name": "module_parameters" - }, - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "type": "object" - } - } - }, - "description": "execute module response" - }, - "400": { - "content": { - "application/json": { - "examples": { - "BadParameter": { - "$ref": "#/components/examples/BadParameter" - }, - "MissingParameter": { - "$ref": "#/components/examples/MissingParameter" - } - }, - "schema": { - "$ref": "#/components/schemas/Error" - } - } - }, - "description": "Bad Request Error" - }, - "404": { - "content": { - "application/json": { - "examples": { - "NotFoundError": { - "$ref": "#/components/examples/NotFoundError" - } - }, - "schema": { - "$ref": "#/components/schemas/Error" - } - } - }, - "description": "Not Found Error" - }, - "500": { - "content": { - "application/json": { - "examples": { - "ServerError": { - "$ref": "#/components/examples/ServerError" - } - }, - "schema": { - "$ref": "#/components/schemas/Error" - } - } - }, - "description": "Internal Error" - } - }, - "summary": "Execute a Nornir module", - "tags": [ - "Nornir" - ] - } - }, - "/nornir/{module_name}/history": { - "get": { - "description": "Get execution log events for a Nornir module.", - "operationId": "automation_gateway.api_v2.nornir.get_execution_log", - "parameters": [ - { - "description": "Name of nornir module", - "in": "path", - "name": "module_name", - "required": "true", - "schema": { - "type": "string" - } - }, - { - "description": "The number of items to skip before starting to collect the result set", - "in": "query", - "name": "offset", - "schema": { - "type": "integer" - } - }, - { - "description": "The number of items to return", - "in": "query", - "name": "limit", - "schema": { - "type": "integer" - } - }, - { - "description": "Most recent execution on top of returned results unless user specifies ascending", - "in": "query", - "name": "order", - "schema": { - "default": "descending", - "enum": [ - "ascending", - "descending" - ], - "type": "string" - } - } - ], - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "type": "object" - } - } - }, - "description": "nornir module execution log events response" - }, - "400": { - "content": { - "application/json": { - "examples": { - "BadParameter": { - "$ref": "#/components/examples/BadParameter" - }, - "MissingParameter": { - "$ref": "#/components/examples/MissingParameter" - } - }, - "schema": { - "$ref": "#/components/schemas/Error" - } - } - }, - "description": "Bad Request Error" - }, - "404": { - "content": { - "application/json": { - "examples": { - "NotFoundError": { - "$ref": "#/components/examples/NotFoundError" - } - }, - "schema": { - "$ref": "#/components/schemas/Error" - } - } - }, - "description": "Not Found Error" - }, - "500": { - "content": { - "application/json": { - "examples": { - "ServerError": { - "$ref": "#/components/examples/ServerError" - } - }, - "schema": { - "$ref": "#/components/schemas/Error" - } - } - }, - "description": "Internal Error" - } - }, - "summary": "Get Nornir module execution log", - "tags": [ - "Nornir" - ] - } - }, - "/nornir/{module_name}/schema": { - "delete": { - "description": "Remove a Nornir module schema.", - "operationId": "automation_gateway.api_v2.nornir.delete", - "responses": { - "200": { - "content": { - "application/json": { - "examples": { - "Deleted": { - "$ref": "#/components/examples/Deleted" - } - }, - "schema": { - "$ref": "#/components/schemas/DeletedMessage" - } - } - }, - "description": "Message indicating nornir module schema has been deleted." - }, - "400": { - "content": { - "application/json": { - "examples": { - "BadParameter": { - "$ref": "#/components/examples/BadParameter" - }, - "MissingParameter": { - "$ref": "#/components/examples/MissingParameter" - } - }, - "schema": { - "$ref": "#/components/schemas/Error" - } - } - }, - "description": "Bad Request Error" - } - }, - "summary": "Remove a Nornir module schema", - "tags": [ - "Nornir" - ] - }, - "get": { - "description": "Get the schema for a Nornir module.", - "operationId": "automation_gateway.api_v2.nornir.get_schema", - "responses": { - "200": { - "content": { - "application/json": { - "example": { - "properties": { - "destination": { - "description": "Destination filename", - "type": "string" - }, - "source": { - "description": "Source filename", - "type": "string" - } - }, - "required": [ - "source", - "destination" - ], - "script_argument_order": [ - "source", - "destination" - ], - "title": "sample_nornir_module.py", - "type": "object" - }, - "schema": { - "$ref": "#/components/schemas/UserSchema" - } - } - }, - "description": "object with schema for nornir module" - }, - "404": { - "content": { - "application/json": { - "examples": { - "NotFoundError": { - "$ref": "#/components/examples/NotFoundError" - } - }, - "schema": { - "$ref": "#/components/schemas/Error" - } - } - }, - "description": "Not Found Error" - } - }, - "summary": "Get a Nornir module schema", - "tags": [ - "Nornir" - ] - }, - "parameters": [ - { - "description": "Name of nornir module", - "in": "path", - "name": "module_name", - "required": "true", - "schema": { - "type": "string" - } - } - ], - "put": { - "description": "Update/Insert a Nornir module schema document.", - "operationId": "automation_gateway.api_v2.nornir.put", - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/UserSchema" - } - } - }, - "description": "Schema to apply to nornir module identified in path", - "required": "true", - "x-body-name": "schema" - }, - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "type": "object" - } - } - }, - "description": "Update schema response" - } - }, - "summary": "Update a Nornir module schema", - "tags": [ - "Nornir" - ] - } - }, - "/openapi_spec": { - "get": { - "description": "Get the current OpenAPI spec from the running instance of IAG", - "responses": { - "200": { - "content": { - "application/json": { - "example": { - "basepath": "/api/v2.0", - "swagger": "2.0" - }, - "schema": { - "type": "object" - } - } - }, - "description": "returns openapi spec" - } - }, - "summary": "Get the AG APIs", - "tags": [ - "System" - ] - } - }, - "/password_reset": { - "post": { - "description": "Reset password for user on the AG server.", - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/PasswordResetParameters" - } - } - }, - "description": "User object of account", - "required": "true", - "x-body-name": "user_object" - }, - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "type": "object" - } - } - }, - "description": "Response stating password reset was success or not" - }, - "400": { - "content": { - "application/json": { - "examples": { - "InvalidJSONError": { - "$ref": "#/components/examples/InvalidJSONError" - } - }, - "schema": { - "type": "object" - } - } - }, - "description": "Bad Request Error" - }, - "404": { - "content": { - "application/json": { - "examples": { - "UserNotFoundError": { - "$ref": "#/components/examples/UserNotFoundError" - } - }, - "schema": { - "$ref": "#/components/schemas/Error" - } - } - }, - "description": "Not Found Error" - } - }, - "summary": "Reset password for user on the AG server", - "tags": [ - "password_reset" - ] - } - }, - "/password_reset/update": { - "post": { - "description": "Update password for user on the AG server.", - "operationId": "automation_gateway.api_v2.password_reset.update", - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/PasswordUpdateParameters" - } - } - }, - "description": "User object of account", - "required": "true", - "x-body-name": "user_object" - }, - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "type": "object" - } - } - }, - "description": "Response stating password reset was success or not" - }, - "400": { - "content": { - "application/json": { - "examples": { - "InvalidJSONError": { - "$ref": "#/components/examples/InvalidJSONError" - } - }, - "schema": { - "type": "object" - } - } - }, - "description": "Bad Request Error" - }, - "404": { - "content": { - "application/json": { - "examples": { - "UserNotFoundError": { - "$ref": "#/components/examples/UserNotFoundError" - } - }, - "schema": { - "$ref": "#/components/schemas/Error" - } - } - }, - "description": "Not Found Error" - } - }, - "summary": "Update password for user on the AG server", - "tags": [ - "password_reset" - ] - } - }, - "/password_reset/update_flag/{username}": { - "post": { - "description": "Update the password change flag to false on the AG server.", - "operationId": "automation_gateway.api_v2.password_reset.update_flag", - "parameters": [ - { - "description": "Username of account", - "in": "path", - "name": "username", - "required": "true", - "schema": { - "type": "string" - } - } - ], - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "type": "object" - } - } - }, - "description": "Response stating the flag is set to false in database" - }, - "400": { - "content": { - "application/json": { - "examples": { - "InvalidJSONError": { - "$ref": "#/components/examples/InvalidJSONError" - } - }, - "schema": { - "type": "object" - } - } - }, - "description": "Bad Request Error" - }, - "404": { - "content": { - "application/json": { - "examples": { - "UserNotFoundError": { - "$ref": "#/components/examples/UserNotFoundError" - } - }, - "schema": { - "$ref": "#/components/schemas/Error" - } - } - }, - "description": "Not Found Error" - } - }, - "summary": "Update the password change flag to false on the AG server", - "tags": [ - "password_reset" - ] - } - }, - "/password_reset/update_questions": { - "post": { - "description": "Update security questions and answers for user on the AG server.", - "operationId": "automation_gateway.api_v2.password_reset.update_questions", - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/SecurityQuesUpdateParameters" - } - } - }, - "description": "User object of account", - "required": "true", - "x-body-name": "user_object" - }, - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "type": "object" - } - } - }, - "description": "Response stating whether security questions update successful or not" - }, - "400": { - "content": { - "application/json": { - "examples": { - "InvalidJSONError": { - "$ref": "#/components/examples/InvalidJSONError" - } - }, - "schema": { - "type": "object" - } - } - }, - "description": "Bad Request Error" - }, - "404": { - "content": { - "application/json": { - "examples": { - "UserNotFoundError": { - "$ref": "#/components/examples/UserNotFoundError" - } - }, - "schema": { - "$ref": "#/components/schemas/Error" - } - } - }, - "description": "Not Found Error" - } - }, - "summary": "Update security questions and answers for user on the AG server", - "tags": [ - "password_reset" - ] - } - }, - "/password_reset/validate_pass_change/{username}": { - "post": { - "description": "Validate if password is changed in the AG server.", - "operationId": "automation_gateway.api_v2.password_reset.validate_pass_change", - "parameters": [ - { - "description": "Username of account", - "in": "path", - "name": "username", - "required": "true", - "schema": { - "type": "string" - } - } - ], - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "type": "object" - } - } - }, - "description": "Response stating whether password change is needed or not" - }, - "400": { - "content": { - "application/json": { - "examples": { - "InvalidJSONError": { - "$ref": "#/components/examples/InvalidJSONError" - } - }, - "schema": { - "type": "object" - } - } - }, - "description": "Bad Request Error" - }, - "404": { - "content": { - "application/json": { - "examples": { - "NotFoundError": { - "$ref": "#/components/examples/NotFoundError" - } - }, - "schema": { - "$ref": "#/components/schemas/Error" - } - } - }, - "description": "Not Found Error" - } - }, - "summary": "Validate if password is changed in the AG server", - "tags": [ - "password_reset" - ] - } - }, - "/playbooks": { - "get": { - "description": "Get a list of Ansible playbooks.", - "parameters": [ - { - "description": "The number of items to skip before starting to collect the result set", - "in": "query", - "name": "offset", - "schema": { - "type": "integer" - } - }, - { - "description": "The number of items to return", - "in": "query", - "name": "limit", - "schema": { - "type": "integer" - } - }, - { - "description": "Response filter function with JSON name/value pair argument, i.e., contains({\"name\":\"sample\"})\nValid filter functions - contains, equals, startswith, endswith\n", - "in": "query", - "name": "filter", - "schema": { - "type": "string" - } - }, - { - "description": "Ascending/Descending sort indication", - "in": "query", - "name": "order", - "schema": { - "default": "ascending", - "enum": [ - "ascending", - "descending" - ], - "type": "string" - } - }, - { - "description": "Select between full detail or summary for each item", - "in": "query", - "name": "detail", - "schema": { - "default": "summary", - "enum": [ - "full", - "summary" - ], - "type": "string" - } - } - ], - "responses": { - "200": { - "content": { - "application/json": { - "example": { - "data": [ - { - "effective_schema_type": "user_schema", - "file": "/usr/share/automation-gateway/playbooks/sample_playbook.yml", - "name": "sample_playbook" - }, - { - "effective_schema_type": "user_schema", - "file": "/usr/share/automation-gateway/playbooks/sample_playbook_2.yml", - "name": "test_playbook" - } - ], - "meta": { - "count": "2", - "queryObject": { - "detail": "summary", - "filter": {}, - "order": "ascending" - } - } - }, - "schema": { - "properties": { - "data": { - "items": { - "$ref": "#/components/schemas/PlaybookSummary" - }, - "type": "array" - }, - "meta": { - "$ref": "#/components/schemas/Meta" - } - }, - "required": [ - "data", - "meta" - ], - "type": "object" - } - } - }, - "description": "get playbooks response" - }, - "400": { - "content": { - "application/json": { - "examples": { - "SearchFilterError": { - "$ref": "#/components/examples/SearchFilterError" - } - }, - "schema": { - "type": "object" - } - } - }, - "description": "Bad Request Error" - } - }, - "summary": "Get a list of Ansible playbooks", - "tags": [ - "Playbooks" - ] - } - }, - "/playbooks/refresh": { - "post": { - "description": "Perform Ansible playbook discovery and update internal cache.", - "operationId": "automation_gateway.api_v2.playbooks.refresh", - "responses": { - "200": { - "content": { - "application/json": { - "example": { - "code": "200", - "message": "Playbook refresh succeeded" - }, - "schema": { - "$ref": "#/components/schemas/PlaybookRefresh" - } - } - }, - "description": "display success or failure" - } - }, - "summary": "Refresh the Ansible playbook cache", - "tags": [ - "Playbooks" - ] - } - }, - "/playbooks/{playbook_name}": { - "get": { - "description": "Get information for an Ansible playbook.", - "parameters": [ - { - "description": "Name of playbook to retrieve.", - "in": "path", - "name": "playbook_name", - "required": "true", - "schema": { - "type": "string" - } - } - ], - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "type": "object" - } - } - }, - "description": "get playbook response" - }, - "404": { - "content": { - "application/json": { - "examples": { - "NotFoundError": { - "$ref": "#/components/examples/NotFoundError" - } - }, - "schema": { - "$ref": "#/components/schemas/Error" - } - } - }, - "description": "Not Found Error" - } - }, - "summary": "Get information for an Ansible playbook", - "tags": [ - "Playbooks" - ] - } - }, - "/playbooks/{playbook_name}/dry_run": { - "post": { - "description": "Execute an Ansible playbook with check mode i.e Dry run.", - "operationId": "automation_gateway.api_v2.playbooks.dry_run", - "parameters": [ - { - "description": "Name of playbook to execute Dry Run.", - "in": "path", - "name": "playbook_name", - "required": "true", - "schema": { - "type": "string" - } - } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/PlaybookParameters" - } - } - }, - "description": "Playbook Execution Parameters", - "required": "true", - "x-body-name": "playbook_parameters" - }, - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "type": "object" - } - } - }, - "description": "execute playbook response" - }, - "400": { - "content": { - "application/json": { - "examples": { - "BadParameter": { - "$ref": "#/components/examples/BadParameter" - }, - "MissingParameter": { - "$ref": "#/components/examples/MissingParameter" - } - }, - "schema": { - "$ref": "#/components/schemas/Error" - } - } - }, - "description": "Bad Request Error" - }, - "404": { - "content": { - "application/json": { - "examples": { - "NotFoundError": { - "$ref": "#/components/examples/NotFoundError" - } - }, - "schema": { - "$ref": "#/components/schemas/Error" - } - } - }, - "description": "Not Found Error" - }, - "500": { - "content": { - "application/json": { - "examples": { - "ServerError": { - "$ref": "#/components/examples/ServerError" - } - }, - "schema": { - "$ref": "#/components/schemas/Error" - } - } - }, - "description": "Internal Error" - } - }, - "summary": "Execute an Ansible playbook with check mode", - "tags": [ - "Playbooks" - ] - } - }, - "/playbooks/{playbook_name}/execute": { - "post": { - "description": "Execute an Ansible playbook.", - "operationId": "automation_gateway.api_v2.playbooks.execute", - "parameters": [ - { - "description": "Name of playbook to execute.", - "in": "path", - "name": "playbook_name", - "required": "true", - "schema": { - "type": "string" - } - } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/PlaybookParameters" - } - } - }, - "description": "Playbook Execution Parameters", - "required": "true", - "x-body-name": "playbook_parameters" - }, - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "type": "object" - } - } - }, - "description": "execute playbook response" - }, - "400": { - "content": { - "application/json": { - "examples": { - "BadParameter": { - "$ref": "#/components/examples/BadParameter" - }, - "MissingParameter": { - "$ref": "#/components/examples/MissingParameter" - } - }, - "schema": { - "$ref": "#/components/schemas/Error" - } - } - }, - "description": "Bad Request Error" - }, - "404": { - "content": { - "application/json": { - "examples": { - "NotFoundError": { - "$ref": "#/components/examples/NotFoundError" - } - }, - "schema": { - "$ref": "#/components/schemas/Error" - } - } - }, - "description": "Not Found Error" - }, - "500": { - "content": { - "application/json": { - "examples": { - "ServerError": { - "$ref": "#/components/examples/ServerError" - } - }, - "schema": { - "$ref": "#/components/schemas/Error" - } - } - }, - "description": "Internal Error" - } - }, - "summary": "Execute an Ansible playbook", - "tags": [ - "Playbooks" - ] - } - }, - "/playbooks/{playbook_name}/history": { - "get": { - "description": "Get execution log events for an Ansible playbook.", - "operationId": "automation_gateway.api_v2.playbooks.get_execution_log", - "parameters": [ - { - "description": "Name of playbook", - "in": "path", - "name": "playbook_name", - "required": "true", - "schema": { - "type": "string" - } - }, - { - "description": "The number of items to skip before starting to collect the result set", - "in": "query", - "name": "offset", - "schema": { - "type": "integer" - } - }, - { - "description": "The number of items to return", - "in": "query", - "name": "limit", - "schema": { - "type": "integer" - } - }, - { - "description": "Most recent execution on top of returned results unless user specifies ascending", - "in": "query", - "name": "order", - "schema": { - "default": "descending", - "enum": [ - "ascending", - "descending" - ], - "type": "string" - } - } - ], - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "type": "object" - } - } - }, - "description": "playbook execution log events response" - }, - "400": { - "content": { - "application/json": { - "examples": { - "BadParameter": { - "$ref": "#/components/examples/BadParameter" - }, - "MissingParameter": { - "$ref": "#/components/examples/MissingParameter" - } - }, - "schema": { - "$ref": "#/components/schemas/Error" - } - } - }, - "description": "Bad Request Error" - }, - "404": { - "content": { - "application/json": { - "examples": { - "NotFoundError": { - "$ref": "#/components/examples/NotFoundError" - } - }, - "schema": { - "$ref": "#/components/schemas/Error" - } - } - }, - "description": "Not Found Error" - }, - "500": { - "content": { - "application/json": { - "examples": { - "ServerError": { - "$ref": "#/components/examples/ServerError" - } - }, - "schema": { - "$ref": "#/components/schemas/Error" - } - } - }, - "description": "Internal Error" - } - }, - "summary": "Get Ansible playbook execution log", - "tags": [ - "Playbooks" - ] - } - }, - "/playbooks/{playbook_name}/schema": { - "delete": { - "description": "Remove an Ansible playbook schema.", - "operationId": "automation_gateway.api_v2.playbooks.delete", - "responses": { - "200": { - "content": { - "application/json": { - "examples": { - "Deleted": { - "$ref": "#/components/examples/Deleted" - } - }, - "schema": { - "$ref": "#/components/schemas/DeletedMessage" - } - } - }, - "description": "Message indicating playbook schema has been deleted." - }, - "404": { - "content": { - "application/json": { - "examples": { - "NotFoundError": { - "$ref": "#/components/examples/NotFoundError" - } - }, - "schema": { - "$ref": "#/components/schemas/Error" - } - } - }, - "description": "Not Found Error" - } - }, - "summary": "Remove an Ansible playbook schema", - "tags": [ - "Playbooks" - ] - }, - "get": { - "description": "Get the schema for an Ansible playbook.", - "operationId": "automation_gateway.api_v2.playbooks.get_schema", - "responses": { - "200": { - "content": { - "application/json": { - "example": { - "schema": { - "properties": { - "interface": { - "description": "Name of device interface", - "type": "string" - } - }, - "required": [ - "interface" - ], - "title": "sample_playbook", - "type": "object" - } - }, - "schema": { - "$ref": "#/components/schemas/UserSchema" - } - } - }, - "description": "object with schema for playbook" - }, - "404": { - "content": { - "application/json": { - "examples": { - "NotFoundError": { - "$ref": "#/components/examples/NotFoundError" - } - }, - "schema": { - "$ref": "#/components/schemas/Error" - } - } - }, - "description": "Not Found Error" - } - }, - "summary": "Get an Ansible playbook schema", - "tags": [ - "Playbooks" - ] - }, - "parameters": [ - { - "description": "Name of playbook", - "in": "path", - "name": "playbook_name", - "required": "true", - "schema": { - "type": "string" - } - } - ], - "put": { - "description": "Update/Insert an Ansible playbook schema document.", - "operationId": "automation_gateway.api_v2.playbooks.put", - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/UserSchema" - } - } - }, - "description": "Schema to apply to playbook identified in path", - "required": "true", - "x-body-name": "schema" - }, - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "type": "object" - } - } - }, - "description": "Update schema response" - } - }, - "summary": "Update an Ansible playbook schema", - "tags": [ - "Playbooks" - ] - } - }, - "/poll": { - "get": { - "description": "Determine if AG server is up and running.", - "responses": { - "200": { - "content": { - "application/json": { - "example": { - "hostname": "automation-gateway-host", - "serviceId": "b3-33-00-00-89-01:8083", - "success": "true" - }, - "schema": { - "$ref": "#/components/schemas/Health", - "type": "object" - } - } - }, - "description": "get system health response" - } - }, - "summary": "Poll AG server health", - "tags": [ - "System" - ] - } - }, - "/pronghorn": { - "get": { - "description": "Get pronghorn.json for the AG server.", - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "type": "object" - } - } - }, - "description": "get pronghorn.json as the response" - }, - "400": { - "content": { - "application/json": { - "examples": { - "InvalidJSONError": { - "$ref": "#/components/examples/InvalidJSONError" - } - }, - "schema": { - "type": "object" - } - } - }, - "description": "Bad Request Error" - } - }, - "summary": "Retrieve pronghorn.json for the AG server", - "tags": [ - "Pronghorn" - ] - } - }, - "/pythonvenv/list": { - "get": { - "description": "Get a list of python venvs", - "operationId": "automation_gateway.api_v2.python_venv.list", - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "items": { - "$ref": "#/components/schemas/PythonVenv" - }, - "type": "array" - } - } - }, - "description": "List of virtual environments" - } - }, - "summary": "Get a list of python venvs", - "tags": [ - "PythonVenv" - ] - } - }, - "/pythonvenv/refresh": { - "get": { - "description": "Refresh the list of python venvs", - "operationId": "automation_gateway.api_v2.python_venv.refresh", - "responses": { - "200": { - "content": { - "application/json": { - "example": { - "code": "200" - } - } - }, - "description": "Display a list of python venvs" - } - }, - "summary": "Refresh the list of python venvs", - "tags": [ - "PythonVenv" - ] - } - }, - "/rbac/groups": { - "get": { - "description": "Get a list of RBAC groups.", - "operationId": "automation_gateway.api_v2.rbac.get_rbac_groups", - "parameters": [ - { - "description": "The number of items to skip before starting to collect the result set", - "in": "query", - "name": "offset", - "schema": { - "type": "integer" - } - }, - { - "description": "The number of items to return", - "in": "query", - "name": "limit", - "schema": { - "type": "integer" - } - }, - { - "description": "Response filter function with JSON name/value pair argument, i.e., contains({\"name\":\"admin\"})\nValid filter functions - contains, equals, startswith, endswith\n", - "in": "query", - "name": "filter", - "schema": { - "type": "string" - } - }, - { - "description": "Ascending/Descending sort indication", - "in": "query", - "name": "order", - "schema": { - "default": "ascending", - "enum": [ - "ascending", - "descending" - ], - "type": "string" - } - } - ], - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "properties": { - "data": { - "items": { - "$ref": "#/components/schemas/RbacGroup" - }, - "type": "array" - }, - "meta": { - "$ref": "#/components/schemas/Meta" - } - }, - "required": [ - "data", - "meta" - ], - "type": "object" - } - } - }, - "description": "get groups response" - }, - "400": { - "content": { - "application/json": { - "example": { - "code": "400", - "message": "Invalid JSON in rbac group filter" - }, - "schema": { - "type": "object" - } - } - }, - "description": "Bad Request Error" - } - }, - "summary": "Get list of RBAC groups", - "tags": [ - "RBAC" - ] - }, - "post": { - "description": "Add a new RBAC group", - "operationId": "automation_gateway.api_v2.rbac.create_group", - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/RbacGroup" - } - } - }, - "description": "Rbac Group definition", - "required": "true", - "x-body-name": "group" - }, - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/RbacGroup" - } - } - }, - "description": "Returns group that was created." - }, - "409": { - "content": { - "application/json": { - "examples": { - "Duplicate": { - "$ref": "#/components/examples/Duplicate" - } - }, - "schema": { - "$ref": "#/components/schemas/Error" - } - } - }, - "description": "Duplicate Name Error (resource with same name already exists)" - } - }, - "summary": "Add a new RBAC group", - "tags": [ - "RBAC" - ] - } - }, - "/rbac/groups/{group_name}": { - "delete": { - "description": "Delete an RBAC group.", - "operationId": "automation_gateway.api_v2.rbac.delete_group", - "responses": { - "200": { - "content": { - "application/json": { - "examples": { - "Deleted": { - "$ref": "#/components/examples/Deleted" - } - }, - "schema": { - "$ref": "#/components/schemas/DeletedMessage" - } - } - }, - "description": "Message indicating group has been deleted." - } - }, - "summary": "Delete an RBAC group", - "tags": [ - "RBAC" - ] - }, - "get": { - "description": "Get information for an RBAC group.", - "operationId": "automation_gateway.api_v2.rbac.get_group", - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/RbacGroup" - } - } - }, - "description": "RBAC Group information" - }, - "404": { - "content": { - "application/json": { - "examples": { - "NotFoundError": { - "$ref": "#/components/examples/NotFoundError" - } - }, - "schema": { - "$ref": "#/components/schemas/Error" - } - } - }, - "description": "Not Found Error" - } - }, - "summary": "Get RBAC group information", - "tags": [ - "RBAC" - ] - }, - "parameters": [ - { - "description": "Name of group", - "in": "path", - "name": "group_name", - "required": "true", - "schema": { - "type": "string" - } - } - ], - "put": { - "operationId": "automation_gateway.api_v2.rbac.update_group", - "requestBody": { - "content": { - "application/json": { - "schema": { - "properties": { - "description": { - "type": "string" - }, - "roles": { - "items": { - "type": "string" - }, - "minItems": "1", - "type": "array" - }, - "users": { - "items": { - "type": "string" - }, - "minItems": "1", - "type": "array" - } - }, - "type": "object" - } - } - }, - "description": "Group Updates", - "required": "true", - "x-body-name": "group" - }, - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/RbacGroup" - } - } - }, - "description": "RBAC Group information" - }, - "404": { - "content": { - "application/json": { - "examples": { - "NotFoundError": { - "$ref": "#/components/examples/NotFoundError" - } - }, - "schema": { - "$ref": "#/components/schemas/Error" - } - } - }, - "description": "Not Found Error" - } - }, - "summary": "Update an RBAC group", - "tags": [ - "RBAC" - ] - } - }, - "/rbac/groups/{group_name}/roles": { - "get": { - "operationId": "automation_gateway.api_v2.rbac.get_group_roles", - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "items": { - "type": "string" - }, - "type": "array" - } - } - }, - "description": "List with roles for RBAC group" - }, - "404": { - "content": { - "application/json": { - "examples": { - "NotFoundError": { - "$ref": "#/components/examples/NotFoundError" - } - }, - "schema": { - "$ref": "#/components/schemas/Error" - } - } - }, - "description": "Not Found Error" - } - }, - "summary": "Get roles for an RBAC group", - "tags": [ - "RBAC" - ] - }, - "parameters": [ - { - "description": "Name of RBAC group", - "in": "path", - "name": "group_name", - "required": "true", - "schema": { - "type": "string" - } - } - ], - "post": { - "description": "Add new roles to the RBAC group.", - "operationId": "automation_gateway.api_v2.rbac.add_group_roles", - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/RbacGroupRoles" - } - } - }, - "description": "Object containing list of roles.", - "required": "true", - "x-body-name": "roles_obj" - }, - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/RbacGroupRoles" - } - } - }, - "description": "Returns roles added." - }, - "404": { - "content": { - "application/json": { - "examples": { - "NotFoundError": { - "$ref": "#/components/examples/NotFoundError" - } - }, - "schema": { - "$ref": "#/components/schemas/Error" - } - } - }, - "description": "Not Found Error" - } - }, - "summary": "Add new roles to the RBAC group", - "tags": [ - "RBAC" - ] - } - }, - "/rbac/groups/{group_name}/roles/{role_name}": { - "delete": { - "description": "Delete a role from the RBAC group.", - "operationId": "automation_gateway.api_v2.rbac.delete_group_role", - "parameters": [ - { - "description": "Name of RBAC group", - "in": "path", - "name": "group_name", - "required": "true", - "schema": { - "type": "string" - } - }, - { - "description": "Name of role", - "in": "path", - "name": "role_name", - "required": "true", - "schema": { - "type": "string" - } - } - ], - "responses": { - "200": { - "content": { - "application/json": { - "examples": { - "Deleted": { - "$ref": "#/components/examples/Deleted" - } - }, - "schema": { - "$ref": "#/components/schemas/DeletedMessage" - } - } - }, - "description": "Message indicating role has been deleted from RBAC group." - }, - "404": { - "content": { - "application/json": { - "examples": { - "NotFoundError": { - "$ref": "#/components/examples/NotFoundError" - } - }, - "schema": { - "$ref": "#/components/schemas/Error" - } - } - }, - "description": "Not Found Error" - } - }, - "summary": "Delete a role from the RBAC group", - "tags": [ - "RBAC" - ] - } - }, - "/rbac/groups/{group_name}/users": { - "get": { - "operationId": "automation_gateway.api_v2.rbac.get_group_users", - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "items": { - "type": "string" - }, - "type": "array" - } - } - }, - "description": "List with users for RBAC group" - }, - "404": { - "content": { - "application/json": { - "examples": { - "NotFoundError": { - "$ref": "#/components/examples/NotFoundError" - } - }, - "schema": { - "$ref": "#/components/schemas/Error" - } - } - }, - "description": "Not Found Error" - } - }, - "summary": "Get users for an RBAC group", - "tags": [ - "RBAC" - ] - }, - "parameters": [ - { - "description": "Name of RBAC group", - "in": "path", - "name": "group_name", - "required": "true", - "schema": { - "type": "string" - } - } - ], - "post": { - "description": "Add new users to the RBAC group.", - "operationId": "automation_gateway.api_v2.rbac.add_group_users", - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/RbacGroupUsers" - } - } - }, - "description": "Object containing list of users.", - "required": "true", - "x-body-name": "users_obj" - }, - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/RbacGroupUsers" - } - } - }, - "description": "Returns users added." - }, - "404": { - "content": { - "application/json": { - "examples": { - "NotFoundError": { - "$ref": "#/components/examples/NotFoundError" - } - }, - "schema": { - "$ref": "#/components/schemas/Error" - } - } - }, - "description": "Not Found Error" - } - }, - "summary": "Add new users to an RBAC group", - "tags": [ - "RBAC" - ] - } - }, - "/rbac/groups/{group_name}/users/{user_name}": { - "delete": { - "description": "Delete a user from the RBAC group.", - "operationId": "automation_gateway.api_v2.rbac.delete_group_user", - "parameters": [ - { - "description": "Name of RBAC group", - "in": "path", - "name": "group_name", - "required": "true", - "schema": { - "type": "string" - } - }, - { - "description": "Name of user", - "in": "path", - "name": "user_name", - "required": "true", - "schema": { - "type": "string" - } - } - ], - "responses": { - "200": { - "content": { - "application/json": { - "examples": { - "Deleted": { - "$ref": "#/components/examples/Deleted" - } - }, - "schema": { - "$ref": "#/components/schemas/DeletedMessage" - } - } - }, - "description": "Message indicating user has been deleted from RBAC group." - }, - "404": { - "content": { - "application/json": { - "examples": { - "NotFoundError": { - "$ref": "#/components/examples/NotFoundError" - } - }, - "schema": { - "$ref": "#/components/schemas/Error" - } - } - }, - "description": "Not Found Error" - } - }, - "summary": "Delete a user from the RBAC group", - "tags": [ - "RBAC" - ] - } - }, - "/rbac/roles": { - "get": { - "description": "Get a list of RBAC roles.", - "operationId": "automation_gateway.api_v2.rbac.get_rbac_roles", - "parameters": [ - { - "description": "The number of items to skip before starting to collect the result set", - "in": "query", - "name": "offset", - "schema": { - "type": "integer" - } - }, - { - "description": "The number of items to return", - "in": "query", - "name": "limit", - "schema": { - "type": "integer" - } - }, - { - "description": "Response filter function with JSON name/value pair argument, i.e., contains({\"name\":\"modules\"})\nValid filter functions - contains, equals, startswith, endswith\n", - "in": "query", - "name": "filter", - "schema": { - "type": "string" - } - }, - { - "description": "Ascending/Descending sort indication", - "in": "query", - "name": "order", - "schema": { - "default": "ascending", - "enum": [ - "ascending", - "descending" - ], - "type": "string" - } - } - ], - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "properties": { - "data": { - "items": { - "$ref": "#/components/schemas/RbacRole" - }, - "type": "array" - }, - "meta": { - "$ref": "#/components/schemas/Meta" - } - }, - "required": [ - "data", - "meta" - ], - "type": "object" - } - } - }, - "description": "get RBAC roles response" - }, - "400": { - "content": { - "application/json": { - "example": { - "code": "400", - "message": "Invalid JSON in RBAC role filter" - }, - "schema": { - "type": "object" - } - } - }, - "description": "Bad Request Error" - } - }, - "summary": "Get list of RBAC roles", - "tags": [ - "RBAC" - ] - } - }, - "/rbac/roles/{role_name}": { - "get": { - "description": "Get information for an RBAC role.", - "operationId": "automation_gateway.api_v2.rbac.get_role", - "parameters": [ - { - "description": "Name of RBAC role", - "in": "path", - "name": "role_name", - "required": "true", - "schema": { - "type": "string" - } - } - ], - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/RbacRole" - } - } - }, - "description": "RBAC Role information" - }, - "404": { - "content": { - "application/json": { - "examples": { - "NotFoundError": { - "$ref": "#/components/examples/NotFoundError" - } - }, - "schema": { - "$ref": "#/components/schemas/Error" - } - } - }, - "description": "Not Found Error" - } - }, - "summary": "Get RBAC role information", - "tags": [ - "RBAC" - ] - } - }, - "/rbac/users/{user_name}/groups": { - "get": { - "description": "Get RBAC group information for a user.", - "operationId": "automation_gateway.api_v2.rbac.get_user_groups", - "parameters": [ - { - "description": "Name of user", - "in": "path", - "name": "user_name", - "required": "true", - "schema": { - "type": "string" - } - }, - { - "description": "The number of items to skip before starting to collect the result set", - "in": "query", - "name": "offset", - "schema": { - "type": "integer" - } - }, - { - "description": "The number of items to return", - "in": "query", - "name": "limit", - "schema": { - "type": "integer" - } - }, - { - "description": "Response filter function with JSON name/value pair argument, i.e., contains({\"name\":\"admin\"})\nValid filter functions - contains, equals, startswith, endswith\n", - "in": "query", - "name": "filter", - "schema": { - "type": "string" - } - }, - { - "description": "Ascending/Descending sort indication", - "in": "query", - "name": "order", - "schema": { - "default": "ascending", - "enum": [ - "ascending", - "descending" - ], - "type": "string" - } - } - ], - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/RbacGroup" - } - } - }, - "description": "RBAC Group information" - }, - "404": { - "content": { - "application/json": { - "examples": { - "NotFoundError": { - "$ref": "#/components/examples/NotFoundError" - } - }, - "schema": { - "$ref": "#/components/schemas/Error" - } - } - }, - "description": "Not Found Error" - } - }, - "summary": "Get RBAC groups for a user", - "tags": [ - "RBAC" - ] - } - }, - "/rbac/users/{user_name}/roles": { - "get": { - "description": "Get RBAC role information for a user.", - "operationId": "automation_gateway.api_v2.rbac.get_user_roles", - "parameters": [ - { - "description": "Name of user", - "in": "path", - "name": "user_name", - "required": "true", - "schema": { - "type": "string" - } - }, - { - "description": "The number of items to skip before starting to collect the result set", - "in": "query", - "name": "offset", - "schema": { - "type": "integer" - } - }, - { - "description": "The number of items to return", - "in": "query", - "name": "limit", - "schema": { - "type": "integer" - } - }, - { - "description": "Response filter function with JSON name/value pair argument, i.e., contains({\"name\":\"modules:read\"})\nValid filter functions - contains, equals, startswith, endswith\n", - "in": "query", - "name": "filter", - "schema": { - "type": "string" - } - }, - { - "description": "Ascending/Descending sort indication", - "in": "query", - "name": "order", - "schema": { - "default": "ascending", - "enum": [ - "ascending", - "descending" - ], - "type": "string" - } - } - ], - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/RbacRole" - } - } - }, - "description": "RBAC Role information" - }, - "404": { - "content": { - "application/json": { - "examples": { - "NotFoundError": { - "$ref": "#/components/examples/NotFoundError" - } - }, - "schema": { - "$ref": "#/components/schemas/Error" - } - } - }, - "description": "Not Found Error" - } - }, - "summary": "Get RBAC roles for a user", - "tags": [ - "RBAC" - ] - } - }, - "/roles": { - "get": { - "description": "Get a list of Ansible roles.", - "parameters": [ - { - "description": "The number of items to skip before starting to collect the result set", - "in": "query", - "name": "offset", - "schema": { - "type": "integer" - } - }, - { - "description": "The number of items to return", - "in": "query", - "name": "limit", - "schema": { - "type": "integer" - } - }, - { - "description": "Response filter function with JSON name/value pair argument, i.e., contains({\"name\":\"itential\"})\nValid filter functions - contains, equals, startswith, endswith\n", - "in": "query", - "name": "filter", - "schema": { - "type": "string" - } - }, - { - "description": "Ascending/Descending sort indication", - "in": "query", - "name": "order", - "schema": { - "default": "ascending", - "enum": [ - "ascending", - "descending" - ], - "type": "string" - } - }, - { - "description": "Select between full detail or summary for each item", - "in": "query", - "name": "detail", - "schema": { - "default": "summary", - "enum": [ - "full", - "summary" - ], - "type": "string" - } - } - ], - "responses": { - "200": { - "content": { - "application/json": { - "example": { - "data": [ - { - "author": "Itential", - "company": "Itential Inc.", - "description": "Run a CLI command on a network device", - "effective_schema_type": "certified_schema", - "galaxy_tags": [], - "itential_modified": "true", - "min_ansible_version": "2.6.3", - "name": "itential_cli" - }, - { - "author": "Itential", - "company": "Itential Inc.", - "description": "Run a CLI command to retrieve the running configuration on a network device.", - "effective_schema_type": "certified_schema", - "galaxy_tags": [], - "itential_modified": "true", - "min_ansible_version": "2.6.3", - "name": "itential_get_config" - } - ], - "meta": { - "count": "2", - "queryObject": { - "detail": "summary", - "filter": {}, - "order": "ascending" - } - } - }, - "schema": { - "properties": { - "data": { - "items": { - "$ref": "#/components/schemas/RoleSummary" - }, - "type": "array" - }, - "meta": { - "$ref": "#/components/schemas/Meta" - } - }, - "required": [ - "data", - "meta" - ], - "type": "object" - } - } - }, - "description": "get roles response" - }, - "400": { - "content": { - "application/json": { - "examples": { - "SearchFilterError": { - "$ref": "#/components/examples/SearchFilterError" - } - }, - "schema": { - "type": "object" - } - } - }, - "description": "Bad Request Error" - } - }, - "summary": "Get a list of Ansible roles", - "tags": [ - "Roles" - ] - } - }, - "/roles/refresh": { - "post": { - "description": "Perform Ansible role discovery and update internal cache.", - "operationId": "automation_gateway.api_v2.roles.refresh", - "responses": { - "200": { - "content": { - "application/json": { - "example": { - "code": "200", - "message": "Role refresh succeeded" - }, - "schema": { - "$ref": "#/components/schemas/RoleRefresh" - } - } - }, - "description": "display success or failure" - } - }, - "summary": "Refresh Ansible role cache", - "tags": [ - "Roles" - ] - } - }, - "/roles/{role_name}": { - "get": { - "description": "Get information for an Ansible role.", - "parameters": [ - { - "description": "Name of role", - "in": "path", - "name": "role_name", - "required": "true", - "schema": { - "type": "string" - } - } - ], - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "type": "object" - } - } - }, - "description": "get role response" - }, - "404": { - "content": { - "application/json": { - "examples": { - "NotFoundError": { - "$ref": "#/components/examples/NotFoundError" - } - }, - "schema": { - "$ref": "#/components/schemas/Error" - } - } - }, - "description": "Not Found Error" - } - }, - "summary": "Get information for an Ansible role", - "tags": [ - "Roles" - ] - } - }, - "/roles/{role_name}/execute": { - "post": { - "description": "Execute an Ansible role.", - "operationId": "automation_gateway.api_v2.roles.execute", - "parameters": [ - { - "description": "Name of role", - "in": "path", - "name": "role_name", - "required": "true", - "schema": { - "type": "string" - } - } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/RoleParameters" - } - } - }, - "description": "Role Execution Parameters", - "required": "true", - "x-body-name": "role_parameters" - }, - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "type": "object" - } - } - }, - "description": "execute role response" - }, - "400": { - "content": { - "application/json": { - "examples": { - "BadParameter": { - "$ref": "#/components/examples/BadParameter" - }, - "MissingParameter": { - "$ref": "#/components/examples/MissingParameter" - } - }, - "schema": { - "$ref": "#/components/schemas/Error" - } - } - }, - "description": "Bad Request Error" - }, - "404": { - "content": { - "application/json": { - "examples": { - "NotFoundError": { - "$ref": "#/components/examples/NotFoundError" - } - }, - "schema": { - "$ref": "#/components/schemas/Error" - } - } - }, - "description": "Not Found Error" - }, - "500": { - "content": { - "application/json": { - "examples": { - "ServerError": { - "$ref": "#/components/examples/ServerError" - } - }, - "schema": { - "$ref": "#/components/schemas/Error" - } - } - }, - "description": "Internal Error" - } - }, - "summary": "Execute an Ansible role", - "tags": [ - "Roles" - ] - } - }, - "/roles/{role_name}/history": { - "get": { - "description": "Get execution log events for an Ansible role.", - "operationId": "automation_gateway.api_v2.roles.get_execution_log", - "parameters": [ - { - "description": "Name of role", - "in": "path", - "name": "role_name", - "required": "true", - "schema": { - "type": "string" - } - }, - { - "description": "The number of items to skip before starting to collect the result set", - "in": "query", - "name": "offset", - "schema": { - "type": "integer" - } - }, - { - "description": "The number of items to return", - "in": "query", - "name": "limit", - "schema": { - "type": "integer" - } - }, - { - "description": "Most recent execution on top of returned results unless user specifies ascending", - "in": "query", - "name": "order", - "schema": { - "default": "descending", - "enum": [ - "ascending", - "descending" - ], - "type": "string" - } - } - ], - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "type": "object" - } - } - }, - "description": "role execution log events response" - }, - "400": { - "content": { - "application/json": { - "examples": { - "BadParameter": { - "$ref": "#/components/examples/BadParameter" - }, - "MissingParameter": { - "$ref": "#/components/examples/MissingParameter" - } - }, - "schema": { - "$ref": "#/components/schemas/Error" - } - } - }, - "description": "Bad Request Error" - }, - "404": { - "content": { - "application/json": { - "examples": { - "NotFoundError": { - "$ref": "#/components/examples/NotFoundError" - } - }, - "schema": { - "$ref": "#/components/schemas/Error" - } - } - }, - "description": "Not Found Error" - }, - "500": { - "content": { - "application/json": { - "examples": { - "ServerError": { - "$ref": "#/components/examples/ServerError" - } - }, - "schema": { - "$ref": "#/components/schemas/Error" - } - } - }, - "description": "Internal Error" - } - }, - "summary": "Get execution log for an Ansible role", - "tags": [ - "Roles" - ] - } - }, - "/roles/{role_name}/schema": { - "delete": { - "description": "Remove an Ansible role schema.", - "operationId": "automation_gateway.api_v2.roles.delete", - "responses": { - "200": { - "content": { - "application/json": { - "examples": { - "Deleted": { - "$ref": "#/components/examples/Deleted" - } - }, - "schema": { - "$ref": "#/components/schemas/DeletedMessage" - } - } - }, - "description": "Message indicating role schema has been deleted." - }, - "404": { - "content": { - "application/json": { - "examples": { - "NotFoundError": { - "$ref": "#/components/examples/NotFoundError" - } - }, - "schema": { - "$ref": "#/components/schemas/Error" - } - } - }, - "description": "Not Found Error" - } - }, - "summary": "Remove an Ansible role schema", - "tags": [ - "Roles" - ] - }, - "get": { - "description": "Get the schema for an Ansible role.", - "operationId": "automation_gateway.api_v2.roles.get_schema", - "responses": { - "200": { - "content": { - "application/json": { - "example": { - "schema": { - "properties": { - "port": { - "description": "Port to connect to device", - "type": "integer" - } - }, - "required": [ - "port" - ], - "title": "sample_role", - "type": "object" - } - }, - "schema": { - "$ref": "#/components/schemas/UserSchema" - } - } - }, - "description": "object with schema for role" - }, - "404": { - "content": { - "application/json": { - "examples": { - "NotFoundError": { - "$ref": "#/components/examples/NotFoundError" - } - }, - "schema": { - "$ref": "#/components/schemas/Error" - } - } - }, - "description": "Not Found Error" - } - }, - "summary": "Get the schema for an Ansible role", - "tags": [ - "Roles" - ] - }, - "parameters": [ - { - "description": "Name of role", - "in": "path", - "name": "role_name", - "required": "true", - "schema": { - "type": "string" - } - } - ], - "put": { - "description": "Update/Insert an Ansible role schema document.", - "operationId": "automation_gateway.api_v2.roles.put", - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/UserSchema" - } - } - }, - "description": "Schema to apply to role identified in path", - "required": "true", - "x-body-name": "schema" - }, - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "type": "object" - } - } - }, - "description": "Update schema response" - } - }, - "summary": "Update an Ansible role schema", - "tags": [ - "Roles" - ] - } - }, - "/scripts": { - "get": { - "description": "Get a list of scripts.", - "parameters": [ - { - "description": "The number of items to skip before starting to collect the result set", - "in": "query", - "name": "offset", - "schema": { - "type": "integer" - } - }, - { - "description": "The number of items to return", - "in": "query", - "name": "limit", - "schema": { - "type": "integer" - } - }, - { - "description": "Response filter function with JSON name/value pair argument, i.e., contains({\"name\":\"sample\"})\nValid filter functions - contains, equals, startswith, endswith\n", - "in": "query", - "name": "filter", - "schema": { - "type": "string" - } - }, - { - "description": "Ascending/Descending sort indication", - "in": "query", - "name": "order", - "schema": { - "default": "ascending", - "enum": [ - "ascending", - "descending" - ], - "type": "string" - } - }, - { - "description": "Select between full detail or summary for each item", - "in": "query", - "name": "detail", - "schema": { - "default": "summary", - "enum": [ - "full", - "summary" - ], - "type": "string" - } - } - ], - "responses": { - "200": { - "content": { - "application/json": { - "example": { - "data": [ - { - "effective_schema_type": "user_schema", - "file": "/usr/share/automation-gateway/scripts/sample_script.sh", - "name": "sample_script.sh" - }, - { - "effective_schema_type": "user_schema", - "file": "/usr/share/automation-gateway/scripts/sample_module.py", - "name": "test_module.py" - } - ], - "meta": { - "count": "2", - "queryObject": { - "detail": "summary", - "filter": {}, - "order": "ascending" - } - } - }, - "schema": { - "properties": { - "data": { - "items": { - "$ref": "#/components/schemas/ScriptSummary" - }, - "type": "array" - }, - "meta": { - "$ref": "#/components/schemas/Meta" - } - }, - "required": [ - "data", - "meta" - ], - "type": "object" - } - } - }, - "description": "get scripts response" - }, - "400": { - "content": { - "application/json": { - "examples": { - "SearchFilterError": { - "$ref": "#/components/examples/SearchFilterError" - } - }, - "schema": { - "type": "object" - } - } - }, - "description": "Bad Request Error" - } - }, - "summary": "Get list of scripts", - "tags": [ - "Scripts" - ] - } - }, - "/scripts/refresh": { - "post": { - "description": "Perform script discovery and update internal cache.", - "operationId": "automation_gateway.api_v2.scripts.refresh", - "responses": { - "200": { - "content": { - "application/json": { - "example": { - "code": "200", - "message": "Script refresh succeeded" - }, - "schema": { - "$ref": "#/components/schemas/ScriptRefresh" - } - } - }, - "description": "display success or failure" - } - }, - "summary": "Refresh script cache", - "tags": [ - "Scripts" - ] - } - }, - "/scripts/{script_name}": { - "get": { - "description": "Get script information.", - "parameters": [ - { - "description": "Name of script to retrieve.", - "in": "path", - "name": "script_name", - "required": "true", - "schema": { - "type": "string" - } - } - ], - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "type": "object" - } - } - }, - "description": "get script response" - }, - "400": { - "content": { - "application/json": { - "examples": { - "BadParameter": { - "$ref": "#/components/examples/BadParameter" - }, - "MissingParameter": { - "$ref": "#/components/examples/MissingParameter" - } - }, - "schema": { - "$ref": "#/components/schemas/Error" - } - } - }, - "description": "Bad Request Error" - } - }, - "summary": "Get script information", - "tags": [ - "Scripts" - ] - } - }, - "/scripts/{script_name}/execute": { - "post": { - "description": "Execute a script.", - "operationId": "automation_gateway.api_v2.scripts.execute", - "parameters": [ - { - "description": "Name of script to execute.", - "in": "path", - "name": "script_name", - "required": "true", - "schema": { - "type": "string" - } - } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ScriptParameters" - } - } - }, - "description": "Script Execution Parameters", - "required": "true", - "x-body-name": "script_parameters" - }, - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "type": "object" - } - } - }, - "description": "execute script response" - }, - "400": { - "content": { - "application/json": { - "example": { - "code": "400", - "message": "'args' is a required parameter" - }, - "schema": { - "$ref": "#/components/schemas/Error" - } - } - }, - "description": "Bad Request Error" - }, - "404": { - "content": { - "application/json": { - "examples": { - "NotFoundError": { - "$ref": "#/components/examples/NotFoundError" - } - }, - "schema": { - "$ref": "#/components/schemas/Error" - } - } - }, - "description": "Not Found Error" - }, - "500": { - "content": { - "application/json": { - "examples": { - "ServerError": { - "$ref": "#/components/examples/ServerError" - } - }, - "schema": { - "$ref": "#/components/schemas/Error" - } - } - }, - "description": "Internal Error" - } - }, - "summary": "Execute a script", - "tags": [ - "Scripts" - ] - } - }, - "/scripts/{script_name}/history": { - "get": { - "description": "Get execution log events for a script.", - "operationId": "automation_gateway.api_v2.scripts.get_execution_log", - "parameters": [ - { - "description": "Name of script", - "in": "path", - "name": "script_name", - "required": "true", - "schema": { - "type": "string" - } - }, - { - "description": "The number of items to skip before starting to collect the result set", - "in": "query", - "name": "offset", - "schema": { - "type": "integer" - } - }, - { - "description": "The number of items to return", - "in": "query", - "name": "limit", - "schema": { - "type": "integer" - } - }, - { - "description": "Most recent execution on top of returned results unless user specifies ascending", - "in": "query", - "name": "order", - "schema": { - "default": "descending", - "enum": [ - "ascending", - "descending" - ], - "type": "string" - } - } - ], - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "type": "object" - } - } - }, - "description": "script execution log events response" - }, - "400": { - "content": { - "application/json": { - "examples": { - "BadParameter": { - "$ref": "#/components/examples/BadParameter" - }, - "MissingParameter": { - "$ref": "#/components/examples/MissingParameter" - } - }, - "schema": { - "$ref": "#/components/schemas/Error" - } - } - }, - "description": "Bad Request Error" - }, - "404": { - "content": { - "application/json": { - "examples": { - "NotFoundError": { - "$ref": "#/components/examples/NotFoundError" - } - }, - "schema": { - "$ref": "#/components/schemas/Error" - } - } - }, - "description": "Not Found Error" - }, - "500": { - "content": { - "application/json": { - "examples": { - "ServerError": { - "$ref": "#/components/examples/ServerError" - } - }, - "schema": { - "$ref": "#/components/schemas/Error" - } - } - }, - "description": "Internal Error" - } - }, - "summary": "Get script execution log", - "tags": [ - "Scripts" - ] - } - }, - "/scripts/{script_name}/schema": { - "delete": { - "description": "Remove a script schema.", - "operationId": "automation_gateway.api_v2.scripts.delete", - "responses": { - "200": { - "content": { - "application/json": { - "examples": { - "Deleted": { - "$ref": "#/components/examples/Deleted" - } - }, - "schema": { - "$ref": "#/components/schemas/DeletedMessage" - } - } - }, - "description": "Message indicating script schema has been deleted." - }, - "404": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Error" - } - } - }, - "description": "Not Found Error" - } - }, - "summary": "Remove a script schema", - "tags": [ - "Scripts" - ] - }, - "get": { - "description": "Get the schema for a script.", - "operationId": "automation_gateway.api_v2.scripts.get_schema", - "responses": { - "200": { - "content": { - "application/json": { - "example": { - "schema": { - "properties": { - "destination": { - "description": "Destination filename", - "type": "string" - }, - "source": { - "description": "Source filename", - "type": "string" - } - }, - "required": [ - "source", - "destination" - ], - "script_argument_order": [ - "source", - "destination" - ], - "title": "sample_script.sh", - "type": "object" - } - }, - "schema": { - "$ref": "#/components/schemas/UserSchema" - } - } - }, - "description": "object with schema for script" - }, - "404": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Error" - } - } - }, - "description": "Not Found Error" - } - }, - "summary": "Get a script schema", - "tags": [ - "Scripts" - ] - }, - "parameters": [ - { - "description": "Name of script", - "in": "path", - "name": "script_name", - "required": "true", - "schema": { - "type": "string" - } - } - ], - "put": { - "description": "Update/Insert a script schema document.", - "operationId": "automation_gateway.api_v2.scripts.put", - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/UserSchema" - } - } - }, - "description": "Schema to apply to script identified in path", - "required": "true", - "x-body-name": "schema" - }, - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "type": "object" - } - } - }, - "description": "Update schema response" - } - }, - "summary": "Update a script schema", - "tags": [ - "Scripts" - ] - } - }, - "/secrets": { - "delete": { - "description": "Delete a Hashicorp Vault secret.", - "responses": { - "200": { - "content": { - "application/json": { - "examples": { - "Deleted": { - "$ref": "#/components/examples/Deleted" - } - }, - "schema": { - "$ref": "#/components/schemas/DeletedMessage" - } - } - }, - "description": "Message indicating secret has been deleted." - } - }, - "summary": "Delete a Hashicorp Vault secret", - "tags": [ - "Secrets" - ] - }, - "get": { - "description": "Get a list of Hashicorp Vault secrets.", - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "properties": { - "data": { - "items": { - "$ref": "#/components/schemas/SecretSummary" - }, - "type": "array" - }, - "meta": { - "$ref": "#/components/schemas/Meta" - } - }, - "required": [ - "data", - "meta" - ], - "type": "object" - } - } - }, - "description": "get secrets response" - }, - "400": { - "content": { - "application/json": { - "example": { - "code": "400", - "message": "Invalid JSON in secret filter" - }, - "schema": { - "type": "object" - } - } - }, - "description": "Bad Request Error" - } - }, - "summary": "Get list of Hashicorp Vault secrets", - "tags": [ - "Secrets" - ] - }, - "parameters": [ - { - "description": "Name of secret path", - "in": "query", - "name": "path", - "schema": { - "type": "string" - } - } - ], - "post": { - "description": "Add a new Hashicorp Vault secret.", - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Secret" - } - } - }, - "description": "Secret definition", - "required": "true", - "x-body-name": "secret_data" - }, - "responses": { - "200": { - "content": { - "application/json": { - "example": { - "name": "devices/ios_host", - "secret_data": { - "ansible_password": "admin123" - } - }, - "schema": { - "$ref": "#/components/schemas/Secret" - } - } - }, - "description": "Returns secret that was created." - }, - "409": { - "content": { - "application/json": { - "examples": { - "Duplicate": { - "$ref": "#/components/examples/Duplicate" - } - }, - "schema": { - "$ref": "#/components/schemas/Error" - } - } - }, - "description": "Duplicate Name Error (resource with same name already exists)" - } - }, - "summary": "Add a new Hashicorp Vault secret", - "tags": [ - "Secrets" - ] - }, - "put": { - "description": "Updata a Hashicorpy Vault secret.", - "requestBody": { - "content": { - "application/json": { - "schema": { - "type": "object" - } - } - }, - "description": "Secret data key/value pairs", - "required": "true", - "x-body-name": "secret_data" - }, - "responses": { - "200": { - "content": { - "application/json": { - "example": { - "path": "devices/ios_host", - "secret_data": { - "ansible_password": "admin123" - } - }, - "schema": { - "$ref": "#/components/schemas/Secret" - } - } - }, - "description": "Device information" - }, - "404": { - "content": { - "application/json": { - "examples": { - "NotFoundError": { - "$ref": "#/components/examples/NotFoundError" - } - }, - "schema": { - "$ref": "#/components/schemas/Error" - } - } - }, - "description": "Not Found Error" - } - }, - "summary": "Update a Hashicorp Vault secret", - "tags": [ - "Secrets" - ] - } - }, - "/security_questions": { - "get": { - "description": "Get security questions for the AG server.", - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/listOfSecurityQuestions" - } - } - }, - "description": "get list of security questions as the response" - }, - "400": { - "content": { - "application/json": { - "examples": { - "InvalidJSONError": { - "$ref": "#/components/examples/InvalidJSONError" - } - }, - "schema": { - "type": "object" - } - } - }, - "description": "Bad Request Error" - } - }, - "summary": "Get security questions for the AG server", - "tags": [ - "security_questions" - ] - } - }, - "/security_questions/validate_answers": { - "post": { - "description": "Validate security answers for email id on the AG server.", - "operationId": "automation_gateway.api_v2.security_questions.validate_answers", - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ValidateSecurityParameters" - } - } - }, - "description": "Security questions and answers object", - "required": "true", - "x-body-name": "security_object" - }, - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "type": "object" - } - } - }, - "description": "get username in an object as the response" - }, - "402": { - "content": { - "application/json": { - "example": { - "code": "402", - "message": "No security questions found for this email)" - }, - "schema": { - "$ref": "#/components/schemas/Error" - } - } - }, - "description": "Password Recovery Error" - } - }, - "summary": "Validate security answers for email id on the AG server", - "tags": [ - "security_questions" - ] - } - }, - "/security_questions/{email}": { - "get": { - "description": "Get security questions for email id on the AG server.", - "parameters": [ - { - "description": "Email ID of user account", - "in": "path", - "name": "email", - "required": "true", - "schema": { - "type": "string" - } - } - ], - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/securityQuestionsByEmail" - } - } - }, - "description": "get list of security questions as the response" - }, - "402": { - "content": { - "application/json": { - "example": { - "code": "402", - "message": "No security questions found for this email)" - }, - "schema": { - "$ref": "#/components/schemas/Error" - } - } - }, - "description": "Password Recovery Error" - } - }, - "summary": "Get security questions for email id on the AG server", - "tags": [ - "security_questions" - ] - } - }, - "/status": { - "get": { - "description": "Get the AG server status (version, ansible version, etc).", - "responses": { - "200": { - "content": { - "application/json": { - "example": { - "ansible_version": "4.5.6", - "version": "1.2.3" - }, - "schema": { - "type": "object" - } - } - }, - "description": "login response" - } - }, - "summary": "Get the AG server status", - "tags": [ - "System" - ] - } - }, - "/terraforms": { - "get": { - "description": "Get list of Terraform modules.", - "parameters": [ - { - "description": "The number of items to skip before starting to collect the result set", - "in": "query", - "name": "offset", - "schema": { - "type": "integer" - } - }, - { - "description": "The number of items to return", - "in": "query", - "name": "limit", - "schema": { - "type": "integer" - } - }, - { - "description": "Response filter function with JSON name/value pair argument, i.e., contains({\"name\":\"sample\"})\nValid filter functions - contains, equals, startswith, endswith\n", - "in": "query", - "name": "filter", - "schema": { - "type": "string" - } - }, - { - "description": "Ascending/Descending sort indication", - "in": "query", - "name": "order", - "schema": { - "default": "ascending", - "enum": [ - "ascending", - "descending" - ], - "type": "string" - } - }, - { - "description": "Select between full detail or summary for each item", - "in": "query", - "name": "detail", - "schema": { - "default": "summary", - "enum": [ - "full", - "summary" - ], - "type": "string" - } - } - ], - "responses": { - "200": { - "content": { - "application/json": { - "example": { - "data": [ - { - "effective_schema_type": "user_schema", - "file": "/usr/share/automation-gateway/terraforms/hello_world", - "name": "sample_terraform_module" - }, - { - "effective_schema_type": "user_schema", - "file": "/usr/share/automation-gateway/terraforms/sample_terra", - "name": "sample_2" - } - ], - "meta": { - "count": "2", - "queryObject": { - "detail": "summary", - "filter": {}, - "order": "ascending" - } - } - }, - "schema": { - "properties": { - "data": { - "items": { - "$ref": "#/components/schemas/TerraformSummary" - }, - "type": "array" - }, - "meta": { - "$ref": "#/components/schemas/Meta" - } - }, - "required": [ - "data", - "meta" - ], - "type": "object" - } - } - }, - "description": "get terraform modules response" - }, - "400": { - "content": { - "application/json": { - "examples": { - "SearchFilterError": { - "$ref": "#/components/examples/SearchFilterError" - } - }, - "schema": { - "type": "object" - } - } - }, - "description": "Bad Request Error" - } - }, - "summary": "Get list of Terraform modules", - "tags": [ - "Terraforms" - ] - } - }, - "/terraforms/refresh": { - "post": { - "description": "Perform Terraform discovery and update internal cache.", - "operationId": "automation_gateway.api_v2.terraforms.refresh", - "responses": { - "200": { - "content": { - "application/json": { - "example": { - "code": "200", - "message": "Playbook refresh succeeded" - }, - "schema": { - "$ref": "#/components/schemas/TerraformRefresh" - } - } - }, - "description": "display success or failure" - } - }, - "summary": "Refresh Terraform module cache", - "tags": [ - "Terraforms" - ] - } - }, - "/terraforms/{terraform_module_name}": { - "get": { - "description": "Get information on a Terraform module.", - "parameters": [ - { - "description": "Name of the terraform_module to retrieve.", - "in": "path", - "name": "terraform_module_name", - "required": "true", - "schema": { - "type": "string" - } - } - ], - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "type": "object" - } - } - }, - "description": "get terraform module response" - }, - "404": { - "content": { - "application/json": { - "examples": { - "NotFoundError": { - "$ref": "#/components/examples/NotFoundError" - } - }, - "schema": { - "$ref": "#/components/schemas/Error" - } - } - }, - "description": "Not Found Error" - } - }, - "summary": "Get information on a Terraform module", - "tags": [ - "Terraforms" - ] - } - }, - "/terraforms/{terraform_module_name}/history": { - "get": { - "description": "Get execution log events for a Terraform module.", - "operationId": "automation_gateway.api_v2.terraforms.get_execution_log", - "parameters": [ - { - "description": "Name of terraform", - "in": "path", - "name": "terraform_module_name", - "required": "true", - "schema": { - "type": "string" - } - }, - { - "description": "The number of items to skip before starting to collect the result set", - "in": "query", - "name": "offset", - "schema": { - "type": "integer" - } - }, - { - "description": "The number of items to return", - "in": "query", - "name": "limit", - "schema": { - "type": "integer" - } - }, - { - "description": "Most recent execution on top of returned results unless user specifies ascending", - "in": "query", - "name": "order", - "schema": { - "default": "descending", - "enum": [ - "ascending", - "descending" - ], - "type": "string" - } - } - ], - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "type": "object" - } - } - }, - "description": "terraform execution log events response" - }, - "400": { - "content": { - "application/json": { - "examples": { - "BadParameter": { - "$ref": "#/components/examples/BadParameter" - }, - "MissingParameter": { - "$ref": "#/components/examples/MissingParameter" - } - }, - "schema": { - "$ref": "#/components/schemas/Error" - } - } - }, - "description": "Bad Request Error" - }, - "404": { - "content": { - "application/json": { - "examples": { - "NotFoundError": { - "$ref": "#/components/examples/NotFoundError" - } - }, - "schema": { - "$ref": "#/components/schemas/Error" - } - } - }, - "description": "Not Found Error" - }, - "500": { - "content": { - "application/json": { - "examples": { - "ServerError": { - "$ref": "#/components/examples/ServerError" - } - }, - "schema": { - "$ref": "#/components/schemas/Error" - } - } - }, - "description": "Internal Error" - } - }, - "summary": "Get execution log of Terraform module", - "tags": [ - "Terraforms" - ] - } - }, - "/terraforms/{terraform_module_name}/schema": { - "delete": { - "description": "Remove a Terraform module schema.", - "operationId": "automation_gateway.api_v2.terraforms.delete", - "responses": { - "200": { - "content": { - "application/json": { - "examples": { - "Deleted": { - "$ref": "#/components/examples/Deleted" - } - }, - "schema": { - "$ref": "#/components/schemas/DeletedMessage" - } - } - }, - "description": "Message indicating terraform schema has been deleted." - }, - "404": { - "content": { - "application/json": { - "examples": { - "NotFoundError": { - "$ref": "#/components/examples/NotFoundError" - } - }, - "schema": { - "$ref": "#/components/schemas/Error" - } - } - }, - "description": "Not Found Error" - } - }, - "summary": "Remove a Terraform module schema", - "tags": [ - "Terraforms" - ] - }, - "get": { - "description": "Get the schema for a Terraform module.", - "operationId": "automation_gateway.api_v2.terraforms.get_schema", - "responses": { - "200": { - "content": { - "application/json": { - "example": { - "schema": { - "properties": { - "interface": { - "description": "Name of the terraform module", - "type": "string" - } - }, - "required": [ - "interface" - ], - "title": "sample_terraform_module", - "type": "object" - } - }, - "schema": { - "$ref": "#/components/schemas/UserSchema" - } - } - }, - "description": "object with schema for terraforms" - }, - "404": { - "content": { - "application/json": { - "examples": { - "NotFoundError": { - "$ref": "#/components/examples/NotFoundError" - } - }, - "schema": { - "$ref": "#/components/schemas/Error" - } - } - }, - "description": "Not Found Error" - } - }, - "summary": "Get a Terraform module schema", - "tags": [ - "Terraforms" - ] - }, - "parameters": [ - { - "description": "Name of the terraform module", - "in": "path", - "name": "terraform_module_name", - "required": "true", - "schema": { - "type": "string" - } - } - ], - "put": { - "description": "Update/Insert a Terraform schema document.", - "operationId": "automation_gateway.api_v2.terraforms.put", - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/UserSchema" - } - } - }, - "description": "Schema to apply to terraform module identified in path", - "required": "true", - "x-body-name": "schema" - }, - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "type": "object" - } - } - }, - "description": "Update schema response" - } - }, - "summary": "Update a Terraform module schema", - "tags": [ - "Terraforms" - ] - } - }, - "/terraforms/{terraform_module_name}/terraform_apply": { - "post": { - "description": "Apply the configuration of a Terraform module", - "operationId": "automation_gateway.api_v2.terraforms.terraform_apply", - "parameters": [ - { - "description": "Name of terraform_module to apply.", - "in": "path", - "name": "terraform_module_name", - "required": "true", - "schema": { - "type": "string" - } - } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/TerraformParameters" - } - } - }, - "description": "Terraform init Parameters", - "required": "true", - "x-body-name": "terraform_parameters" - }, - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "type": "object" - } - } - }, - "description": "apply terraform response" - }, - "400": { - "content": { - "application/json": { - "examples": { - "BadParameter": { - "$ref": "#/components/examples/BadParameter" - }, - "MissingParameter": { - "$ref": "#/components/examples/MissingParameter" - } - }, - "schema": { - "$ref": "#/components/schemas/Error" - } - } - }, - "description": "Bad Request Error" - }, - "404": { - "content": { - "application/json": { - "examples": { - "NotFoundError": { - "$ref": "#/components/examples/NotFoundError" - } - }, - "schema": { - "$ref": "#/components/schemas/Error" - } - } - }, - "description": "Not Found Error" - }, - "500": { - "content": { - "application/json": { - "examples": { - "ServerError": { - "$ref": "#/components/examples/ServerError" - } - }, - "schema": { - "$ref": "#/components/schemas/Error" - } - } - }, - "description": "Internal Error" - } - }, - "summary": "Apply a Terraform module", - "tags": [ - "Terraforms" - ] - } - }, - "/terraforms/{terraform_module_name}/terraform_destroy": { - "post": { - "description": "Destroy the resources of a Terraform module.", - "operationId": "automation_gateway.api_v2.terraforms.terraform_destroy", - "parameters": [ - { - "description": "Name of terraform_module to destroy.", - "in": "path", - "name": "terraform_module_name", - "required": "true", - "schema": { - "type": "string" - } - } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/TerraformParameters" - } - } - }, - "description": "Terraform destroy Parameters", - "required": "true", - "x-body-name": "terraform_parameters" - }, - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "type": "object" - } - } - }, - "description": "destroy terraform response" - }, - "400": { - "content": { - "application/json": { - "examples": { - "BadParameter": { - "$ref": "#/components/examples/BadParameter" - }, - "MissingParameter": { - "$ref": "#/components/examples/MissingParameter" - } - }, - "schema": { - "$ref": "#/components/schemas/Error" - } - } - }, - "description": "Bad Request Error" - }, - "404": { - "content": { - "application/json": { - "examples": { - "NotFoundError": { - "$ref": "#/components/examples/NotFoundError" - } - }, - "schema": { - "$ref": "#/components/schemas/Error" - } - } - }, - "description": "Not Found Error" - }, - "500": { - "content": { - "application/json": { - "examples": { - "ServerError": { - "$ref": "#/components/examples/ServerError" - } - }, - "schema": { - "$ref": "#/components/schemas/Error" - } - } - }, - "description": "Internal Error" - } - }, - "summary": "Destroy a Terraform resource", - "tags": [ - "Terraforms" - ] - } - }, - "/terraforms/{terraform_module_name}/terraform_init": { - "post": { - "description": "Initialize the providers of a Terraform module.", - "operationId": "automation_gateway.api_v2.terraforms.terraform_init", - "parameters": [ - { - "description": "Name of terraform_module to init.", - "in": "path", - "name": "terraform_module_name", - "required": "true", - "schema": { - "type": "string" - } - } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/TerraformParameters" - } - } - }, - "description": "Terraform init Parameters", - "required": "true", - "x-body-name": "terraform_parameters" - }, - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "type": "object" - } - } - }, - "description": "init terraform response" - }, - "400": { - "content": { - "application/json": { - "examples": { - "BadParameter": { - "$ref": "#/components/examples/BadParameter" - }, - "MissingParameter": { - "$ref": "#/components/examples/MissingParameter" - } - }, - "schema": { - "$ref": "#/components/schemas/Error" - } - } - }, - "description": "Bad Request Error" - }, - "404": { - "content": { - "application/json": { - "examples": { - "NotFoundError": { - "$ref": "#/components/examples/NotFoundError" - } - }, - "schema": { - "$ref": "#/components/schemas/Error" - } - } - }, - "description": "Not Found Error" - }, - "500": { - "content": { - "application/json": { - "examples": { - "ServerError": { - "$ref": "#/components/examples/ServerError" - } - }, - "schema": { - "$ref": "#/components/schemas/Error" - } - } - }, - "description": "Internal Error" - } - }, - "summary": "Initialize a Terraform module", - "tags": [ - "Terraforms" - ] - } - }, - "/terraforms/{terraform_module_name}/terraform_plan": { - "post": { - "description": "Plan the execution of a Terraform module.", - "operationId": "automation_gateway.api_v2.terraforms.terraform_plan", - "parameters": [ - { - "description": "Name of terraform_module to plan.", - "in": "path", - "name": "terraform_module_name", - "required": "true", - "schema": { - "type": "string" - } - } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/TerraformParameters" - } - } - }, - "description": "Terraform plan Parameters", - "required": "true", - "x-body-name": "terraform_parameters" - }, - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "type": "object" - } - } - }, - "description": "plan terraform response" - }, - "400": { - "content": { - "application/json": { - "examples": { - "BadParameter": { - "$ref": "#/components/examples/BadParameter" - }, - "MissingParameter": { - "$ref": "#/components/examples/MissingParameter" - } - }, - "schema": { - "$ref": "#/components/schemas/Error" - } - } - }, - "description": "Bad Request Error" - }, - "404": { - "content": { - "application/json": { - "examples": { - "NotFoundError": { - "$ref": "#/components/examples/NotFoundError" - } - }, - "schema": { - "$ref": "#/components/schemas/Error" - } - } - }, - "description": "Not Found Error" - }, - "500": { - "content": { - "application/json": { - "examples": { - "ServerError": { - "$ref": "#/components/examples/ServerError" - } - }, - "schema": { - "$ref": "#/components/schemas/Error" - } - } - }, - "description": "Internal Error" - } - }, - "summary": "Plan execution of a Terraform module", - "tags": [ - "Terraforms" - ] - } - }, - "/terraforms/{terraform_module_name}/terraform_validate": { - "post": { - "description": "Validate the configuration of a Terraform module.", - "operationId": "automation_gateway.api_v2.terraforms.terraform_validate", - "parameters": [ - { - "description": "Name of terraform_module to validate.", - "in": "path", - "name": "terraform_module_name", - "required": "true", - "schema": { - "type": "string" - } - } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/TerraformParameters" - } - } - }, - "description": "Terraform Validate Parameters", - "required": "true", - "x-body-name": "terraform_parameters" - }, - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "type": "object" - } - } - }, - "description": "init terraform response" - }, - "400": { - "content": { - "application/json": { - "examples": { - "BadParameter": { - "$ref": "#/components/examples/BadParameter" - }, - "MissingParameter": { - "$ref": "#/components/examples/MissingParameter" - } - }, - "schema": { - "$ref": "#/components/schemas/Error" - } - } - }, - "description": "Bad Request Error" - }, - "404": { - "content": { - "application/json": { - "examples": { - "NotFoundError": { - "$ref": "#/components/examples/NotFoundError" - } - }, - "schema": { - "$ref": "#/components/schemas/Error" - } - } - }, - "description": "Not Found Error" - }, - "500": { - "content": { - "application/json": { - "examples": { - "ServerError": { - "$ref": "#/components/examples/ServerError" - } - }, - "schema": { - "$ref": "#/components/schemas/Error" - } - } - }, - "description": "Internal Error" - } - }, - "summary": "Validate configuration of a Terraform module", - "tags": [ - "Terraforms" - ] - } - }, - "/user-schema/{schema_type}/{schema_name}": { - "delete": { - "description": "Remove a user schema.", - "operationId": "automation_gateway.api_v2.user_schema.delete", - "responses": { - "200": { - "content": { - "application/json": { - "examples": { - "Deleted": { - "$ref": "#/components/examples/Deleted" - } - }, - "schema": { - "$ref": "#/components/schemas/DeletedMessage" - } - } - }, - "description": "Message indicating user schema has been deleted." - }, - "400": { - "content": { - "application/json": { - "examples": { - "InvalidSchemaError": { - "$ref": "#/components/examples/InvalidSchemaError" - } - }, - "schema": { - "type": "object" - } - } - }, - "description": "Bad Request Error" - }, - "404": { - "content": { - "application/json": { - "examples": { - "NotFoundError": { - "$ref": "#/components/examples/NotFoundError" - } - }, - "schema": { - "$ref": "#/components/schemas/Error" - } - } - }, - "description": "Not Found Error" - } - }, - "summary": "Remove a user schema", - "tags": [ - "User Schema" - ] - }, - "parameters": [ - { - "description": "Type of schema", - "in": "path", - "name": "schema_type", - "required": "true", - "schema": { - "type": "string" - } - }, - { - "description": "Name of schema", - "in": "path", - "name": "schema_name", - "required": "true", - "schema": { - "type": "string" - } - } - ], - "put": { - "description": "Update/Insert a user schema document.", - "operationId": "automation_gateway.api_v2.user_schema.put", - "requestBody": { - "content": { - "application/json": { - "schema": { - "properties": { - "schema": { - "properties": {}, - "type": "object" - } - }, - "type": "object" - } - } - }, - "description": "Schema to apply entity identified in path", - "required": "true", - "x-body-name": "schema" - }, - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "type": "object" - } - } - }, - "description": "Update schema response" - }, - "400": { - "content": { - "application/json": { - "examples": { - "InvalidSchemaError": { - "$ref": "#/components/examples/InvalidSchemaError" - } - }, - "schema": { - "type": "object" - } - } - }, - "description": "Bad Request Error" - }, - "404": { - "content": { - "application/json": { - "examples": { - "NotFoundError": { - "$ref": "#/components/examples/NotFoundError" - } - }, - "schema": { - "$ref": "#/components/schemas/Error" - } - } - }, - "description": "Not Found Error" - } - }, - "summary": "Upsert a user schema", - "tags": [ - "User Schema" - ] - } - } - }, - "servers": [ - { - "url": "/api/v2.0" - } - ] -} diff --git a/docs/usage.md b/docs/usage.md new file mode 100644 index 0000000..8964c7e --- /dev/null +++ b/docs/usage.md @@ -0,0 +1,333 @@ +# Usage Guide + +asyncgateway is an async Python client for the Itential Automation Gateway (IAG) 4.x REST API. It has two layers: + +- **Services** — thin async wrappers that map 1:1 to IAG API endpoints (`client.services.`) +- **Resources** — declarative abstractions that compose services into idempotent operations (`client.resources.`) + +## Installation + +```bash +pip install asyncgateway +``` + +YAML support is optional. Install `PyYAML` to enable YAML file loading and output: + +```bash +pip install asyncgateway[yaml] +``` + +## Quick Start + +All interaction with IAG goes through a `Client` instance used as an async context manager: + +```python +import asyncio +import asyncgateway + +config = { + "host": "https://iag.example.com", + "username": "admin", + "password": "secret", +} + +async def main(): + async with asyncgateway.client(**config) as client: + devices = await client.services.devices.get_all() + print(devices) + +asyncio.run(main()) +``` + +All `**kwargs` are forwarded to `ipsdk.gateway_factory()`. Refer to the ipsdk documentation for the full list of connection parameters. + +## Services Layer + +Services expose the raw IAG API. Each method maps to a single endpoint and returns the parsed JSON response. There is no added logic — use services when you need direct API access. + +### Devices + +```python +async with asyncgateway.client(**config) as client: + # List all devices (paginated automatically) + devices = await client.services.devices.get_all() + + # Get a single device + device = await client.services.devices.get("router1") + + # Create a device + await client.services.devices.create("router1", {"ansible_host": "10.0.0.1"}) + + # Update device variables + await client.services.devices.patch("router1", {"ansible_host": "10.0.0.2"}) + + # Delete a device + await client.services.devices.delete("router1") + + # Get device variables + variables = await client.services.devices.get_variables("router1") + + # Get a specific variable + var = await client.services.devices.get_variable("router1", "ansible_host") + + # Get device state + state = await client.services.devices.get_state("router1") +``` + +### Playbooks + +```python +async with asyncgateway.client(**config) as client: + # List all playbooks + playbooks = await client.services.playbooks.get_all() + + # Execute a playbook + result = await client.services.playbooks.execute("site.yml", {"limit": "routers"}) + + # Dry run a playbook + result = await client.services.playbooks.dry_run("site.yml", {}) +``` + +### Available Services + +| Name | Description | +|------|-------------| +| `accounts` | User account management | +| `ansible_venv` | Ansible virtual environment management | +| `collections` | Ansible collection management | +| `config` | Gateway configuration | +| `devices` | Device inventory | +| `git` | Git repository management | +| `gnmi` | gNMI operations | +| `gnoi` | gNOI operations | +| `groups` | Device group management | +| `http_requests` | HTTP request execution | +| `inventory` | Inventory management | +| `ldap` | LDAP configuration | +| `modules` | Ansible module management | +| `netconf` | NETCONF operations | +| `netmiko` | Netmiko operations | +| `nornir` | Nornir operations | +| `playbooks` | Ansible playbook execution | +| `pronghorn` | Pronghorn integration | +| `python_venv` | Python virtual environment management | +| `rbac` | Role-based access control | +| `roles` | Ansible role management | +| `scripts` | Script execution | +| `secrets` | Secret management | +| `system` | System operations | +| `terraforms` | Terraform execution | +| `user_schema` | User schema management | + +## Resources Layer + +Resources provide declarative, idempotent operations. Use resources when you want "ensure this state exists" semantics rather than direct CRUD. + +### ensure / absent + +`ensure` creates a resource if it is missing, or updates it if variables are provided. `absent` deletes a resource if it exists, and is a no-op otherwise. + +```python +async with asyncgateway.client(**config) as client: + # Ensure a device exists with the given variables + device = await client.resources.devices.ensure( + "router1", + {"ansible_host": "10.0.0.1", "ansible_user": "admin"} + ) + + # Ensure a device exists without changing its variables + device = await client.resources.devices.ensure("router1") + + # Delete a device if it exists (no error if already gone) + await client.resources.devices.absent("router1") +``` + +### Running Playbooks + +```python +async with asyncgateway.client(**config) as client: + # Run a playbook + result = await client.resources.playbooks.run( + "site.yml", + {"limit": "routers", "tags": "deploy"} + ) + + # Dry run a playbook + result = await client.resources.playbooks.dry_run("site.yml") + + # Manage playbook schemas + await client.resources.playbooks.ensure_schema("site.yml", {...}) + await client.resources.playbooks.remove_schema("site.yml") + + # Refresh playbooks from external sources + await client.resources.playbooks.refresh() +``` + +### Available Resources + +| Name | Operations | +|------|------------| +| `accounts` | ensure, absent | +| `collections` | ensure, absent | +| `config` | ensure | +| `devices` | ensure, absent, load, dump | +| `git` | ensure, absent | +| `gnmi` | run | +| `gnoi` | run | +| `groups` | ensure, absent | +| `http_requests` | run | +| `inventory` | ensure, absent | +| `modules` | ensure, absent | +| `netconf` | run | +| `netmiko` | run | +| `nornir` | run | +| `playbooks` | run, dry_run, ensure_schema, remove_schema, load, refresh | +| `rbac` | ensure, absent | +| `roles` | ensure, absent | +| `scripts` | run | +| `secrets` | ensure, absent | +| `system` | run | +| `terraforms` | run | + +## Bulk Operations + +### Loading from Files + +`client.load()` reads JSON or YAML files from a directory tree and imports them into IAG. The directory must contain subdirectories named after each service: + +``` +/data/ + devices/ + routers.json + switches.yaml + playbooks/ + site.json +``` + +```python +from asyncgateway.services import Operation + +async with asyncgateway.client(**config) as client: + results = await client.load("/data", Operation.MERGE) + print(results["services_processed"]) + print(results["total_resources_created"]) + if results["errors"]: + print(results["errors"]) +``` + +**Operations:** + +| Operation | Behavior | +|-----------|----------| +| `Operation.MERGE` | Add missing resources; skip existing ones | +| `Operation.OVERWRITE` | Add missing resources; replace existing ones | +| `Operation.REPLACE` | Delete all existing resources; add all from files | + +`Operation.MERGE` is the default and the safest choice. File contents must be a JSON/YAML object or array of objects, each with a `name` field. + +### Exporting to Files + +The `devices` resource supports dumping the current device inventory to files: + +```python +async with asyncgateway.client(**config) as client: + # Single file with all devices + results = await client.resources.devices.dump( + format_type="json", + devices_folder="./backup" + ) + + # One file per device + results = await client.resources.devices.dump( + individual_files=True, + format_type="yaml", + devices_folder="./backup" + ) + + print(results["files_created"]) + print(results["devices_count"]) +``` + +### In-memory Bulk Load + +Resources also support loading from an in-memory list directly: + +```python +async with asyncgateway.client(**config) as client: + devices = [ + {"name": "router1", "variables": {"ansible_host": "10.0.0.1"}}, + {"name": "router2", "variables": {"ansible_host": "10.0.0.2"}}, + ] + results = await client.resources.devices.load(devices, Operation.MERGE) +``` + +## Error Handling + +All exceptions inherit from `AsyncGatewayError`: + +```python +from asyncgateway.exceptions import AsyncGatewayError, ValidationError + +async with asyncgateway.client(**config) as client: + try: + device = await client.services.devices.get("nonexistent") + except AsyncGatewayError as e: + print(f"Gateway error: {e}") + except ValidationError as e: + print(f"Invalid input: {e}") +``` + +| Exception | Raised for | +|-----------|-----------| +| `AsyncGatewayError` | Base class; all gateway errors | +| `ValidationError` | Invalid input, JSON/YAML parsing errors | + +## Logging + +Logging is disabled by default (level `NONE = 100`). Enable it before creating the client: + +```python +import asyncgateway + +# Enable debug logging +asyncgateway.logging.set_level(asyncgateway.logging.DEBUG) + +# Enable info logging only +asyncgateway.logging.set_level(asyncgateway.logging.INFO) + +# Also enable httpx/httpcore transport logging +asyncgateway.logging.set_level(asyncgateway.logging.DEBUG, propagate=True) + +# Disable logging +asyncgateway.logging.set_level(asyncgateway.logging.NONE) +``` + +Available levels: `TRACE (5)`, `DEBUG (10)`, `INFO (20)`, `WARNING (30)`, `ERROR (40)`, `CRITICAL (50)`, `FATAL (90)`, `NONE (100)`. + +### Sensitive Data Filtering + +Enable automatic redaction of credentials and tokens in log output: + +```python +asyncgateway.logging.enable_sensitive_data_filtering() + +# Add a custom pattern +asyncgateway.logging.add_sensitive_data_pattern( + "my_token", + r"my_token=(\S+)" +) + +asyncgateway.logging.disable_sensitive_data_filtering() +``` + +## YAML Support + +YAML file loading requires `PyYAML`. If it is not installed, any operation that reads a YAML file raises `ValidationError`. JSON always works with no optional dependencies. + +Check availability at runtime: + +```python +from asyncgateway import serdes +if serdes.YAML_AVAILABLE: + print("YAML support enabled") +```