[ 
https://issues.apache.org/jira/browse/USERGRID-929?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14715665#comment-14715665
 ] 

Michael Russo edited comment on USERGRID-929 at 8/27/15 12:32 AM:
------------------------------------------------------------------

You can import an entity with:

PUT /:org/:app:/:collection/:oldEntityUUID

Example:

{code}
PUT /test-org/test-app/trivialentities/41c75680-3806-11e5-a720-f6bc3806f37d
{code}

{code}
{
            "created": 1438403522921,
            "metadata": {
                "path": "/trivialentities/41c75680-3806-11e5-a720-f6bc3806f37d"
            },
            "modified": 1438403522921,
            "name": "trivial1",
            "type": "trivialentity",
            "uuid": "41c75680-3806-11e5-a720-f6bc3806f37d"
        }
{code}

This will preserve the UUID and properties and create an entity in the system 
with that data.  However, there is not a REST endpoint expose for creating the 
:org and :app.  This functionality is built in the Management Service layer, 
see: 
org.apache.usergrid.management.cassandra.ManagementServiceImpl#importOrganization

It's only used by the standalone usergrid-tools, and not exposed via REST 
endpoint.  Maybe expose via REST only to superuser so admins could do full 
imports via REST API?


was (Author: mrusso):
You can import an entity with:

PUT /:org/:app:/:collection/:oldEntityUUID

Example:

{code}
PUT /test-org/test-app/trivialentities/41c75680-3806-11e5-a720-f6bc3806f37d
{code}

{code}
{
            "created": 1438403522921,
            "metadata": {
                "path": "/trivialentities/41c75680-3806-11e5-a720-f6bc3806f37d"
            },
            "modified": 1438403522921,
            "name": "trivial1",
            "type": "trivialentity",
            "uuid": "41c75680-3806-11e5-a720-f6bc3806f37d"
        }
{code}

This will preserve the UUID and properties and create an entity in the system 
with that data.  However, there is not a REST endpoint expose for creating the 
:org and :app.  This functionality is built in the Management Service layer, 
see: 
org.apache.usergrid.management.cassandra.ManagementServiceImpl#importOrganization

It's only used by the standalone usergrid-tools, and not exposed via REST 
endpoint.

> Test the creation of entities which have an OldUUID to migrate from 1.0 to 2.1
> ------------------------------------------------------------------------------
>
>                 Key: USERGRID-929
>                 URL: https://issues.apache.org/jira/browse/USERGRID-929
>             Project: Usergrid
>          Issue Type: Story
>            Reporter: Jeffrey 
>            Assignee: Michael Russo
>




--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to