You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 9 Next »

The Confluence Connector can be configured using the Rest API. It requires the following entities to be created:

  • Credential
  • Connection
  • Connector
  • Seed

Below are the examples of how to create the Credential, Connection and the Seed. For the Connector, please check this page.

Create Credential


FieldRequiredDefaultMultipleNotesExample
typeYes-NoThe value must be "confluence"."confluence"
descriptionYes-NoName of the confluence object."My Confluence"
propertiesYes-NoConfiguration object
userYes-NoUser name."admin"
passwordYes-NoPassword or the token in case of Cloud"adminPassword"
domainNo-NoDomain used to login to Confluence. If the domain is not required by the environment it is ignored."CompanyDomain"
userFormsAuthNofalseNoUse login.action POST action to authenticate instead of using BASIC Authorization headers (only for On Premise version)false
cookieTimeoutNo3000NoCookie Timeout (in secs)2000

Example

POST aspire/_api/credentials
{
    "type": "confluence",
    "description": "My Confluence Credential",
    "properties": {
        "user": "admin",
        "password": "adminPassword"
    }
}

Create Connection


FieldRequiredDefaultMultipleNotesExample
typeYes-NoThe value must be "confluence"."confluence"
descriptionYes-NoName of the connection object."My Confluence Connection"
throttlePolicyNo-NoId of the throttle policy that applies to this connection object."6b235b333a1b"
routingPoliciesNo[ ]YesThe ids of the routing policies that this connection will use.["17f75ce7d0c7", "d42780003b36"]
credentialYes-NoId of the credential"6b235b333a1b"
propertiesYes-NoConfiguration object
urlYes-NoURL to access the Confluence server in the form of: http://{servername}{:port} In some Confluence installations you must add '/confluence' to the end of the server name – e.g http://wiki.local.search/confluence . The connector uses REST API to communicate with Confluence. To verify REST append /rest/api/space at the end of the URL. Test it in a browser."http://confluence.company.com/"
cloudNofalseNoSelect if your server is in Cloudtrue
indexContainersNotrueNoSelect if containers (space, page, blog) are to be indexed. Clear to index attachments onlyfalse
scanRecursivelyNotrueNoSelect if subfolders are to be scanned.false
scanExcludedItemsNofalseNoSelect so that the scanner will scan sub items of container items excluded by a pattern (because it matches an exclude pattern or because it doesn't match an include pattern).true
stopCrawlOnScannerErrorNotrueNoIf enabled, crawled will stop if a scanner error is thrown (i.e. a space has no sufficient permissions or does not exist). An error is logged otherwise, and the crawl continues.false
anonymousAccessAllowedNofalseNo

Select to indicate anonymous access is allowed in the Confluence instance. If anonymous (or public) access is allowed on your Confluence instance, you can check the "Anonymous access allowed" checkbox. To see if anonymous access is allowed, please see access in your Confluence instance. This has its meaning when Aspire creates ACL's. Basically if Confluence space has anonymous access allowed Aspire will assign ACL "public" to it instead of other defined space permissions. But it does not work that way that all objects get automatically ACL “public” when anonymous access is allowed. Pages that have explicit restrictions should retain their ACL’s. Only pages that have inherited security from the space with anonymous access allowed would get ACL’s “public”.

true






limitItemContentSizeNofalseNoImpose a max limit for the size of the page content that can be extracted from Confluence or the time it takes to read the content. Pages /w content over this size or which take longer then the timeout will have their content replaced with a configurable string. These pages will still have their metadata extracted.true
maxItemContentSize true10000NoThe maximum allowed content size (in kilobytes.)20000
readItemContentTimeout true30NoThe maximum amount of time (in secs) to wait while reading the content bytes.20
fetchMetadataWhenContentFails falsefalseNoIf the REST API call to get the Page content fails, fetch the metadata only.true
removedContentReplacement falseItemContentRemovedNoA string/token to replace the content when the content exceeds the max allowed size or it cannot be read in the allotted time or the REST content fetch request fails."ContentRemoved"






connectionTimeoutNo15000No

Maximum time to wait (in millis) for the connection

30000
readTimeoutNo30000NoMaximum time to wait for read (in millis)40000
retriesNo3NoMaximum number of retries a failed document1
retryDelayNo15000NoRetry delay (in millis)30000
maxRetryDelayNo600000NoMaximum retry delay (in millis)500000
retryDelayMultiplierNo1.0No

Retry delay multiplier

1.5






resultSetLimitNo100NoThe maximum number of records to be retrieved at a time per page through the Confluence REST API.200
logRestAPINofalseNoSelect to Log REST API requests details on the INFO level.true

Example

POST aspire/_api/connections
{
   "type": confluence,
   "description": "Confluence",
    "properties": {
        "url": "https://coreengtest.atlassian.net",
        "cloud": true,
        "indexContainers": true,
        "scanRecursively": true,
        "scanExcludedItems": false,
        "stopCrawlOnScannerError": true,
        "anonymousAccessAllowed": false,
        "limitItemContentSize": false,
        "connectionTimeout": "15000",
        "readTimeout": "30000",
        "retries": "3",
        "retryDelay": "15000",
        "maxRetryDelay": "600000",
        "retryDelayMultiplier": "1.0",
        "resultSetLimit": "100",
        "logRestAPI": false
    }
}

Update Connection


FieldRequiredDefaultMultipleNotesExample
idYes-NoId of the connection to update"d442adcab4b0",
descriptionNo-NoName of the connection object."My RDB Connection"
throttlePolicyNo-NoId of the throttle policy that applies to this connection object."b3a9-6b235b333a1b"
routingPoliciesNo[ ]YesThe ids of the routing policies that this connection will use.["17f75ce7d0c7", "d42780003b36"]
credentialNo-NoId of the credential"6b235b333a1b"
propertiesNo-NoConfiguration object
(see create connection)




Example

PUT aspire/_api/connections/89d6632a-a296-426c-adb0-d442adcab4b0
{
   "id": "89d6632a-a296-426c-adb0-d442adcab4b0",
   "description": "Confluence",
     "properties": {
        "url": "https://coreengtest.atlassian.net",
        "cloud": true,
        "indexContainers": true,
        "scanRecursively": true,
        "scanExcludedItems": false,
        "stopCrawlOnScannerError": true,
        "anonymousAccessAllowed": false,
        "limitItemContentSize": false,
        "connectionTimeout": "15000",
        "readTimeout": "30000",
        "retries": "3",
        "retryDelay": "15000",
        "maxRetryDelay": "600000",
        "retryDelayMultiplier": "1.0",
        "resultSetLimit": "100",
        "logRestAPI": false
    } 
}

Create Connector


For the creation of the Connector object using the Rest API check this page

Update Connector


For the update of the Connector object using the Rest API check this page

Create Seed


FieldRequiredDefaultMultipleNotesExample
typeYes-NoThe value must be "confluence"."confluence"
descriptionYes-NoName of the seed object."My Confluence Seed"
connectorYes-NoThe id of the connector to be used with this seed. The connector type must match the seed type."e3ca414b0d31"
connectionYes-NoThe id of the connection to be used with this seed. The connection type must match the seed type."e4a663fe9ee6"
workflowsNo[ ]YesThe ids of the workflows that will be executed for the documents crawled.["5696c3f0bda4"]
throttlePolicyNo-NoId of the throttle policy that applies to this seed object."6b235b333a1b"
routingPoliciesNo[ ]YesThe ids of the routing policies that this seed will use.["17f75ce7d0c7", "d42780003b36"]
tagsNo[ ]YesThe tags of the seed. These can be used to filter the seed["tag1", "tag2"]
propertiesYes-NoConfiguration object
useKeysForSpacesListYes-NoFull SQL. Run a "SELECT" query to retrieve all documents. This query is used only for full scans. Use the "WHERE" clause to specify any required condition for crawling just the desired documents. If slicing is enabled, add a "WHERE" clause: "SELECT idCol, col1, col2, col3 FROM data_table WHERE {SLICES}"SELECT * FROM table"
spacesYes-NoThe column name that holds the unique key. The default name of the column which holds the value to use as the document id. This column must be present in fullSQL. SQL aliases are NOT supported."id"
spacesFileNofalseNoCheck if the unique key is a string valuetrue
excludedSpacesNo-NoThe SQL to run after a crawl
spaceNo-NoThe SQL to run before an incremental crawl. This SQL can be used to mark documents for update, save timestamps, clear update tables, etc. as needed to prepare for an incremental crawl"UPDATE updates_table SET status='I'"
excludedSpacesFileYes-NoThe SQL to run during an incremental crawl. This SQL should provide a list of all adds and deletes to the documents in the index. Some field names have special meaning (such as 'title', 'content', 'url', 'id', etc.) - see the wiki for more information. Note the special column, 'action' should report 'I' (for inserts), 'U' (for updates, typically the same as updates for most search engines), and 'D' (for deletes)The SQL to run during an incremental crawl. This SQL should provide a list of all adds and deletes to the documents in the index. Some field names have special meaning (such as 'title', 'content', 'url', 'id', etc.) - see the wiki for more information. Note the special column, 'action' should report 'I' (for inserts), 'U' (for updates, typically the same as updates for most search engines), and 'D' (for deletes)"SELECT updates_table.sequence, updates_table.id, updates_table.action, students.first_name, students.last_name FROM students RIGHT OUTER JOIN updates_table ON students.id = updates_table.id WHERE updates_table.status = 'I' ORDER BY updates_table.sequence ASC"
excludePersonalSpacesNo-NoThe SQL to run after each record is processed. This SQL can be used un-mark / delete each document in the tables after it is complete. Your SQL may include placeholders for the row id, action, sequence id and whether the processing was successful. These are {documentId}, {action}, {sequenceId} and {failed} respectivelyUPDATE updates_table SET status = 'C' WHERE sequence = {sequenceId}
excludeArchivedSpacesNo-NoThe SQL to run after each record if processing fails. If not configured, the 'Post update SQL' will be run instead Your SQL may include placeholders for the row id, action, sequence id and whether the processing was successful. These are {documentId}, {action}, {sequenceId} and {failed} respectively
includesYes-NoThe name of the column in the returned data which holds the sequence number of the update. This is only used for incremental crawls and must match the name returned by the SQL. If the column is aliased using the SQL "AS" construct, you should provide the alias name here."sequence"
includeYes-NoThe name of the column in the returned data which holds action of the update (ie Insert, Update or Delete). This is only used for incremental crawls and must match the name returned by the SQL. If the column is aliased using the SQL "AS" construct, you should provide the alias name here"action"
excludesNofalseNoChecking this option allows incremental crawls to use SQL that is bounded by a condition. When entering SQL you may use the variables {lowerBound} and {upperBound} in a WHERE clause to limit the data collected. The {upperBound} will be calculated at the start of the crawl. The {lowerBound} will be the {upperBound} from the previous crawl. Two types of bounding are available - 'Timestamp' returns the bounds as a 'long' value representing the current system time whilst 'SQL' allows you to define SQL to return the new upper bound when the crawl startstrue
excludeNo-NoThe SQL run when the crawl starts to return the new upper bound. The upper bound will be taken from the first column of the first row returned
includeAttachmentsYes (aclColumn or aclSQL)-NoThe column name that holds the ACLs. Each ACL must be separated by semi-colons and must follow this format: my-domain\userOrGroup@NT"acl"
includeCommentsYes (aclColumn or aclSQL)-NoThe query to use for extracting and building ACLs. This query depends of the Database engine, so the syntax could vary. For example on Oracle: SELECT 'my-domain\\' || user || '@NT;' FROM myTable"SELECT * FROM table_acl"

Example

POST aspire/_api/seeds
{
  "type": "confluence",
  "description": "Confluence",
   "properties": {
        "useKeyForSpacesLists": true,
        "spaces": [
            {
                "space": "PEPO"
            }
        ],
        "spacesFile": "",
        "excludedSpaces": [],
        "excludedSpacesFile": "",
        "excludePersonalSpaces": true,
        "excludeArchivedSpaces": true,
        "includes": [],
        "excludes": [],
        "includeAttachments": false,
        "includeComments": false
    }
}

Update Seed


FieldRequiredDefaultMultipleNotesExample
idYes-NoId of the seed to update"2f287669-d163-4e35-ad17-6bbfe9df3778"
(see the "Create seed" for other fields)




Example

PUT aspire/_api/seeds/2f287669-d163-4e35-ad17-6bbfe9df3778
{
  "id": "2f287669-d163-4e35-ad17-6bbfe9df3778",
  "seed": "test_db",
  "description": "RDB_Test",
  "properties": {
      "useKeyForSpacesLists": true,
      "spaces": [
          {
              "space": "PEPO"
          }
      ],
      "spacesFile": "",
      "excludedSpaces": [],
      "excludedSpacesFile": "",
      "excludePersonalSpaces": true,
      "excludeArchivedSpaces": true,
      "includes": [],
      "excludes": [],
      "includeAttachments": false,
      "includeComments": false
  }
}
  • No labels