GoogleCloudPlatform / application-integration-management-toolkit

This tool lets you interact with Application Integration, Integration Connectors or Apigee Integration/Connector APIs. The tool lets you manage (create, del, get, list) integrations, connections etc.
Apache License 2.0
22 stars 16 forks source link

Can't override Trigger #82

Closed carlosmscabral closed 1 year ago

carlosmscabral commented 1 year ago

I have an integration with the following Trigger portion:

    "triggerConfigs": [
        {
            "label": "API Trigger",
            "triggerType": "API",
            "triggerNumber": "1",
            "triggerId": "api_trigger/template-db_API_1",
            "startTasks": [
                {
                    "taskId": "1",
                    "condition": "$operation$ = \"GET\"",
                    "displayName": "LIST"
                },
                {
                    "taskId": "5",
                    "condition": "$operation$ = \"POST\"",
                    "displayName": "INSERT"
                }
            ],
            "properties": {
                "Trigger name": "template-db_API_1"
            }
        }
    ]

I want to be able to specify/change, using the overrides file, the triggerId and the Trigger Name property, but apparently these two items are not in the Trigger struct in the overrides.go file.

I want to be able to specify something like this in my overrides file:

    "trigger_overrides": [{
        "triggerNumber": "1",
        "triggerId": "api_trigger/_DBNAME__API_1",
        "properties": {
            "Trigger name": "_DBNAME__API_1"
        }
    }]
srinandan commented 1 year ago

There are two issues: 1) your overrides are incorrect 2) I wasn't copying properties. Here is the right way to construct the overrides:

{
    "trigger_overrides":[{
        "triggerType": "API",
        "triggerNumber": "1",
        "apiPath": "nandan_API_1",
        "properties": {
            "Trigger name": "nandan_API_1"
        }
    }]
}

NOTE: The difference in the element: apiPath. This was done on purpose to keep it separate from the field in the integration. This field does not include api_trigger/.

I have fixed the issue with properties. I will request @ssvaidyanathan to create a version with this fix.

carlosmscabral commented 1 year ago

ack, thanks. will try it once fixed.