我在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"
单击导出项目工件并运行后,emdeddedMI记录了一条成功消息。
"成功地更新了服务目录";。
现在;当我试图访问APIM Publisher Portal中的服务目录时,我在浏览器上收到了以下错误:
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中的列表页面存在问题,因此可以使用RESTAPI从服务目录中删除服务。
- 通过调用
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 API:
- 通过进行以下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
}'
它将返回生成的OAuth应用程序的clientId
和clientSecret
。
- 获取具有所需作用域的令牌:
您需要获得具有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"
您可以在本文档中找到有关服务目录RESTAPI和令牌生成的更多信息。
请注意,我将wso2.apim.com
称为APIM节点的主机名。在默认配置下,它将是https://localhost:9443
。