Search kind of PolicyAction into specific Policy

What product/components do you use and which version/fix level are you on?

API Gateway 10.11 ; last fixed at

Is your question related to the free trial, or to a production (customer) instance?

It’s a production instance

What are you trying to achieve? Please describe it in detail.

For automation using Gitlab Pipeline, executing a Shell Script, I want to add CORS configuration to the API created by this script.

Script already create API to the APIM, I need to upgrade the Script to add CORS configuration to the Response Processing policy.

Do you get any error messages? Please provide a full error message screenshot and log file.

A don’t have any issue, but, because your API endpoint reset configuration, I can’t just use the API to add this PolicyAction ; I notice :

  1. I need first to retrieve the API Policies configuration
  2. Merge the response with the new policyAction to add ; before POST the policy update

But before to do that, I need to ensure, there is not already a CORS policyAction to the Policy of the API.
So I need to search all kind of CORS PolicyAction into a specific API Policy.

How can I write the request of the /search endpoint to get CORS PolicyAction of a specific Policy GUID.

UrlPath : [GET] /search
Example to complete/correct :

{
    "types": [
        "policy_action"
    ],
    "scope": [
        {
            "attributeName": "policy.id",
            "keyword": "123-456-789-012"
        },
        {
            "attributeName": "policy_action.templateKey",
            "keyword": "cors"
        }
    ],
    "responseFields": [
        "policy_action.id",
        "policy_action.name"
    ],
    "from": 0,
    "size": -1
}

Hi,
You can get all the CORS policies by using the below request in /search API.

{
    "types": [
        "policy_action"
    ],
    "scope": [
        {
            "attributeName": "templateKey",
            "keyword": "cors"
        }
    ],
    "responseFields": [
        "*"
    ]
}

Hope this helps!!

Regards.

Thanks, but I need to link the policies to there API ; so either :

  • We find the way to get all CORS policies for a specific API using it’s api.id
  • We find the way to update your solution and add to the response, the api.id field