[Apiman-user] REST Sample

Arun Gupta arun.gupta at gmail.com
Tue Jul 21 22:19:44 EDT 2015


POST on http://localhost:8080/apiman/organizations/{organizationId}/services/{serviceId}/versions
takes only:

{
version:string
cloneVersion:string
clone:boolean
}

and returns all the information about the created endpoint, including
all the information that needs to be set later by calling PUT on
http://localhost:8080/apiman/organizations/{organizationId}/services/{serviceId}/versions/{versionId}.

Was there discussion about taking in the relevant information as part
of original POST request?

Also, optional JSON parts are not indicated in the payload. How can
that be done?

Can an appropriate syntax highlighter be used?

Arun

On Tue, Jul 21, 2015 at 6:11 PM, Eric Wittmann <eric.wittmann at redhat.com> wrote:
> It depends on a number of variables.  But basically for each service you
> want to create you'll need at least:
>
> 1) create the service
> 2) create version of the service
> 3) update version with the desired settings (endpoint info, plans, etc)
> 4) publish version (pushes it to the gateway)
>
> That would be for a public service with no policies.
>
> If you want to configure it with policies, then there are extra calls for
> that.  If you wanted to add a service definition (swagger) then there's a
> separate call for that.  Etc.
>
> You'll of course need an organization to hold the services.  You also need
> to create and lock plans if you intend to use multiple plans.  If you use
> plans (vs. public services) you'll need to create applications and then
> contracts between the apps and the service(s).  :)
>
> -Eric
>
> On 7/21/2015 5:06 PM, Arun Gupta wrote:
>>
>> This is helpful!
>>
>> What is the minimum number of calls required for registering endpoints
>> for a few services?
>>
>> Arun
>>
>> On Tue, Jul 21, 2015 at 7:11 AM, Eric Wittmann <eric.wittmann at redhat.com>
>> wrote:
>>>
>>> There is a test plan in apiman that does all of this.  It can be found
>>> here:
>>>
>>>
>>> https://github.com/apiman/apiman/blob/master/test/suite/src/main/resources/scripts/api-manager-testPlan.xml
>>>
>>> Each of the tests in the XML file is executed in order, starting with
>>> this
>>> one:
>>>
>>>
>>> https://github.com/apiman/apiman/blob/master/test/suite/src/main/resources/data/orgs/001_create-test.resttest
>>>
>>> The format of each *.resttest file is:
>>>
>>> VERB /path/to/API/resource user/pass
>>> Request-Header-1: value
>>> Request-Header-2: value
>>>
>>> {
>>>    "json" : "payload"
>>> }
>>> ----
>>> expectedResponseCode
>>> Expected-Response-Header-1: value
>>> Expected-Response-Header-2: value
>>>
>>> {
>>>    "expected-json" : "response-payload"
>>> }
>>>
>>> So basically you would be interested only in what is above the "----"
>>> separator.
>>>
>>> You are right - we should write a blog post or document a hello world
>>> use-case.
>>>
>>> -Eric
>>>
>>>
>>> On 7/20/2015 7:11 PM, Arun Gupta wrote:
>>>>
>>>>
>>>> Is there a sample that shows the complete creation/order of
>>>> organization, services, endpoints, etc using the REST API?
>>>>
>>>> The documents at [1] are helpful but a Hello World sample would be
>>>> very useful. I started creating a sample at [2].
>>>>
>>>> [1] http://www.apiman.io/latest/api-manager-restdocs.html
>>>> [2]
>>>>
>>>> https://github.com/arun-gupta/microservices/blob/master/microservice/docker/Dockerfile
>>>>
>>>> Cheers,
>>>> Arun
>>>>
>>>
>>
>>
>>
>



-- 
http://blog.arungupta.me
http://twitter.com/arungupta


More information about the Apiman-user mailing list