Initial release of the oVirt/RHV Engine API simulator.
Stateful FastAPI lab with contract packs, Compose/Helm, Docker Hub release targets, and Pulumi coverage across all Engine series (GET/POST/PUT/DELETE/HEAD).
This commit is contained in:
@@ -0,0 +1,29 @@
|
||||
**Language / Язык:** [English](ansible.md) | [Русский](../ru/examples/ansible.md)
|
||||
|
||||
# Ansible
|
||||
|
||||
Use `ansible.builtin.uri` against Engine HTTPS:
|
||||
|
||||
```yaml
|
||||
- name: List oVirt VMs
|
||||
hosts: local
|
||||
gather_facts: false
|
||||
vars:
|
||||
engine_api: "https://127.0.0.1/ovirt-engine/api"
|
||||
tasks:
|
||||
- name: GET /vms
|
||||
ansible.builtin.uri:
|
||||
url: "{{ engine_api }}/vms"
|
||||
user: admin@internal
|
||||
password: secret
|
||||
force_basic_auth: true
|
||||
validate_certs: false
|
||||
headers:
|
||||
Accept: application/json
|
||||
Version: "4"
|
||||
status_code: [200]
|
||||
register: vms
|
||||
```
|
||||
|
||||
Native suite (150 cases): `make test-ansible` / `make test-ansible-smoke` under
|
||||
[`pulumi-tests/ansible/`](../../pulumi-tests/README.md).
|
||||
@@ -0,0 +1,35 @@
|
||||
**Language / Язык:** [English](overview.md) | [Русский](../ru/examples/overview.md)
|
||||
|
||||
# Clients & examples
|
||||
|
||||
Use the **inline snippets** below and the Pulumi contract-coverage lab under
|
||||
[`pulumi-tests/`](../../pulumi-tests/README.md).
|
||||
|
||||
## Base URL and credentials
|
||||
|
||||
| Setting | Value |
|
||||
|---|---|
|
||||
| Engine API | `https://127.0.0.1/ovirt-engine/api` |
|
||||
| SSO token | `https://127.0.0.1/ovirt-engine/sso/oauth/token` |
|
||||
| Web UI | `http://127.0.0.1:5000/` |
|
||||
| User | `admin@internal` |
|
||||
| Password | `secret` |
|
||||
|
||||
Disable HTTP proxies for local clients:
|
||||
|
||||
```bash
|
||||
unset HTTP_PROXY HTTPS_PROXY ALL_PROXY http_proxy https_proxy all_proxy
|
||||
export NO_PROXY='*'
|
||||
```
|
||||
|
||||
## Guides
|
||||
|
||||
| Guide | Focus |
|
||||
|---|---|
|
||||
| [Python requests](python-requests.md) | Raw HTTPS Basic / OAuth |
|
||||
| [Ansible](ansible.md) | `uri` module against Engine |
|
||||
| [Terraform](terraform.md) | IaC notes |
|
||||
| [Pulumi](pulumi.md) | Full contract coverage + HTML report |
|
||||
| [Troubleshooting clients](troubleshooting-clients.md) | Common client failures |
|
||||
|
||||
Prerequisites: `make up && make seed` (or `make seed-demo`).
|
||||
@@ -0,0 +1,13 @@
|
||||
**Language / Язык:** [English](pulumi.md) | [Русский](../ru/examples/pulumi.md)
|
||||
|
||||
# Pulumi
|
||||
|
||||
Contract-coverage lab under [`pulumi-tests/pulumi/`](../../pulumi-tests/README.md).
|
||||
|
||||
```bash
|
||||
make up && make seed
|
||||
make test-pulumi-smoke
|
||||
make test-pulumi
|
||||
```
|
||||
|
||||
HTML report: `pulumi-tests/reports/pulumi-contract-coverage.html`
|
||||
@@ -0,0 +1,43 @@
|
||||
**Language / Язык:** [English](python-requests.md) | [Русский](../ru/examples/python-requests.md)
|
||||
|
||||
# Python (`requests`)
|
||||
|
||||
Minimal pattern against the Engine gateway:
|
||||
|
||||
```python
|
||||
import requests
|
||||
|
||||
BASE = "https://127.0.0.1/ovirt-engine/api"
|
||||
AUTH = ("admin@internal", "secret")
|
||||
HEADERS = {"Accept": "application/json", "Version": "4"}
|
||||
|
||||
r = requests.get(f"{BASE}/vms", auth=AUTH, headers=HEADERS, verify=False, timeout=60)
|
||||
r.raise_for_status()
|
||||
print(r.json())
|
||||
```
|
||||
|
||||
OAuth password grant:
|
||||
|
||||
```python
|
||||
token = requests.post(
|
||||
"https://127.0.0.1/ovirt-engine/sso/oauth/token",
|
||||
data={
|
||||
"grant_type": "password",
|
||||
"username": "admin@internal",
|
||||
"password": "secret",
|
||||
"scope": "ovirt-app-api",
|
||||
},
|
||||
verify=False,
|
||||
timeout=60,
|
||||
).json()["access_token"]
|
||||
|
||||
r = requests.get(
|
||||
f"{BASE}/vms",
|
||||
headers={**HEADERS, "Authorization": f"Bearer {token}"},
|
||||
verify=False,
|
||||
timeout=60,
|
||||
)
|
||||
```
|
||||
|
||||
Native suite: `make test-python` / `make test-python-smoke` under
|
||||
[`pulumi-tests/`](../../pulumi-tests/README.md).
|
||||
@@ -0,0 +1,15 @@
|
||||
**Language / Язык:** [English](terraform.md) | [Русский](../ru/examples/terraform.md)
|
||||
|
||||
# Terraform
|
||||
|
||||
Native suite (150 cases) lives under
|
||||
[`pulumi-tests/terraform/`](../../pulumi-tests/README.md):
|
||||
|
||||
```bash
|
||||
make up && make seed
|
||||
make test-terraform-smoke
|
||||
make test-terraform
|
||||
```
|
||||
|
||||
Configure providers against Engine HTTPS with lab credentials and disable TLS
|
||||
verification for the Compose self-signed certificate.
|
||||
@@ -0,0 +1,38 @@
|
||||
**Language / Язык:** [English](troubleshooting-clients.md) | [Русский](../ru/examples/troubleshooting-clients.md)
|
||||
|
||||
# Troubleshooting clients
|
||||
|
||||
## TLS verification failures
|
||||
|
||||
Expected with the Compose self-signed Engine cert. Disable verification in the
|
||||
client (`verify=False`, `insecure`, `validate_certs: false`).
|
||||
|
||||
## HTTP 401
|
||||
|
||||
Confirm principal format `user@internal` and password `secret`. For OAuth,
|
||||
include `scope=ovirt-app-api`.
|
||||
|
||||
## Wrong host / port
|
||||
|
||||
On Compose, Engine is **`443`** (HTTPS) and UI is **`5000`** (HTTP) by default.
|
||||
Helm without a custom Ingress exposes FastAPI on **`8080`**. See
|
||||
[ports.md](../ports.md) and [kubernetes.md](../kubernetes.md).
|
||||
|
||||
## Empty lists after seed
|
||||
|
||||
Wait for `/health/ready`. Lifespan auto-loads `minimal` unless the DB is already
|
||||
`demo`. For density: `make seed-demo`.
|
||||
|
||||
## Proxy interference
|
||||
|
||||
IDE sandboxes often inject proxies that break local HTTPS. Unset proxy env vars
|
||||
([overview.md](overview.md)).
|
||||
|
||||
## Version / XML surprises
|
||||
|
||||
Send `Version: 4` and `Accept: application/json` unless you intentionally test
|
||||
v3 or XML.
|
||||
|
||||
## Wrong tool / suite
|
||||
|
||||
Prefer the snippets in this docs tree or the suites under `pulumi-tests/`.
|
||||
Reference in New Issue
Block a user