metadata Class
Functions for working with metadata objects
Methods
- createObject
- deleteObject
- deleteVisualization
- etlPull
- getAttributes
- getAvailableAttributes
- getAvailableFacts
- getAvailableMetrics
- getCommonAttributes
- getDimensions
- getFacts
- getFolders
- getFoldersWithItems
- getIdentifiersFromUris
- getMetrics
- getObjectDetails
- getObjectIdentifier
- getObjects
- getObjectsByQuery
- getObjectUri
- getObjectUsing
- getObjectUsingMany
- getUrisFromIdentifiers
- getValidElements
- getVisualization
- getVisualizations
- ldmManage
- saveVisualization
- updateObject
- updateVisualization
createObject
-
projectId
-
obj
Create object
Parameters
-
projectId
String -
obj
Stringobject definition
deleteObject
-
uri
Delete object
Parameters
-
uri
Stringof the object to be deleted
deleteVisualization
-
visualizationUri
Delete visualization
Parameters
-
visualizationUri
String
etlPull
-
projectId
-
uploadsDir
-
options
ETL pull
Parameters
-
projectId
String -
uploadsDir
String -
options
Objectfor polling (maxAttempts, pollStep)
getAttributes
-
projectId
Returns all attributes in a project specified by projectId param
Parameters
-
projectId
StringProject identifier
Returns
An array of attribute objects
getAvailableAttributes
-
projectId
-
metrics
Returns all attributes that are reachable (with respect to ldm of the project specified by the given projectId) for given metrics (also called as drillCrossPath)
Parameters
-
projectId
String- Project identifier
-
metrics
Array- An array of metric uris for which we want to get available attributes
Returns
An array of reachable attributes for the given metrics
getAvailableFacts
-
projectId
-
items
Returns all attributes that are reachable (with respect to ldm of the project specified by the given projectId) for given metrics (also called as drillCrossPath)
Parameters
-
projectId
String- Project identifier
-
items
Array- An array of metric or attribute uris for which we want to get available facts
Returns
An array of reachable facts for the given items
getAvailableMetrics
-
projectId
-
attrs
Returns all metrics that are reachable (with respect to ldm of the project specified by the given projectId) for given attributes
Parameters
-
projectId
String- Project identifier
-
attrs
Array- An array of attribute uris for which we want to get available metrics
Returns
An array of reachable metrics for the given attrs
getCommonAttributes
-
projectId
-
attributeUris
Get closest connecting attributes in the LDM by calling the "attributeupperbound" endpoint
Parameters
-
projectId
StringA project identifier
-
attributeUris
ArrayInput list of attribute URIs
Returns
Resolves with result list of attribute URIs
getDimensions
-
projectId
Returns all dimensions in a project specified by projectId param
Parameters
-
projectId
StringProject identifier
Returns
An array of dimension objects
getFacts
-
projectId
Returns all facts in a project specified by the given projectId
Parameters
-
projectId
StringProject identifier
Returns
An array of fact objects
getFolders
-
projectId
-
type
Returns project folders. Folders can be of specific types and you can specify
the type you need by passing and optional type
parameter
Parameters
-
projectId
String- Project identifier
-
type
String- Optional, possible values are
metric
,fact
,attribute
- Optional, possible values are
Returns
An array of dimension objects
getFoldersWithItems
-
type
Get folders with items. Returns array of folders, each having a title and items property which is an array of corresponding items. Each item is either a metric or attribute, keeping its original verbose structure.
Parameters
-
type
Stringtype of folders to return
Returns
Array of folder object, each containing title and corresponding items.
getIdentifiersFromUris
-
projectId
-
uris
Get identifiers specified by uris
Parameters
-
projectId
Stringid of the project
-
uris
Arrayof the metadata objects
Returns
array of identifier + uri pairs
getMetrics
-
projectId
Returns all metrics in a project specified by the given projectId
Parameters
-
projectId
StringProject identifier
Returns
An array of metric objects
getObjectDetails
-
uri
Get details of a metadata object specified by its uri
Parameters
-
uri
Objecturi of the metadata object for which details are to be retrieved
Returns
object details
getObjectIdentifier
-
uri
Get identifier of a metadata object identified by its uri
Parameters
-
uri
Objecturi of the metadata object for which the identifier is to be retrieved
Returns
object identifier
getObjects
-
projectId
-
objectUris
Load all objects with given uris (use bulk loading instead of getting objects one by one)
Parameters
-
projectId
Stringid of the project
-
objectUris
Arrayarray of uris for objects to be loaded
Returns
array of loaded elements
getObjectsByQuery
-
projectId
-
options
Loads all objects by query (fetches all pages, one by one)
Parameters
-
projectId
Stringid of the project
-
options
Object(see https://developer.gooddata.com/api endpoint: /gdc/md/{project_id}/objects/query) - category {String} for example 'dataSets' or 'projectDashboard' - mode {String} 'enriched' or 'raw' - author {String} the URI of the author of the metadata objects - limit {number} default is 50 (also maximum) - deprecated {boolean} show also deprecated objects
Returns
array of returned objects
getObjectUri
-
projectId
-
identifier
Get uri of an metadata object, specified by its identifier and project id it belongs to
Parameters
-
projectId
Stringid of the project
-
identifier
Objectidentifier of the metadata object
Returns
uri of the metadata object
getObjectUsing
-
projectId
-
uri
-
options
Get MD objects from using2 resource. Include only objects of given types and take care about fetching only nearest objects if requested.
Parameters
-
projectId
Stringid of the project
-
uri
Stringuri of the object for which dependencies are to be found
-
options
Objectobjects with options: - types {Array} array of strings with object types to be included - nearest {Boolean} whether to include only nearest dependencies
Returns
promise promise once resolved returns an array of entries returned by using2 resource
getObjectUsingMany
-
projectId
-
uris
-
options
Get MD objects from using2 resource. Include only objects of given types and take care about fetching only nearest objects if requested.
Parameters
-
projectId
Stringid of the project
-
uris
Arrayuris of objects for which dependencies are to be found
-
options
Objectobjects with options: - types {Array} array of strings with object types to be included - nearest {Boolean} whether to include only nearest dependencies
Returns
promise promise once resolved returns an array of entries returned by using2 resource
getUrisFromIdentifiers
-
projectId
-
identifiers
Get uris specified by identifiers
Parameters
-
projectId
Stringid of the project
-
identifiers
Arrayidentifiers of the metadata objects
Returns
array of identifier + uri pairs
getValidElements
-
projectId
-
id
-
options
Get valid elements of an attribute, specified by its identifier and project id it belongs to
Parameters
-
projectId
Stringid of the project
-
id
Objectdisplay form id of the metadata object
-
options
Objectobjects with options: - limit {Number} - offset {Number} - order {String} 'asc' or 'desc' - filter {String} - prompt {String} - uris {Array} - complement {Boolean} - includeTotalCountWithoutFilters {Boolean} - restrictiveDefinition {String} - afm {Object}
Returns
ValidElements response with: - items {Array} elements - paging {Object} - elementsMeta {Object}
getVisualization
-
visualizationUri
Get visualization by Uri and process data
Parameters
-
visualizationUri
String
getVisualizations
-
projectId
Returns all visualizationObjects metadata in a project specified by projectId param
Parameters
-
projectId
StringProject identifier
Returns
An array of visualization objects metadata
ldmManage
-
projectId
-
maql
-
options
LDM manage
Parameters
-
projectId
String -
maql
String -
options
Objectfor polling (maxAttempts, pollStep)
saveVisualization
-
visualizationUri
Save visualization
Parameters
-
visualizationUri
String
updateObject
-
projectId
-
visualizationUri
-
obj
Update object
Parameters
-
projectId
String -
visualizationUri
String -
obj
Stringobject definition
updateVisualization
-
visualizationUri
Update visualization
Parameters
-
visualizationUri
String