Team , we are trying to create an api template which can be used to create/register a new api in apihub using apigeex CICD automation. we have one api in apihub which is updated manually with all the info & need to export using registy tool so that it can be used to build the template. can someone provide insights how it could be acheived?
Thanks!!
Raghu
Hey @raghunathapalle,
Are you looking to build a template based on the manual creation of the API or are you looking for the data contract for invocation? The following should be of assistance:
Thanks!
Matt
1 Like
Some API hints
# ====================================================================
# list of APIs registered in the hub.
#
# paged output
#
GET :hub/v1/projects/:proj/locations/:loc/apis
Authorization: Bearer :mytoken
# ====================================================================
# get the version of ONE API registered in the hub.
#
:api = dc1dee4e-286c-45d4-9ca8-6d2b9c034005
:version = a663bd76-694e-4b1f-a9c0-d15744944f42
GET :hub/v1/projects/:proj/locations/:loc/apis/:api/versions/:version
Authorization: Bearer :mytoken
# ====================================================================
# get the metadata about a spec for ONE API registered in the hub.
#
:api = dc1dee4e-286c-45d4-9ca8-6d2b9c034005
:version = a663bd76-694e-4b1f-a9c0-d15744944f42
:spec = 89131793-ce49-43f7-bf69-f84f140712c9
GET :hub/v1/projects/:proj/locations/:loc/apis/:api/versions/:version/specs/:spec
Authorization: Bearer :mytoken
# ====================================================================
# get the contents for a spec for ONE API registered in the hub.
#
:api = dc1dee4e-286c-45d4-9ca8-6d2b9c034005
:version = a663bd76-694e-4b1f-a9c0-d15744944f42
:spec = 89131793-ce49-43f7-bf69-f84f140712c9
GET :hub/v1/projects/:proj/locations/:loc/apis/:api/versions/:version/specs/:spec:contents
Authorization: Bearer :mytoken
# jq -r '.contents' | base64 --decode