- HTTP request
- Path parameters
- Query parameters
- Request body
- Response body
- Authorization scopes
- DBTreeType
- DatabaseEntityView
- DatabaseEntity
- TreeType
- EntityMapping
- EntityMappingLogEntry
- EntityDdl
- EntityIssue
- IssueType
- IssueSeverity
- Position
- DatabaseInstanceEntity
- SchemaEntity
- TableEntity
- ColumnEntity
- ConstraintEntity
- IndexEntity
- TriggerEntity
- ViewEntity
- SequenceEntity
- StoredProcedureEntity
- FunctionEntity
- SynonymEntity
- PackageEntity
- UDTEntity
- MaterializedViewEntity
- Examples
- Try it!
Describes the database entities tree for a specific conversion workspace and a specific tree type.
Database entities are not resources like conversion workspaces or mapping rules, and they can't be created, updated or deleted. Instead, they are simple data objects describing the structure of the client database.
HTTP request
GET https://datamigration.googleapis.com/v1/{conversionWorkspace}:describeDatabaseEntities
Path parameters
Parameters | |
---|---|
conversionWorkspace |
Required. Name of the conversion workspace resource whose database entities are described. Must be in the form of: projects/{project}/locations/{location}/conversionWorkspaces/{conversionWorkspace}. |
Query parameters
Parameters | |
---|---|
pageSize |
Optional. The maximum number of entities to return. The service may return fewer entities than the value specifies. |
pageToken |
Optional. The nextPageToken value received in the previous call to conversionWorkspace.describeDatabaseEntities, used in the subsequent request to retrieve the next page of results. On first call this should be left blank. When paginating, all other parameters provided to conversionWorkspace.describeDatabaseEntities must match the call that provided the page token. |
tree |
Required. The tree to fetch. |
uncommitted |
Optional. Whether to retrieve the latest committed version of the entities or the latest version. This field is ignored if a specific commitId is specified. |
commitId |
Optional. Request a specific commit ID. If not specified, the entities from the latest commit are returned. |
filter |
Optional. Filter the returned entities based on AIP-160 standard. |
view |
Optional. Results view based on AIP-157 |
Request body
The request body must be empty.
Response body
Response message for 'conversionWorkspaces.describeDatabaseEntities' request.
If successful, the response body contains data with the following structure:
JSON representation |
---|
{
"databaseEntities": [
{
object ( |
Fields | |
---|---|
databaseEntities[] |
The list of database entities for the conversion workspace. |
nextPageToken |
A token which can be sent as |
Authorization scopes
Requires the following OAuth scope:
https://www.googleapis.com/auth/cloud-platform
For more information, see the Authentication Overview.
DBTreeType
The type of a tree to return
Enums | |
---|---|
DB_TREE_TYPE_UNSPECIFIED |
Unspecified tree type. |
SOURCE_TREE |
The source database tree. |
DRAFT_TREE |
The draft database tree. |
DESTINATION_TREE |
The destination database tree. |
DatabaseEntityView
AIP-157 Partial Response view for Database Entity.
Enums | |
---|---|
DATABASE_ENTITY_VIEW_UNSPECIFIED |
Unspecified view. Defaults to basic view. |
DATABASE_ENTITY_VIEW_BASIC |
Default view. Does not return DDLs or Issues. |
DATABASE_ENTITY_VIEW_FULL |
Return full entity details including mappings, ddl and issues. |
DATABASE_ENTITY_VIEW_ROOT_SUMMARY |
Top-most (Database, Schema) nodes which are returned contains summary details for their decendents such as the number of entities per type and issues rollups. When this view is used, only a single page of result is returned and the pageSize property of the request is ignored. The returned page will only include the top-most node types. |
DatabaseEntity
The base entity type for all the database related entities. The message contains the entity name, the name of its parent, the entity type, and the specific details per entity type.
JSON representation |
---|
{ "shortName": string, "parentEntity": string, "tree": enum ( |
Fields | |
---|---|
shortName |
The short name (e.g. table name) of the entity. |
parentEntity |
The full name of the parent entity (e.g. schema name). |
tree |
The type of tree the entity belongs to. |
entityType |
The type of the database entity (table, view, index, ...). |
mappings[] |
Details about entity mappings. For source tree entities, this holds the draft entities which were generated by the mapping rules. For draft tree entities, this holds the source entities which were converted to form the draft entity. Destination entities will have no mapping details. |
entityDdl[] |
Details about the entity DDL script. Multiple DDL scripts are provided for child entities such as a table entity will have one DDL for the table with additional DDLs for each index, constraint and such. |
issues[] |
Details about the various issues found for the entity. |
Union field entity_body . The specific body for each entity type. entity_body can be only one of the following: |
|
database |
Database. |
schema |
Schema. |
table |
Table. |
view |
View. |
sequence |
Sequence. |
storedProcedure |
Stored procedure. |
databaseFunction |
Function. |
synonym |
Synonym. |
databasePackage |
Package. |
udt |
UDT. |
materializedView |
Materialized view. |
TreeType
The type of database entities tree.
Enums | |
---|---|
TREE_TYPE_UNSPECIFIED |
Tree type unspecified. |
SOURCE |
Tree of entities loaded from a source database. |
DRAFT |
Tree of entities converted from the source tree using the mapping rules. |
DESTINATION |
Tree of entities observed on the destination database. |
EntityMapping
Details of the mappings of a database entity.
JSON representation |
---|
{ "sourceEntity": string, "draftEntity": string, "sourceType": enum ( |
Fields | |
---|---|
sourceEntity |
Source entity full name. The source entity can also be a column, index or constraint using the same naming notation schema.table.column. |
draftEntity |
Target entity full name. The draft entity can also include a column, index or constraint using the same naming notation schema.table.column. |
sourceType |
Type of source entity. |
draftType |
Type of draft entity. |
mappingLog[] |
Entity mapping log entries. Multiple rules can be effective and contribute changes to a converted entity, such as a rule can handle the entity name, another rule can handle an entity type. In addition, rules which did not change the entity are also logged along with the reason preventing them to do so. |
EntityMappingLogEntry
A single record of a rule which was used for a mapping.
JSON representation |
---|
{ "ruleId": string, "ruleRevisionId": string, "mappingComment": string } |
Fields | |
---|---|
ruleId |
Which rule caused this log entry. |
ruleRevisionId |
Rule revision ID. |
mappingComment |
Comment. |
EntityDdl
A single DDL statement for a specific entity
JSON representation |
---|
{
"ddlType": string,
"entity": string,
"ddl": string,
"entityType": enum ( |
Fields | |
---|---|
ddlType |
Type of DDL (Create, Alter). |
entity |
The name of the database entity the ddl refers to. |
ddl |
The actual ddl code. |
entityType |
The entity type (if the DDL is for a sub entity). |
issueId[] |
EntityIssues found for this ddl. |
EntityIssue
Issue related to the entity.
JSON representation |
---|
{ "id": string, "type": enum ( |
Fields | |
---|---|
id |
Unique Issue ID. |
type |
The type of the issue. |
severity |
Severity of the issue |
message |
Issue detailed message |
code |
Error/Warning code |
entityType |
The entity type (if the DDL is for a sub entity). |
ddl |
The ddl which caused the issue, if relevant. |
position |
The position of the issue found, if relevant. |
IssueType
Type of issue.
Enums | |
---|---|
ISSUE_TYPE_UNSPECIFIED |
Unspecified issue type. |
ISSUE_TYPE_DDL |
Issue originated from the DDL |
ISSUE_TYPE_APPLY |
Issue originated during the apply process |
ISSUE_TYPE_CONVERT |
Issue originated during the convert process |
IssueSeverity
Severity of issue.
Enums | |
---|---|
ISSUE_SEVERITY_UNSPECIFIED |
Unspecified issue severity |
ISSUE_SEVERITY_INFO |
Info |
ISSUE_SEVERITY_WARNING |
Warning |
ISSUE_SEVERITY_ERROR |
Error |
Position
Issue position.
JSON representation |
---|
{ "line": integer, "column": integer, "offset": integer, "length": integer } |
Fields | |
---|---|
line |
Issue line number |
column |
Issue column number |
offset |
Issue offset |
length |
Issue length |
DatabaseInstanceEntity
DatabaseInstance acts as a parent entity to other database entities.
JSON representation |
---|
{ "customFeatures": { object } } |
Fields | |
---|---|
customFeatures |
Custom engine specific features. |
SchemaEntity
Schema typically has no parent entity, but can have a parent entity DatabaseInstance (for database engines which support it). For some database engines, the terms schema and user can be used interchangeably when they refer to a namespace or a collection of other database entities. Can store additional information which is schema specific.
JSON representation |
---|
{ "customFeatures": { object } } |
Fields | |
---|---|
customFeatures |
Custom engine specific features. |
TableEntity
Table's parent is a schema.
JSON representation |
---|
{ "columns": [ { object ( |
Fields | |
---|---|
columns[] |
Table columns. |
constraints[] |
Table constraints. |
indices[] |
Table indices. |
triggers[] |
Table triggers. |
customFeatures |
Custom engine specific features. |
comment |
Comment associated with the table. |
ColumnEntity
Column is not used as an independent entity, it is retrieved as part of a Table entity.
JSON representation |
---|
{ "name": string, "dataType": string, "charset": string, "collation": string, "length": string, "precision": integer, "scale": integer, "fractionalSecondsPrecision": integer, "array": boolean, "arrayLength": integer, "nullable": boolean, "autoGenerated": boolean, "udt": boolean, "customFeatures": { object }, "setValues": [ string ], "comment": string, "ordinalPosition": integer, "defaultValue": string } |
Fields | |
---|---|
name |
Column name. |
dataType |
Column data type. |
charset |
Charset override - instead of table level charset. |
collation |
Collation override - instead of table level collation. |
length |
Column length - e.g. varchar (50). |
precision |
Column precision - when relevant. |
scale |
Column scale - when relevant. |
fractionalSecondsPrecision |
Column fractional second precision - used for timestamp based datatypes. |
array |
Is the column of array type. |
arrayLength |
If the column is array, of which length. |
nullable |
Is the column nullable. |
autoGenerated |
Is the column auto-generated/identity. |
udt |
Is the column a UDT. |
customFeatures |
Custom engine specific features. |
setValues[] |
Specifies the list of values allowed in the column. Only used for set data type. |
comment |
Comment associated with the column. |
ordinalPosition |
Column order in the table. |
defaultValue |
Default value of the column. |
ConstraintEntity
Constraint is not used as an independent entity, it is retrieved as part of another entity such as Table or View.
JSON representation |
---|
{ "name": string, "type": string, "tableColumns": [ string ], "customFeatures": { object }, "referenceColumns": [ string ], "referenceTable": string, "tableName": string } |
Fields | |
---|---|
name |
The name of the table constraint. |
type |
Type of constraint, for example unique, primary key, foreign key (currently only primary key is supported). |
tableColumns[] |
Table columns used as part of the Constraint, for example primary key constraint should list the columns which constitutes the key. |
customFeatures |
Custom engine specific features. |
referenceColumns[] |
Reference columns which may be associated with the constraint. For example, if the constraint is a FOREIGN_KEY, this represents the list of full names of referenced columns by the foreign key. |
referenceTable |
Reference table which may be associated with the constraint. For example, if the constraint is a FOREIGN_KEY, this represents the list of full name of the referenced table by the foreign key. |
tableName |
Table which is associated with the constraint. In case the constraint is defined on a table, this field is left empty as this information is stored in parent_name. However, if constraint is defined on a view, this field stores the table name on which the view is defined. |
IndexEntity
Index is not used as an independent entity, it is retrieved as part of a Table entity.
JSON representation |
---|
{ "name": string, "type": string, "tableColumns": [ string ], "tableColumnsDescending": [ boolean ], "unique": boolean, "customFeatures": { object } } |
Fields | |
---|---|
name |
The name of the index. |
type |
Type of index, for example B-TREE. |
tableColumns[] |
Table columns used as part of the Index, for example B-TREE index should list the columns which constitutes the index. |
tableColumnsDescending[] |
For each table_column, mark whether it's sorting order is ascending (false) or descending (true). If no value is defined, assume all columns are sorted in ascending order. Otherwise, the number of items must match that of tableColumns with each value specifying the direction of the matched column by its index. |
unique |
Boolean value indicating whether the index is unique. |
customFeatures |
Custom engine specific features. |
TriggerEntity
Trigger is not used as an independent entity, it is retrieved as part of a Table entity.
JSON representation |
---|
{ "name": string, "triggeringEvents": [ string ], "triggerType": string, "sqlCode": string, "customFeatures": { object } } |
Fields | |
---|---|
name |
The name of the trigger. |
triggeringEvents[] |
The DML, DDL, or database events that fire the trigger, for example INSERT, UPDATE. |
triggerType |
Indicates when the trigger fires, for example BEFORE STATEMENT, AFTER EACH ROW. |
sqlCode |
The SQL code which creates the trigger. |
customFeatures |
Custom engine specific features. |
ViewEntity
View's parent is a schema.
JSON representation |
---|
{
"sqlCode": string,
"customFeatures": {
object
},
"constraints": [
{
object ( |
Fields | |
---|---|
sqlCode |
The SQL code which creates the view. |
customFeatures |
Custom engine specific features. |
constraints[] |
View constraints. |
SequenceEntity
Sequence's parent is a schema.
JSON representation |
---|
{ "increment": string, "startValue": string, "maxValue": string, "minValue": string, "cycle": boolean, "cache": string, "customFeatures": { object } } |
Fields | |
---|---|
increment |
Increment value for the sequence. |
startValue |
Start number for the sequence represented as bytes to accommodate large. numbers A base64-encoded string. |
maxValue |
Maximum number for the sequence represented as bytes to accommodate large. numbers A base64-encoded string. |
minValue |
Minimum number for the sequence represented as bytes to accommodate large. numbers A base64-encoded string. |
cycle |
Indicates whether the sequence value should cycle through. |
cache |
Indicates number of entries to cache / precreate. |
customFeatures |
Custom engine specific features. |
StoredProcedureEntity
Stored procedure's parent is a schema.
JSON representation |
---|
{ "sqlCode": string, "customFeatures": { object } } |
Fields | |
---|---|
sqlCode |
The SQL code which creates the stored procedure. |
customFeatures |
Custom engine specific features. |
FunctionEntity
Function's parent is a schema.
JSON representation |
---|
{ "sqlCode": string, "customFeatures": { object } } |
Fields | |
---|---|
sqlCode |
The SQL code which creates the function. |
customFeatures |
Custom engine specific features. |
SynonymEntity
Synonym's parent is a schema.
JSON representation |
---|
{
"sourceEntity": string,
"sourceType": enum ( |
Fields | |
---|---|
sourceEntity |
The name of the entity for which the synonym is being created (the source). |
sourceType |
The type of the entity for which the synonym is being created (usually a table or a sequence). |
customFeatures |
Custom engine specific features. |
PackageEntity
Package's parent is a schema.
JSON representation |
---|
{ "packageSqlCode": string, "packageBody": string, "customFeatures": { object } } |
Fields | |
---|---|
packageSqlCode |
The SQL code which creates the package. |
packageBody |
The SQL code which creates the package body. If the package specification has cursors or subprograms, then the package body is mandatory. |
customFeatures |
Custom engine specific features. |
UDTEntity
UDT's parent is a schema.
JSON representation |
---|
{ "udtSqlCode": string, "udtBody": string, "customFeatures": { object } } |
Fields | |
---|---|
udtSqlCode |
The SQL code which creates the udt. |
udtBody |
The SQL code which creates the udt body. |
customFeatures |
Custom engine specific features. |
MaterializedViewEntity
MaterializedView's parent is a schema.
JSON representation |
---|
{ "sqlCode": string, "customFeatures": { object } } |
Fields | |
---|---|
sqlCode |
The SQL code which creates the view. |
customFeatures |
Custom engine specific features. |