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
-
projectIdString -
objStringobject definition
deleteObject
-
uri
Delete object
Parameters
-
uriStringof the object to be deleted
deleteVisualization
-
visualizationUri
Delete visualization
Parameters
-
visualizationUriString
etlPull
-
projectId -
uploadsDir -
options
ETL pull
Parameters
-
projectIdString -
uploadsDirString -
optionsObjectfor polling (maxAttempts, pollStep)
getAttributes
-
projectId
Returns all attributes in a project specified by projectId param
Parameters
-
projectIdStringProject 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
-
projectIdString- Project identifier
-
metricsArray- 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
-
projectIdString- Project identifier
-
itemsArray- 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
-
projectIdString- Project identifier
-
attrsArray- 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
-
projectIdStringA project identifier
-
attributeUrisArrayInput 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
-
projectIdStringProject identifier
Returns
An array of dimension objects
getFacts
-
projectId
Returns all facts in a project specified by the given projectId
Parameters
-
projectIdStringProject 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
-
projectIdString- Project identifier
-
typeString- 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
-
typeStringtype of folders to return
Returns
Array of folder object, each containing title and corresponding items.
getIdentifiersFromUris
-
projectId -
uris
Get identifiers specified by uris
Parameters
-
projectIdStringid of the project
-
urisArrayof the metadata objects
Returns
array of identifier + uri pairs
getMetrics
-
projectId
Returns all metrics in a project specified by the given projectId
Parameters
-
projectIdStringProject identifier
Returns
An array of metric objects
getObjectDetails
-
uri
Get details of a metadata object specified by its uri
Parameters
-
uriObjecturi 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
-
uriObjecturi 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
-
projectIdStringid of the project
-
objectUrisArrayarray 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
-
projectIdStringid of the project
-
optionsObject(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
-
projectIdStringid of the project
-
identifierObjectidentifier 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
-
projectIdStringid of the project
-
uriStringuri of the object for which dependencies are to be found
-
optionsObjectobjects 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
-
projectIdStringid of the project
-
urisArrayuris of objects for which dependencies are to be found
-
optionsObjectobjects 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
-
projectIdStringid of the project
-
identifiersArrayidentifiers 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
-
projectIdStringid of the project
-
idObjectdisplay form id of the metadata object
-
optionsObjectobjects 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
-
visualizationUriString
getVisualizations
-
projectId
Returns all visualizationObjects metadata in a project specified by projectId param
Parameters
-
projectIdStringProject identifier
Returns
An array of visualization objects metadata
ldmManage
-
projectId -
maql -
options
LDM manage
Parameters
-
projectIdString -
maqlString -
optionsObjectfor polling (maxAttempts, pollStep)
saveVisualization
-
visualizationUri
Save visualization
Parameters
-
visualizationUriString
updateObject
-
projectId -
visualizationUri -
obj
Update object
Parameters
-
projectIdString -
visualizationUriString -
objStringobject definition
updateVisualization
-
visualizationUri
Update visualization
Parameters
-
visualizationUriString