Creating Endpoints

Required API

To create an endpoint you will need to use a number of different services APIs.

Selecting a connector

You first need to know what connector you will be using with your endpoint.

You can view all the connectors using the connector-depot's /connectors endpoint.

curl --request GET '{{impulse-protocol}}://{{impulse-domain}}:{{impulse-port}}/public/connector-depot/connectors'

This request will list all the available connectors. You will need the id of the connector you want to use with the endpoint.

Saving an Endpoint

Now that you know the connector ID, you will need to save the endpoint to the endpoint-depot.

You can do this by using the endpoint-depot /endpoints endpoint.

an example request would be as follows:

curl --request POST '{{impulse-protocol}}://{{impulse-domain}}:{{impulse-port}}/private/endpoint-depot/endpoints' \
--header 'Content-Type: application/json' \
--data-raw '{
	"name" : "my-endpoint",
	"connectorId": "12dcb152-51b5-422a-b2f3-615dd3387fbd",
	"contentRepo" : "dotcms",
	"contentRepoVersion" : "5.2.7",
	"active": true
}'

Be sure to get use the correct contentRepo and contentRepoVersion when saving the endpoint. View the specific connector's doc for more details.

The response returned after the endpoint is saved will contain the endpoint ID. You will need to make note of this ID and use it in the following API.

Source Connector Config

Adapter Read Config

Once an endpoint is created and you have it's ID, you need to save config to connect to your chosen repository. The adapter read config is only available for connectors level 2 or level 3. The config is required to sync content from the repository or for full Impulse capabilities, such as diff reporting. Without this config, the content will not be picked up and saved into Impulse.

Based on which connector you want to use for the endpoint you will use a different config API. View the specific connectors user doc and API doc for more information. For this example we will use the dotCMS source connector. As such you will need to create the config payload. All connectors configs have few matching attributes.

  • endPointId

    • The endpoint ID of the associated endpoint

  • taxiPickupURL

    • The relative URL of the pickup taxi

    • Public Impulse uses the value: http://taxi-pickup-app:8080

  • taxiDropoffURL

    • The relative URL of the drop off taxi

    • Public Impulse uses the value: http://taxi-dropoff-app:8080

The dotCMS adapter has specific properties that are listed in both the API doc and the dotCMS source connector doc.

Making the example request:

curl --request PUT '{{impulse-protocol}}://{{impulse-domain}}:{{impulse-port}}/private/{{adapter-name}}/config' \
--header 'Content-Type: application/json' \
--data-raw '{
  "endPointID": "{{endpoint-id}}",
  "taxiPickupURL": "http://taxi-pickup-app:8080",
  "taxiDropoffURL": "http://taxi-dropoff-app:8080",
  "properties": {
    "dbUser": "dotcmsdbuser",
    "dbPassword": "password",
    "dbConnectionURL": "postgres://source-dotcms-db:5432/dotcms",
    "assetsPath": "/data/shared/assets",
    "defaultLanguageCode": "en",
    "defaultCountryCode": "US",
    "defaultHostStructure": "855a2d72-f2f3-4169-8b04-ac5157c4380c"
  }
}'

This same request can be used to update the adapter config. To update the config use the same endPointId in the request. This will update any existing config with that endpoint ID or create a new config if one does not exist.

Taxi Pickup Config

Once an endpoint is created and you have it's ID, you need to save config to connect to your chosen connector. The taxi pickup config is required for source connectors. These are connectors with either level 2 or level 3. If you are using the endpoint as a source you must save taxi pickup config. The config is required to sync content from the repository or for full Impulse capabilities, such as diff reporting. Without this config, the content will not be picked up and saved into Impulse.

Based on which connector you have chosen, you will use a different value in the payload of the config. For this example we will use the dotCMS source connector. The example request would look like the following.

curl --request PUT '{{impulse-protocol}}://{{impulse-domain}}:{{impulse-port}}/private/taxi-pickup/config/{{endpoint-id}}' \
--header 'Content-Type: application/json' \
--data-raw '{
    "AdapterURL" : "http://{{relative-dotcms-adapter-read-domain}}:8080"
}'

The AdapterURL is the relative URL to the connector's read adapter.

Destination Connector Config

Adapter Write Config

Once an endpoint is created and you have it's ID, you need to save config to connect to your chosen repository. The adapter write config is only available for connectors level 1 or level 3. The config is required to sync content to the repository. Without this config, the content will not be saved to a destination repository.

Based on which connector you want to use for the endpoint you will use a different config API. View the specific connectors user doc and API doc for more information. For this example we will use the dotCMS destination connector. As such you will need to create the config payload. All connectors configs have few matching attributes.

  • endPointId

    • The endpoint ID of the associated endpoint

  • taxiPickupURL

    • The relative URL of the pickup taxi

    • Public Impulse uses the value: http://taxi-pickup-app:8080

  • taxiDropoffURL

    • The relative URL of the drop off taxi

    • Public Impulse uses the value: http://taxi-dropoff-app:8080

The dotCMS adapter has specific properties that are listed in both the API doc and the dotCMS source connector doc.

Making the example request:

curl --request PUT '{{impulse-protocol}}://{{impulse-domain}}:{{impulse-port}}/private/{{adapter-name}}/config' \
--header 'Content-Type: application/json' \
--data-raw '{
  "endPointID": "{{endpoint-id}}",
  "taxiPickupURL": "http://taxi-pickup-app:8080",
  "taxiDropoffURL": "http://taxi-dropoff-app:8080",
  "properties": {
    "dbUser": "dotcmsdbuser",
    "dbPassword": "password",
    "dbConnectionURL": "postgres://dest-dotcms-db:5432/dotcms",
    "assetsPath": "/data/shared/assets",
    "defaultLanguageCode": "en",
    "defaultCountryCode": "US",
    "defaultHostStructure": "855a2d72-f2f3-4169-8b04-ac5157c4380c"
  }
}'

This same request can be used to update the adapter config. To update the config use the same endPointId in the request. This will update any existing config with that endpoint ID or create a new config if one does not exist.

Taxi Drop-off Config

Once an endpoint is created and you have it's ID, you need to save config to connect to your chosen connector. The taxi drop off config is required for destination connectors. These are connectors with either level 1 or level 3. If you are using the endpoint as a destination you must save taxi drop off config. Without this config, the content will not be saved to a repository.

Based on which connector you have chosen, you will use a different value in the payload of the config. For this example we will use the dotCMS destination connector. The example request would look like the following.

curl --request PUT '{{impulse-protocol}}://{{impulse-domain}}:{{impulse-port}}/private/taxi-pickup/config/{{endpoint-id}}' \
--header 'Content-Type: application/json' \
--data-raw '{
    "AdapterURL" : "http://{{relative-dotcms-adapter-write-domain}}:8080"
}'

The AdapterURL is the relative URL to the connector's write adapter.

Last updated