AppMage

ServiceMeshRpc

This RPC class exposes service-mesh control operations for inspecting namespace state, managing node lifecycle and configuration, and administering traffic routing rules. Every method in this file is marked systemOnly: true, so none of the endpoints are part of the public API surface.

Endpoints

No public endpoints are documented for ServiceMeshRpc because all @rpcMethod entries in this file are internal-only.

Methods

getNamespaceState

This method retrieves the current service mesh namespace topology and health information.

Name Type Required Description
params Object Yes An empty object. The schema does not define any input fields.
context Object Yes Request context used for access control checks.

setNodeStatus

This method updates the status of a specific node in the service mesh.

Name Type Required Description
serviceName String Yes The name of the service that owns the target node.
instanceId String Yes The instance identifier of the target node.
status String Yes The new node status. Allowed values are active, draining, and offline.
context Object Yes Request context used for access control checks.

dropNode

This method forcefully removes a node from the registry.

Name Type Required Description
serviceName String Yes The name of the service that owns the target node.
instanceId String Yes The instance identifier of the target node.
context Object Yes Request context used for access control checks.

updateNodeConfig

This method updates node configuration such as tags or dedicated-node status. If the target node is the current server instance, the update is applied locally. Otherwise, the request is routed through the service mesh to the target instance.

Name Type Required Description
serviceName String Yes The name of the service that owns the target node.
instanceId String Yes The instance identifier of the target node.
updates Object Yes Configuration values to apply to the node.
updates.tags Array<String> No Optional list of tags to assign to the node.
updates.isDedicated Boolean No Optional flag indicating whether the node is dedicated.
context Object Yes Request context used for access control checks.

getTrafficRules

This method returns all active traffic routing rules.

Name Type Required Description
params Object Yes An empty object. The schema does not define any input fields.
context Object Yes Request context used for access control checks.

setTrafficRule

This method creates or updates a traffic routing rule.

Name Type Required Description
scopeType String Yes The rule scope. Allowed values are sub and user.
scopeValue String Yes The identifier value for the selected scope.
targetTag String Yes The tag used as the traffic target.
context Object Yes Request context used for access control checks.

removeTrafficRule

This method removes a traffic routing rule.

Name Type Required Description
scopeType String Yes The rule scope. Allowed values are sub and user.
scopeValue String Yes The identifier value for the selected scope.
context Object Yes Request context used for access control checks.

Access Control

All methods in this RPC class call _checkAccess(context) before performing any mesh operation. The source enforces two conditions:

  1. The request must be made by a system context or by a user whose role is admin.
  2. Service mesh functionality must be enabled in ServiceMeshService configuration.

If either condition fails, the method throws an error.

Behavior Notes

The updateNodeConfig method has two execution paths. When the requested instanceId matches the current server instance, it updates local node configuration directly through ServiceMeshService. Otherwise, it forwards the request to the target instance using the mesh call mechanism.

graph TD A[updateNodeConfig called] --> B{instanceId matches current instance?} B -- Yes --> C[Apply update locally] B -- No --> D[Forward request via service mesh] C --> E[Return result] D --> E[Return result]