{
  "repo": "tidbcloud/VictoriaMetrics",
  "binary": "vmbackup",
  "binary_path": "app/vmbackup/main.go",
  "dependencies": {
    "Runtime VMBackupLifecycle.InitializeFlagsAndLogging": {
      "infrastructure": {},
      "services": []
    },
    "Runtime VMBackupLifecycle.HandleSignalCancellation": {
      "infrastructure": {},
      "services": []
    },
    "Runtime VMBackupLifecycle.CreateSnapshotIfConfigured": {
      "infrastructure": {},
      "services": [
        {
          "name": "victoriametrics-snapshot-api",
          "target_interface": "POST snapshot.createURL",
          "operation_type": "http_post",
          "conditions": [
            "Only when snapshot.createURL is configured"
          ],
          "operations": [
            {
              "operation": "CREATE SNAPSHOT",
              "trigger": "Create a fresh VM snapshot before copying backup data",
              "conditions": [
                "snapshot.createURL != \"\""
              ],
              "implementation": "main -> snapshot.Create(ctx, snapshot.createURL)"
            }
          ]
        },
        {
          "name": "victoriametrics-snapshot-api",
          "target_interface": "POST snapshot.deleteURL",
          "operation_type": "http_post",
          "conditions": [
            "Only when snapshot.createURL is configured and backup finishes or exits through the delete path"
          ],
          "operations": [
            {
              "operation": "DELETE SNAPSHOT",
              "trigger": "Delete the temporary snapshot created for backup",
              "conditions": [
                "deleteSnapshot() is invoked"
              ],
              "implementation": "main -> deleteSnapshot() -> snapshot.Delete(context.Background(), snapshot.deleteURL, snapshotName)"
            }
          ]
        }
      ]
    },
    "Runtime VMBackupLifecycle.StartHTTPServer": {
      "infrastructure": {},
      "services": []
    },
    "Runtime VMBackupLifecycle.RunBackup": {
      "infrastructure": {
        "filesystem": {
          "conditions": [
            "When snapshotName is set and storageDataPath points to local VM data"
          ],
          "operations": [
            {
              "operation": "READ SNAPSHOT FILES",
              "trigger": "Open and stream local VM snapshot data for backup upload",
              "conditions": [
                "snapshotName != \"\""
              ],
              "implementation": "makeBackup -> newSrcFS() -> os.Open(snapshotPath) + fslocal.FS.Init()"
            }
          ]
        }
      },
      "services": [
        {
          "name": "remote-backup-storage",
          "target_interface": "actions.NewRemoteFS(dst)",
          "operation_type": "storage_write",
          "conditions": [
            "dst is configured with gs://, s3://, azblob://, or fs://"
          ],
          "operations": [
            {
              "operation": "WRITE BACKUP DATA",
              "trigger": "Upload changed snapshot blocks to remote backup storage",
              "conditions": [
                "snapshotName != \"\""
              ],
              "implementation": "makeBackup -> newDstFS(ctx) -> actions.Backup.Run()"
            }
          ]
        },
        {
          "name": "remote-backup-storage",
          "target_interface": "actions.NewRemoteFS(origin)",
          "operation_type": "storage_read",
          "conditions": [
            "origin is configured"
          ],
          "operations": [
            {
              "operation": "READ PREVIOUS BACKUP",
              "trigger": "Reuse origin backup blocks during incremental or server-side copy mode",
              "conditions": [
                "origin != \"\""
              ],
              "implementation": "makeBackup -> newOriginFS(ctx) or newRemoteOriginFS(ctx)"
            }
          ]
        }
      ]
    },
    "Runtime VMBackupLifecycle.StopHTTPServer": {
      "infrastructure": {},
      "services": []
    },
    "HTTP ANY /health": {
      "infrastructure": {},
      "services": []
    },
    "HTTP ANY /ping": {
      "infrastructure": {},
      "services": []
    },
    "HTTP ANY /metrics": {
      "infrastructure": {},
      "services": []
    },
    "HTTP ANY /flags": {
      "infrastructure": {},
      "services": []
    },
    "HTTP ANY /-/healthy": {
      "infrastructure": {},
      "services": []
    },
    "HTTP ANY /-/ready": {
      "infrastructure": {},
      "services": []
    },
    "HTTP ANY /debug/pprof/*": {
      "infrastructure": {},
      "services": []
    }
  }
}
