[ 
https://issues.apache.org/jira/browse/KNOX-3084?focusedWorklogId=974045&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-974045
 ]

ASF GitHub Bot logged work on KNOX-3084:
----------------------------------------

                Author: ASF GitHub Bot
            Created on: 09/Jul/25 20:58
            Start Date: 09/Jul/25 20:58
    Worklog Time Spent: 10m 
      Work Description: bonampak opened a new pull request, #1059:
URL: https://github.com/apache/knox/pull/1059

   ## What changes were proposed in this pull request?
   The Knox Cloudera Manager service discovery can use the new CM API call
   `GET /clusters/{clusterName}/services/serviceName}/roles/configs`
   if present. This call is using offset-limit pagination with a default value 
of 100. The page size used by Knox is set to 500 by default.
   To enable this, one can set the properties in gateway-site.xml:
   ```
   gateway.cloudera.manager.service.discovery.role.fetch.strategy=byService
   gateway.cloudera.manager.service.discovery.api.version=v57
   gateway.cloudera.manager.service.discovery.role.pagesize=300
   ```
   The version and endpoint can be checked in the CM UI (Support/API Explorer) 
   
https://cm-host:7183/static/apidocs/ui/index.html#/RolesResource/readRolesConfig
   
   By default, the original behavior is used, with CM API version v32 and the 
calls
   - `GET /clusters/{clusterName}/services/{serviceName}/roles`
   - `GET 
/clusters/{clusterName}/services/{serviceName}/roles/{roleName}/config` (for 
each service role)
   
   The default role configuration fetch can be configured by leaving these 
parameters empty or setting them to 
   ```
   gateway.cloudera.manager.service.discovery.role.fetch.strategy=byRole
   gateway.cloudera.manager.service.discovery.api.version=v32
   ```
   
   ## How was this patch tested?
   
   Tested using CM 7.13.1. Verified that the same topologies are generated and 
the discovery cache under data/cm-clusters remains the same for both discovery 
strategies.
   




Issue Time Tracking
-------------------

            Worklog Id:     (was: 974045)
    Remaining Estimate: 0h
            Time Spent: 10m

> Update CM service discovery with the enhanced role configs endpoint
> -------------------------------------------------------------------
>
>                 Key: KNOX-3084
>                 URL: https://issues.apache.org/jira/browse/KNOX-3084
>             Project: Apache Knox
>          Issue Type: Task
>          Components: cm-discovery
>    Affects Versions: 2.1.0
>            Reporter: Tamás Marcinkovics
>            Assignee: Tamás Marcinkovics
>            Priority: Major
>          Time Spent: 10m
>  Remaining Estimate: 0h
>
> There is a new CM API endpoint to fetch all role configurations for a given 
> service ({{RolesResouce.readRolesConfig}}) if the supported API version is 
> greater than or equal to v57. This endpoint is available in the 
> cloudera-manager-api-swagger:7.13.1 artifact.
> [https://repository.cloudera.com/service/rest/repository/browse/cloudera-repos/com/cloudera/api/swagger/cloudera-manager-api-swagger/7.13.1/]
> On the Knox side, we need to change the existing {{readRoles}} and 
> {{readRoleConfig}} API calls to the new {{readRolesConfig}} call.
> The {{view}} parameter should still remain {{full}} as 
> {{full_with_no_health_check}} only returns role configuration parameters with 
> non-default values.
> As the new cloudera-manager-api-swagger artifact is using okhttp 4.10, we 
> also need to change {{DiscoveryApiClient}} setup and our Okhttp interceptors 
> from Okhttp 2.7.5 to Okhttp 4.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to