The following defines the v1 interface for managing APIs and Tenants. These endpoints are exposed on port 9000.
Create a new API. Note that you should first create a tenant and obtain its tenantId
.
body:
{ "name": *(string), "basePath": *(string), "tenantId": *(string), "resources": { "<path>": { "cors":{ "origin": *(string), "methods": *(string) }, "operations": { "<method>": { "backendMethod": *(string), "backendUrl": *(string), "policies": [ { "type": *(string), "value": {} }, ... ], "security": [ {...} ] }, ... } } } }
See below for details on how to implement different policies and security:
returns:
{ "id": (string), "name": (string), "basePath": (string), "tenantId": (string), "resources": { ... } }
Update attributes for a given API.
body:
{ "name": *(string), "basePath": *(string), "tenantId": *(string), "resources": { "<path>": { "cors": { "origin": *(string), "methods": *(string) }, "operations": { "<method>": { "backendMethod": *(string), "backendUrl": *(string), "policies": [ { "type": *(string), "value": {} }, ... ], "security": [ {...} ] }, ... } } } }
returns:
{ "id": (string), "name": (string), "basePath": (string), "tenantId": (string), "resources": { ... } }
Find all instances of APIs added to the gateway.
returns:
[ { "id": (string), "name": (string), "basePath": (string), "tenantId": (string), "resources": { ... } } ]
Find an API by its id.
returns:
{ "id": (string), "name": (string), "basePath": (string), "tenantId": (string), "resources": { ... } }
Find the tenant associated with this API.
returns:
{ "id": (string), "namespace" (string), "instance" (string) }
Delete the API
returns:
{}
Create a new tenant.
body:
{ "namespace": *(string), "instance": *(string) }
returns:
{ "id": (string), "namespace" (string), "instance" (string) }
Update attributes for a given tenant.
body:
{ "namespace": *(string), "instance": *(string) }
returns:
{ "id": (string), "namespace" (string), "instance" (string) }
Find all instances of tenants added to the gateway.
returns:
[ { "id": (string), "namespace" (string), "instance" (string) } ]
Find a tenant by its id.
returns:
{ "id": (string), "namespace" (string), "instance" (string) }
Delete the tenant.
returns:
{}
Get all APIs for the given tenant.
returns:
[ { "id": (string), "name": (string), "basePath": (string), "tenantId": (string), "resources": { ... } } ]
Add/update an api key for the specified tenant, resource, or api.
body:
{ "key": *(string) The api key to store to redis. "scope": *(string) The scope to use the api key. "tenant", "resource", or "api". "tenantId": *(string) Tenant guid. "resource": (string) Resource path. Required if scope is "resource". "apiId": (string) API Guid. Required if scope is "API". }
Returns:
Subscription created.
Delete an api key associated with the specified tenant, resource or api.
body:
{ "key": *(string) The api key to delete. "scope": *(string) The scope to use the api key. "tenant", "resource", or "api". "tenantId": *(string) Tenant guid. "resource": (string) Resource path. Required if scope is "resource". "apiId": (string) API Guid. Required if scope is "API". }
Returns:
Subscription deleted.