Configure Salesforce integration for OSS manually

Configure Salesforce integration for OSS manuallyΒΆ

Warning

The DevOps Portal has been deprecated in the Q4`18 MCP release tagged with the 2019.2.0 Build ID.

The Push Notification services can automatically create tickets in Saleforce based on the alarms triggered by the issues that are found by Prometheus Alertmanager. Moreover, the Push Notification service ensures the following:

  • The Salesforce tickets are not duplicated. When the same alarm gets triggered multiple times, only one Saleseforce ticket is created per the alarm.

  • The Push Notification service creates one entry in a SalesForce feed, that is a FeedItem, per alarm with a link to an existing ticket. This enables the users to track important changes as well as close the ticket which has been fixed.

Warning

This section describes how to manually configure the Push Notification service Reclass metadata to integrate with Salesforce in an existing OSS deployment. Therefore, if you want to configure the Salesforce integration, perform the procedure below.

Otherwise, if you are performing the initial deployment of your MCP environment, you should have already configured your deployment model with the Salesforce (SFDC) parameters as described in OSS parameters. In this case, skip this section.

To configure Salesforce integration for OSS manually:

  1. Collect the following data from Saleforce:

    • auth_url

      The URL of a Salesforce instance. The same for the MCP users.

    • username

      The username in Salesforce used for integration; all Salesforce cases are created by this user. The unique identifier for an MCP user.

    • password

      The password used for logging in to the Support Customer Portal. The unique identifier for an MCP user.

    • environment

      The Cloud ID in Salesforce. The unique identifier for an MCP user.

      The detailed information on a Salesforce Cloud is provided by either Mirantis support engineers or customer depending on whom the Cloud object was created by.

    • consumer_key

      The Consumer Key in Salesforce required for Open Authorization (OAuth).

    • consumer_secret

      The Consumer Secret from Salesforce required for OAuth.

    • organization_id

      The Salesforce Organization ID in Salesforce required for OAuth.

  2. Verify that the following services are properly configured and deployed:

    • Elasticsearch

    • PostgreSQL

    Note

    For the configuration and deployment details, see:

  3. In the classes/cluster/${_param:cluster_name}/oss/client.yml file of your deployment model, define the system.postgresql.client.sfdc class :

    classes:
      - system.postgresql.client.sfdc
    
  4. In the /srv/salt/reclass/classes/cluster/${_param:cluster_name}/oss/server.yml file, define the following parameters:

    parameters:
      _param:
        # SFDC configuration
        sfdc_auth_url: <AUTH_URL>
        sfdc_username: <USERNAME>
        sfdc_password: <PASSWORD>
        sfdc_consumer_key: <CONSUMER_KEY>
        sfdc_consumer_secret: <CONSUMER_SECRET>
        sfdc_organization_id: <ORGANIZATION_ID>
        sfdc_sandbox_enabled:  True
    

    Note

    Sandbox environments are isolated from the production Salesforce clouds. Set the sfdc_sandbox_enabled to True to use Salesforce sandbox for testing and evaluation purposes. Verify that you specify the correct sandbox-url value in the sfdc_auth_url parameter. Otherwise, set the parameter to False.

  5. Push all changes of the model to the dedicated project repository.

  6. Refresh pillars and synchronize Salt modules:

    salt '*' saltutil.refresh_pillar
    salt '*' saltutil.sync_modules
    
  7. If you have the running pushkin docker stack, remove it and apply the following Salt states:

    salt -C 'I@docker:swarm:role:master' state.sls docker.client
    salt -C 'I@postgresql:client' state.sls postgresql.client
    
  8. To test whether the Push Notification service is configured properly:

    1. View the list of all applications, preconfigured in the Push Notification service, and their details by checking the system response for the following command:

      curl -D - http://${HAPROXY_STATS_IP}:8887/apps
      

      Example of system response:

      {"applications": [{"login_id": 11, "enabled": true, "id": 1, "name": "notify_service"}]}
      
    2. Send the test request to the service using the following command:

      curl -i -XPOST -H 'Content-Type: application/json' <PUSH_NOTIFICATION_ENDPOINT> -d \
        '{"notifications": [{"login_id" : <APP_LOGIN_ID>, \
        "title" : "Salesforce test notification", \
        "content" : {"handler": "sfdc","payload": \
        {"status": "<NOTIFICATION_STATUS>","priority": "<NOTIFICATION_PRIORITY>",\
        "subject": "<NOTIFICATION_SUBJECT>","host": "<EXAMPLE.NET>",\
        "service": "<SERVICE>","environment": "<ENVIRONMENT_ID>",\
        "body": "<NOTIFICATION_ITEM_BODY>"}, \
        "application_id": <APP_ID>}}]}'
      

      The table below provides the desription of the parameters required for the test request.

      Parameter

      Description

      login_id

      The Login ID of an application on behalf of which the notification will be send. Define the parameter according to the login_id parameter value retrieved during the previous step.

      environment

      The Cloud ID in Salesforce which the notification will be send to. Define the parameter according to the environment parameter value collected during the first step of this procedure.

      application_id

      The ID of an application on behalf of which the notification will be send. Define the parameter according to the id parameter value retrieved during the previous step.

      Example:

      curl -i -XPOST -H 'Content-Type: application/json' http://${HAPROXY_STATS_IP}:8887/post_notification_json -d \
        '{"notifications": [{"login_id" : 12, \
        "title" : "SFDC test notification", \
        "content" : {"handler": "sfdc","payload": \
        {"status": "down","priority": "070 Unknown",\
        "subject": "Notification subject","host": "example.net",\
        "service": "test-service","environment": "123",\
        "body": "Notification item body"}, \
        "application_id": 2}}]}'
      
    3. Log in to Salesforce and verify that the alert is filed correctly.