Is there a way to update Target Endpoint using management API call?

Not applicable

Like there is an API to check the policies that are present and also resources that are present

eg : https://api.enterprise.apigee.com/v1/organizations...

So, similarly is there anyway to update the TargetEndpoint details or Policy through management API calls.

0 10 821
10 REPLIES 10

Dear @akshay_anand ,

Did you check Update API Proxy API call ? It helps you update API proxy details.

I don't think there is an API to update policy details or target endpoint details directly. You need to use combination of Export API Proxy API call , Modify Details and use Import API proxy API call.

Cheers,

Anil Sagar

Hi @Anil Sagar

Update will not help me update the TargetEndpoint Url.

Is there a way to update the TargetEndpoint Url and ServiceCallout url through management API?

Thanks

Did you check Create a Policy API call ? Not sure whether it works for Update of existing policy. Worth to give a try..

I have just verified same.. It doesn't work for update.. So , I don't think there exists an API using which you can update policy details. You need to use combination of Export API Proxy API call , Modify Details and use Import API proxy API call.

Thanks @Anil Sagar for the hep , Just wanted to know if there is anyway I can update the Target Endpoint post API deployment , excluding the use of TargetServers.

Actually my requirement is I want to create a proxy.zip and post that I want to deploy in an environment and once I have deployed the bundle I want to change the backend urls for that environemnt.

Again, You need to use combination of Export API Proxy API call , Modify Details and use Import API proxy API call.

adas
New Member

@akshay_anand You could use the following API to do it:

PUT https://mgmtUrl/v1/o/{ord}/apis/{api}/revisions/{id}/targets/{name}


<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<TargetEndpoint name="default">
    <Description></Description>
    <FaultRules/>
    <Flows/>
    <PostFlow name="PostFlow">
        <Request/>
        <Response>
            <Step>
                <FaultRules/>
                <Name>JavaScriptPolicy</Name>
            </Step>
        </Response>
    </PostFlow>
    <PreFlow name="PreFlow">
        <Request/>
        <Response/>
    </PreFlow>
    <HTTPTargetConnection>
        <Properties/>
        <URL>http://myapis.com/v1/data/1k.xml</URL>
    </HTTPTargetConnection>
</TargetEndpoint>

Basically do a GET of the above api first and then modify the target URL and make a PUT call with that request body. Remember, you would need to redeploy the proxy for the changes to take effect.

@arghya das Above API is missing from docs... Is it a docs issue ?

@Anil Sagar Might be. One thing I know is that, the apiproxies UPDATE apis are intentionally not documented because we do not want customers to use UPDATE calls to make changes to the proxy definition because of the lack of transaction management capabilities in C*. For some reason if the update call fails, it would corrupt the bundle in C* and there's no way to recover. So we encourage customers to make the changes in the proxies outside of EDGE and then upload them as new revisions, in the form of zip files. So I would go with that strategy.

@Anil Sagar , Got it... Thank you for details.