def _get_resource_ids()

in src/modules/get_cluster_status_scs.py [0:0]


    def _get_resource_ids(self) -> None:
        """
        Retrieves the resource IDs for ASCS and ERS from the cluster status XML.

        :return: None
        """
        try:
            resources_string = self.execute_command_subprocess(CIB_ADMIN("resources"))
            if resources_string is not None:
                resources = ET.fromstring(resources_string).findall(
                    ".//primitive[@type='SAPInstance']"
                )
                for resource in resources:
                    resource_id = resource.attrib.get("id")
                    instance_attributes = resource.find("instance_attributes")

                    if instance_attributes is not None:
                        is_ers = False

                        for nvpair in instance_attributes:
                            name = nvpair.attrib.get("name")
                            value = nvpair.attrib.get("value")

                            if name == "IS_ERS" and value == "true":
                                is_ers = True

                        if is_ers:
                            self.ers_resource_id = resource_id
                        else:
                            self.ascs_resource_id = resource_id

        except Exception as ex:
            self.handle_error(ex)