Move and Bulk Move
------------------

The following model types can be enabled for this operation:

* Data models
* Device models
* Relations

For an API call that carries out a move on a ``<model_type>``, a POST payload in JSON format is added.

A move can only take place from a source hierarchy equal to or lower than ``[target_hierarchy]``.

* Task

  Move the instance with [pkid] to [target_hierarchy]


.. tabularcolumns:: |p{1cm}|p{4cm}|p{5cm}|p{5cm}|

+------+---------------------+---------------------------------------+-----------------------------------------+
| Call | URL                 | Parameters                            | Payload                                 |
+======+=====================+=======================================+=========================================+
| POST | /api/tool/DataMove/ | format=json                           | {"hrefs": ["/api/<model_type>/[pkid]"]} |
|      | ?model_type=        |                                       |                                         |
|      | <model_type>        | hierarchy=[hierarchy]                 |                                         |
|      |                     | context_hierarchy= [target_hierarchy] |                                         |
|      |                     | (nowait=true)                         |                                         |
+------+---------------------+---------------------------------------+-----------------------------------------+





* Task

  Move one or more model instances ([pkid1], [pkid2],...) from source hierarchy (pkid or dot notation) to target_hierarchy (pkid or dot notation).


.. tabularcolumns:: |p{1cm}|p{4cm}|p{5cm}|p{5cm}|

+------+---------------------+---------------------------------------+------------------------------------------------------------------------------------------+
| Call | URL                 | Parameters                            | Payload                                                                                  |
+======+=====================+=======================================+==========================================================================================+
| POST | /api/tool/DataMove/ | format=json                           | {"hrefs": ["/api/relation/Subscriber/[pkid1]", "/api/relation/Subscriber/[pkid2]", ...]} |
|      | ?model_type=        |                                       |                                                                                          |
|      | <model_type>        | hierarchy=[hierarchy]                 |                                                                                          |
|      |                     | context_hierarchy= [target_hierarchy] |                                                                                          |
|      |                     | (nowait=true)                         |                                                                                          |
+------+---------------------+---------------------------------------+------------------------------------------------------------------------------------------+


For a list of hierarchy pkids and their dot notation available from [hierarchy], use the GET call:

::

   GET api/relation/<model_type>/
    ?hierarchy=[hierarchy]
    &format=json
    &schema_rules=true




.. |VOSS-4-UC| replace:: VOSS-4-UC
.. |Unified CM| replace:: Unified CM