{
  "repo": "tidbcloud/VictoriaMetrics",
  "binary": "vmctl",
  "binary_path": "app/vmctl/main.go",
  "dependencies": {
    "Runtime VMCtlLifecycle.InitializeCLI": {
      "infrastructure": {},
      "services": []
    },
    "Runtime VMCtlLifecycle.HandleSignalCancellation": {
      "infrastructure": {},
      "services": []
    },
    "CLI opentsdb": {
      "infrastructure": {},
      "services": [
        {
          "name": "opentsdb",
          "target_interface": "OpenTSDB query API",
          "operation_type": "http_get",
          "conditions": [
            "otsdbAddr is a valid URL",
            "opentsdb.NewClient(...) succeeds"
          ],
          "operations": [
            {
              "operation": "READ SOURCE SERIES",
              "trigger": "Scan OpenTSDB series and query datapoints for migration",
              "conditions": [
                "otsdbProcessor.run() is executing"
              ],
              "implementation": "main -> opentsdb.NewClient(...) -> otsdbProcessor.run() -> otsdbProcessor.do(...)"
            }
          ]
        },
        {
          "name": "victoriametrics",
          "target_interface": "VictoriaMetrics import API",
          "operation_type": "http_post",
          "conditions": [
            "vmAddr is a valid URL",
            "vm.NewImporter(...) succeeds"
          ],
          "operations": [
            {
              "operation": "IMPORT TIMESERIES",
              "trigger": "Push OpenTSDB samples into VictoriaMetrics",
              "conditions": [
                "otsdbProcessor.do(...) converts rows successfully"
              ],
              "implementation": "main -> vm.NewImporter(...) -> otsdbProcessor.do(...) -> importer.Input(...) -> vm.Importer.Import(...)"
            }
          ]
        }
      ]
    },
    "CLI influx": {
      "infrastructure": {},
      "services": [
        {
          "name": "influxdb",
          "target_interface": "Influx query API",
          "operation_type": "http_get",
          "conditions": [
            "influx.NewClient(...) succeeds"
          ],
          "operations": [
            {
              "operation": "READ SOURCE SERIES",
              "trigger": "Iterate InfluxDB series and chunks for migration",
              "conditions": [
                "influxProcessor.run() is executing"
              ],
              "implementation": "main -> influx.NewClient(...) -> influxProcessor.run() -> influxProcessor.do(...)"
            }
          ]
        },
        {
          "name": "victoriametrics",
          "target_interface": "VictoriaMetrics import API",
          "operation_type": "http_post",
          "conditions": [
            "vm.NewImporter(...) succeeds"
          ],
          "operations": [
            {
              "operation": "IMPORT TIMESERIES",
              "trigger": "Push converted InfluxDB series into VictoriaMetrics",
              "conditions": [
                "influxProcessor.do(...) emits rows"
              ],
              "implementation": "main -> vm.NewImporter(...) -> influxProcessor.do(...) -> importer.Input(...) -> vm.Importer.Import(...)"
            }
          ]
        }
      ]
    },
    "CLI remote-read": {
      "infrastructure": {},
      "services": [
        {
          "name": "prometheus-remote-read",
          "target_interface": "Prometheus remote-read API",
          "operation_type": "http_post",
          "conditions": [
            "remoteReadSrcAddr is a valid URL",
            "remoteread.NewClient(...) succeeds"
          ],
          "operations": [
            {
              "operation": "READ SOURCE SERIES",
              "trigger": "Fetch source series via the Prometheus remote-read protocol",
              "conditions": [
                "remoteReadProcessor.run(ctx) is executing"
              ],
              "implementation": "main -> remoteread.NewClient(...) -> remoteReadProcessor.run(ctx) -> remoteReadProcessor.do(...)"
            }
          ]
        },
        {
          "name": "victoriametrics",
          "target_interface": "VictoriaMetrics import API",
          "operation_type": "http_post",
          "conditions": [
            "vm.NewImporter(...) succeeds"
          ],
          "operations": [
            {
              "operation": "IMPORT TIMESERIES",
              "trigger": "Push remote-read samples into VictoriaMetrics",
              "conditions": [
                "remoteReadProcessor.do(...) emits rows"
              ],
              "implementation": "main -> vm.NewImporter(...) -> remoteReadProcessor.do(...) -> importer.Input(...) -> vm.Importer.Import(...)"
            }
          ]
        }
      ]
    },
    "CLI prometheus": {
      "infrastructure": {
        "filesystem": {
          "conditions": [
            "prom-snapshot points to a local TSDB snapshot"
          ],
          "operations": [
            {
              "operation": "READ SNAPSHOT BLOCKS",
              "trigger": "Open and iterate Prometheus TSDB snapshot blocks",
              "conditions": [
                "prometheus.NewClient(...) succeeds"
              ],
              "implementation": "main -> prometheus.NewClient(...) -> tsdb.OpenDBReadOnly(snapshot, ...)"
            }
          ]
        }
      },
      "services": [
        {
          "name": "victoriametrics",
          "target_interface": "VictoriaMetrics import API",
          "operation_type": "http_post",
          "conditions": [
            "vm.NewImporter(...) succeeds"
          ],
          "operations": [
            {
              "operation": "IMPORT TIMESERIES",
              "trigger": "Push Prometheus snapshot series into VictoriaMetrics",
              "conditions": [
                "prometheusProcessor.do(...) emits rows"
              ],
              "implementation": "main -> vm.NewImporter(...) -> prometheusProcessor.run() -> prometheusProcessor.do(...) -> importer.Input(...) -> vm.Importer.Import(...)"
            }
          ]
        }
      ]
    },
    "CLI vm-native": {
      "infrastructure": {},
      "services": [
        {
          "name": "source-victoriametrics",
          "target_interface": "VictoriaMetrics native export API",
          "operation_type": "http_get",
          "conditions": [
            "vmNativeSrcAddr is configured",
            "vmNativeFilterMatch is non-empty"
          ],
          "operations": [
            {
              "operation": "EXPORT NATIVE BLOCKS",
              "trigger": "Read native export data from the source VictoriaMetrics installation",
              "conditions": [
                "vmNativeProcessor.run(ctx) is executing"
              ],
              "implementation": "main -> vmNativeProcessor.run(ctx) -> vmNativeProcessor.do(...) -> native.Client.Export(...)"
            }
          ]
        },
        {
          "name": "destination-victoriametrics",
          "target_interface": "VictoriaMetrics native import API",
          "operation_type": "http_post",
          "conditions": [
            "vmNativeDstAddr is configured"
          ],
          "operations": [
            {
              "operation": "IMPORT NATIVE BLOCKS",
              "trigger": "Pipe native export data into the destination VictoriaMetrics installation",
              "conditions": [
                "vmNativeProcessor.do(...) has a destination URL"
              ],
              "implementation": "main -> vmNativeProcessor.run(ctx) -> vmNativeProcessor.do(...) -> native.Client.ImportPipe(...)"
            }
          ]
        }
      ]
    },
    "CLI verify-block": {
      "infrastructure": {
        "filesystem": {
          "conditions": [
            "A local block path argument is provided"
          ],
          "operations": [
            {
              "operation": "READ BLOCK FILE",
              "trigger": "Open and parse a native export block for verification",
              "conditions": [
                "blockPath != \"\""
              ],
              "implementation": "main -> os.OpenFile(blockPath, O_RDONLY, ...) -> stream.Parse(...)"
            }
          ]
        }
      },
      "services": []
    }
  }
}
