Loading…
Loading…
Discover and import API services from an A10 Thunder ADC load balancer via the aXAPI v3. Explains the discovery process, data mapping, and persistence.
The A10 Discovery Service automates the discovery and registration of services hosted on an A10 Thunder Application Delivery Controller (ADC). It connects to the A10 device using the aXAPI v3 API, inventories all configured SLB Virtual Servers (VS) and their associated ports, and syncs them into the platform's service registry.
This component solves the problem of manually tracking and registering services exposed through an A10 load balancer. By treating each port on a Virtual Server as a distinct discoverable service, it provides a granular view of the frontend endpoints available for API traffic.
The discovery process is initiated by invoking the runDiscovery method with a target A10 instance identifier. It reads credentials from the s2r_lb_connector_credentials table, communicates with the A10 aXAPI, and then upserts the discovered service information into the s2r_discovered_service database table.
The discovery process follows a precise sequence of API calls and data transformations to translate A10 Thunder ADC configuration into platform service entries.
The service executes the following steps for each discovery run:
s2r_lb_connector_credentials store.POST request to the /axapi/v3/auth endpoint. A successful authentication returns a signature (token) used for subsequent requests.GET request to /axapi/v3/slb/virtual-server.GET /axapi/v3/slb/virtual-server/{name}/port.
b. For each port, it checks for an associated service-group.
c. If a service-group is present, it fetches the group's details, including its member list, via GET /axapi/v3/slb/service-group/{name}.POST /axapi/v3/logoff. This step is not critical to the success of the discovery.s2r_discovered_service database table. New services are inserted, existing ones are updated, and any services previously seen but not found in the current run are marked as inactive.The following diagram illustrates the interaction between the platform and the A10 Thunder ADC during a discovery run.
sequenceDiagram
participant Platform
participant A10 Thunder ADC
participant Platform Database
Platform->>Platform: runDiscovery(gatewayType, instanceName)
Platform->>Platform Database: Load credentials for instance
Platform->>A10 Thunder ADC: POST /axapi/v3/auth
A10 Thunder ADC-->>Platform: Auth Signature
Platform->>A10 Thunder ADC: GET /axapi/v3/slb/virtual-server
A10 Thunder ADC-->>Platform: List of Virtual Servers
loop For each Virtual Server
Platform->>A10 Thunder ADC: GET /slb/virtual-server/{vs-name}/port
A10 Thunder ADC-->>Platform: List of ports
loop For each Port
alt Port has a Service Group
Platform->>A10 Thunder ADC: GET /slb/service-group/{sg-name}
A10 Thunder ADC-->>Platform: Service Group details
end
Platform->>Platform: Assemble discovered service record
end
end
Platform->>A10 Thunder ADC: POST /axapi/v3/logoff (best-effort)
Platform->>Platform Database: UPSERT records into s2r_discovered_service
Platform->>Platform Database: Mark stale records as inactive
Platform-->>Platform: Return DiscoveryResultEach port on a Virtual Server is treated as a unique, discoverable service. The mapping from A10 configuration objects to the platform's service model is as follows:
| Platform Field | A10 Source | Derivation |
|---|---|---|
vendor_service_id | VS Name, Port Number | A unique identifier constructed as vs:<vs-name>:<port-number>. |
display_name | Virtual Server name | The name of the Virtual Server. |
frontend_host | Virtual Server ip-address | The IP address of the Virtual Server. |
frontend_port | Port port-number | The port number of the listener. |
frontend_protocol | Port protocol | The protocol of the listener (e.g., tcp, udp), converted to lowercase. |
backend_pool_name | Port service-group | The name of the service group attached to the port. |
backend_members | Service Group member-list | A JSON array of objects, each containing the name and port of a backend member. |
raw_metadata | All API responses | A JSON object containing the full, unmodified API responses for the VS, port, and service group. |
NOTE
If a Virtual Server has no configured ports, or if fetching its ports fails, a single service entry is created for the VS itself. In this case, the vendor_service_id is simply vs:<vs-name>, and port-related fields are null.
The service exposes a single public method to initiate a discovery pass.
runDiscoveryTriggers a full discovery and persistence cycle for a specified A10 Thunder ADC instance.
DiscoveryResult runDiscovery(String gatewayType, String instanceName)
| Name | Type | Required | Description |
|---|---|---|---|
gatewayType | String | Yes | The type identifier for the gateway connector. |
instanceName | String | Yes | The unique name of the A10 instance to discover. |
An object of type DiscoveryResult containing statistics about the run:
| Field | Type | Description |
|---|---|---|
totalDiscovered | long | The total number of services found on the A10 instance. |
newlyAdded | long | The number of services inserted into the database for the first time. |
updated | long | The number of existing services that were updated. |
markedInactive | long | The number of previously discovered services that were not found in this run and were marked as inactive. |
durationMs | long | The total duration of the discovery run in milliseconds. |
errors | List<String> | A list of non-fatal error messages encountered during the run. |
LbConnectorCredentialService.NotFoundException: If credentials for the specified gatewayType and instanceName are not found in the s2r_lb_connector_credentials table.The A10 Discovery Service relies on credentials stored in the s2r_lb_connector_credentials table. Each A10 instance must have a corresponding entry with the following details.
| Field | Type | Required | Description |
|---|---|---|---|
host | String | Yes | The hostname or IP address of the A10 Thunder ADC management interface. |
port | Integer | No | The port for the aXAPI. If not specified, defaults to 443. |
username | String | Yes | The username for aXAPI authentication. |
password | String | Yes | The password for the specified user. The value is stored encrypted. |
verifyTls | Boolean | Yes | Whether to verify the TLS certificate of the A10 device. |
The discovery process logs errors with specific codes to aid in diagnostics.
| Error Code | Message | Cause | Impact |
|---|---|---|---|
S2R-LBC-0401 | A10 auth failed: ... | An A10AuthException was thrown during authentication or a subsequent API call. This typically indicates invalid credentials or insufficient permissions for the user. | The discovery run terminates immediately. No services are discovered or persisted. |
S2R-LBC-0502 | failed to build A10ThunderClient: ... | The internal HTTP client could not be initialized. This may be due to invalid configuration parameters like the host. | The discovery run terminates immediately. |
S2R-LBC-0502 | A10 authenticate failed: ... | An unexpected exception (e.g., network error, timeout) occurred during the authentication attempt. | The discovery run terminates immediately. |
S2R-LBC-0502 | A10 listVirtualServers failed: ... | An unexpected exception occurred while fetching the list of Virtual Servers. | The discovery run terminates immediately. |
S2R-LBC-0502 | listVirtualServerPorts(...) failed: ... | An error occurred fetching the ports for a specific Virtual Server. | The process continues. A single, generic service entry is created for the VS without port details. An error is added to the DiscoveryResult. |
S2R-LBC-0502 | getServiceGroup(...) failed: ... | An error occurred fetching details for a service-group. | The process continues. The service is discovered, but backend_pool_name and backend_members will be incomplete. An error is added to the DiscoveryResult. |
S2R-LBC-0502 | DB persist error: ... | An exception occurred while writing results to the s2r_discovered_service database. | The discovery from the A10 device was successful, but the results could not be saved. The error is logged, and the DiscoveryResult will reflect the failure. |
WARNING
The backend_members list in a discovered service contains the name and port of each member server. The IP address of the member is not resolved during this discovery process. Retrieving the member's host IP requires an additional API call that is not currently implemented.