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
|
# File 'app/controllers/security_groups_controller.rb', line 24
def create
data = {
:description => params[:description],
:rule => params[:rule]
}
@security_group = DcmgrResource::SecurityGroup.create(data)
render :json => @security_group
end
|
#destroy ⇒ Object
33
34
35
36
37
|
# File 'app/controllers/security_groups_controller.rb', line 33
def destroy
uuid = params[:id]
@security_group = DcmgrResource::SecurityGroup.destroy(uuid)
render :json => @security_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]
}
@security_group = DcmgrResource::SecurityGroup.list(data)
respond_with(@security_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]
@security_group = DcmgrResource::SecurityGroup.show(uuid)
respond_with(@security_group,:to => [:json])
end
|
#show_groups ⇒ Object
49
50
51
52
|
# File 'app/controllers/security_groups_controller.rb', line 49
def show_groups
@security_group = DcmgrResource::SecurityGroup.list
respond_with(@security_group[0],:to => [:json])
end
|
#update ⇒ Object
39
40
41
42
43
44
45
46
47
|
# File 'app/controllers/security_groups_controller.rb', line 39
def update
uuid = params[:id]
data = {
:description => params[:description],
:rule => params[:rule]
}
@security_group = DcmgrResource::SecurityGroup.update(uuid,data)
render :json => @security_group
end
|