Skip to main content

Version: 3.2.3.x

Add Service from API Definition

Once API development and deployment are complete, publish to API7 Enterprise Edition to leverage its capabilities.

Prerequisites

  1. Obtain a User Account with Super Admin or API Provider Role.
  2. Complete Plan Your API Definition.
  3. One OpenAPI specification corresponds to one service. This means all paths in the spec share the same upstream.
  4. Complete Deploy Your Upstreams on Server Nodes. If a real API backend is not deployed yet, use a mock server instead, complete Mock API Response for Testing.
  5. Learn key concept Services.

Import OpenAPI Specification to Add Service(Recommended)

At this time, OpenAPI 3.0 is the only supported version.

  1. Select Services , then click Add Service.
  2. Choose Upload OpenAPI 3.0 Spec.
  3. Upload YAML/JSON file, then click Next.

Add Service Step1 Import

  1. Confirm the following information:
    • service name(Title field in OpenAPI Specification)
    • description(Description field in OpenAPI Specification)
    • labels(Tags field in OpenAPI Specification)
    • routes(Paths field in OpenAPI Spec).

Host and path prefix configuration are not needed in this tutorial. Click Next.

Add Service Step2 Import

  1. Choose HTTPS as the Upstream Scheme.
  2. Enter one upstream endpoint URL(If using a load balancer for your upstream servers, set its address as the Upstream URL) or use the mock server address as the Upstream URL. You can add more nodes later.
  3. Click Add.

Add Service Step Import

  1. The default status of the service is disabled. Select Actions > Enable to make all routes of the service accessible.

Enable Service

Validate

curl "http://127.0.0.1:9080/pet/1"

You can see the response from upstream:

{
"name": "Dog",
"photoUrls": [
"https://example.com/dog-1.jpg",
"https://example.com/dog-2.jpg"
],
"id": 1,
"category": {
"id": 1,
"name": "pets"
},
"tags": [
{
"id": 1,
"name": "friendly"
},
{
"id": 2,
"name": "smart"
}
],
"status": "available"
}

API7.ai Logo

API Management for Modern Architectures with Edge, API Gateway, Kubernetes, and Service Mesh.

Product

API7 Cloud

SOC2 Type IIISO 27001HIPAAGDPRRed Herring

Copyright © APISEVEN PTE. LTD 2019 – 2025. Apache, Apache APISIX, APISIX, and associated open source project names are trademarks of the

Apache Software Foundation