I am trying to configure some API's through CA-API Gateway.
However the CA product seem to be heavily based on UI interaction JSP. I have seen that they also provide REST interface.
Has anyone set up a complete API using something else than the JAVA based UI?
Ideally I would like to have my complete configurations as code.
The REST api for the API Gateway seems to provide a lot of get and post functionality, but I have not been able to get it working:
Executing a get template towards my CA APIGW instance (https://localhost:9443/restman/1.0/services/template) yields:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<l7:Item xmlns:l7="http://ns.l7tech.com/2010/04/gateway-management">
<l7:Name>SERVICE Template</l7:Name>
<l7:Type>SERVICE</l7:Type>
<l7:TimeStamp>2017-06-13T07:30:22.487Z</l7:TimeStamp>
<l7:Link rel="self" uri="https://d7a66e5db02e:9443/restman/1.0/services/template"/>
<l7:Link rel="list" uri="https://d7a66e5db02e:9443/restman/1.0/services"/>
<l7:Resource>
<l7:Service>
<l7:ServiceDetail folderId="FolderID">
<l7:Name>My New Service</l7:Name>
<l7:Enabled>false</l7:Enabled>
</l7:ServiceDetail>
<l7:Resources>
<l7:ResourceSet tag="policy">
<l7:Resource type="policy">Policy XML</l7:Resource>
</l7:ResourceSet>
</l7:Resources>
</l7:Service>
</l7:Resource>
</l7:Item>
From reading the template I expect to be able to create a new published service using post and the following body:
<l7:Service>
<l7:ServiceDetail folderId="0000000000000000ffffffffffffec76">
<l7:Name>MyNewService</l7:Name>
<l7:Enabled>false</l7:Enabled>
</l7:ServiceDetail>
<l7:Resources>
<l7:ResourceSet tag="policy">
<l7:Resource type="policy">Policy XML</l7:Resource>
</l7:ResourceSet>
</l7:Resources>
</l7:Service>
The POST to https://localhost:9443/restman/1.0/services however yields:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>400 Bad Request</title>
</head>
<body>
<h1>Bad Request</h1>
<h3>The request sent by the client was syntactically incorrect.</h3>
</body>
</html>
And there is no apparent way for me to debug what actually fails. I would expect to be able to trace the error in a log somewhere but can not find any documentation or examples of this.
The following worked for me:
If you'd like to oupdate an existing service:
If the version does not match, the update will fail.