{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/google-cloud-dataproc/json-schema/google-cloud-dataproc-migration-execution-schema.json",
  "title": "MigrationExecution",
  "description": "The details of a migration execution resource.",
  "x-generated": "2026-11-11",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/google-cloud-dataproc-metastore-projects-api-openapi.yml#/components/schemas/MigrationExecution",
  "type": "object",
  "properties": {
    "name": {
      "type": "string",
      "description": "Output only. The relative resource name of the migration execution, in the following form: projects/{project_number}/locations/{location_id}/services/{service_id}/migrationExecutions/{migration_execution_id}",
      "readOnly": true
    },
    "state": {
      "enum": [
        "STATE_UNSPECIFIED",
        "STARTING",
        "RUNNING",
        "CANCELLING",
        "AWAITING_USER_ACTION",
        "SUCCEEDED",
        "FAILED",
        "CANCELLED",
        "DELETING",
        "ROLLED_BACK"
      ],
      "readOnly": true,
      "description": "Output only. The current state of the migration execution.",
      "type": "string"
    },
    "biglakeMetastoreMigrationConfig": {
      "$ref": "#/$defs/BigLakeMetastoreMigrationConfig",
      "description": "Configuration information specific to migrating from Dataproc Metastore to BigLake Metastore."
    },
    "stateMessage": {
      "type": "string",
      "readOnly": true,
      "description": "Output only. Additional information about the current state of the migration execution."
    },
    "phase": {
      "description": "Output only. Deprecated: Phase was designed for incoming migrations to Dataproc Metastore, not applicable when migrating away from it. The current phase of the migration execution.",
      "type": "string",
      "enum": [
        "PHASE_UNSPECIFIED",
        "REPLICATION",
        "CUTOVER"
      ],
      "readOnly": true,
      "deprecated": true
    },
    "createTime": {
      "format": "google-datetime",
      "description": "Output only. The time when the migration execution was started.",
      "type": "string",
      "readOnly": true
    },
    "endTime": {
      "readOnly": true,
      "type": "string",
      "description": "Output only. The time when the migration execution finished.",
      "format": "google-datetime"
    }
  },
  "$defs": {
    "BackfillStatus": {
      "description": "Backfill status for the migration execution.",
      "properties": {
        "reportPath": {
          "type": "string",
          "readOnly": true,
          "description": "Output only. The Cloud Storage path where the backfill or dry run report is written. Format: \"gs://path-to-report\"."
        },
        "migrationSummary": {
          "$ref": "#/$defs/MigrationSummary",
          "description": "Output only. Summary of the migration results. This is populated after the backfill or dry run is finished."
        },
        "state": {
          "type": "string",
          "readOnly": true,
          "description": "Output only. The current state of the backfill (or dry run).",
          "enum": [
            "STATE_UNSPECIFIED",
            "PENDING",
            "RUNNING",
            "SUCCEEDED",
            "FAILED"
          ]
        }
      },
      "type": "object"
    },
    "BigLakeMetastoreMigrationConfig": {
      "type": "object",
      "properties": {
        "dryRun": {
          "description": "Optional. If true, performs discovery of requested resources and analysis against the target catalog to come up with a plan for each resource (e.g. Create, Update, Skip, etc.). No metadata is actually migrated.",
          "type": "boolean"
        },
        "backfillStatus": {
          "$ref": "#/$defs/BackfillStatus",
          "description": "Output only. "
        },
        "conflictPolicy": {
          "type": "string",
          "enum": [
            "CONFLICT_POLICY_UNSPECIFIED",
            "SKIP",
            "OVERWRITE"
          ],
          "description": "Optional. The policy to handle conflicts when migrating resources, defaults to SKIP if not specified."
        },
        "mode": {
          "description": "Required. Defines the behavior of the migration execution.",
          "type": "string",
          "enum": [
            "MIGRATION_MODE_UNSPECIFIED",
            "BACKFILL"
          ]
        },
        "icebergConfig": {
          "$ref": "#/$defs/IcebergConfig",
          "description": "Optional. Configuration for migrating Iceberg tables to a BigLake Iceberg REST catalog."
        },
        "reportPath": {
          "type": "string",
          "description": "Optional. The Cloud Storage path where the backfill / dry run report should be written. If not provided, the report will be generated in the service's artifacts bucket. Format: \"gs://path/to/folder\""
        },
        "hiveConfig": {
          "$ref": "#/$defs/HiveConfig",
          "description": "Optional. At least one of hive_config or iceberg_config must be provided, otherwise, a validation error will be thrown. If only one is provided, the service only migrates tables of that specific type. If both are provided, both Hive and Iceberg tables will be migrated.Configuration for migrating Hive tables to a BigLake Hive catalog."
        }
      },
      "description": "Defines the configuration required to migrate metadata from a Dataproc Metastore service to BigLake Metastore."
    },
    "CatalogSummary": {
      "description": "Summary of results for a specific destination catalog.",
      "type": "object",
      "properties": {
        "catalogType": {
          "readOnly": true,
          "enum": [
            "CATALOG_TYPE_UNSPECIFIED",
            "HIVE",
            "ICEBERG"
          ],
          "description": "Output only. The type of the catalog.",
          "type": "string"
        },
        "catalog": {
          "type": "string",
          "description": "Output only. The catalog resource name (format: projects/*/catalogs/*).",
          "readOnly": true
        },
        "databaseSummaries": {
          "readOnly": true,
          "description": "Output only. Summary of results for each database in the catalog.",
          "type": "array",
          "items": {
            "$ref": "#/$defs/DatabaseSummary"
          }
        }
      }
    },
    "DatabaseSummary": {
      "type": "object",
      "properties": {
        "database": {
          "readOnly": true,
          "type": "string",
          "description": "Output only. The name of the database."
        },
        "resultStatus": {
          "readOnly": true,
          "description": "Output only. The migration result status for the database. This is only set if the migration is not a dry run.",
          "enum": [
            "STATE_UNSPECIFIED",
            "SUCCEEDED",
            "FAILED",
            "SKIPPED"
          ],
          "type": "string"
        },
        "tableSummary": {
          "$ref": "#/$defs/TableSummary",
          "description": "Output only. Aggregated summary of results for all tables in the database."
        },
        "planAction": {
          "description": "Output only. The migration plan action for the database.",
          "type": "string",
          "readOnly": true,
          "enum": [
            "ACTION_UNSPECIFIED",
            "CREATE",
            "UPDATE",
            "SKIP",
            "DEPENDENCY_FAILURE",
            "ERROR"
          ]
        }
      },
      "description": "Summary of results for a specific database in a catalog."
    },
    "HiveConfig": {
      "description": "Configuration for migrating Hive metadata.",
      "type": "object",
      "properties": {
        "catalog": {
          "type": "string",
          "description": "Required. The target catalog for migrated databases and tables. Format: \"projects/{project_id_or_number}/catalogs/{catalog_id}\""
        },
        "databases": {
          "description": "Required. The list of databases to migrate to the Hive catalog. Use \"*\" to migrate all databases. Note: If Iceberg tables exist in these databases, they will only be migrated if iceberg_config is also specified.",
          "type": "array",
          "items": {
            "type": "string"
          }
        }
      }
    },
    "IcebergConfig": {
      "type": "object",
      "description": "Configuration for migrating Iceberg metadata.",
      "properties": {
        "catalog": {
          "type": "string",
          "description": "Required. The target catalog for migrated Iceberg metadata. Format: \"projects/{project_id_or_number}/catalogs/{catalog_id}\""
        },
        "namespaces": {
          "items": {
            "type": "string"
          },
          "type": "array",
          "description": "Required. The list of namespaces to migrate to the Iceberg REST catalog. Use \"*\" to migrate all namespaces. Note: If Hive tables exist in these namespaces, they will only be migrated if hive_config is also specified."
        }
      }
    },
    "MigrationSummary": {
      "description": "Summary of the migration results.",
      "properties": {
        "service": {
          "readOnly": true,
          "description": "Output only. The Dataproc Metastore service name (format: projects/*/locations/*/services/*) on which the migration was executed.",
          "type": "string"
        },
        "catalogSummaries": {
          "description": "Output only. Summary of results for each catalog involved in the migration.",
          "readOnly": true,
          "type": "array",
          "items": {
            "$ref": "#/$defs/CatalogSummary"
          }
        },
        "endTime": {
          "format": "google-datetime",
          "type": "string",
          "readOnly": true,
          "description": "Output only. The UTC time when the report was written."
        },
        "dryRun": {
          "readOnly": true,
          "description": "Output only. Whether the migration was a dry run.",
          "type": "boolean"
        },
        "createTime": {
          "description": "Output only. The UTC time when the source metadata read was initiated.",
          "type": "string",
          "readOnly": true,
          "format": "google-datetime"
        }
      },
      "type": "object"
    },
    "TableSummary": {
      "description": "Aggregated summary of results for all tables in a database.",
      "properties": {
        "planCounts": {
          "description": "Output only. Number of tables with a specific migration plan action. The key is the action name (e.g. CREATE, UPDATE, SKIP, etc.).",
          "type": "object",
          "readOnly": true,
          "additionalProperties": {
            "type": "string",
            "format": "int64"
          }
        },
        "partitionFailedCount": {
          "readOnly": true,
          "type": "string",
          "description": "Output only. The total number of partitions that failed to migrate at the target.",
          "format": "int64"
        },
        "partitionDiscoveredCount": {
          "type": "string",
          "format": "int64",
          "readOnly": true,
          "description": "Output only. Partition migration summary across all Hive tables in the database.The total number of partitions discovered at the source."
        },
        "partitionSuccessCount": {
          "description": "Output only. The total number of partitions successfully migrated at the target.",
          "readOnly": true,
          "format": "int64",
          "type": "string"
        },
        "resultCounts": {
          "additionalProperties": {
            "type": "string",
            "format": "int64"
          },
          "description": "Output only. Number of tables with a specific migration result status. The key is the status name (e.g. SUCCEEDED, FAILED, SKIPPED, etc.). This is only set if the migration is not a dry run.",
          "readOnly": true,
          "type": "object"
        }
      },
      "type": "object"
    }
  }
}