设置门户的网址

Apigee 为您提供了 Apigee Developer Services 门户(简称门户),您可以使用该门户构建和发布自己的自定义网站,为您的开发社区提供所有这些服务。边缘客户可以在云端或本地创建自己的开发者门户。如需了解详情,请参阅什么是开发者门户?

Edge 界面在发布 > 开发者页面上显示 DevPortal 按钮,点击该按钮会打开与组织关联的门户。默认情况下,该按钮会打开以下网址:

http://live-orgname.devportal.apigee.com

其中 orgname 是组织的名称,

您可以将此网址设置为其他网址(例如,如果您的门户具有 DNS 记录),也可以完全停用该按钮。请使用组织的以下属性来控制该按钮:

  • features.devportalDisabled:设置为 false(默认值)可启用该按钮,设置为 true 可停用该按钮。
  • features.devportalUrl:设置为开发者门户的网址。

您可以分别为每个组织设置这些属性。如需设置这些属性,请先使用以下 API 调用来确定组织的当前属性设置:

curl -H "Content-Type:application/json" -u adminEmail:pword -X GET \
  http://ms_IP:8080/v1/organizations/orgname

此调用会返回一个对象,以采用以下格式来描述组织:

{
  "createdAt" : 1428676711119,
  "createdBy" : "me@my.com",
  "displayName" : "orgname",
  "environments" : [ "prod" ],
  "lastModifiedAt" : 1428692717222,
  "lastModifiedBy" : "me@my.com",
  "name" : "organme",
  "properties" : {
    "property" : [ {
      "name" : "foo",
      "value" : "bar"
    } ]
  },
  "type" : "paid"
}

记下对象的 properties 区域中的所有现有属性。为组织设置属性时,属性中的值会覆盖任何当前属性。因此,如果要在组织中设置 features.devportalDisabledfeatures.devportalUrl,请确保在设置时复制所有现有属性。

使用以下 PUT 调用来设置组织的属性:

curl -H "Content-Type:application/json" -u adminEmail:pword -X PUT \
  http://ms_IP:8080/v1/organizations/orgname \
  -d '{
    "displayName" : "orgname",
    "name" : "orgname",
    "properties" : {
      "property" : [
        {
          "name" : "foo",
          "value" : "bar"
        },
        {
          "name": "features.devportalUrl",
          "value": "http://dev-orgname.devportal.apigee.com/"
        },
        {
          "name": "features.devportalDisabled",
          "value": "false"
        }
      ]
    }
  }'

在 PUT 调用中,您只需指定 displayNamenameproperties。请注意,此调用包含最初在组织中设置的“foo”属性。