Provides functionality to add, fetch ids, fetch document.

Add Content


Adds a new content record for the given key in the specified scope.

Request

The URL is composed by the ElasticSearch index  and the scope (I.e. connectorocrindex, etc) to which the key content will be saved to.

On this page:

The add PUT request requires a JSON with the fields:

  • key: The unique identifier of the content record. 
  • version: A version to chronologically identify the transaction. If a record with key already exists with a higher version, the request will be discarded.
  • content: JSON content associated with the scope being added. 
  • policy: The policy to use when adding a new content record:
    • NEW: only adds the content if the key doesn't exist in the storage unit.
    • OVERWRITE: if a record with key already exists, it overwrites all of it's previous content (discards other existing scopes for that key), otherwise, it adds the record.
    • MERGE: if a record with key already exists, it adds the scope information without affecting any other scopes for this record.
PUT localhost:50505/transaction/transaction/add/<elastic-search-index>/<scope>
{
    "content": {"doc": {"test":"value"}},
    "policy":"MERGE",
    "key":"79990bd7a7a43bc4f0d4ab03ebd6dd74",
    "version": "1"
} 

Response

If the add operation is successful, a 200 response code and an OK message are returned.

 {"message":"OK"}

Access


Fetch a JSON transaction against the ElasticSearch index.

Request

The URL is composed by the ElasticSearch index, the scope (I.e. connectorocrindex, etc) and key . 

GET localhost:50505/transaction/access/fetch/<elastic-search-index>/<key>/<scope>


Response

If the execute operation is successful, a 200 response code and json message with content is returned.


{
    "version": "1445618448043",
    "key": "64784ef56285465cc43188ab9e74588d",
    "content": {
        "publisher": {
            "repItemType": "aspire/file",
            "acls": {
                "groups": {
                    "PUBLIC_ALL": {
                        "access": "allow",
                        "name": "PUBLIC_ALL"
                    }
                }
            },
            "hierarchy": {
                "level": "2",
                "name": "1 - Copy (81).txt",
                "id": "C:\\Users\\david.grobelny\\Aspire-crowl\\1 - Copy (81).txt",
                "ancestors": {
                    "parent": "true",
                    "level": "1",
                    "name": "Aspire-crowl",
                    "id": "C:\\Users\\david.grobelny\\Aspire-crowl\\",
                    "type": "aspire/folder",
                    "hashId": "0AF963D5350E7934928BE835A6A42CD4",
                    "url": "file://C:/Users/david.grobelny/Aspire-crowl/"
                },
                "hashId": "A1681D991B9B8CC2DAEBFADF10999EF1",
                "url": "file://C:/Users/david.grobelny/Aspire-crowl/1%20-%20Copy%20(81).txt"
            },
            "isContainer": "false",
            "connectorSpecific": {
                "isContainer": "false"
            },
            "url": "file:///C:/Users/david.grobelny/Aspire-crowl/1%20-%20Copy%20(81).txt",
            "content": "Hello Here\n",
            "displayurl": "C:\\Users\\david.grobelny\\Aspire-crowl\\1 - Copy (81).txt",
            "crawlStart": "2021-07-15T16:25:41Z",
            "ingestionEnd": "2021-07-15T16:25:46Z",
            "submitTime": "2021-07-15T16:25:46+0000",
            "sourceType": "filesystem",
            "ingestionStart": "2021-07-15T16:25:44Z",
            "sourceName": "File System",
            "last_modified": "2021-05-06T10:01:48Z"
        }
    }
}


Fetch Transactions


Executes a list of transactions against the elastic search index.

Request

The URL is composed by the ElasticSearch index, the scope (I.e. connectorocrindex, etc), start id, batch size which all transactions will be executed to.

 GET localhost:50505/transaction/subscription/fetchTransactions/<elastic-search-index>/<scope>?batchSize=<size>&startId=<key>


Response

If the batch operation is successful, a 200 response code and a list of JSON message are returned if no transactions failed.

When it completes successfully:

    [
    {
        "record": {
            "version": "1445618448043",
            "key": "66d24f249e52a3586d9a22e653eab0d0",
            "content": {
                "publisher": {
                    "repItemType": "aspire/file",
                    "acls": {
                        "groups": {
                            "PUBLIC_ALL": {
                                "access": "allow",
                                "name": "PUBLIC_ALL"
                            }
                        }
                    },
                    "hierarchy": {
                        "level": "2",
                        "name": "1 - Copy (56).txt",
                        "id": "C:\\Users\\david.grobelny\\Aspire-crowl\\1 - Copy (56).txt",
                        "ancestors": {
                            "parent": "true",
                            "level": "1",
                            "name": "Aspire-crowl",
                            "id": "C:\\Users\\david.grobelny\\Aspire-crowl\\",
                            "type": "aspire/folder",
                            "hashId": "0AF963D5350E7934928BE835A6A42CD4",
                            "url": "file://C:/Users/david.grobelny/Aspire-crowl/"
                        },
                        "hashId": "47E0410425EB7B37225EC3D2632EDC8F",
                        "url": "file://C:/Users/david.grobelny/Aspire-crowl/1%20-%20Copy%20(56).txt"
                    },
                    "isContainer": "false",
                    "connectorSpecific": {
                        "isContainer": "false"
                    },
                    "url": "file:///C:/Users/david.grobelny/Aspire-crowl/1%20-%20Copy%20(56).txt",
                    "content": "Hello Here\n",
                    "displayurl": "C:\\Users\\david.grobelny\\Aspire-crowl\\1 - Copy (56).txt",
                    "crawlStart": "2021-07-15T16:25:41Z",
                    "ingestionEnd": "2021-07-15T16:25:48Z",
                    "submitTime": "2021-07-15T16:25:48+0000",
                    "sourceType": "filesystem",
                    "ingestionStart": "2021-07-15T16:25:44Z",
                    "sourceName": "File System",
                    "last_modified": "2021-05-06T10:01:48Z"
                }
            }
        },
        "transaction": {
            "recordId": "66d24f249e52a3586d9a22e653eab0d0",
            "scope": "publisher",
            "type": "add",
            "timestamp": "2021-07-15T16:25:49.544209100Z"
        }
    },




  • No labels