Adding Two Versions of Same API to Product in APIC

401 Views Asked by At

I am using IBM API Connect v5. We have an API with two different versions, 1.0.0 and 2.0.0. We have both APIs inside a single Product. From APIMgr we are able to stage and deploy the Product to Marketplace. However, when running CLI we get an error like the below:

"\u001b[31mError:\u001b[39m The Plan Default Plan refers to an API team-api:1.0.0 which is not present in the product."

The product yaml looks like the below

product: "1.0.0" info: name: "team-product" title: "Team Product" version: "1.0.0" visibility: view: enabled: true type: "public" tags: [] orgs: [] subscribe: enabled: true type: "authenticated" tags: [] orgs: [] apis: team-api: $ref: "team-api_1.0.0.yaml" team-api_1: $ref: "team-api_2.0.0.yaml" plans: default: title: "Default Plan" description: "Default Plan" approval: false rate-limit: hard-limit: false value: "100/hour"

Does anyone know how to specify the APIs explicitly in the Product yaml file so that when running apic publish from CLI this error does not occur?

1

There are 1 best solutions below

0
On

A Product can have many APIs (but remember, when you deploy a one version the second version will also be deployed! Accordingly, there will be downtime for both versions)

We have APIC v5 and use yaml like this:

product: 1.0.0
info:
  name: test-datapower-product
  title: Test-DataPower product
  version: 1.0.0
visibility:
  view:
    enabled: true
    type: public
    tags: []
    orgs: []
  subscribe:
    enabled: true
    type: authenticated
    tags: []
    orgs: []
apis:
  api-first-version:
    id: 5f04285fe4b0e12ae4d9803f
  api-second-version:
    id: 5fb2b1aee4b0cab276cdafc1
plans:
  default:
    title: Default Plan
    description: Default Plan
    approval: false
    rate-limit:
      hard-limit: true
      value: 100/hour