Imports the mapping rules for a given conversion workspace. Supports various formats of external rules files.
HTTP request
POST https://datamigration.googleapis.com/v1/{parent}/mappingRules:import
Path parameters
Parameters
parent
string
Required. Name of the conversion workspace resource to import the rules to in the form of: projects/{project}/locations/{location}/conversionWorkspaces/{conversionWorkspace}.
Request body
The request body contains data with the following structure:
Required. The filename of the rules that needs to be converted. The filename is used mainly so that future logs of the import rules job contain it, and can therefore be searched by it.
rulesContent
string
Required. The text content of the rules that needs to be converted.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-07-28 UTC."],[[["\u003cp\u003eThis API endpoint imports mapping rules for a conversion workspace, supporting various external rules file formats.\u003c/p\u003e\n"],["\u003cp\u003eThe HTTP request is a \u003ccode\u003ePOST\u003c/code\u003e method to a specific URL, requiring a \u003ccode\u003eparent\u003c/code\u003e path parameter specifying the conversion workspace.\u003c/p\u003e\n"],["\u003cp\u003eThe request body must include the \u003ccode\u003erulesFormat\u003c/code\u003e, one or more \u003ccode\u003erulesFiles\u003c/code\u003e objects containing the rules' content and filename, and \u003ccode\u003eautoCommit\u003c/code\u003e, a boolean value for automatically committing the workspace after the import.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003erulesFiles\u003c/code\u003e object requires both the \u003ccode\u003erulesSourceFilename\u003c/code\u003e, and the \u003ccode\u003erulesContent\u003c/code\u003e, which is the text content of the rules to be converted.\u003c/p\u003e\n"],["\u003cp\u003eThe endpoint requires OAuth scope \u003ccode\u003ehttps://www.googleapis.com/auth/cloud-platform\u003c/code\u003e for authorization.\u003c/p\u003e\n"]]],[],null,["# Method: projects.locations.conversionWorkspaces.mappingRules.import\n\n- [HTTP request](#body.HTTP_TEMPLATE)\n- [Path parameters](#body.PATH_PARAMETERS)\n- [Request body](#body.request_body)\n - [JSON representation](#body.request_body.SCHEMA_REPRESENTATION)\n- [Response body](#body.response_body)\n- [Authorization scopes](#body.aspect)\n- [RulesFile](#RulesFile)\n - [JSON representation](#RulesFile.SCHEMA_REPRESENTATION)\n- [Examples](#examples)\n- [Try it!](#try-it)\n\nImports the mapping rules for a given conversion workspace. Supports various formats of external rules files.\n\n### HTTP request\n\n`POST https://datamigration.googleapis.com/v1/{parent}/mappingRules:import`\n\n### Path parameters\n\n### Request body\n\nThe request body contains data with the following structure:\n\n### Response body\n\nIf successful, the response body contains an instance of [Operation](/database-migration/docs/reference/rest/Shared.Types/ListOperationsResponse#Operation).\n\n### Authorization scopes\n\nRequires the following OAuth scope:\n\n- `https://www.googleapis.com/auth/cloud-platform`\n\nFor more information, see the [Authentication Overview](https://cloud.google.com/docs/authentication/).\n\nRulesFile\n---------\n\nDetails of a single rules file."]]