简体   繁体   English

Apigee Edge服务器API中API产品的唯一ID是什么?

[英]What is the unique ID for API Products in the Apigee Edge server API?

I am using the REST API for the Apigee Edge server, and am getting the details of the API products for my organization: https://api.enterprise.apigee.com/v1/organizations/chrisnovak/apiproducts/PremiumWeatherAPI 我正在为Apigee Edge服务器使用REST API,并且正在为我的组织获取API产品的详细信息: https ://api.enterprise.apigee.com/v1/organizations/chrisnovak/apiproducts/PremiumWeatherAPI

Here is the response: 以下是回复:

{
  "apiResources" : [ ],
  "approvalType" : "auto",
  "attributes" : [ {
    "name" : "description",
    "value" : "Premium API Product to expose the weather API to developers"
  }, {
    "name" : "access",
    "value" : "public"
  }, {
    "name" : "developer.quota.limit",
    "value" : "10000"
  }, {
    "name" : "developer.quota.interval",
    "value" : "1"
  }, {
    "name" : "developer.quota.timeunit",
    "value" : "month"
  } ],
  "createdAt" : 1351796304109,
  "createdBy" : "noreply_admin@apigee.com",
  "description" : "",
  "displayName" : "Weather API",
  "environments" : [ "test", "prod" ],
  "lastModifiedAt" : 1386812022110,
  "lastModifiedBy" : "cnovak@apigee.com",
  "name" : "PremiumWeatherAPI",
  "proxies" : [ "weather" ],
  "quota" : "10000",
  "quotaInterval" : "1",
  "quotaTimeUnit" : "month",
  "scopes" : [ "READ" ]
}

However, I do not see a unique key in the response, and do not see any Apigee API reference documentation for API products around what the unique key is. 但是,我没有在响应中看到唯一的键,并且没有看到有关唯一键的API产品的任何Apigee API参考文档

My questions are: 我的问题是:

  1. What is the unique ID for the API products in the system? 系统中API产品的唯一ID是什么?
  2. If there is not a unique ID, what happens if the API product is renamed? 如果没有唯一ID,那么重命名API产品会发生什么? I need to be able to associate API products with documentation in an external system, and if the name changes, I will no longer be able to associate that documentation with that API product. 我需要能够将API产品与外部系统中的文档相关联,如果名称发生变化,我将无法再将该文档与该API产品相关联。

Chris, 克里斯,

The unique ID is the name field. 唯一ID是名称字段。 It is generated from the display name the first time you save the product. 它是在您第一次保存产品时从显示名称生成的。 That never changes. 这永远不会改变。 Any later changes to the name change the displayName field but not the name. 对名称的任何后续更改都会更改displayName字段,但不会更改名称。

The 'Name' field is the unique field here. “名称”字段是此处的唯一字段。 if you change the display name it will not affect the name field, so you can go ahead and use the name field in your documentation. 如果更改显示名称,则不会影响名称字段,因此您可以继续使用文档中的名称字段。

Name field is unique here. 名称字段在这里是唯一的。

You can test it by changing the name field and doing a POST for apiproducts. 您可以通过更改名称字段并为apiproducts执行POST来测试它。 It will create an apiproduct with the same display name but different name field. 它将创建一个具有相同显示名称但名称字段不同的apiproduct。

Then if you are using the same name field and editing just display name and trying to POST for apiproducts it will give error as below: 然后,如果您使用相同的名称字段并仅编辑显示名称并尝试POST for apiproducts,则会出现如下错误:

-bash-4.1$ POST /o/weatherapi/apiproducts -H "Accept: text/xml" -H "Content-Type: text/xml" -d @st.xml Test keymanagement.service.apiproduct_already_exists ApiProduct with name yahoo1 already exists -bash-4.1$ -bash-4.1 $ POST / o / weatherapi / apiproducts -H“Accept:text / xml”-H“Content-Type:text / xml”-d @st.xml Test keymanagement.service.apiproduct_already_exists名称为yahoo1的ApiProduct已经存在-bash-4.1 $

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

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