Export TML
To export the TML data, your account must have the DATAMANAGEMENT (Can manage data) or ADMINISTRATION (Can administer ThoughtSpot) privilege.
The default format to export the objects is JSON. To export the TML representation of the metadata objects from ThoughtSpot in JSON or YAML format, use the following endpoint:
To export the TML representation of the metadata objects in a batch, use the following endpoint:
There are several export options available with these APIs:
Metadata specification for Answers🔗
To export a specific metadata object, specify the name or ID of the object.
For Answer objects, the identifier is optional, and you can define parameters such as session_identifier and generation_number instead. These attributes can be used to export unsaved Answers generated from Spotter queries or Answers that do not have the name and ID assigned.
Export associated objects🔗
To export associated objects, set the following attributes:
-
export_associated
When set totrue, exports the associated objects for theexport_idsspecified in the API request. The API exports any underlying Models, tables, or views for a given object. By default, the API does not export these underlying objects. -
export_dependent
Specifies if the Tables of the referenced Connection object must be included in the export. -
export_connection_as_dependent
Specifies if a Connection object must be included as a dependent object when exporting a Table, Model, Answer, or Liveboard TML.
Export FQNs🔗
When export_fqn=true, the API exports the FQNs of the referenced objects in the TML data. For example, if you are exporting a Liveboard and its associated objects, the API returns the Liveboard TML data with the FQNs of the referenced Model.
Note that the FQN of a referenced object is the same as the GUID of that object.
ThoughtSpot recommends adding the fqn property before importing the TML objects into the system, because only the name of a referenced object is not sufficient to identify the referenced object during TML import. For example, if your ThoughtSpot instance has two Models with the same name, the TML import for a Liveboard that uses one of these Models would fail unless the Liveboard TML includes the FQN of the referenced object.
The export_fqn attribute is useful when ThoughtSpot has multiple objects with the same name and you want to eliminate ambiguity during TML import. The export_fqn=true property adds the FQNs of the referenced objects in the TML export API response and saves the manual effort of adding FQNs for TML import.
|
Note
|
When you import multiple objects in bulk and create objects using the |
For more information about using FQNs during import, see Import TML.
Export schema🔗
Specifies the schema version to use during TML export. For Models, set export_schema_version to v2.
The v1 schema is used for Worksheet objects (Deprecated).
Additional export options for REST API v2🔗
Following are some additional attributes which can be set for exporting objects:
-
include_obj_id_ref
When set totrue, exports the object ID of the referenced object. This flag will work only when the object ID feature is enabled. Contact ThoughtSpot Support to enable the feature. -
include_guid
When set totrue, exports the guid of the object. This flag will work only when the object ID feature is enabled. Contact ThoughtSpot Support to enable the feature. -
include_obj_id
When set totrue, exports the object ID of the object. This flag will work only when the object ID feature is enabled. Contact ThoughtSpot Support to enable the feature. -
export_with_associated_feedbacks
When set totrue, exports the TML of an object along with all feedback, such as Spotter or Sage feedback, associated with that object. No feedback file will be exported if there are no feedback entries associated with the object -
export_column_security_rulesBeta
When set totrue, exports the column-level security rules defined on the object. Contact ThoughtSpot Support to enable the feature. -
export_with_column_aliasesBeta
When set totrue, export column aliases of the Model if the data Model includes any column aliases.
Export in a batch🔗
This API operation supports exporting User, User Group, and Role objects only. To export objects in a batch, set the following additional attributes:
-
metadata_type
Type of the metadata object to export. Use one of the following values:USER,USER_GROUP, orROLE. TheROLEvalue applies only to instances on which Role-based access control is enabled. -
batch_size
Exports the specified number of objects in a single API request. A batch size of up to 200 objects is allowed for a single API operation. The default batch size is 20. -
batch_offset
Offsets the API response by the specified number. Batch offset value defines the starting position of the records for the results returned by the API. The default batch offset is 0.
-
export_dependent
Specifies if the dependent objects must be exported. For example, the user groups to which user objects are assigned, or the sub-groups of a user group. To get full details of the dependent objects, the API call initiator must have view or edit access to the dependent object.
For more information, see the API documentation in REST API v2 Playground.