<2022-09-25 Sun> some notes to kaki-san:

list cities

curl https://api.mirage.city/cities/list | jq .
{
  "status": "ok",
  "data": [
    {
      "id": "0d5fcaff-d572-4923-8d7c-ef25ea37e7d2",
      "name": "Springfield",
      "address": "18.27.123.81:9000"
    },
    {
      "id": "ea0bcd92-b5e6-4013-857c-6d299e8494cf",
      "name": "Cannburg",
      "address": "18.27.123.81:9000"
    },
    {
      "id": "8dd8446a-9dc2-4f25-823d-28df24006c4c",
      "name": "Los Palma",
      "address": "18.27.123.81:9000"
    },
    {
      "id": "1d1029c2-7fb1-486a-8bb0-722aac3187f7",
      "name": "Rockwood",
      "address": "18.27.123.81:9000"
    },
    {
      "id": "eea17fbf-b307-44d3-af9e-eb16d4599f96",
      "name": "Rockwood",
      "address": "18.27.123.81:9000"
    },
    {
      "id": "e10cf764-ebff-4470-b764-ca10da573dbc",
      "name": "Rennes",
      "address": "18.27.123.81:9000"
    },
    {
      "id": "88fe1800-9e42-4dbb-bb19-4c91d0c991f4",
      "name": "Cannburg",
      "address": "18.27.123.81:9000"
    },
    {
      "id": "4b543ae8-6e33-498a-baf2-57f7302c57fe",
      "name": "Westwood",
      "address": "18.27.123.81:9000"
    },
    {
      "id": "c58e9028-7fe3-4f5f-a79f-39dbd4676651",
      "name": "CruncherIslands",
      "address": "18.27.123.81:9000"
    },
    {
      "id": "d1a499e7-e229-4e98-a21e-44a77cded699",
      "name": "Las Vegas",
      "address": "18.27.127.167:9000"
    },
    {
      "id": "d2d1db3b-a504-4d09-afd1-dda7be952e72",
      "name": "Test City",
      "address": "18.27.123.81:9000"
    },
    {
      "id": "6b81c45b-6129-45f5-ad3f-7baa4991c597",
      "name": "Las Vegas",
      "address": "18.27.123.81:9000"
    },
    {
      "id": "38718ac1-d711-4be8-8e82-53c5ddaf967b",
      "name": "Springfield",
      "address": "18.27.123.81:9000"
    },
    {
      "id": "c145b23d-0fd0-4b7f-bb0b-005fd984a0ab",
      "name": "Lakefield",
      "address": "18.27.123.81:9000"
    },
    {
      "id": "70cd64c3-3d6e-4677-8dc2-1d79fca4a34b",
      "name": "CruncherIsland",
      "address": "18.27.123.81:9000"
    },
    {
      "id": "f1b39805-e8ae-465f-94ea-7fc27e7c30a3",
      "name": "GeminiCityTest",
      "address": "18.27.123.81:9000"
    }
  ]
}

you will need the id to get data of that city

{
  "status": "ok",
  "data": [
    {
      "id": "d2d1db3b-a504-4d09-afd1-dda7be952e72",
      "name": "Test City",
      "address": "18.27.123.81:9000"
    }
  ]
}

get latest city info

curl https://api.mirage.city/city/info/d2d1db3b-a504-4d09-afd1-dda7be952e72/latest | jq .

you will find death_count and birth_rate inside data

output
{
  "status": "ok",
  "data": {
    "elapsed": 1215210,
    "happiness": 50,
    "population": 5,
    "death_count": 0,
    "birth_rate": 0,
    "residential_demand": 100,
    "commercial_demand": 3,
    "industrial_demand": 0,
    "scenes": [
      "default"
    ],
    "network_zone_info": {
      "nodes": [
        {
          "id": 371,
          "pos": [
            878.9366,
            100.3836,
            225.4117
          ]
        },
        {
          "id": 4990,
          "pos": [
            879.3757,
            101.2376,
            192.0089
          ]
        },
        {
          "id": 23086,
          "pos": [
            879.9374,
            100.7126,
            152.0128
          ]
        }
      ],
      "edges": [
        {
          "id": 23562,
          "start": 371,
          "end": 4990,
          "sl": 48201,
          "sr": 26242,
          "el": 0,
          "er": 0,
          "sd": [
            0.01404304,
            0,
            -0.9999014
          ],
          "ed": [
            -0.01404304,
            0,
            0.9999014
          ]
        },
        {
          "id": 25000,
          "start": 4990,
          "end": 23086,
          "sl": 4478,
          "sr": 40242,
          "el": 0,
          "er": 0,
          "sd": [
            0.01404304,
            0,
            -0.9999014
          ],
          "ed": [
            -0.01404304,
            0,
            0.9999014
          ]
        }
      ],
      "blocks": [
        {
          "id": 26242,
          "cells": [
            {
              "x": 0,
              "z": 0,
              "land_use": "ResLow"
            },
            {
              "x": 0,
              "z": 1,
              "land_use": "ResLow"
            },
            {
              "x": 0,
              "z": 2,
              "land_use": "ResLow"
            },
            {
              "x": 0,
              "z": 3,
              "land_use": "ResLow"
            },
            {
              "x": 1,
              "z": 0,
              "land_use": "ResLow"
            },
            {
              "x": 1,
              "z": 1,
              "land_use": "ResLow"
            },
            {
              "x": 1,
              "z": 2,
              "land_use": "ResLow"
            },
            {
              "x": 1,
              "z": 3,
              "land_use": "ResLow"
            },
            {
              "x": 2,
              "z": 0,
              "land_use": "ResLow"
            },
            {
              "x": 2,
              "z": 1,
              "land_use": "ResLow"
            },
            {
              "x": 2,
              "z": 2,
              "land_use": "ResLow"
            },
            {
              "x": 2,
              "z": 3,
              "land_use": "ResLow"
            },
            {
              "x": 3,
              "z": 0,
              "land_use": "ResLow"
            },
            {
              "x": 3,
              "z": 1,
              "land_use": "ResLow"
            },
            {
              "x": 3,
              "z": 2,
              "land_use": "ResLow"
            },
            {
              "x": 3,
              "z": 3,
              "land_use": "ResLow"
            }
          ]
        },
        {
          "id": 4478,
          "cells": [
            {
              "x": 0,
              "z": 2,
              "land_use": "UnZone"
            },
            {
              "x": 0,
              "z": 3,
              "land_use": "UnZone"
            },
            {
              "x": 0,
              "z": 4,
              "land_use": "UnZone"
            },
            {
              "x": 1,
              "z": 2,
              "land_use": "UnZone"
            },
            {
              "x": 1,
              "z": 3,
              "land_use": "UnZone"
            },
            {
              "x": 1,
              "z": 4,
              "land_use": "UnZone"
            },
            {
              "x": 2,
              "z": 2,
              "land_use": "UnZone"
            },
            {
              "x": 2,
              "z": 3,
              "land_use": "UnZone"
            },
            {
              "x": 2,
              "z": 4,
              "land_use": "UnZone"
            },
            {
              "x": 3,
              "z": 2,
              "land_use": "UnZone"
            },
            {
              "x": 3,
              "z": 3,
              "land_use": "UnZone"
            },
            {
              "x": 3,
              "z": 4,
              "land_use": "UnZone"
            }
          ]
        },
        {
          "id": 40242,
          "cells": [
            {
              "x": 0,
              "z": 0,
              "land_use": "ResLow"
            },
            {
              "x": 0,
              "z": 1,
              "land_use": "ResLow"
            },
            {
              "x": 0,
              "z": 2,
              "land_use": "ResLow"
            },
            {
              "x": 0,
              "z": 3,
              "land_use": "ResLow"
            },
            {
              "x": 0,
              "z": 4,
              "land_use": "ResLow"
            },
            {
              "x": 1,
              "z": 0,
              "land_use": "ResLow"
            },
            {
              "x": 1,
              "z": 1,
              "land_use": "ResLow"
            },
            {
              "x": 1,
              "z": 2,
              "land_use": "ResLow"
            },
            {
              "x": 1,
              "z": 3,
              "land_use": "ResLow"
            },
            {
              "x": 1,
              "z": 4,
              "land_use": "ResLow"
            },
            {
              "x": 2,
              "z": 0,
              "land_use": "ResLow"
            },
            {
              "x": 2,
              "z": 1,
              "land_use": "ResLow"
            },
            {
              "x": 2,
              "z": 2,
              "land_use": "ResLow"
            },
            {
              "x": 2,
              "z": 3,
              "land_use": "ResLow"
            },
            {
              "x": 2,
              "z": 4,
              "land_use": "ResLow"
            },
            {
              "x": 3,
              "z": 0,
              "land_use": "ResLow"
            },
            {
              "x": 3,
              "z": 1,
              "land_use": "ResLow"
            },
            {
              "x": 3,
              "z": 2,
              "land_use": "ResLow"
            },
            {
              "x": 3,
              "z": 3,
              "land_use": "ResLow"
            },
            {
              "x": 3,
              "z": 4,
              "land_use": "ResLow"
            }
          ]
        }
      ]
    }
  }
}

get list of city info

curl https://api.mirage.city/city/info/d2d1db3b-a504-4d09-afd1-dda7be952e72/timestamps | jq .
{
  "status": "ok",
  "data": [
    1215210,
    1228942
  ]
}

get city info at a given timestamp

curl https://api.mirage.city/city/info/d2d1db3b-a504-4d09-afd1-dda7be952e72/1215210 | jq .
output
{
  "status": "ok",
  "data": {
    "elapsed": 1215210,
    "happiness": 50,
    "population": 5,
    "death_count": 0,
    "birth_rate": 0,
    "residential_demand": 100,
    "commercial_demand": 3,
    "industrial_demand": 0,
    "scenes": [
      "default"
    ],
    "network_zone_info": {
      "nodes": [
        {
          "id": 371,
          "pos": [
            878.9366,
            100.3836,
            225.4117
          ]
        },
        {
          "id": 4990,
          "pos": [
            879.3757,
            101.2376,
            192.0089
          ]
        },
        {
          "id": 23086,
          "pos": [
            879.9374,
            100.7126,
            152.0128
          ]
        }
      ],
      "edges": [
        {
          "id": 23562,
          "start": 371,
          "end": 4990,
          "sl": 48201,
          "sr": 26242,
          "el": 0,
          "er": 0,
          "sd": [
            0.01404304,
            0,
            -0.9999014
          ],
          "ed": [
            -0.01404304,
            0,
            0.9999014
          ]
        },
        {
          "id": 25000,
          "start": 4990,
          "end": 23086,
          "sl": 4478,
          "sr": 40242,
          "el": 0,
          "er": 0,
          "sd": [
            0.01404304,
            0,
            -0.9999014
          ],
          "ed": [
            -0.01404304,
            0,
            0.9999014
          ]
        }
      ],
      "blocks": [
        {
          "id": 26242,
          "cells": [
            {
              "x": 0,
              "z": 0,
              "land_use": "ResLow"
            },
            {
              "x": 0,
              "z": 1,
              "land_use": "ResLow"
            },
            {
              "x": 0,
              "z": 2,
              "land_use": "ResLow"
            },
            {
              "x": 0,
              "z": 3,
              "land_use": "ResLow"
            },
            {
              "x": 1,
              "z": 0,
              "land_use": "ResLow"
            },
            {
              "x": 1,
              "z": 1,
              "land_use": "ResLow"
            },
            {
              "x": 1,
              "z": 2,
              "land_use": "ResLow"
            },
            {
              "x": 1,
              "z": 3,
              "land_use": "ResLow"
            },
            {
              "x": 2,
              "z": 0,
              "land_use": "ResLow"
            },
            {
              "x": 2,
              "z": 1,
              "land_use": "ResLow"
            },
            {
              "x": 2,
              "z": 2,
              "land_use": "ResLow"
            },
            {
              "x": 2,
              "z": 3,
              "land_use": "ResLow"
            },
            {
              "x": 3,
              "z": 0,
              "land_use": "ResLow"
            },
            {
              "x": 3,
              "z": 1,
              "land_use": "ResLow"
            },
            {
              "x": 3,
              "z": 2,
              "land_use": "ResLow"
            },
            {
              "x": 3,
              "z": 3,
              "land_use": "ResLow"
            }
          ]
        },
        {
          "id": 4478,
          "cells": [
            {
              "x": 0,
              "z": 2,
              "land_use": "UnZone"
            },
            {
              "x": 0,
              "z": 3,
              "land_use": "UnZone"
            },
            {
              "x": 0,
              "z": 4,
              "land_use": "UnZone"
            },
            {
              "x": 1,
              "z": 2,
              "land_use": "UnZone"
            },
            {
              "x": 1,
              "z": 3,
              "land_use": "UnZone"
            },
            {
              "x": 1,
              "z": 4,
              "land_use": "UnZone"
            },
            {
              "x": 2,
              "z": 2,
              "land_use": "UnZone"
            },
            {
              "x": 2,
              "z": 3,
              "land_use": "UnZone"
            },
            {
              "x": 2,
              "z": 4,
              "land_use": "UnZone"
            },
            {
              "x": 3,
              "z": 2,
              "land_use": "UnZone"
            },
            {
              "x": 3,
              "z": 3,
              "land_use": "UnZone"
            },
            {
              "x": 3,
              "z": 4,
              "land_use": "UnZone"
            }
          ]
        },
        {
          "id": 40242,
          "cells": [
            {
              "x": 0,
              "z": 0,
              "land_use": "ResLow"
            },
            {
              "x": 0,
              "z": 1,
              "land_use": "ResLow"
            },
            {
              "x": 0,
              "z": 2,
              "land_use": "ResLow"
            },
            {
              "x": 0,
              "z": 3,
              "land_use": "ResLow"
            },
            {
              "x": 0,
              "z": 4,
              "land_use": "ResLow"
            },
            {
              "x": 1,
              "z": 0,
              "land_use": "ResLow"
            },
            {
              "x": 1,
              "z": 1,
              "land_use": "ResLow"
            },
            {
              "x": 1,
              "z": 2,
              "land_use": "ResLow"
            },
            {
              "x": 1,
              "z": 3,
              "land_use": "ResLow"
            },
            {
              "x": 1,
              "z": 4,
              "land_use": "ResLow"
            },
            {
              "x": 2,
              "z": 0,
              "land_use": "ResLow"
            },
            {
              "x": 2,
              "z": 1,
              "land_use": "ResLow"
            },
            {
              "x": 2,
              "z": 2,
              "land_use": "ResLow"
            },
            {
              "x": 2,
              "z": 3,
              "land_use": "ResLow"
            },
            {
              "x": 2,
              "z": 4,
              "land_use": "ResLow"
            },
            {
              "x": 3,
              "z": 0,
              "land_use": "ResLow"
            },
            {
              "x": 3,
              "z": 1,
              "land_use": "ResLow"
            },
            {
              "x": 3,
              "z": 2,
              "land_use": "ResLow"
            },
            {
              "x": 3,
              "z": 3,
              "land_use": "ResLow"
            },
            {
              "x": 3,
              "z": 4,
              "land_use": "ResLow"
            }
          ]
        }
      ]
    }
  }
}

add scene

curl -H "Content-Type: application/json" -d '{"name": "center", "x":900, "z": 200, "size": 500, "yaw":90, "pitch":90 }' https://api.mirage.city/city/command/d2d1db3b-a504-4d09-afd1-dda7be952e72/add_scene
<html>
<head><title>504 Gateway Time-out</title></head>
<body>
<center><h1>504 Gateway Time-out</h1></center>
<hr><center>nginx/1.23.1</center>
</body>
</html>

command history

curl https://api.mirage.city/city/command/72174fec-a612-4998-9455-ba88a810539e | jq .
{
  "status": "ok",
  "data": [
    "530528,zone,48284,0,4,1",
    "530528,toggle",
    "546623,toggle"
  ]
}

Date: 2022-09-25 Sun 20:40