Modify the name of a dataset or DataSet folder

<< Click to Display Table of Contents >>

Current:  System Integration > WebAPI 

Modify the name of a dataset or DataSet folder

Previous pageReturn to chapter overviewNext page

Request address

http://ip:port/bi/api?action=changeQueryName&token=xxxx

Request message

Request parameter

required parameter:xmlData(required)

<?xml version="1.0" encoding="UTF-8"?>

<info>

  <oquery>

     <type>sql</type>

     <path>coffee</path>

  </oquery>

  <query>

     <type>sql</type>

     <path>coffee_modify</path>

  </query>

</info>

parametric description

The request parameters are new user information and old user information:

1)oquery(required) Corresponds to the information before the dataset is changed.

2)query(required) Information that corresponds to changes to the dataset.

3)type (required) Types include:connections,connection folders, dataset folders, dataset types (see Appendix)

4)path(required) Corresponds to a dataset or dataset folder.

Sample

function changeName() {

        var xml = getXml();

        $.post("http://" + ip + ":" + port + "/" + project + "/api?action=changeQueryName&token=xxxx",

           {xmlData : xml},

           function(result) {        

              writeXml(result);

           });

     }

Response message

Response result

 

1)Successful operation

<?xml version="1.0" encoding="UTF-8"?>

<results>

  <result>

         <level>1</level>

         <message>Update successfully.</message>

  </result>

</results>

2)Operation failure

<?xml version="1.0" encoding="UTF-8"?>

<results>

  <result>

     <level>6</level>

     <message>Folder "test" already exists </message>

  </result>

</results>

or

<?xml version="1.0" encoding="UTF-8"?>

<results>

<result>

<level>6</level>

<message>Folder not found: hangyeanli/lingshouye.</message>

</result></results>

or

<?xml version="1.0" encoding="UTF-8"?>

<results>

  <result>

     <level>6</level>

     <message>Asset not found: test2.</message>

  </result>

</results>

or

<?xml version="1.0" encoding="UTF-8"?>

<results>

  <result>

     <level>6</level>

     <message>File "kafeixiaoshoutongji_xiugai" has been used by another user or already exists, please update the name and save it again.</message>

  </result>

</results>

Result description

The response result information is xml. direct parse.

1)Level return type, different values represent different return status, see appendix.

2)Message is the interface operation result information.