AMPLIFY Central - Promote API to Unified Catalog
AMPLIFY Central collection to promote an APIs to AMPLIFY Central Unified Catalog.
For authentication, the APIS require OAuth2 implicit: https://learning.postman.com/docs/postman/sending-api-requests/authorization/#implicit
To authenticate use:
- Grant Type:
Implicit
- Auth URL:
https://login.axway.com/auth/realms/Broker/protocol/openid-connect/auth?idpHint=360
To run the collection make sure your Axway Platform tenant id is set as a Postman Environment variable named "org_id".
All the resources in this collection are created in AMPLIFY API Server.
API Server oas3 specification can be downloaded from: https://apicentral.axway.com/apis/docs
API Server resource types
API Server supports two types of resources: Unscoped and Scoped.
Unscoped resources
Are top level resources that can group a set of other resources. The endpoints for Unscoped resources are defined as:
Scoped resources
Can only be created, updated and deleted by specifying the scope in their path.
References between resources
A resource can reference another one by name in their spec. The fields the contain a reference are annotated in the oas3 spec with x-amplify-kind-ref
.
There are two types of references:
- hard
- soft
When a spec field has a hard reference to another resource, that means that when the referenced resource is removed, the current resource that has the reference will also be removed. Example, when an APIService gets removed, its APIServiceRevision gets removed as well.
When a spec field has a soft reference to another resource, it will not get removed when the referenced resource is removed, but its reference will get nulled out.
For soft references, the API Server oas3 spec will have an additional annotation: x-amplify-kind-ref-type: "soft"
.
Example, when a Webhook resource gets removed, the reference from ConsumerSubscriptionDefinition resources get nulled out.
For both types of resources, if they live under an unscoped resource, then when the unscoped resource gets removed, all the resources in its scope are removed. Example, when an Environment is removed, APIService, APIServiceRevision, etc. are cleaned asynchronously.
Promoting an API Service to Unified Catalog
Promoting the API Service is done through creating a ConsumerInstance resource. AMPLIFY Central will asynchronously gather information from the created API Service, API Service Revision and API Service Instance to create an entry in AMPLIFY Unified Catalog.
AMPLIFY Unified Catalog currently has support of the following definition types and subtypes:
In API Server, the resource representing a Catalog Item in AMPLIFY Unified Catalog is a ConsumerInstance. The ConsumerInstance has an optional reference to an APIServiceInstance, while the APIServiceInstance is linked to an APIServiceRevision.
Mapping between API Server resources and Unified Catalog resource types:
If a ConsumerInstance has a reference to an APIServiceInstance, then the type in Unified Catalog will be API. If a ConsumerInstance does not reference an APIServiceInstance, then the type is CUSTOM, subtype unstructured.
Configure Unified Catalog to send events on subscription updates
Wehbhook invocations on subscription updates in Unified Catalog is possible by creating a Webhook resource, linking it to a ConsumerSubscriptionDefinition and having the ConsumerSubscriptionDefinition references in the ConsumerInstance resource.