Skip to content

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.

bash
docker compose exec agent wg-flow-agent plugin install sweb
# or
wg-flow-agent plugin install sweb

Then the local UI → Connections → sweb, or YAML.

What lands in inventory ​

SpaceWeb objectresource_typeNotes
VPSserver/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 domaindomainapex + subdomains from /domains; apex also calls getDomainInfo
Hostname from A / AAAA / CNAMEdomainchild FQDNs such as docs.apex.ru
DNS recorddnsMX / TXT / SRV and _*; apex/@ is not duplicated as a subdomain
SSL certificatecertificate/vh/ssl and /vps/ssl: valid_to and renewal price
DBaaSdatabase/dbaas index: plan and price
Load balancerload_balancer/balancer index: plan and price
Virtual hosting planhosting/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.

KeyWhen presentMeaning
expires_atdomain, certificateDate YYYY-MM-DD: registration end (expired) or certificate valid_to
billing_amountprice greater than zeroAmount in rubles
billing_currencywith the amountAlways RUB
billing_periodwith the amountmonthly — 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 ​

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: true

Several SpaceWeb accounts = several sources.

Source fields ​

FieldRequiredDescription
idyesLog key (sweb/account)
provider_accountyesAccount label in inventory
urlnoDefault https://api.sweb.ru
login / passwordyesPanel account; password is masked in the UI
collect_vps / collect_domains / collect_dnsnotrue by default
sync_interval_secondsnoMinimum 300

Check ​

bash
wg-flow-agent status
wg-flow-agent dry-run

JSON should show provider: sweb. Plugin health calls pay.getBalance (session check only; the balance is not stored in inventory).

Common errors ​

SymptomCheck
JSON-RPC -32603 / sessionthe plugin should refresh the token; if not — login/password
Empty domainscollect_domains / collect_dns are not off
Duplicates with Cloudflare / Prometheusdifferent provider is expected; merge in the console