diff --git a/bruno/coordinator/01 List Instances.bru b/bruno/coordinator/01 List Instances.bru new file mode 100644 index 0000000..ad8f30e --- /dev/null +++ b/bruno/coordinator/01 List Instances.bru @@ -0,0 +1,33 @@ +meta { + name: List Instances + type: http + seq: 1 +} + +get { + url: {{coordinatorBaseUrl}}/api/coordinator/instances + body: none + auth: inherit +} + +settings { + encodeUrl: true + timeout: 0 +} + +docs { + Returns all known core instances from the in-memory registry. + Registry is populated via gRPC heartbeats from core instances. + + Requires port-forward: kubectl port-forward svc/nowchess-coordinator 8086:8086 -n + + Response: InstanceMetadata[] + instanceId: string — unique instance ID + hostname: string + httpPort: int + grpcPort: int + subscriptionCount: int — active game subscriptions + localCacheSize: int + lastHeartbeat: string — ISO-8601 timestamp + state: string — "HEALTHY" | "DEAD" +} diff --git a/bruno/coordinator/01 List Instances1.bru b/bruno/coordinator/01 List Instances1.bru new file mode 100644 index 0000000..7f3e037 --- /dev/null +++ b/bruno/coordinator/01 List Instances1.bru @@ -0,0 +1,30 @@ +meta { + name: List Instances + type: http + seq: 1 +} + +http { + method: GET + url: {{coordinatorBaseUrl}}/api/coordinator/instances + auth: none +} + +headers { + Accept: application/json +} + +notes { + Returns all known core instances from the in-memory registry. + Registry is populated via gRPC heartbeats from core instances. + + Response: InstanceMetadata[] + instanceId: string — unique instance ID + hostname: string + httpPort: int + grpcPort: int + subscriptionCount: int — number of active game subscriptions + localCacheSize: int + lastHeartbeat: string — ISO-8601 timestamp + state: string — "HEALTHY" | "DEAD" +} diff --git a/bruno/coordinator/02 Get Metrics.bru b/bruno/coordinator/02 Get Metrics.bru new file mode 100644 index 0000000..f451c10 --- /dev/null +++ b/bruno/coordinator/02 Get Metrics.bru @@ -0,0 +1,32 @@ +meta { + name: Get Metrics + type: http + seq: 2 +} + +get { + url: {{coordinatorBaseUrl}}/api/coordinator/metrics + body: none + auth: inherit +} + +settings { + encodeUrl: true + timeout: 0 +} + +docs { + Aggregate load metrics computed from the instance registry. + + Requires port-forward: kubectl port-forward svc/nowchess-coordinator 8086:8086 -n + + Response: MetricsDto + totalInstances: int + healthyInstances: int + deadInstances: int + totalGames: int — sum of subscriptionCount across all instances + avgGamesPerCore: double + maxGamesPerCore: int + minGamesPerCore: int + instances: InstanceMetadata[] +} diff --git a/bruno/coordinator/03 Rebalance.bru b/bruno/coordinator/03 Rebalance.bru new file mode 100644 index 0000000..66588dd --- /dev/null +++ b/bruno/coordinator/03 Rebalance.bru @@ -0,0 +1,29 @@ +meta { + name: Rebalance + type: http + seq: 3 +} + +post { + url: {{coordinatorBaseUrl}}/api/coordinator/rebalance + body: none + auth: inherit +} + +settings { + encodeUrl: true + timeout: 0 +} + +docs { + Triggers a manual rebalance of game subscriptions across core instances. + Runs asynchronously — response does not wait for completion. + + Requires port-forward: kubectl port-forward svc/nowchess-coordinator 8086:8086 -n + + Auto-rebalance runs every 30s (rebalance-interval), min 60s between runs + (rebalance-min-interval). Triggers when load deviation exceeds 20% + (max-deviation-percent). + + Response: {"status": "rebalance_started"} +} diff --git a/bruno/coordinator/04 Failover.bru b/bruno/coordinator/04 Failover.bru new file mode 100644 index 0000000..6bb7abe --- /dev/null +++ b/bruno/coordinator/04 Failover.bru @@ -0,0 +1,32 @@ +meta { + name: Failover + type: http + seq: 4 +} + +post { + url: {{coordinatorBaseUrl}}/api/coordinator/failover/{{instanceId}} + body: none + auth: inherit +} + +settings { + encodeUrl: true + timeout: 0 +} + +vars:pre-request { + instanceId: core-instance-1 +} + +docs { + Triggers manual failover for a specific core instance. + Marks it DEAD and migrates its game subscriptions to healthy instances. + Runs asynchronously — response does not wait for completion. + + Requires port-forward: kubectl port-forward svc/nowchess-coordinator 8086:8086 -n + + Path param: instanceId — from /instances response (instanceId field) + + Response: {"status": "failover_started", "instanceId": ""} +} diff --git a/bruno/coordinator/05 Scale Up.bru b/bruno/coordinator/05 Scale Up.bru new file mode 100644 index 0000000..64b0743 --- /dev/null +++ b/bruno/coordinator/05 Scale Up.bru @@ -0,0 +1,28 @@ +meta { + name: Scale Up + type: http + seq: 5 +} + +post { + url: {{coordinatorBaseUrl}}/api/coordinator/scale-up + body: none + auth: inherit +} + +settings { + encodeUrl: true + timeout: 0 +} + +docs { + Triggers manual scale-up of core replicas via Kubernetes rollout. + Requires auto-scale-enabled=true and a reachable k8s API. + Respects scale-max-replicas (default: 10). + + Requires port-forward: kubectl port-forward svc/nowchess-coordinator 8086:8086 -n + + Auto-scale triggers when avg load exceeds scale-up-threshold (default: 0.8). + + Response: {"status": "scale_up_started"} +} diff --git a/bruno/coordinator/06 Scale Down.bru b/bruno/coordinator/06 Scale Down.bru new file mode 100644 index 0000000..f574493 --- /dev/null +++ b/bruno/coordinator/06 Scale Down.bru @@ -0,0 +1,28 @@ +meta { + name: Scale Down + type: http + seq: 6 +} + +post { + url: {{coordinatorBaseUrl}}/api/coordinator/scale-down + body: none + auth: inherit +} + +settings { + encodeUrl: true + timeout: 0 +} + +docs { + Triggers manual scale-down of core replicas via Kubernetes rollout. + Requires auto-scale-enabled=true and a reachable k8s API. + Respects scale-min-replicas (default: 2). + + Requires port-forward: kubectl port-forward svc/nowchess-coordinator 8086:8086 -n + + Auto-scale triggers when avg load drops below scale-down-threshold (default: 0.3). + + Response: {"status": "scale_down_started"} +} diff --git a/bruno/coordinator/List Instances.bru b/bruno/coordinator/List Instances.bru new file mode 100644 index 0000000..21b8ad3 --- /dev/null +++ b/bruno/coordinator/List Instances.bru @@ -0,0 +1,31 @@ +meta { + name: List Instances + type: http + seq: 1 +} + +get { + url: {{coordinatorBaseUrl}}/api/coordinator/instances + body: none + auth: inherit +} + +settings { + encodeUrl: true + timeout: 0 +} + +docs { + Returns all known core instances from the in-memory registry. + Registry is populated via gRPC heartbeats from core instances. + + Response: InstanceMetadata[] + instanceId: string — unique instance ID + hostname: string + httpPort: int + grpcPort: int + subscriptionCount: int — number of active game subscriptions + localCacheSize: int + lastHeartbeat: string — ISO-8601 timestamp + state: string — "HEALTHY" | "DEAD" +} diff --git a/bruno/coordinator/folder.bru b/bruno/coordinator/folder.bru new file mode 100644 index 0000000..3d7dd75 --- /dev/null +++ b/bruno/coordinator/folder.bru @@ -0,0 +1,4 @@ +meta { + name: coordinator + seq: 6 +} diff --git a/bruno/ws/Game WebSocket.bru b/bruno/ws/Game WebSocket.bru new file mode 100644 index 0000000..7ae3e6e --- /dev/null +++ b/bruno/ws/Game WebSocket.bru @@ -0,0 +1,23 @@ +meta { + name: Game WebSocket + type: ws + seq: 1 +} + +ws { + url: {{wsBaseUrl}}/api/board/game/{{gameId}}/ws + body: ws + auth: inherit +} + +headers { + Authorization: Bearer {{token}} +} + +body:ws { + name: message 1 + type: json + content: ''' + {} + ''' +} diff --git a/bruno/ws/User WebSocket.bru b/bruno/ws/User WebSocket.bru new file mode 100644 index 0000000..ea656ad --- /dev/null +++ b/bruno/ws/User WebSocket.bru @@ -0,0 +1,23 @@ +meta { + name: User WebSocket + type: ws + seq: 2 +} + +ws { + url: {{wsBaseUrl}}/api/user/ws + body: ws + auth: inherit +} + +headers { + Authorization: Bearer {{token}} +} + +body:ws { + name: message 1 + type: json + content: ''' + {} + ''' +} diff --git a/bruno/ws/folder.bru b/bruno/ws/folder.bru new file mode 100644 index 0000000..2a951a9 --- /dev/null +++ b/bruno/ws/folder.bru @@ -0,0 +1,4 @@ +meta { + name: ws + seq: 7 +}