<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>question Re: Read service-wide configuration values via API in Support Questions</title>
    <link>https://community.cloudera.com/t5/Support-Questions/Read-service-wide-configuration-values-via-API/m-p/284156#M211049</link>
    <description>&lt;P&gt;The solution is quite simple, was not aware that the service-wide configurations are not in roles but in services. So the solution is to use a&amp;nbsp;ServicesResourceApi endpoint and&amp;nbsp;read_service_config method.&lt;/P&gt;&lt;P&gt;Something like this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;    def get_service_config(self, service_name):
        """Returns the configuration of the service"""
        services_instance = cm_client.ServicesResourceApi(self.api)
        view = 'summary'
        try:
            api_response = services_instance.read_service_config(
                self.cluster_name, service_name, view=view)
            return api_response.to_dict()
        except ApiException as exception:
            print(f"Exception when calling ServicesResourceApi-&amp;gt;read_service_config: {exception}\n")&lt;/LI-CODE&gt;</description>
    <pubDate>Wed, 27 Nov 2019 07:47:34 GMT</pubDate>
    <dc:creator>Tomas79</dc:creator>
    <dc:date>2019-11-27T07:47:34Z</dc:date>
    <item>
      <title>Read service-wide configuration values via API</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Read-service-wide-configuration-values-via-API/m-p/283503#M210715</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;I am wondering if it is possible to get Service-Wide configurations via read_config method of the&amp;nbsp;&lt;EM&gt;RoleConfigGroupsResourceApi class.&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://archive.cloudera.com/cm6/6.3.0/generic/jar/cm_api/swagger-html-sdk-docs/python/docs/RoleConfigGroupsResourceApi.html#read_config" target="_blank" rel="noopener"&gt;https://archive.cloudera.com/cm6/6.3.0/generic/jar/cm_api/swagger-html-sdk-docs/python/docs/RoleConfigGroupsResourceApi.html#read_config&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The read_roles method of RolesResourceAPI returns theses roles:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;CD-HDFS-eHtEMKVf-DATANODE-BASE
CD-HDFS-eHtEMKVf-SECONDARYNAMENODE-BASE
CD-HDFS-eHtEMKVf-HTTPFS-BASE
CD-HDFS-eHtEMKVf-DATANODE-BASE
CD-HDFS-eHtEMKVf-DATANODE-BASE
CD-HDFS-eHtEMKVf-NAMENODE-BASE&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;But when I query all these roles, I cannot find the Service-Wide property of Advanced configuration for core-site.xml&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Reading configuration for CD-HDFS-eHtEMKVf-DATANODE-BASE
{'items': [{'default': None,
            'description': 'For advanced use only, key-value pairs (one on '
                           "each line) to be inserted into a role's "
                           'environment. Applies to configurations of this '
                           'role except client configuration.',
            'display_name': 'DataNode Environment Advanced Configuration '
                            'Snippet (Safety Valve)',
            'name': 'DATANODE_role_env_safety_valve',
            'related_name': '',
            'required': False,
            'sensitive': False,
            'validation_message': None,
            'validation_state': 'OK',
            'validation_warnings_suppressed': False,
            'value': None},
           {'default': '{"critical":"never","warning":"1000000.0"}',
            'description': 'The health test thresholds of the number of blocks '
                           'on a DataNode',
            'display_name': 'DataNode Block Count Thresholds',
            'name': 'datanode_block_count_thresholds',
            'related_name': '',
            'required': False,
            'sensitive': False,
            'validation_message': None,
            'validation_state': 'OK',
            'validation_warnings_suppressed': None,
            'value': None},
           {'default': None,&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Maybe I should search in other classes? Please advise,&lt;/P&gt;
&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Thu, 21 Nov 2019 17:32:47 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Read-service-wide-configuration-values-via-API/m-p/283503#M210715</guid>
      <dc:creator>Tomas79</dc:creator>
      <dc:date>2019-11-21T17:32:47Z</dc:date>
    </item>
    <item>
      <title>Re: Read service-wide configuration values via API</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Read-service-wide-configuration-values-via-API/m-p/284156#M211049</link>
      <description>&lt;P&gt;The solution is quite simple, was not aware that the service-wide configurations are not in roles but in services. So the solution is to use a&amp;nbsp;ServicesResourceApi endpoint and&amp;nbsp;read_service_config method.&lt;/P&gt;&lt;P&gt;Something like this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;    def get_service_config(self, service_name):
        """Returns the configuration of the service"""
        services_instance = cm_client.ServicesResourceApi(self.api)
        view = 'summary'
        try:
            api_response = services_instance.read_service_config(
                self.cluster_name, service_name, view=view)
            return api_response.to_dict()
        except ApiException as exception:
            print(f"Exception when calling ServicesResourceApi-&amp;gt;read_service_config: {exception}\n")&lt;/LI-CODE&gt;</description>
      <pubDate>Wed, 27 Nov 2019 07:47:34 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Read-service-wide-configuration-values-via-API/m-p/284156#M211049</guid>
      <dc:creator>Tomas79</dc:creator>
      <dc:date>2019-11-27T07:47:34Z</dc:date>
    </item>
  </channel>
</rss>

