# rpc.py

包括两个类：RpcCallbacks和AgentNotifierApi。

前者负责当agent往plugin发出rpc请求时候，plugin实现请求的相关动作，除了继承自父类（dhcp rpc、dvr rpc、sg\_db rpc和tunnel rpc）中的方法，还包括get\_port\_from\_device、get\_device\_details、get\_devices\_details\_list、update\_device\_down、update\_device\_up、get\_dvr\_mac\_address\_by\_host、get\_compute\_ports\_on\_host\_by\_subnet、get\_subnet\_for\_dvr等方法。

后者负责当plugin往agent发出rpc请求（plugin通知agent）的时候，plugin端的方法。继承自dvr、sg、tunnel等父类。此外还实现了network\_delete、port\_update两个方法。


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://yeasy.gitbook.io/openstack_code_neutron/neutron/plugins/ml2/rpcpy.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
