SpaceWeb
Status: available · package wg-flow-plugin-sweb · provider sweb · category cloud.
The plugin calls the public JSON-RPC API at api.sweb.ru and sends VPS, domains, and DNS into inventory. Panel login and password stay in agent YAML.
SpaceWeb sessions are short-lived: the plugin exchanges login+password for a Bearer token and refreshes it when it expires.
Install
The agent must be connected to the API.
docker compose exec agent wg-flow-agent plugin install sweb
# or
wg-flow-agent plugin install swebThen the local UI → Connections → sweb, or YAML.
What lands in inventory
| SpaceWeb object | resource_type | Notes |
|---|---|---|
| VPS | server | /vps index. A whole-number plan_price is rubles per month. A fractional price (Cloud plans) is rubles per hour; billing_amount stores the month as price × 730 |
| Panel domain | domain | apex + subdomains from /domains; apex also calls getDomainInfo |
| Hostname from A / AAAA / CNAME | domain | child FQDNs such as docs.apex.ru |
| DNS record | dns | MX / TXT / SRV and _*; apex/@ is not duplicated as a subdomain |
| SSL certificate | certificate | /vh/ssl and /vps/ssl: valid_to and renewal price |
| DBaaS | database | /dbaas index: plan and price |
| Load balancer | load_balancer | /balancer index: plan and price |
| Virtual hosting plan | hosting | /tariff index, one hosting resource per account |
If the account has no such product (a VPS account with no shared hosting, or the reverse), the method returns “Object not found” and that slice is skipped. The rest of the collect continues.
In the console, domains are grouped by apex, same as Prometheus.
You can turn off part of collect: VPS, domains, or DNS separately in the schema / YAML. Certificates, DBaaS, balancers, and the hosting plan are always requested and simply do not appear when the service is absent.
Expiry and price
The plugin writes metadata fields that a later alert or cost rate can read. The plugin does not create alert rules or cost records itself.
| Key | When present | Meaning |
|---|---|---|
expires_at | domain, certificate | Date YYYY-MM-DD: registration end (expired) or certificate valid_to |
billing_amount | price greater than zero | Amount in rubles |
billing_currency | with the amount | Always RUB |
billing_period | with the amount | monthly — VPS, DBaaS, balancer, monthly hosting. yearly — domain, certificate, yearly hosting |
For a domain the amount is the renewal price (prolong_price, otherwise prolong_confirm.price, otherwise reg_price). A zero or negative price is omitted. VPS index has no paid-until date. A whole-number plan_price is the monthly tariff. A fractional price is rubles per hour (Cloud plans): billing_amount is price × 730, and the raw rate stays in plan_price_hourly. A control panel on the VPS (ISP) is stored separately as isp_license, isp_price, isp_expires_at and is not folded into the server amount.
YAML
plugins:
sweb:
enabled: true
sources:
- id: account
provider_account: "sweb-main"
sync_interval_seconds: 300
url: "https://api.sweb.ru"
login: "account@example.com"
password: "…"
collect_vps: true
collect_domains: true
collect_dns: trueSeveral SpaceWeb accounts = several sources.
Source fields
| Field | Required | Description |
|---|---|---|
id | yes | Log key (sweb/account) |
provider_account | yes | Account label in inventory |
url | no | Default https://api.sweb.ru |
login / password | yes | Panel account; password is masked in the UI |
collect_vps / collect_domains / collect_dns | no | true by default |
sync_interval_seconds | no | Minimum 300 |
Check
wg-flow-agent status
wg-flow-agent dry-runJSON should show provider: sweb. Plugin health calls pay.getBalance (session check only; the balance is not stored in inventory).
Common errors
| Symptom | Check |
|---|---|
JSON-RPC -32603 / session | the plugin should refresh the token; if not — login/password |
| Empty domains | collect_domains / collect_dns are not off |
| Duplicates with Cloudflare / Prometheus | different provider is expected; merge in the console |