Class: SecurityGroupsController
Instance Method Summary
collapse
#dispatch, #get_locales, #is_dcmgr?, #set_application, #set_locale
Instance Method Details
#create ⇒ Object
24
25
26
27
28
29
30
31
32
|
# File 'app/controllers/security_groups_controller.rb', line 24
def create
data = {
:name => params[:name],
:description => params[:description],
:rule => params[:rule]
}
@netfilter_group = DcmgrResource::NetfilterGroup.create(data)
render :json => @netfilter_group
end
|
#destroy ⇒ Object
34
35
36
37
38
|
# File 'app/controllers/security_groups_controller.rb', line 34
def destroy
uuid = params[:id]
@netfilter_group = DcmgrResource::NetfilterGroup.destroy(uuid)
render :json => @netfilter_group
end
|
#index ⇒ Object
4
5
|
# File 'app/controllers/security_groups_controller.rb', line 4
def index
end
|
#list ⇒ Object
security_groups/show/1.json
8
9
10
11
12
13
14
15
|
# File 'app/controllers/security_groups_controller.rb', line 8
def list
data = {
:start => params[:start].to_i - 1,
:limit => params[:limit]
}
@netfilter_group = DcmgrResource::NetfilterGroup.list(data)
respond_with(@netfilter_group[0],:to => [:json])
end
|
#show ⇒ Object
security_groups/detail/s-000001.json
18
19
20
21
22
|
# File 'app/controllers/security_groups_controller.rb', line 18
def show
uuid = params[:id]
@netfilter_group = DcmgrResource::NetfilterGroup.show(uuid)
respond_with(@netfilter_group,:to => [:json])
end
|
#show_groups ⇒ Object
50
51
52
53
|
# File 'app/controllers/security_groups_controller.rb', line 50
def show_groups
@netfilter_group = DcmgrResource::NetfilterGroup.list
respond_with(@netfilter_group[0],:to => [:json])
end
|
#update ⇒ Object
40
41
42
43
44
45
46
47
48
|
# File 'app/controllers/security_groups_controller.rb', line 40
def update
uuid = params[:id]
data = {
:description => params[:description],
:rule => params[:rule]
}
@netfilter_group = DcmgrResource::NetfilterGroup.update(uuid,data)
render :json => @netfilter_group
end
|