Add instance address to the matching scheduling policy by type.
(self, instance_type: str, instance_address: str)
| 1842 | return summary |
| 1843 | |
| 1844 | def add_instance(self, instance_type: str, instance_address: str): |
| 1845 | """Add instance address to the matching scheduling policy by type.""" |
| 1846 | if not instance_address: |
| 1847 | raise ValueError("instance_address cannot be empty") |
| 1848 | |
| 1849 | if instance_type == "encoder": |
| 1850 | self.encoder_policy.add_instance(instance_address) |
| 1851 | elif instance_type == "transformer": |
| 1852 | self.transformer_policy.add_instance(instance_address) |
| 1853 | elif instance_type == "decoder": |
| 1854 | self.decoder_policy.add_instance(instance_address) |
| 1855 | else: |
| 1856 | raise ValueError("instance_type must be one of: encoder, transformer, decoder") |
| 1857 | |
| 1858 | def remove_instance(self, instance_type: str, instance_address: str): |
| 1859 | """Remove instance address from the matching scheduling policy by type.""" |