Skip to content

Commit

Permalink
Merge "Support filtering and pagination together in introspect" into …
Browse files Browse the repository at this point in the history
…R2.20
  • Loading branch information
Zuul authored and opencontrail-ci-admin committed May 11, 2015
2 parents 74bb8d6 + a02c639 commit e566f0f
Show file tree
Hide file tree
Showing 47 changed files with 603 additions and 447 deletions.
9 changes: 7 additions & 2 deletions src/vnsw/agent/cmn/agent_db.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ class AgentDBEntry;
class AgentDBTable;
class AgentDBState;
class AgentSandesh;
class AgentSandeshArguments;
class AgentSandesh;
typedef class boost::shared_ptr<AgentSandesh> AgentSandeshPtr;

/////////////////////////////////////////////////////////////////////////////
// Refcount class for AgentDBEntry
Expand Down Expand Up @@ -164,8 +167,10 @@ class AgentDBTable : public DBTable {
};
virtual void OnZeroRefcount(AgentDBEntry *e) {};
virtual void NotifyEntry(DBEntryBase *entry);
virtual AgentSandesh *GetAgentSandesh(const std::string &context) {
return NULL;

virtual AgentSandeshPtr GetAgentSandesh(const AgentSandeshArguments *args,
const std::string &context) {
return AgentSandeshPtr();
}

// Dummy notification
Expand Down
8 changes: 5 additions & 3 deletions src/vnsw/agent/filter/acl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -667,11 +667,13 @@ void AclTable::AclFlowCountResponse(const string acl_uuid_str,

void AclReq::HandleRequest() const {
AgentSandeshPtr sand(new AgentAclSandesh(context(), get_uuid()));
sand->DoSandesh(0, AgentSandesh::kEntriesPerPage);
sand->DoSandesh(sand);
}

AgentSandesh *AclTable::GetAgentSandesh(const std::string &context) {
return new AgentAclSandesh(context, "");
AgentSandeshPtr AclTable::GetAgentSandesh(const AgentSandeshArguments *args,
const std::string &context) {
return AgentSandeshPtr(new AgentAclSandesh(context,
args->GetString("name")));
}

void NextAclFlowReq::HandleRequest() const {
Expand Down
3 changes: 2 additions & 1 deletion src/vnsw/agent/filter/acl.h
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,8 @@ class AclTable : public AgentDBTable {
virtual bool IFLinkToReq(IFMapLink *link, IFMapNode *node,
const std::string &peer_type, IFMapNode *peer,
DBRequest &req);
virtual AgentSandesh *GetAgentSandesh(const std::string &context);
virtual AgentSandeshPtr GetAgentSandesh(const AgentSandeshArguments *args,
const std::string &context);

static DBTableBase *CreateTable(DB *db, const std::string &name);
TrafficAction::Action ConvertActionString(std::string action) const;
Expand Down
95 changes: 43 additions & 52 deletions src/vnsw/agent/oper/agent.sandesh
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,21 @@ enum AgentConsts {
MAX_SANDESH_COUNT = 256
}

request sandesh SandeshDBEntryIndex {
request sandesh PageReq {
1: string key;
}

struct SandeshPageReq {
1: string prev_page (link="SandeshDBEntryIndex");
2: string next_page (link="SandeshDBEntryIndex");
3: string first_page (link="SandeshDBEntryIndex");
4: string all (link="SandeshDBEntryIndex");
5: string entries;
struct PageReqData {
1: string prev_page (link="PageReq");
2: string next_page (link="PageReq");
3: string first_page (link="PageReq");
4: string all (link="PageReq");
5: u32 table_size;
6: string entries;
}

response sandesh Pagination {
1: PageReqData req;
}

struct ServiceVlanSandeshList {
Expand Down Expand Up @@ -339,43 +344,38 @@ request sandesh SgListReq {
}

response sandesh SgListResp {
1: SandeshPageReq req;
2: list<SgSandeshData> sg_list;
1: list<SgSandeshData> sg_list;
}

request sandesh VnListReq {
1: string name; // send data for given name substring
}

response sandesh VnListResp {
1: SandeshPageReq req;
2: list<VnSandeshData> vn_list;
1: list<VnSandeshData> vn_list;
}

request sandesh VmListReq {
1: string uuid; // send data for given name substring
}

response sandesh VmListResp {
1: SandeshPageReq req;
2: list<VmSandeshData> vm_list;
1: list<VmSandeshData> vm_list;
}

request sandesh NhListReq {
}

response sandesh NhListResp {
1: SandeshPageReq req;
2: list<NhSandeshData> nh_list;
1: list<NhSandeshData> nh_list;
}

request sandesh VrfListReq {
1: string name; // send data for given name substring
}

response sandesh VrfListResp {
1: SandeshPageReq req;
2: list<VrfSandeshData> vrf_list;
1: list<VrfSandeshData> vrf_list;
}

request sandesh Inet4UcRouteReq {
Expand All @@ -386,8 +386,7 @@ request sandesh Inet4UcRouteReq {
}

response sandesh Inet4UcRouteResp {
1: SandeshPageReq req;
2: list<RouteUcSandeshData> route_list; // routes
1: list<RouteUcSandeshData> route_list; // routes
}

request sandesh Inet6UcRouteReq {
Expand All @@ -398,8 +397,7 @@ request sandesh Inet6UcRouteReq {
}

response sandesh Inet6UcRouteResp {
1: SandeshPageReq req;
2: list<RouteUcSandeshData> route_list; // routes
1: list<RouteUcSandeshData> route_list; // routes
}

request sandesh Inet4McRouteReq {
Expand All @@ -408,8 +406,7 @@ request sandesh Inet4McRouteReq {
}

response sandesh Inet4McRouteResp {
1: SandeshPageReq req;
2: list<RouteMcSandeshData> route_list; // routes
1: list<RouteMcSandeshData> route_list; // routes
}

request sandesh Layer2RouteReq {
Expand All @@ -419,8 +416,7 @@ request sandesh Layer2RouteReq {
}

response sandesh Layer2RouteResp {
1: SandeshPageReq req;
2: list<RouteL2SandeshData> route_list; // routes
1: list<RouteL2SandeshData> route_list; // routes
}

request sandesh BridgeRouteReq {
Expand All @@ -430,8 +426,7 @@ request sandesh BridgeRouteReq {
}

response sandesh BridgeRouteResp {
1: SandeshPageReq req;
2: list<RouteL2SandeshData> route_list; // routes
1: list<RouteL2SandeshData> route_list; // routes
}

request sandesh EvpnRouteReq {
Expand All @@ -441,25 +436,29 @@ request sandesh EvpnRouteReq {
}

response sandesh EvpnRouteResp {
1: SandeshPageReq req;
2: list<RouteEvpnSandeshData> route_list; // routes
1: list<RouteEvpnSandeshData> route_list; // routes
}

request sandesh ItfReq {
1: string name; // send data for given name substring
1: string name;
2: string type;
3: string uuid;
4: string vn;
5: string mac;
6: string ipv4_address;
7: string ipv6_address;
8: string parent_uuid;
}

response sandesh ItfResp {
1: SandeshPageReq req;
2: list<ItfSandeshData> itf_list;
1: list<ItfSandeshData> itf_list;
}

request sandesh MplsReq {
}

response sandesh MplsResp {
1: SandeshPageReq req;
2: list<MplsSandeshData> mpls_list;
1: list<MplsSandeshData> mpls_list;
}

struct VrfAssignSandeshData {
Expand All @@ -474,16 +473,14 @@ request sandesh VrfAssignReq {
}

response sandesh VrfAssignResp {
1: SandeshPageReq req;
2: list<VrfAssignSandeshData> vrf_assign_list;
1: list<VrfAssignSandeshData> vrf_assign_list;
}

request sandesh MirrorEntryReq {
}

response sandesh MirrorEntryResp {
1: SandeshPageReq req;
2: list<MirrorEntrySandeshData> mirror_entry_list;
1: list<MirrorEntrySandeshData> mirror_entry_list;
}

response sandesh ErrorResp {
Expand Down Expand Up @@ -614,8 +611,7 @@ request sandesh LoadBalancerReq {
}

response sandesh LoadBalancerResp {
1: SandeshPageReq req;
2: list<LoadBalancerSandeshData> load_balancer_list;
1: list<LoadBalancerSandeshData> load_balancer_list;
}

struct AceIdFlowCnt {
Expand All @@ -635,8 +631,7 @@ request sandesh AclReq {
}

response sandesh AclResp {
1: SandeshPageReq req;
2: list<AclSandeshData> acl_list;
1: list<AclSandeshData> acl_list;
}

request sandesh AclFlowReq {
Expand Down Expand Up @@ -753,17 +748,15 @@ request sandesh VxLanReq {
}

response sandesh VxLanResp {
1: SandeshPageReq req;
2: list<VxLanSandeshData> vxlan_list;
1: list<VxLanSandeshData> vxlan_list;
}

request sandesh ServiceInstanceReq {
1: string uuid;
}

response sandesh ServiceInstanceResp {
1: SandeshPageReq req;
2: list<ServiceInstanceSandeshData> service_instance_list;
1: list<ServiceInstanceSandeshData> service_instance_list;
}

struct MirrorCfgSandesh {
Expand Down Expand Up @@ -1148,8 +1141,7 @@ struct SandeshDevice {
}

response sandesh SandeshDeviceListResp {
1: SandeshPageReq req;
2: list<SandeshDevice> device_list;
1: list<SandeshDevice> device_list;
}

request sandesh SandeshDeviceReq {
Expand Down Expand Up @@ -1184,12 +1176,12 @@ struct SandeshPhysicalDeviceVn {
}

response sandesh SandeshPhysicalDeviceVnListResp {
1: SandeshPageReq req;
2: list<SandeshPhysicalDeviceVn> port_list;
1: list<SandeshPhysicalDeviceVn> port_list;
}

request sandesh SandeshPhysicalDeviceVnReq {
1: string device;
2: string vn;
}

/* Config tree */
Expand All @@ -1202,8 +1194,7 @@ struct SandeshConfigPhysicalDeviceVn {
}

response sandesh SandeshConfigPhysicalDeviceVnListResp {
1: SandeshPageReq req;
2: list<SandeshConfigPhysicalDeviceVn> device_vn_list;
1: list<SandeshConfigPhysicalDeviceVn> device_vn_list;
}

request sandesh SandeshConfigPhysicalDeviceVnReq {
Expand Down
5 changes: 3 additions & 2 deletions src/vnsw/agent/oper/agent_route.h
Original file line number Diff line number Diff line change
Expand Up @@ -124,8 +124,9 @@ class AgentRouteTable : public RouteTable {
//Can be used for operations resulting from deletion of route.
virtual void PreRouteDelete(AgentRoute *entry) { }

virtual AgentSandesh *GetAgentSandesh(const std::string &context) {
return NULL;
virtual AgentSandeshPtr GetAgentSandesh(const AgentSandeshArguments *args,
const std::string &context) {
return AgentSandeshPtr();
}
// Unresolved route tree accessors
UnresolvedRouteTree::const_iterator unresolved_route_begin() const {
Expand Down

0 comments on commit e566f0f

Please sign in to comment.