我在Kubernetes上部署了APIM 4.0.0。然后,我尝试在APIM中使用Integration。然后,我将这些行添加到Integration中的嵌入式deployment.toml文件中。
[[service_catalog]]
apim_host = "https://xxx.xxx"
enable = true
username = "admin"
password = "admin"
单击导出项目工件并运行后,emdedded将记录一条成功消息。
“成功更新服务目录”。
现在,当我试图访问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
发布于 2021-12-02 15:36:40
由于UI中的列表页存在问题,所以可以使用REST从中删除服务。
GET /services
REST来获取服务的UUID。curl -k -H "Authorization: Bearer <access-token>" "https://wso2.apim.com/api/am/service-catalog/v0/services"
DELETE /services/{serviceId}
REST来删除服务。curl -k -X DELETE -H "Authorization: Bearer <access-token>" "https://wso2.apim.com/api/am/service-catalog/v0/services/{serviceUUID}"
更新
请参考下面的步骤来创建访问服务目录REST的令牌:
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
}'
它将返回生成的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"
您可以在此文档中找到有关服务目录、REST和令牌生成的更多信息。
请注意,我将wso2.apim.com
称为APIM节点的主机名。在默认配置下,它将是https://localhost:9443
。
https://stackoverflow.com/questions/70185901
复制相似问题