- [Resource: MetadataJob](https://docs.cloud.google.com/knowledge-catalog/docs/reference/rest/v1/projects.locations.metadataJobs#MetadataJob)
  - [JSON representation](https://docs.cloud.google.com/knowledge-catalog/docs/reference/rest/v1/projects.locations.metadataJobs#MetadataJob.SCHEMA_REPRESENTATION)
- [Type](https://docs.cloud.google.com/knowledge-catalog/docs/reference/rest/v1/projects.locations.metadataJobs#Type)
- [ImportJobSpec](https://docs.cloud.google.com/knowledge-catalog/docs/reference/rest/v1/projects.locations.metadataJobs#ImportJobSpec)
  - [JSON representation](https://docs.cloud.google.com/knowledge-catalog/docs/reference/rest/v1/projects.locations.metadataJobs#ImportJobSpec.SCHEMA_REPRESENTATION)
- [ImportJobScope](https://docs.cloud.google.com/knowledge-catalog/docs/reference/rest/v1/projects.locations.metadataJobs#ImportJobScope)
  - [JSON representation](https://docs.cloud.google.com/knowledge-catalog/docs/reference/rest/v1/projects.locations.metadataJobs#ImportJobScope.SCHEMA_REPRESENTATION)
- [SyncMode](https://docs.cloud.google.com/knowledge-catalog/docs/reference/rest/v1/projects.locations.metadataJobs#SyncMode)
- [LogLevel](https://docs.cloud.google.com/knowledge-catalog/docs/reference/rest/v1/projects.locations.metadataJobs#LogLevel)
- [ExportJobSpec](https://docs.cloud.google.com/knowledge-catalog/docs/reference/rest/v1/projects.locations.metadataJobs#ExportJobSpec)
  - [JSON representation](https://docs.cloud.google.com/knowledge-catalog/docs/reference/rest/v1/projects.locations.metadataJobs#ExportJobSpec.SCHEMA_REPRESENTATION)
- [ExportJobScope](https://docs.cloud.google.com/knowledge-catalog/docs/reference/rest/v1/projects.locations.metadataJobs#ExportJobScope)
  - [JSON representation](https://docs.cloud.google.com/knowledge-catalog/docs/reference/rest/v1/projects.locations.metadataJobs#ExportJobScope.SCHEMA_REPRESENTATION)
- [ImportJobResult](https://docs.cloud.google.com/knowledge-catalog/docs/reference/rest/v1/projects.locations.metadataJobs#ImportJobResult)
  - [JSON representation](https://docs.cloud.google.com/knowledge-catalog/docs/reference/rest/v1/projects.locations.metadataJobs#ImportJobResult.SCHEMA_REPRESENTATION)
- [ExportJobResult](https://docs.cloud.google.com/knowledge-catalog/docs/reference/rest/v1/projects.locations.metadataJobs#ExportJobResult)
  - [JSON representation](https://docs.cloud.google.com/knowledge-catalog/docs/reference/rest/v1/projects.locations.metadataJobs#ExportJobResult.SCHEMA_REPRESENTATION)
- [Status](https://docs.cloud.google.com/knowledge-catalog/docs/reference/rest/v1/projects.locations.metadataJobs#Status)
  - [JSON representation](https://docs.cloud.google.com/knowledge-catalog/docs/reference/rest/v1/projects.locations.metadataJobs#Status.SCHEMA_REPRESENTATION)
- [State](https://docs.cloud.google.com/knowledge-catalog/docs/reference/rest/v1/projects.locations.metadataJobs#State)
- [Methods](https://docs.cloud.google.com/knowledge-catalog/docs/reference/rest/v1/projects.locations.metadataJobs#METHODS_SUMMARY)

## Resource: MetadataJob

A metadata job resource.

| JSON representation |
|---|
| ``` { "name": string, "uid": string, "createTime": string, "updateTime": string, "labels": { string: string, ... }, "type": enum (`https://docs.cloud.google.com/knowledge-catalog/docs/reference/rest/v1/projects.locations.metadataJobs#Type`), "status": { object (`https://docs.cloud.google.com/knowledge-catalog/docs/reference/rest/v1/projects.locations.metadataJobs#Status`) }, // The following is a list of mutually exclusive fields. At most one of the // fields will be set in a response: "importSpec": { object (`https://docs.cloud.google.com/knowledge-catalog/docs/reference/rest/v1/projects.locations.metadataJobs#ImportJobSpec`) }, "exportSpec": { object (`https://docs.cloud.google.com/knowledge-catalog/docs/reference/rest/v1/projects.locations.metadataJobs#ExportJobSpec`) } // End of mutually exclusive fields. // The following is a list of mutually exclusive fields. At most one of the // fields will be set in a response: "importResult": { object (`https://docs.cloud.google.com/knowledge-catalog/docs/reference/rest/v1/projects.locations.metadataJobs#ImportJobResult`) }, "exportResult": { object (`https://docs.cloud.google.com/knowledge-catalog/docs/reference/rest/v1/projects.locations.metadataJobs#ExportJobResult`) } // End of mutually exclusive fields. } ``` |

| Fields ||
|---|---|
| `name` | `string` Output only. Identifier. The name of the resource that the configuration is applied to, in the format `projects/{projectNumber}/locations/{locationId}/metadataJobs/{metadataJobId}`. |
| `uid` | `string` Output only. A system-generated, globally unique ID for the metadata job. If the metadata job is deleted and then re-created with the same name, this ID is different. |
| `createTime` | ``string (`https://protobuf.dev/reference/protobuf/google.protobuf#timestamp` format)`` Output only. The time when the metadata job was created. Uses RFC 3339, where generated output will always be Z-normalized and use 0, 3, 6 or 9 fractional digits. Offsets other than "Z" are also accepted. Examples: `"2014-10-02T15:01:23Z"`, `"2014-10-02T15:01:23.045123456Z"` or `"2014-10-02T15:01:23+05:30"`. |
| `updateTime` | ``string (`https://protobuf.dev/reference/protobuf/google.protobuf#timestamp` format)`` Output only. The time when the metadata job was updated. Uses RFC 3339, where generated output will always be Z-normalized and use 0, 3, 6 or 9 fractional digits. Offsets other than "Z" are also accepted. Examples: `"2014-10-02T15:01:23Z"`, `"2014-10-02T15:01:23.045123456Z"` or `"2014-10-02T15:01:23+05:30"`. |
| `labels` | `map (key: string, value: string)` Optional. User-defined labels. An object containing a list of `"key": value` pairs. Example: `{ "name": "wrench", "mass": "1.3kg", "count": "3" }`. |
| `type` | ``enum (`https://docs.cloud.google.com/knowledge-catalog/docs/reference/rest/v1/projects.locations.metadataJobs#Type`)`` Required. Metadata job type. |
| `status` | ``object (`https://docs.cloud.google.com/knowledge-catalog/docs/reference/rest/v1/projects.locations.metadataJobs#Status`)`` Output only. Metadata job status. |
| The following is a list of mutually exclusive fields. At most one of the fields will be set in a response: ||
| `importSpec` | ``object (`https://docs.cloud.google.com/knowledge-catalog/docs/reference/rest/v1/projects.locations.metadataJobs#ImportJobSpec`)`` Import job specification. |
| `exportSpec` | ``object (`https://docs.cloud.google.com/knowledge-catalog/docs/reference/rest/v1/projects.locations.metadataJobs#ExportJobSpec`)`` Export job specification. |
| End of mutually exclusive fields. ||
| The following is a list of mutually exclusive fields. At most one of the fields will be set in a response: ||
| `importResult` | ``object (`https://docs.cloud.google.com/knowledge-catalog/docs/reference/rest/v1/projects.locations.metadataJobs#ImportJobResult`)`` Output only. Import job result. |
| `exportResult` | ``object (`https://docs.cloud.google.com/knowledge-catalog/docs/reference/rest/v1/projects.locations.metadataJobs#ExportJobResult`)`` Output only. Export job result. |
| End of mutually exclusive fields. ||

## Type

Metadata job type.

| Enums ||
|---|---|
| `TYPE_UNSPECIFIED` | Unspecified. |
| `IMPORT` | Import job. |
| `EXPORT` | Export job. |

## ImportJobSpec

Job specification for a metadata import job.

You can run the following kinds of metadata import jobs:

- Full sync of entries with incremental import of their aspects. Supported for custom entries.
- Incremental import of aspects only. Supported for aspects that belong to custom entries and system entries. For custom entries, you can modify both optional aspects and required aspects. For system entries, you can modify optional aspects.

| JSON representation |
|---|
| ``` { "sourceStorageUri": string, "sourceCreateTime": string, "scope": { object (`https://docs.cloud.google.com/knowledge-catalog/docs/reference/rest/v1/projects.locations.metadataJobs#ImportJobScope`) }, "entrySyncMode": enum (`https://docs.cloud.google.com/knowledge-catalog/docs/reference/rest/v1/projects.locations.metadataJobs#SyncMode`), "aspectSyncMode": enum (`https://docs.cloud.google.com/knowledge-catalog/docs/reference/rest/v1/projects.locations.metadataJobs#SyncMode`), "logLevel": enum (`https://docs.cloud.google.com/knowledge-catalog/docs/reference/rest/v1/projects.locations.metadataJobs#LogLevel`) } ``` |

| Fields ||
|---|---|
| `sourceStorageUri` | `string` Optional. The URI of a Cloud Storage bucket or folder (beginning with `gs://` and ending with `/`) that contains the metadata import files for this job. A metadata import file defines the values to set for each of the entries and aspects in a metadata import job. For more information about how to create a metadata import file and the file requirements, see [Metadata import file](https://cloud.google.com/knowledge-catalog/docs/import-metadata#metadata-import-file). You can provide multiple metadata import files in the same metadata job. The bucket or folder must contain at least one metadata import file, in JSON Lines format (either `.json` or `.jsonl` file extension). In `FULL` entry sync mode, don't save the metadata import file in a folder named `SOURCE_STORAGE_URI/deletions/`. **Caution**: If the metadata import file contains no data, all entries and aspects that belong to the job's scope are deleted. |
| `sourceCreateTime` | ``string (`https://protobuf.dev/reference/protobuf/google.protobuf#timestamp` format)`` Optional. The time when the process that created the metadata import files began. Uses RFC 3339, where generated output will always be Z-normalized and use 0, 3, 6 or 9 fractional digits. Offsets other than "Z" are also accepted. Examples: `"2014-10-02T15:01:23Z"`, `"2014-10-02T15:01:23.045123456Z"` or `"2014-10-02T15:01:23+05:30"`. |
| `scope` | ``object (`https://docs.cloud.google.com/knowledge-catalog/docs/reference/rest/v1/projects.locations.metadataJobs#ImportJobScope`)`` Required. A boundary on the scope of impact that the metadata import job can have. |
| `entrySyncMode` | ``enum (`https://docs.cloud.google.com/knowledge-catalog/docs/reference/rest/v1/projects.locations.metadataJobs#SyncMode`)`` Required. The sync mode for entries. |
| `aspectSyncMode` | ``enum (`https://docs.cloud.google.com/knowledge-catalog/docs/reference/rest/v1/projects.locations.metadataJobs#SyncMode`)`` Required. The sync mode for aspects. |
| `logLevel` | ``enum (`https://docs.cloud.google.com/knowledge-catalog/docs/reference/rest/v1/projects.locations.metadataJobs#LogLevel`)`` Optional. The level of logs to write to Cloud Logging for this job. Debug-level logs provide highly-detailed information for troubleshooting, but their increased verbosity could incur [additional costs](https://cloud.google.com/stackdriver/pricing) that might not be merited for all jobs. If unspecified, defaults to `INFO`. |

## ImportJobScope

A boundary on the scope of impact that the metadata import job can have.

| JSON representation |
|---|
| ``` { "entryGroups": [ string ], "entryTypes": [ string ], "aspectTypes": [ string ], "glossaries": [ string ], "entryLinkTypes": [ string ], "referencedEntryScopes": [ string ] } ``` |

| Fields ||
|---|---|
| `entryGroups[]` | `string` Required. The entry groups that are in scope for the import job, specified as relative resource names in the format `projects/{project_number_or_id}/locations/{locationId}/entryGroups/{entryGroupId}`. Only entries and aspects that belong to the specified entry groups are affected by the job. The entry groups and the job must be in the same location. |
| `entryTypes[]` | `string` Required. The entry types that are in scope for the import job, specified as relative resource names in the format `projects/{project_number_or_id}/locations/{locationId}/entryTypes/{entryTypeId}`. The job modifies only the entries and aspects that belong to these entry types. If the metadata import file attempts to modify an entry whose type isn't included in this list, the import job is halted before modifying any entries or aspects. The location of an entry type must either match the location of the job, or the entry type must be global. |
| `aspectTypes[]` | `string` Optional. The aspect types that are in scope for the import job, specified as relative resource names in the format `projects/{project_number_or_id}/locations/{locationId}/aspectTypes/{aspectTypeId}`. The job modifies only the aspects that belong to these aspect types. This field is required when creating an aspect-only import job. If the metadata import file attempts to modify an aspect whose type isn't included in this list, the import job is halted before modifying any entries or aspects. The location of an aspect type must either match the location of the job, or the aspect type must be global. |
| `glossaries[]` | `string` Optional. The glossaries that are in scope for the import job, specified as relative resource names in the format `projects/{project_number_or_id}/locations/{locationId}/glossaries/{glossaryId}`. While importing Business Glossary entries, the user must provide glossaries. While importing entries, the user does not have to provide glossaries. If the metadata import file attempts to modify Business Glossary entries whose glossary isn't included in this list, the import job will skip those entries. The location of a glossary must either match the location of the job, or the glossary must be global. |
| `entryLinkTypes[]` | `string` Optional. The entry link types that are in scope for the import job, specified as relative resource names in the format `projects/{project_number_or_id}/locations/{locationId}/entryLinkTypes/{entryLinkTypeId}`. The job modifies only the entryLinks that belong to these entry link types. If the metadata import file attempts to create or delete an entry link whose entry link type isn't included in this list, the import job will skip those entry links. |
| `referencedEntryScopes[]` | `string` Optional. Defines the scope of entries that can be referenced in the entry links. Currently, projects are supported as valid scopes. Format: `projects/{project_number_or_id}` If the metadata import file attempts to create an entry link which references an entry that is not in the scope, the import job will skip that entry link. |

## SyncMode

Specifies how the entries and aspects in a metadata import job are updated. For more information, see [Sync mode](https://cloud.google.com/knowledge-catalog/docs/import-metadata#sync-mode).

| Enums ||
|---|---|
| `SYNC_MODE_UNSPECIFIED` | Sync mode unspecified. |
| `FULL` | All resources in the job's scope are modified. If a resource exists in Dataplex Universal Catalog but isn't included in the metadata import file, the resource is deleted when you run the metadata job. Use this mode to perform a full sync of the set of entries in the job scope. This sync mode is supported for entries. |
| `INCREMENTAL` | Only the resources that are explicitly included in the metadata import file are modified. Use this mode to modify a subset of resources while leaving unreferenced resources unchanged. This sync mode is supported for aspects. |
| `NONE` | If entry sync mode is `NONE`, then aspects are modified according to the aspect sync mode. Other metadata that belongs to entries in the job's scope isn't modified. This sync mode is supported for entries. |

## LogLevel

The level of logs to write to Cloud Logging for this job.

| Enums ||
|---|---|
| `LOG_LEVEL_UNSPECIFIED` | Log level unspecified. |
| `DEBUG` | Debug-level logging. Captures detailed logs for each import item. Use debug-level logging to troubleshoot issues with specific import items. For example, use debug-level logging to identify resources that are missing from the job scope, entries or aspects that don't conform to the associated entry type or aspect type, or other misconfigurations with the metadata import file. Depending on the size of your metadata job and the number of logs that are generated, debug-level logging might incur [additional costs](https://cloud.google.com/stackdriver/pricing). |
| `INFO` | Info-level logging. Captures logs at the overall job level. Includes aggregate logs about import items, but doesn't specify which import item has an error. |

## ExportJobSpec

Job specification for a metadata export job.

| JSON representation |
|---|
| ``` { "scope": { object (`https://docs.cloud.google.com/knowledge-catalog/docs/reference/rest/v1/projects.locations.metadataJobs#ExportJobScope`) }, "outputPath": string } ``` |

| Fields ||
|---|---|
| `scope` | ``object (`https://docs.cloud.google.com/knowledge-catalog/docs/reference/rest/v1/projects.locations.metadataJobs#ExportJobScope`)`` Required. The scope of the export job. |
| `outputPath` | `string` Required. The root path of the Cloud Storage bucket to export the metadata to, in the format `gs://{bucket}/`. You can optionally specify a custom prefix after the bucket name, in the format `gs://{bucket}/{prefix}/`. The maximum length of the custom prefix is 128 characters. Dataplex Universal Catalog constructs the object path for the exported files by using the bucket name and prefix that you provide, followed by a system-generated path. The bucket must be in the same VPC Service Controls perimeter as the job. |

## ExportJobScope

The scope of the export job.

| JSON representation |
|---|
| ``` { "organizationLevel": boolean, "projects": [ string ], "entryGroups": [ string ], "entryTypes": [ string ], "aspectTypes": [ string ] } ``` |

| Fields ||
|---|---|
| `organizationLevel` | `boolean` Whether the metadata export job is an organization-level export job. - If `true`, the job exports the entries from the same organization and VPC Service Controls perimeter as the job. The project that the job belongs to determines the VPC Service Controls perimeter. If you set the job scope to be at the organization level, then don't provide a list of projects or entry groups. - If `false`, you must specify a list of projects or a list of entry groups whose entries you want to export. The default is `false`. |
| `projects[]` | `string` The projects whose metadata you want to export, in the format `projects/{project_id_or_number}`. Only the entries from the specified projects are exported. The projects must be in the same organization and VPC Service Controls perimeter as the job. If you set the job scope to be a list of projects, then set the organization-level export flag to false and don't provide a list of entry groups. |
| `entryGroups[]` | `string` The entry groups whose metadata you want to export, in the format `projects/{project_id_or_number}/locations/{locationId}/entryGroups/{entryGroupId}`. Only the entries in the specified entry groups are exported. The entry groups must be in the same location and the same VPC Service Controls perimeter as the job. If you set the job scope to be a list of entry groups, then set the organization-level export flag to false and don't provide a list of projects. |
| `entryTypes[]` | `string` The entry types that are in scope for the export job, specified as relative resource names in the format `projects/{project_id_or_number}/locations/{location}/entryTypes/{entryTypeId}`. Only entries that belong to the specified entry types are affected by the job. |
| `aspectTypes[]` | `string` The aspect types that are in scope for the export job, specified as relative resource names in the format `projects/{project_id_or_number}/locations/{location}/aspectTypes/{aspectTypeId}`. Only aspects that belong to the specified aspect types are affected by the job. |

## ImportJobResult

Results from a metadata import job.

| JSON representation |
|---|
| ``` { "deletedEntries": string, "updatedEntries": string, "createdEntries": string, "unchangedEntries": string, "recreatedEntries": string, "updateTime": string, "deletedEntryLinks": string, "createdEntryLinks": string, "unchangedEntryLinks": string } ``` |

| Fields ||
|---|---|
| `deletedEntries` | `string (https://developers.google.com/discovery/v1/type-format format)` Output only. The total number of entries that were deleted. |
| `updatedEntries` | `string (https://developers.google.com/discovery/v1/type-format format)` Output only. The total number of entries that were updated. |
| `createdEntries` | `string (https://developers.google.com/discovery/v1/type-format format)` Output only. The total number of entries that were created. |
| `unchangedEntries` | `string (https://developers.google.com/discovery/v1/type-format format)` Output only. The total number of entries that were unchanged. |
| `recreatedEntries` | `string (https://developers.google.com/discovery/v1/type-format format)` Output only. The total number of entries that were recreated. |
| `updateTime` | ``string (`https://protobuf.dev/reference/protobuf/google.protobuf#timestamp` format)`` Output only. The time when the status was updated. Uses RFC 3339, where generated output will always be Z-normalized and use 0, 3, 6 or 9 fractional digits. Offsets other than "Z" are also accepted. Examples: `"2014-10-02T15:01:23Z"`, `"2014-10-02T15:01:23.045123456Z"` or `"2014-10-02T15:01:23+05:30"`. |
| `deletedEntryLinks` | `string (https://developers.google.com/discovery/v1/type-format format)` Output only. The total number of entry links that were successfully deleted. |
| `createdEntryLinks` | `string (https://developers.google.com/discovery/v1/type-format format)` Output only. The total number of entry links that were successfully created. |
| `unchangedEntryLinks` | `string (https://developers.google.com/discovery/v1/type-format format)` Output only. The total number of entry links that were left unchanged. |

## ExportJobResult

Summary results from a metadata export job. The results are a snapshot of the metadata at the time when the job was created. The exported entries are saved to a Cloud Storage bucket.

| JSON representation |
|---|
| ``` { "exportedEntries": string, "errorMessage": string } ``` |

| Fields ||
|---|---|
| `exportedEntries` | `string (https://developers.google.com/discovery/v1/type-format format)` Output only. The number of entries that were exported. |
| `errorMessage` | `string` Output only. The error message if the metadata export job failed. |

## Status

Metadata job status.

| JSON representation |
|---|
| ``` { "state": enum (`https://docs.cloud.google.com/knowledge-catalog/docs/reference/rest/v1/projects.locations.metadataJobs#State`), "message": string, "completionPercent": integer, "updateTime": string } ``` |

| Fields ||
|---|---|
| `state` | ``enum (`https://docs.cloud.google.com/knowledge-catalog/docs/reference/rest/v1/projects.locations.metadataJobs#State`)`` Output only. State of the metadata job. |
| `message` | `string` Output only. Message relating to the progression of a metadata job. |
| `completionPercent` | `integer` Output only. Progress tracking. |
| `updateTime` | ``string (`https://protobuf.dev/reference/protobuf/google.protobuf#timestamp` format)`` Output only. The time when the status was updated. Uses RFC 3339, where generated output will always be Z-normalized and use 0, 3, 6 or 9 fractional digits. Offsets other than "Z" are also accepted. Examples: `"2014-10-02T15:01:23Z"`, `"2014-10-02T15:01:23.045123456Z"` or `"2014-10-02T15:01:23+05:30"`. |

## State

State of a metadata job.

| Enums ||
|---|---|
| `STATE_UNSPECIFIED` | State unspecified. |
| `QUEUED` | The job is queued. |
| `RUNNING` | The job is running. |
| `CANCELING` | The job is being canceled. |
| `CANCELED` | The job is canceled. |
| `SUCCEEDED` | The job succeeded. |
| `FAILED` | The job failed. |
| `SUCCEEDED_WITH_ERRORS` | The job completed with some errors. |

| ## Methods ||
|---|---|
| ### `https://docs.cloud.google.com/knowledge-catalog/docs/reference/rest/v1/projects.locations.metadataJobs/cancel` | Cancels a metadata job. |
| ### `https://docs.cloud.google.com/knowledge-catalog/docs/reference/rest/v1/projects.locations.metadataJobs/create` | Creates a metadata job. |
| ### `https://docs.cloud.google.com/knowledge-catalog/docs/reference/rest/v1/projects.locations.metadataJobs/get` | Gets a metadata job. |
| ### `https://docs.cloud.google.com/knowledge-catalog/docs/reference/rest/v1/projects.locations.metadataJobs/list` | Lists metadata jobs. |