Version: 1.0.0 Workflow: query-and-monitor-planet Category: Monitoring
Query planet information and set up monitoring via streaming.
planet_idwebapp-planet-by-idGEThttp://localhost:8080/api/planet/{planet_id}Parameters:
| Parameter | Example Value |
|---|---|
| planet_id | 3-1 |
Data Extraction:
planet_id from response.body.idowner_id from response.body.owner_idplanet_name from response.body.nameExpected Response:
200schemas/entities.md#/definitions/PlanetError Handling:
| Status | Action |
|---|---|
| 404 | Planet not found - verify planet_id |
webapp-planet-shield-healthGEThttp://localhost:8080/api/planet/{planet_id}/shield/healthParameters:
| Parameter | Value |
|---|---|
| planet_id | `` |
Data Extraction:
shield_health from response.body.healthshield_max_health from response.body.max_healthshield_percentage calculated as response.body.health / response.body.max_health * 100Expected Response:
200schemas/responses.md#/definitions/ShieldHealthResponseError Handling:
| Status | Action |
|---|---|
| 404 | Planet not found or no shield data |
webapp-planet-raid-activeGEThttp://localhost:8080/api/planet/{planet_id}/raid/activeParameters:
| Parameter | Value |
|---|---|
| planet_id | `` |
Data Extraction:
has_active_raid from response.body !== nullraid_info from response.bodyExpected Response:
200schemas/entities.md#/definitions/RaidResponse may be null if no active raid.
Error Handling:
| Status | Action |
|---|---|
| 404 | Planet not found (null response is valid if no active raid) |
webapp-struct-by-planetGEThttp://localhost:8080/api/struct/planet/{planet_id}Parameters:
| Parameter | Value |
|---|---|
| planet_id | `` |
Data Extraction:
structs from response.bodystruct_count from response.body.lengthExpected Response:
200schemas/entities.md#/definitions/Struct[]Error Handling:
| Status | Action |
|---|---|
| 404 | Planet not found or no structs |
Set up real-time monitoring via streaming.
grass-nats-protocolNATSnats://localhost:4222Subscription:
structs.planet.Events:
raid_statusfleet_arrivefleet_advancefleet_departDocumentation: See protocols/streaming.md
Error Handling:
| Error | Action |
|---|---|
| connection_error | NATS connection failed - check NATS server |
| subscription_error | Subscription failed - verify subject pattern |
{
"planet": {
"id": "",
"name": "",
"owner_id": "",
"shield": {
"health": "",
"max_health": "",
"health_percentage": ""
},
"raid": {
"active": "",
"info": ""
},
"structs": {
"count": "",
"list": ""
}
},
"monitoring": {
"streaming_subject": "structs.planet.",
"status": "subscribed"
}
}
This workflow demonstrates querying planet information and setting up real-time monitoring. Steps 2-4 can be executed in parallel for better performance. Step 5 establishes a streaming connection for real-time updates.