APIM 4.0.0 服务目录列表错误
Error on APIM 4.0.0 service catalog listing
我在 Kubernetes 上部署了 APIM 4.0.0。然后,我尝试将 Integration Studio 与 APIM 结合使用。然后,我将这些行添加到 Integration Studio 中的嵌入式 deployment.toml 文件中。
[[service_catalog]]
apim_host = "https://xxx.xxx"
enable = true
username = "admin"
password = "admin"
单击导出项目工件和 运行 后,emdedded MI 记录了一条成功消息。
“已成功更新服务目录”。
现在;当我尝试访问 APIM 发布者门户中的服务目录时,我在浏览器上收到此错误:
OOPS
Something went wrong
API Listing
Failed to construct 'URL': Invalid URL
TypeError: Failed to construct 'URL': Invalid URL
at https://xxx.xxx/publisher/site/public/dist/ProtectedApps.8633bb016fecd98c9d94.bundle.js:1:6884
at x (https://xxx.xxx/publisher/site/public/dist/ProtectedApps.8633bb016fecd98c9d94.bundle.js:1:7011)
at $i (https://xxx.xxx/publisher/site/public/dist/index.7422e2feefc0de743eb6.bundle.js:81:57930)
at vu (https://xxx.xxx/publisher/site/public/dist/index.7422e2feefc0de743eb6.bundle.js:81:104169)
at lc (https://xxx.xxx/publisher/site/public/dist/index.7422e2feefc0de743eb6.bundle.js:81:96717)
at uc (https://xxx.xxx/publisher/site/public/dist/index.7422e2feefc0de743eb6.bundle.js:81:96642)
at Zu (https://xxx.xxx/publisher/site/public/dist/index.7422e2feefc0de743eb6.bundle.js:81:93672)
at https://xxx.xxx/publisher/site/public/dist/index.7422e2feefc0de743eb6.bundle.js:81:45314
at t.unstable_runWithPriority (https://xxx.xxx/publisher/site/public/dist/index.7422e2feefc0de743eb6.bundle.js:102:3844)
at Ho (https://xxx.xxx/publisher/site/public/dist/index.7422e2feefc0de743eb6.bundle.js:81:45023)
in x
in div
in ForwardRef
in ForwardRef
in div
in ForwardRef
in ForwardRef
in div
in ForwardRef
in a
in ForwardRef
in ForwardRef
in ForwardRef
in ForwardRef
in ForwardRef
in ForwardRef
in div
in ForwardRef
in ForwardRef
in w
in div
in ForwardRef
in ForwardRef
in div
in ForwardRef
in ForwardRef
in _
in div
in ForwardRef
in ForwardRef
in div
in ForwardRef
in div
in ForwardRef
in ForwardRef
in div
in ForwardRef
in b
in t
in t
in u
in t
in t
in div
in main
in div
in E
in AppErrorBoundary
in ForwardRef
in Unknown
in Unknown
in Protected
in Suspense
in t
in t
in t
in t
in PublisherRootErrorBoundary
in IntlProvider
in Publisher
- 我该如何解决这个问题?
- 如何从服务目录中删除服务?
- 我是否需要为 MI 单独部署才能在 APIM 中进行集成,或者 APIM 是否可以以某种方式 运行 集成本身。我在这里感到困惑,因为 EI 下载页面指出 APIM 包含 EI 的功能。不过,https://apim.docs.wso2.com/en/latest/get-started/integration-quick-start-guide/ MI好像要单独安装。
由于 UI 中的列表页面存在问题,您可以使用 REST API 将服务从服务目录中删除。
- 通过调用
GET /services
REST API. 检索所有服务,获取服务的 UUID
curl -k -H "Authorization: Bearer <access-token>" "https://wso2.apim.com/api/am/service-catalog/v0/services"
- 通过调用
DELETE /services/{serviceId}
REST API 删除服务。
curl -k -X DELETE -H "Authorization: Bearer <access-token>" "https://wso2.apim.com/api/am/service-catalog/v0/services/{serviceUUID}"
[更新]
请参考以下步骤创建令牌以访问服务目录 REST APIs:
- 通过以下 API 调用注册 OAuth 客户端:
curl --location --request POST 'https://localhost:9443/client-registration/v0.17/register' \
--header 'Authorization: Basic base64Encode(username:password)' \
--header 'Content-Type: application/json' \
--data-raw '{
"callbackUrl":"www.google.lk",
"clientName":"rest_api_service_catalog",
"owner":"admin",
"grantType":"client_credentials password refresh_token",
"saasApp":true
}'
它将 return clientId
和 clientSecret
生成的 OAuth 应用程序。
- 获取具有所需范围的令牌:
您需要获得范围为 service_catalog:service_view
的令牌才能检索所有服务,并且需要范围为 service_catalog:service_write
的令牌才能删除服务。因此,您可以请求具有以下两个范围的令牌:
curl https://localhost:9443/oauth2/token -k \
-H "Authorization: Basic base64Encode(clientId:clientSercret)" \
-d "grant_type=password&username=<username>&password=<password>&scope=service_catalog:service_view service_catalog:service_write"
您可以在此 doc.
中找到有关服务目录 REST API 和令牌生成的更多信息
请注意,我将 wso2.apim.com
称为 APIM 节点的主机名。在默认配置下,它将是 https://localhost:9443
.
我在 Kubernetes 上部署了 APIM 4.0.0。然后,我尝试将 Integration Studio 与 APIM 结合使用。然后,我将这些行添加到 Integration Studio 中的嵌入式 deployment.toml 文件中。
[[service_catalog]]
apim_host = "https://xxx.xxx"
enable = true
username = "admin"
password = "admin"
单击导出项目工件和 运行 后,emdedded MI 记录了一条成功消息。
“已成功更新服务目录”。
现在;当我尝试访问 APIM 发布者门户中的服务目录时,我在浏览器上收到此错误:
OOPS
Something went wrong
API Listing
Failed to construct 'URL': Invalid URL
TypeError: Failed to construct 'URL': Invalid URL
at https://xxx.xxx/publisher/site/public/dist/ProtectedApps.8633bb016fecd98c9d94.bundle.js:1:6884
at x (https://xxx.xxx/publisher/site/public/dist/ProtectedApps.8633bb016fecd98c9d94.bundle.js:1:7011)
at $i (https://xxx.xxx/publisher/site/public/dist/index.7422e2feefc0de743eb6.bundle.js:81:57930)
at vu (https://xxx.xxx/publisher/site/public/dist/index.7422e2feefc0de743eb6.bundle.js:81:104169)
at lc (https://xxx.xxx/publisher/site/public/dist/index.7422e2feefc0de743eb6.bundle.js:81:96717)
at uc (https://xxx.xxx/publisher/site/public/dist/index.7422e2feefc0de743eb6.bundle.js:81:96642)
at Zu (https://xxx.xxx/publisher/site/public/dist/index.7422e2feefc0de743eb6.bundle.js:81:93672)
at https://xxx.xxx/publisher/site/public/dist/index.7422e2feefc0de743eb6.bundle.js:81:45314
at t.unstable_runWithPriority (https://xxx.xxx/publisher/site/public/dist/index.7422e2feefc0de743eb6.bundle.js:102:3844)
at Ho (https://xxx.xxx/publisher/site/public/dist/index.7422e2feefc0de743eb6.bundle.js:81:45023)
in x
in div
in ForwardRef
in ForwardRef
in div
in ForwardRef
in ForwardRef
in div
in ForwardRef
in a
in ForwardRef
in ForwardRef
in ForwardRef
in ForwardRef
in ForwardRef
in ForwardRef
in div
in ForwardRef
in ForwardRef
in w
in div
in ForwardRef
in ForwardRef
in div
in ForwardRef
in ForwardRef
in _
in div
in ForwardRef
in ForwardRef
in div
in ForwardRef
in div
in ForwardRef
in ForwardRef
in div
in ForwardRef
in b
in t
in t
in u
in t
in t
in div
in main
in div
in E
in AppErrorBoundary
in ForwardRef
in Unknown
in Unknown
in Protected
in Suspense
in t
in t
in t
in t
in PublisherRootErrorBoundary
in IntlProvider
in Publisher
- 我该如何解决这个问题?
- 如何从服务目录中删除服务?
- 我是否需要为 MI 单独部署才能在 APIM 中进行集成,或者 APIM 是否可以以某种方式 运行 集成本身。我在这里感到困惑,因为 EI 下载页面指出 APIM 包含 EI 的功能。不过,https://apim.docs.wso2.com/en/latest/get-started/integration-quick-start-guide/ MI好像要单独安装。
由于 UI 中的列表页面存在问题,您可以使用 REST API 将服务从服务目录中删除。
- 通过调用
GET /services
REST API. 检索所有服务,获取服务的 UUID
curl -k -H "Authorization: Bearer <access-token>" "https://wso2.apim.com/api/am/service-catalog/v0/services"
- 通过调用
DELETE /services/{serviceId}
REST API 删除服务。
curl -k -X DELETE -H "Authorization: Bearer <access-token>" "https://wso2.apim.com/api/am/service-catalog/v0/services/{serviceUUID}"
[更新]
请参考以下步骤创建令牌以访问服务目录 REST APIs:
- 通过以下 API 调用注册 OAuth 客户端:
curl --location --request POST 'https://localhost:9443/client-registration/v0.17/register' \
--header 'Authorization: Basic base64Encode(username:password)' \
--header 'Content-Type: application/json' \
--data-raw '{
"callbackUrl":"www.google.lk",
"clientName":"rest_api_service_catalog",
"owner":"admin",
"grantType":"client_credentials password refresh_token",
"saasApp":true
}'
它将 return clientId
和 clientSecret
生成的 OAuth 应用程序。
- 获取具有所需范围的令牌:
您需要获得范围为 service_catalog:service_view
的令牌才能检索所有服务,并且需要范围为 service_catalog:service_write
的令牌才能删除服务。因此,您可以请求具有以下两个范围的令牌:
curl https://localhost:9443/oauth2/token -k \
-H "Authorization: Basic base64Encode(clientId:clientSercret)" \
-d "grant_type=password&username=<username>&password=<password>&scope=service_catalog:service_view service_catalog:service_write"
您可以在此 doc.
中找到有关服务目录 REST API 和令牌生成的更多信息请注意,我将 wso2.apim.com
称为 APIM 节点的主机名。在默认配置下,它将是 https://localhost:9443
.