def set_machine_maintenance_state(
            self,
            name_or_id,
            state=True,
            reason=None):
        with _utils.shade_exceptions(
            "Error setting machine maintenance state to {state} on node "
            "{node}".format(state=state, node=name_or_id)
        ):
            if state:
                result = self.manager.submitTask(
                    _tasks.MachineSetMaintenance(node_id=name_or_id,
                                                 state='true',
                                                 maint_reason=reason))
            else:
                result = self.manager.submitTask(
                    _tasks.MachineSetMaintenance(node_id=name_or_id,
                                                 state='false'))
            if result is not None:
                raise OpenStackCloudException(
                    "Failed setting machine maintenance state to %s "
                    "on node %s. Received: %s" % (
                        state, name_or_id, result))
            return None
Subscribe an SQS queue to a topic.
dataset/ETHPy150Open openstack-infra/shade/shade/operatorcloud.py/OperatorCloud.set_machine_maintenance_state--crossover with--dataset/ETHPy150Open darcyliu/storyboard/boto/sns/connection.py/SNSConnection.subscribe_sqs_queue