简体   繁体   English

在 APIC 中将相同 API 的两个版本添加到产品中

[英]Adding Two Versions of Same API to Product in APIC

I am using IBM API Connect v5.我正在使用 IBM API Connect v5。 We have an API with two different versions, 1.0.0 and 2.0.0.我们有一个 API 有两个不同的版本,1.0.0 和 2.0.0。 We have both APIs inside a single Product.我们在一个产品中同时拥有这两个 API。 From APIMgr we are able to stage and deploy the Product to Marketplace.通过 APIMgr,我们能够将产品暂存并部署到市场。 However, when running CLI we get an error like the below:但是,在运行 CLI 时,我们会收到如下错误:

" [31mError: [39m The Plan Default Plan refers to an API team-api:1.0.0 which is not present in the product." “ [31mError: [39m 计划默认计划指的是产品中不存在的 API team-api:1.0.0。”

The product yaml looks like the below产品 yaml 如下所示

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"产品:“1.0.0”信息:名称:“团队产品”标题:“团队产品”版本:“1.0.0”可见性:视图:启用:真实类型:“公共”标签:[]组织:[]订阅:启用:真实类型:“已验证”标签:[] orgs:[] api:team-api:$ref:“team-api_1.0.0.yaml” team-api_1:$ref:“team-api_2.0.0.yaml “计划:默认:标题:“默认计划”描述:“默认计划”批准:错误速率限制:硬限制:错误值:“100 /小时”

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?有谁知道如何在产品 yaml 文件中明确指定 API,以便在从 CLI 运行 apic publish 时不会发生此错误?

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)一个产品可以有很多 API(但请记住,当你部署一个版本时,第二个版本也会被部署,因此,两个版本都会有停机时间)

We have APIC v5 and use yaml like this:我们有 APIC v5 并像这样使用 yaml:

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM