[英]How to update TM1 Cube data using Rest API call
I am trying to find a way to make a Rest API call to TM1 that sends it an array of data to be updated in the Cube.我正在尝试找到一种方法来对 TM1 进行 Rest API 调用,该调用向其发送要在多维数据集中更新的数据数组。 The data to be updated will be identifiable by the Cube's key but it wont be all the records to be update (eg update row 3 and 5 with new values).要更新的数据将可以通过 Cube 的键来识别,但不会是要更新的所有记录(例如,使用新值更新第 3 行和第 5 行)。
I am having issue finding an example.我在寻找示例时遇到问题。 I did see from documentation "Cube.UpdateCells" But didnt see example on how to use it.我确实从文档“Cube.UpdateCells”中看到,但没有看到如何使用它的示例。 I also saw https://www.ibm.com/support/knowledgecenter/SS9RXT_10.2.2/com.ibm.swg.ba.cognos.tm1_rest_api.10.2.2.doc/t_tm1_rest_api_cellsets.html#dg_tm1_odata_update_many_cell_values where it mentions updating many cells but no example..我还看到https://www.ibm.com/support/knowledgecenter/SS9RXT_10.2.2/com.ibm.swg.ba.cognos.tm1_rest_api.10.2.2.doc/t_tm1_rest_api_cellsets.html#dg_tm1_odata_update_many提到更新cell_value的单元格但没有例子..
I didn't find anything here about it so any help would be appreciated!我在这里没有找到任何关于它的信息,所以任何帮助将不胜感激!
You should try the tm1.Update function and write the exact crossing in the cube.您应该尝试 tm1.Update function 并在立方体中写入精确的交叉点。 the URL will look like this one; URL 看起来像这个; https://myserver:myportnumber/api/v1/Cubes('mycube')/tm1.Update
and in the body of your POST Request you'll puch the exact crossing of your cube with the value. https://myserver:myportnumber/api/v1/Cubes('mycube')/tm1.Update
并在您的 POST 请求正文中,您将使用该值精确地穿过立方体。 it will look like this one:它看起来像这样:
{
"Cells":[
{"Tuple@odata.bind": [
"Dimensions('Version')/Hierarchies('Version')/Elements('BUDGET')",
"Dimensions('Societe')/Hierarchies('Societe')/Elements('S01')",
"Dimensions('Compte')/Hierarchies('Compte')/Elements('C7090')",
"Dimensions('Annee')/Hierarchies('Annee')/Elements('2019')",
"Dimensions('Mois')/Hierarchies('Mois')/Elements('M01')",
"Dimensions('m_Couts')/Hierarchies('m_Couts')/Elements('MONTANT')"
]
}
],
"Value":"1234"
}
You can learn more about the TM1 REST API here: https://code.cubewise.com/tm1-rest-api您可以在此处了解有关 TM1 REST API 的更多信息: https://code.cubewise.com/tm1-rest-api
You'll have a lot of explanation.你会有很多解释。 Try their Postman Collection for the TM1 REST API you'll learn a lot.试试他们的 Postman TM1 系列 REST API 你会学到很多东西。 You just have to install POSTMAN on your laptop and try it on the IBM samples servers.您只需在笔记本电脑上安装 POSTMAN 并在 IBM 示例服务器上试用。
In general Cubewise as a lot of good tools.一般来说 Cubewise 是很多好的工具。 To go further if you know Python or you want to learn it you have the TM1Py library wich is good to work with the TM1 REST API To go further if you know Python or you want to learn it you have the TM1Py library wich is good to work with the TM1 REST API
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.