Method: projects.locations.conversionWorkspaces.describeDatabaseEntities

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

string

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

integer

Optional. The maximum number of entities to return. The service may return fewer entities than the value specifies.

pageToken

string

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

enum (DBTreeType)

Required. The tree to fetch.

uncommitted

boolean

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

string

Optional. Request a specific commit ID. If not specified, the entities from the latest commit are returned.

filter

string

Optional. Filter the returned entities based on AIP-160 standard.

view

enum (DatabaseEntityView)

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 (DatabaseEntity)
    }
  ],
  "nextPageToken": string
}
Fields
databaseEntities[]

object (DatabaseEntity)

The list of database entities for the conversion workspace.

nextPageToken

string

A token which can be sent as pageToken to retrieve the next page. If this field is omitted, there are no subsequent pages.

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 (TreeType),
  "entityType": enum (DatabaseEntityType),
  "mappings": [
    {
      object (EntityMapping)
    }
  ],
  "entityDdl": [
    {
      object (EntityDdl)
    }
  ],
  "issues": [
    {
      object (EntityIssue)
    }
  ],

  // Union field entity_body can be only one of the following:
  "database": {
    object (DatabaseInstanceEntity)
  },
  "schema": {
    object (SchemaEntity)
  },
  "table": {
    object (TableEntity)
  },
  "view": {
    object (ViewEntity)
  },
  "sequence": {
    object (SequenceEntity)
  },
  "storedProcedure": {
    object (StoredProcedureEntity)
  },
  "databaseFunction": {
    object (FunctionEntity)
  },
  "synonym": {
    object (SynonymEntity)
  },
  "databasePackage": {
    object (PackageEntity)
  },
  "udt": {
    object (UDTEntity)
  },
  "materializedView": {
    object (MaterializedViewEntity)
  }
  // End of list of possible types for union field entity_body.
}
Fields
shortName

string

The short name (e.g. table name) of the entity.

parentEntity

string

The full name of the parent entity (e.g. schema name).

tree

enum (TreeType)

The type of tree the entity belongs to.

entityType

enum (DatabaseEntityType)

The type of the database entity (table, view, index, ...).

mappings[]

object (EntityMapping)

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[]

object (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[]

object (EntityIssue)

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

object (DatabaseInstanceEntity)

Database.

schema

object (SchemaEntity)

Schema.

table

object (TableEntity)

Table.

view

object (ViewEntity)

View.

sequence

object (SequenceEntity)

Sequence.

storedProcedure

object (StoredProcedureEntity)

Stored procedure.

databaseFunction

object (FunctionEntity)

Function.

synonym

object (SynonymEntity)

Synonym.

databasePackage

object (PackageEntity)

Package.

udt

object (UDTEntity)

UDT.

materializedView

object (MaterializedViewEntity)

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 (DatabaseEntityType),
  "draftType": enum (DatabaseEntityType),
  "mappingLog": [
    {
      object (EntityMappingLogEntry)
    }
  ]
}
Fields
sourceEntity

string

Source entity full name. The source entity can also be a column, index or constraint using the same naming notation schema.table.column.

draftEntity

string

Target entity full name. The draft entity can also include a column, index or constraint using the same naming notation schema.table.column.

sourceType

enum (DatabaseEntityType)

Type of source entity.

draftType

enum (DatabaseEntityType)

Type of draft entity.

mappingLog[]

object (EntityMappingLogEntry)

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

string

Which rule caused this log entry.

ruleRevisionId

string

Rule revision ID.

mappingComment

string

Comment.

EntityDdl

A single DDL statement for a specific entity

JSON representation
{
  "ddlType": string,
  "entity": string,
  "ddl": string,
  "entityType": enum (DatabaseEntityType),
  "issueId": [
    string
  ]
}
Fields
ddlType

string

Type of DDL (Create, Alter).

entity

string

The name of the database entity the ddl refers to.

ddl

string

The actual ddl code.

entityType

enum (DatabaseEntityType)

The entity type (if the DDL is for a sub entity).

issueId[]

string

EntityIssues found for this ddl.

EntityIssue

Issue related to the entity.

JSON representation
{
  "id": string,
  "type": enum (IssueType),
  "severity": enum (IssueSeverity),
  "message": string,
  "code": string,
  "entityType": enum (DatabaseEntityType),
  "ddl": string,
  "position": {
    object (Position)
  }
}
Fields
id

string

Unique Issue ID.

type

enum (IssueType)

The type of the issue.

severity

enum (IssueSeverity)

Severity of the issue

message

string

Issue detailed message

code

string

Error/Warning code

entityType

enum (DatabaseEntityType)

The entity type (if the DDL is for a sub entity).

ddl

string

The ddl which caused the issue, if relevant.

position

object (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

integer

Issue line number

column

integer

Issue column number

offset

integer

Issue offset

length

integer

Issue length

DatabaseInstanceEntity

DatabaseInstance acts as a parent entity to other database entities.

JSON representation
{
  "customFeatures": {
    object
  }
}
Fields
customFeatures

object (Struct format)

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

object (Struct format)

Custom engine specific features.

TableEntity

Table's parent is a schema.

JSON representation
{
  "columns": [
    {
      object (ColumnEntity)
    }
  ],
  "constraints": [
    {
      object (ConstraintEntity)
    }
  ],
  "indices": [
    {
      object (IndexEntity)
    }
  ],
  "triggers": [
    {
      object (TriggerEntity)
    }
  ],
  "customFeatures": {
    object
  },
  "comment": string
}
Fields
columns[]

object (ColumnEntity)

Table columns.

constraints[]

object (ConstraintEntity)

Table constraints.

indices[]

object (IndexEntity)

Table indices.

triggers[]

object (TriggerEntity)

Table triggers.

customFeatures

object (Struct format)

Custom engine specific features.

comment

string

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

string

Column name.

dataType

string

Column data type.

charset

string

Charset override - instead of table level charset.

collation

string

Collation override - instead of table level collation.

length

string (int64 format)

Column length - e.g. varchar (50).

precision

integer

Column precision - when relevant.

scale

integer

Column scale - when relevant.

fractionalSecondsPrecision

integer

Column fractional second precision - used for timestamp based datatypes.

array

boolean

Is the column of array type.

arrayLength

integer

If the column is array, of which length.

nullable

boolean

Is the column nullable.

autoGenerated

boolean

Is the column auto-generated/identity.

udt

boolean

Is the column a UDT.

customFeatures

object (Struct format)

Custom engine specific features.

setValues[]

string

Specifies the list of values allowed in the column. Only used for set data type.

comment

string

Comment associated with the column.

ordinalPosition

integer

Column order in the table.

defaultValue

string

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

string

The name of the table constraint.

type

string

Type of constraint, for example unique, primary key, foreign key (currently only primary key is supported).

tableColumns[]

string

Table columns used as part of the Constraint, for example primary key constraint should list the columns which constitutes the key.

customFeatures

object (Struct format)

Custom engine specific features.

referenceColumns[]

string

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

string

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

string

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

string

The name of the index.

type

string

Type of index, for example B-TREE.

tableColumns[]

string

Table columns used as part of the Index, for example B-TREE index should list the columns which constitutes the index.

tableColumnsDescending[]

boolean

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

Boolean value indicating whether the index is unique.

customFeatures

object (Struct format)

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

string

The name of the trigger.

triggeringEvents[]

string

The DML, DDL, or database events that fire the trigger, for example INSERT, UPDATE.

triggerType

string

Indicates when the trigger fires, for example BEFORE STATEMENT, AFTER EACH ROW.

sqlCode

string

The SQL code which creates the trigger.

customFeatures

object (Struct format)

Custom engine specific features.

ViewEntity

View's parent is a schema.

JSON representation
{
  "sqlCode": string,
  "customFeatures": {
    object
  },
  "constraints": [
    {
      object (ConstraintEntity)
    }
  ]
}
Fields
sqlCode

string

The SQL code which creates the view.

customFeatures

object (Struct format)

Custom engine specific features.

constraints[]

object (ConstraintEntity)

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

string (int64 format)

Increment value for the sequence.

startValue

string (bytes format)

Start number for the sequence represented as bytes to accommodate large. numbers

A base64-encoded string.

maxValue

string (bytes format)

Maximum number for the sequence represented as bytes to accommodate large. numbers

A base64-encoded string.

minValue

string (bytes format)

Minimum number for the sequence represented as bytes to accommodate large. numbers

A base64-encoded string.

cycle

boolean

Indicates whether the sequence value should cycle through.

cache

string (int64 format)

Indicates number of entries to cache / precreate.

customFeatures

object (Struct format)

Custom engine specific features.

StoredProcedureEntity

Stored procedure's parent is a schema.

JSON representation
{
  "sqlCode": string,
  "customFeatures": {
    object
  }
}
Fields
sqlCode

string

The SQL code which creates the stored procedure.

customFeatures

object (Struct format)

Custom engine specific features.

FunctionEntity

Function's parent is a schema.

JSON representation
{
  "sqlCode": string,
  "customFeatures": {
    object
  }
}
Fields
sqlCode

string

The SQL code which creates the function.

customFeatures

object (Struct format)

Custom engine specific features.

SynonymEntity

Synonym's parent is a schema.

JSON representation
{
  "sourceEntity": string,
  "sourceType": enum (DatabaseEntityType),
  "customFeatures": {
    object
  }
}
Fields
sourceEntity

string

The name of the entity for which the synonym is being created (the source).

sourceType

enum (DatabaseEntityType)

The type of the entity for which the synonym is being created (usually a table or a sequence).

customFeatures

object (Struct format)

Custom engine specific features.

PackageEntity

Package's parent is a schema.

JSON representation
{
  "packageSqlCode": string,
  "packageBody": string,
  "customFeatures": {
    object
  }
}
Fields
packageSqlCode

string

The SQL code which creates the package.

packageBody

string

The SQL code which creates the package body. If the package specification has cursors or subprograms, then the package body is mandatory.

customFeatures

object (Struct format)

Custom engine specific features.

UDTEntity

UDT's parent is a schema.

JSON representation
{
  "udtSqlCode": string,
  "udtBody": string,
  "customFeatures": {
    object
  }
}
Fields
udtSqlCode

string

The SQL code which creates the udt.

udtBody

string

The SQL code which creates the udt body.

customFeatures

object (Struct format)

Custom engine specific features.

MaterializedViewEntity

MaterializedView's parent is a schema.

JSON representation
{
  "sqlCode": string,
  "customFeatures": {
    object
  }
}
Fields
sqlCode

string

The SQL code which creates the view.

customFeatures

object (Struct format)

Custom engine specific features.