# REST Resource: projects.locations.importJobs

- [Resource: ImportJob](https://docs.cloud.google.com/migration-center/docs/reference/rest/v1/projects.locations.importJobs#ImportJob)
  - [JSON representation](https://docs.cloud.google.com/migration-center/docs/reference/rest/v1/projects.locations.importJobs#ImportJob.SCHEMA_REPRESENTATION)
- [ImportJobState](https://docs.cloud.google.com/migration-center/docs/reference/rest/v1/projects.locations.importJobs#ImportJobState)
- [ValidationReport](https://docs.cloud.google.com/migration-center/docs/reference/rest/v1/projects.locations.importJobs#ValidationReport)
  - [JSON representation](https://docs.cloud.google.com/migration-center/docs/reference/rest/v1/projects.locations.importJobs#ValidationReport.SCHEMA_REPRESENTATION)
- [FileValidationReport](https://docs.cloud.google.com/migration-center/docs/reference/rest/v1/projects.locations.importJobs#FileValidationReport)
  - [JSON representation](https://docs.cloud.google.com/migration-center/docs/reference/rest/v1/projects.locations.importJobs#FileValidationReport.SCHEMA_REPRESENTATION)
- [ImportRowError](https://docs.cloud.google.com/migration-center/docs/reference/rest/v1/projects.locations.importJobs#ImportRowError)
  - [JSON representation](https://docs.cloud.google.com/migration-center/docs/reference/rest/v1/projects.locations.importJobs#ImportRowError.SCHEMA_REPRESENTATION)
- [ImportError](https://docs.cloud.google.com/migration-center/docs/reference/rest/v1/projects.locations.importJobs#ImportError)
  - [JSON representation](https://docs.cloud.google.com/migration-center/docs/reference/rest/v1/projects.locations.importJobs#ImportError.SCHEMA_REPRESENTATION)
- [Severity](https://docs.cloud.google.com/migration-center/docs/reference/rest/v1/projects.locations.importJobs#Severity)
- [CsvErrorDetails](https://docs.cloud.google.com/migration-center/docs/reference/rest/v1/projects.locations.importJobs#CsvErrorDetails)
  - [JSON representation](https://docs.cloud.google.com/migration-center/docs/reference/rest/v1/projects.locations.importJobs#CsvErrorDetails.SCHEMA_REPRESENTATION)
- [XlsxErrorDetails](https://docs.cloud.google.com/migration-center/docs/reference/rest/v1/projects.locations.importJobs#XlsxErrorDetails)
  - [JSON representation](https://docs.cloud.google.com/migration-center/docs/reference/rest/v1/projects.locations.importJobs#XlsxErrorDetails.SCHEMA_REPRESENTATION)
- [ArchiveErrorDetails](https://docs.cloud.google.com/migration-center/docs/reference/rest/v1/projects.locations.importJobs#ArchiveErrorDetails)
  - [JSON representation](https://docs.cloud.google.com/migration-center/docs/reference/rest/v1/projects.locations.importJobs#ArchiveErrorDetails.SCHEMA_REPRESENTATION)
- [ExecutionReport](https://docs.cloud.google.com/migration-center/docs/reference/rest/v1/projects.locations.importJobs#ExecutionReport)
  - [JSON representation](https://docs.cloud.google.com/migration-center/docs/reference/rest/v1/projects.locations.importJobs#ExecutionReport.SCHEMA_REPRESENTATION)
- [Methods](https://docs.cloud.google.com/migration-center/docs/reference/rest/v1/projects.locations.importJobs#METHODS_SUMMARY)

## Resource: ImportJob

A resource that represents the background job that imports asset frames.

| JSON representation |
|---|
| ``` { "name": string, "displayName": string, "createTime": string, "updateTime": string, "completeTime": string, "state": enum (`https://docs.cloud.google.com/migration-center/docs/reference/rest/v1/projects.locations.importJobs#ImportJobState`), "labels": { string: string, ... }, "assetSource": string, // Union field `report` can be only one of the following: "validationReport": { object (`https://docs.cloud.google.com/migration-center/docs/reference/rest/v1/projects.locations.importJobs#ValidationReport`) }, "executionReport": { object (`https://docs.cloud.google.com/migration-center/docs/reference/rest/v1/projects.locations.importJobs#ExecutionReport`) } // End of list of possible types for union field `report`. } ``` |

| Fields ||
|---|---|
| `name` | `string` Output only. The full name of the import job. |
| `displayName` | `string` Optional. User-friendly display name. Maximum length is 256 characters. |
| `createTime` | ``string (`https://protobuf.dev/reference/protobuf/google.protobuf#timestamp` format)`` Output only. The timestamp when the import job was created. A timestamp in RFC3339 UTC "Zulu" format, with nanosecond resolution and up to nine fractional digits. Examples: `"2014-10-02T15:01:23Z"` and `"2014-10-02T15:01:23.045123456Z"`. |
| `updateTime` | ``string (`https://protobuf.dev/reference/protobuf/google.protobuf#timestamp` format)`` Output only. The timestamp when the import job was last updated. A timestamp in RFC3339 UTC "Zulu" format, with nanosecond resolution and up to nine fractional digits. Examples: `"2014-10-02T15:01:23Z"` and `"2014-10-02T15:01:23.045123456Z"`. |
| `completeTime` | ``string (`https://protobuf.dev/reference/protobuf/google.protobuf#timestamp` format)`` Output only. The timestamp when the import job was completed. A timestamp in RFC3339 UTC "Zulu" format, with nanosecond resolution and up to nine fractional digits. Examples: `"2014-10-02T15:01:23Z"` and `"2014-10-02T15:01:23.045123456Z"`. |
| `state` | ``enum (`https://docs.cloud.google.com/migration-center/docs/reference/rest/v1/projects.locations.importJobs#ImportJobState`)`` Output only. The state of the import job. |
| `labels` | `map (key: string, value: string)` Labels as key value pairs. An object containing a list of `"key": value` pairs. Example: `{ "name": "wrench", "mass": "1.3kg", "count": "3" }`. |
| `assetSource` | `string` Required. Reference to a source. |
| Union field `report`. Holds the various report types of an import job. `report` can be only one of the following: ||
| `validationReport` | ``object (`https://docs.cloud.google.com/migration-center/docs/reference/rest/v1/projects.locations.importJobs#ValidationReport`)`` Output only. The report with the validation results of the import job. |
| `executionReport` | ``object (`https://docs.cloud.google.com/migration-center/docs/reference/rest/v1/projects.locations.importJobs#ExecutionReport`)`` Output only. The report with the results of running the import job. |

## ImportJobState

Enumerates possible states of an import job.

| Enums ||
|---|---|
| `IMPORT_JOB_STATE_UNSPECIFIED` | Default value. |
| `IMPORT_JOB_STATE_PENDING` | The import job is pending. |
| `IMPORT_JOB_STATE_RUNNING` | The processing of the import job is ongoing. |
| `IMPORT_JOB_STATE_COMPLETED` | The import job processing has completed. |
| `IMPORT_JOB_STATE_FAILED` | The import job failed to be processed. |
| `IMPORT_JOB_STATE_VALIDATING` | The import job is being validated. |
| `IMPORT_JOB_STATE_FAILED_VALIDATION` | The import job contains blocking errors. |
| `IMPORT_JOB_STATE_READY` | The validation of the job completed with no blocking errors. |

## ValidationReport

A resource that aggregates errors across import job files.

| JSON representation |
|---|
| ``` { "fileValidations": [ { object (`https://docs.cloud.google.com/migration-center/docs/reference/rest/v1/projects.locations.importJobs#FileValidationReport`) } ], "jobErrors": [ { object (`https://docs.cloud.google.com/migration-center/docs/reference/rest/v1/projects.locations.importJobs#ImportError`) } ] } ``` |

| Fields ||
|---|---|
| `fileValidations[]` | ``object (`https://docs.cloud.google.com/migration-center/docs/reference/rest/v1/projects.locations.importJobs#FileValidationReport`)`` List of errors found in files. |
| `jobErrors[]` | ``object (`https://docs.cloud.google.com/migration-center/docs/reference/rest/v1/projects.locations.importJobs#ImportError`)`` List of job level errors. |

## FileValidationReport

A resource that aggregates the validation errors found in an import job file.

| JSON representation |
|---|
| ``` { "fileName": string, "rowErrors": [ { object (`https://docs.cloud.google.com/migration-center/docs/reference/rest/v1/projects.locations.importJobs#ImportRowError`) } ], "partialReport": boolean, "fileErrors": [ { object (`https://docs.cloud.google.com/migration-center/docs/reference/rest/v1/projects.locations.importJobs#ImportError`) } ] } ``` |

| Fields ||
|---|---|
| `fileName` | `string` The name of the file. |
| `rowErrors[]` | ``object (`https://docs.cloud.google.com/migration-center/docs/reference/rest/v1/projects.locations.importJobs#ImportRowError`)`` Partial list of rows that encountered validation error. |
| `partialReport` | `boolean` Flag indicating that processing was aborted due to maximum number of errors. |
| `fileErrors[]` | ``object (`https://docs.cloud.google.com/migration-center/docs/reference/rest/v1/projects.locations.importJobs#ImportError`)`` List of file level errors. |

## ImportRowError

A resource that reports the import job errors at row level.

| JSON representation |
|---|
| ``` { "rowNumber": integer, "vmName": string, "vmUuid": string, "assetTitle": string, "errors": [ { object (`https://docs.cloud.google.com/migration-center/docs/reference/rest/v1/projects.locations.importJobs#ImportError`) } ], // Union field `error_details` can be only one of the following: "csvError": { object (`https://docs.cloud.google.com/migration-center/docs/reference/rest/v1/projects.locations.importJobs#CsvErrorDetails`) }, "xlsxError": { object (`https://docs.cloud.google.com/migration-center/docs/reference/rest/v1/projects.locations.importJobs#XlsxErrorDetails`) }, "archiveError": { object (`https://docs.cloud.google.com/migration-center/docs/reference/rest/v1/projects.locations.importJobs#ArchiveErrorDetails`) } // End of list of possible types for union field `error_details`. } ``` |

| Fields ||
|---|---|
| `rowNumber (deprecated)` | `integer` > [!WARNING] > This item is deprecated! The row number where the error was detected. |
| `vmName` | `string` The name of the VM in the row. |
| `vmUuid` | `string` The VM UUID. |
| `assetTitle` | `string` Output only. The asset title. |
| `errors[]` | ``object (`https://docs.cloud.google.com/migration-center/docs/reference/rest/v1/projects.locations.importJobs#ImportError`)`` The list of errors detected in the row. |
| Union field `error_details`. Additional error details per file type. `error_details` can be only one of the following: ||
| `csvError` | ``object (`https://docs.cloud.google.com/migration-center/docs/reference/rest/v1/projects.locations.importJobs#CsvErrorDetails`)`` Error details for a CSV file. |
| `xlsxError` | ``object (`https://docs.cloud.google.com/migration-center/docs/reference/rest/v1/projects.locations.importJobs#XlsxErrorDetails`)`` Error details for an XLSX file. |
| `archiveError` | ``object (`https://docs.cloud.google.com/migration-center/docs/reference/rest/v1/projects.locations.importJobs#ArchiveErrorDetails`)`` Error details for an archive file. |

## ImportError

A resource that reports the errors encountered while processing an import job.

| JSON representation |
|---|
| ``` { "errorDetails": string, "severity": enum (`https://docs.cloud.google.com/migration-center/docs/reference/rest/v1/projects.locations.importJobs#Severity`) } ``` |

| Fields ||
|---|---|
| `errorDetails` | `string` The error information. |
| `severity` | ``enum (`https://docs.cloud.google.com/migration-center/docs/reference/rest/v1/projects.locations.importJobs#Severity`)`` The severity of the error. |

## Severity

Enumerate possible error severity.

| Enums ||
|---|---|
| `SEVERITY_UNSPECIFIED` |   |
| `ERROR` |   |
| `WARNING` |   |
| `INFO` |   |

## CsvErrorDetails

Error details for a CSV file.

| JSON representation |
|---|
| ``` { "rowNumber": integer } ``` |

| Fields ||
|---|---|
| `rowNumber` | `integer` The row number where the error was detected. |

## XlsxErrorDetails

Error details for an XLSX file.

| JSON representation |
|---|
| ``` { "sheet": string, "rowNumber": integer } ``` |

| Fields ||
|---|---|
| `sheet` | `string` The name of the sheet where the error was detected. |
| `rowNumber` | `integer` The row number where the error was detected. |

## ArchiveErrorDetails

Error details for an archive file.

| JSON representation |
|---|
| ``` { "filePath": string, // Union field `error_details` can be only one of the following: "csvError": { object (`https://docs.cloud.google.com/migration-center/docs/reference/rest/v1/projects.locations.importJobs#CsvErrorDetails`) } // End of list of possible types for union field `error_details`. } ``` |

| Fields ||
|---|---|
| `filePath` | `string` Output only. The file path inside the archive where the error was detected. |
| Union field `error_details`. Additional error details per file type. `error_details` can be only one of the following: ||
| `csvError` | ``object (`https://docs.cloud.google.com/migration-center/docs/reference/rest/v1/projects.locations.importJobs#CsvErrorDetails`)`` Error details for a CSV file. |

## ExecutionReport

A resource that reports result of the import job execution.

| JSON representation |
|---|
| ``` { "framesReported": integer, "executionErrors": { object (`https://docs.cloud.google.com/migration-center/docs/reference/rest/v1/projects.locations.importJobs#ValidationReport`) }, "totalRowsCount": integer } ``` |

| Fields ||
|---|---|
| `framesReported` | `integer` Total number of asset frames reported for the import job. |
| `executionErrors` | ``object (`https://docs.cloud.google.com/migration-center/docs/reference/rest/v1/projects.locations.importJobs#ValidationReport`)`` Validation errors encountered during the execution of the import job. |
| `totalRowsCount` | `integer` Output only. Total number of rows in the import job. |

| ## Methods ||
|---|---|
| ### `https://docs.cloud.google.com/migration-center/docs/reference/rest/v1/projects.locations.importJobs/create` | Creates an import job. |
| ### `https://docs.cloud.google.com/migration-center/docs/reference/rest/v1/projects.locations.importJobs/delete` | Deletes an import job. |
| ### `https://docs.cloud.google.com/migration-center/docs/reference/rest/v1/projects.locations.importJobs/get` | Gets the details of an import job. |
| ### `https://docs.cloud.google.com/migration-center/docs/reference/rest/v1/projects.locations.importJobs/list` | Lists all import jobs. |
| ### `https://docs.cloud.google.com/migration-center/docs/reference/rest/v1/projects.locations.importJobs/patch` | Updates an import job. |
| ### `https://docs.cloud.google.com/migration-center/docs/reference/rest/v1/projects.locations.importJobs/run` | Runs an import job. |
| ### `https://docs.cloud.google.com/migration-center/docs/reference/rest/v1/projects.locations.importJobs/validate` | Validates an import job. |