Skip to content

Commit

Permalink
create & delete methods
Browse files Browse the repository at this point in the history
  • Loading branch information
TonySchneider committed Feb 22, 2023
1 parent d270599 commit 84d116c
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 10 deletions.
8 changes: 0 additions & 8 deletions app/controllers/api/cloud_volume_snapshots_controller.rb
Original file line number Diff line number Diff line change
@@ -1,13 +1,5 @@
module Api
class CloudVolumeSnapshotsController < BaseController
def create_resource(type, _id = nil, data = {})
require "byebug"
byebug
create_ems_resource(type, data, :supports => true) do |ems, klass|
{:task_id => klass.create_snapshot_queue(User.current_userid, ems, data)}
end
end

def delete_resource_action(type, id = nil, _data = nil)
api_resource(type, id, "Deleting", :supports => :delete) do |snapshot|
{:task_id => snapshot.delete_snapshot_queue(User.current_userid)}
Expand Down
34 changes: 32 additions & 2 deletions config/api.yml
Original file line number Diff line number Diff line change
Expand Up @@ -769,8 +769,6 @@
- :name: read
:identifier: cloud_volume_snapshot_view
:post:
- :name: create
:identifier: cloud_volume_snapshot_create
- :name: delete
:identifier: cloud_volume_snapshot_delete
:resource_actions:
Expand Down Expand Up @@ -846,6 +844,22 @@
:identifier: cloud_volume_tag
- :name: unassign
:identifier: cloud_volume_tag
:cloud_volume_snapshots_subcollection_actions:
:get:
- :name: read
:identifier: cloud_volume_snapshot_view
:post:
- :name: create
:identifier: cloud_volume_snapshot_create
- :name: delete
:identifier: cloud_volume_snapshot_delete
:cloud_volume_snapshots_subresource_actions:
:get:
- :name: read
:identifier: cloud_volume_snapshot_view
:post:
- :name: delete
:identifier: cloud_volume_snapshot_delete
:clusters:
:description: Clusters
:identifier: ems_cluster
Expand Down Expand Up @@ -1994,6 +2008,22 @@
:identifier: instance_retire_now
- :name: request_retire
:identifier: instance_retire
:snapshots_subcollection_actions:
:get:
- :name: read
:identifier: cloud_volume_snapshot_view
:post:
- :name: create
:identifier: cloud_volume_snapshot_create
- :name: delete
:identifier: cloud_volume_snapshot_delete
:snapshots_subresource_actions:
:get:
- :name: read
:identifier: cloud_volume_snapshot_view
:post:
- :name: delete
:identifier: cloud_volume_snapshot_delete
:custom_attributes_subcollection_actions:
:post:
- :name: add
Expand Down

0 comments on commit 84d116c

Please sign in to comment.