How to create a proxy endpoint using management API?

Not applicable

Hi,

I created API proxy following this . Now I need to app a proxy endpoint to this API proxy. I couldn't find any documentation which I can use.

Does Apigee has one such management API?

Thanks,

Uday

Solved Solved
0 4 843
1 ACCEPTED SOLUTION

You can. Here's an example.

curl -i -n -X POST -H content-type:application/json \
   $mgmtserver/v1/o/$ORG/apis/$PROXYNAME/revisions/$REV/proxies -d '...'

The payload needs to be a proxyendpoint definition. Here's a dummy example, to give you an idea:

{
  "connection" : {
    "basePath" : "/unique-basepath-here",
    "connectionType" : "httpConnection",
    "virtualHost" : [ "secure" ]
  },
  "connectionType" : "httpConnection",
  "description" : "description here",
  "faultRules" : [ ],
  "flows" : [ ],
  "name" : "unique-endpoint-name-here",
  "postClientFlow" : {
    "name" : "PostClientFlow",
    "request" : {
      "children" : [ ]
    },
    "response" : {
      "children" : [ ]
    }
  },
  "postFlow" : {
    "name" : "PostFlow",
    "request" : {
      "children" : [ ]
    },
    "response" : {
      "children" : [ ]
    }
  },
  "preFlow" : {
    "name" : "PreFlow",
    "request" : {
      "children" : [ ]
    },
    "response" : {
      "children" : [ {
        "Step" : {
          "name" : "AM-Response"
        }
      } ]
    }
  },
  "routeRule" : [ {
    "empty" : true,
    "name" : "NoRouteRule"
  } ],
  "routeRuleNames" : [ "NoRouteRule" ],
  "type" : "Proxy"
}


View solution in original post

4 REPLIES 4

You can. Here's an example.

curl -i -n -X POST -H content-type:application/json \
   $mgmtserver/v1/o/$ORG/apis/$PROXYNAME/revisions/$REV/proxies -d '...'

The payload needs to be a proxyendpoint definition. Here's a dummy example, to give you an idea:

{
  "connection" : {
    "basePath" : "/unique-basepath-here",
    "connectionType" : "httpConnection",
    "virtualHost" : [ "secure" ]
  },
  "connectionType" : "httpConnection",
  "description" : "description here",
  "faultRules" : [ ],
  "flows" : [ ],
  "name" : "unique-endpoint-name-here",
  "postClientFlow" : {
    "name" : "PostClientFlow",
    "request" : {
      "children" : [ ]
    },
    "response" : {
      "children" : [ ]
    }
  },
  "postFlow" : {
    "name" : "PostFlow",
    "request" : {
      "children" : [ ]
    },
    "response" : {
      "children" : [ ]
    }
  },
  "preFlow" : {
    "name" : "PreFlow",
    "request" : {
      "children" : [ ]
    },
    "response" : {
      "children" : [ {
        "Step" : {
          "name" : "AM-Response"
        }
      } ]
    }
  },
  "routeRule" : [ {
    "empty" : true,
    "name" : "NoRouteRule"
  } ],
  "routeRuleNames" : [ "NoRouteRule" ],
  "type" : "Proxy"
}


could you please direct me to the link where it is documented? Also I was looking for api to create target endpoint which I failed to locate? Thanks for your help 🙂 @Dino-at-Google

I don't know if this is explicitly documented. It's discoverable if you explore the API by doing something like:

curl -X GET $mgmtserver/v1/o/$ORG/apis/$PROXYNAME
curl -X GET $mgmtserver/v1/o/$ORG/apis/$PROXYNAME/revisions
curl -X GET $mgmtserver/v1/o/$ORG/apis/$PROXYNAME/revisions/$REV
curl -X GET $mgmtserver/v1/o/$ORG/apis/$PROXYNAME/revisions/$REV/proxies

...etc.

Thanks @Dino-at-Google 🙂