> For the complete documentation index, see [llms.txt](https://yeasy.gitbook.io/openstack_code_neutron/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://yeasy.gitbook.io/openstack_code_neutron/neutron/plugins/ml2/rpcpy.md).

# 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
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

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

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
