-
-
Notifications
You must be signed in to change notification settings - Fork 84
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature/add snapshot functionalities #362
base: master
Are you sure you want to change the base?
Feature/add snapshot functionalities #362
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please make the suggested changes. Also, add an integration test for this feature.
end | ||
|
||
def destroy(async = false) | ||
service.delete_snapshot(resource_group_name, name, async) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In case of asynchronous calls, you will have to modify the response to return a Fog::AsyncResponse
object. You can see it here
module Compute | ||
class AzureRM | ||
# This class is giving implementation of all/list, get and | ||
# check existence for snapshots of managedisk. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Typo in managedisk
. Should be managed disk
.
snapshot.name = snapshot_params[:name] | ||
snapshot.type = SNAPSHOT_PREFIX | ||
snapshot.location = snapshot_params[:location] | ||
snapshot.tags = snapshot_params[:tags] if snapshot.tags.nil? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be unless
instead of if
class AzureRM | ||
# Real class for Compute Request | ||
class Real | ||
def delete_snapshot(resource_group_name, snapshot_name, async = false) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If this request is called asynchronously, then the response return should be as done here
test/models/compute/test_snapshot.rb
Outdated
end | ||
end | ||
|
||
def test_destroy_async_method_true_response |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This method will be updated once you update your delete method for asynchronous calls.
end | ||
end | ||
|
||
def test_delete_managed_disk_async |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This method will be updated once you update your delete method for asynchronous calls.
@@ -0,0 +1,24 @@ | |||
require File.expand_path '../../test_helper', __dir__ | |||
|
|||
# Test class for List Snapshots by Ressource Group Request |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Typo in Resource
@bilal-naeem-confiz Excuse the tardly reply. Your requests are been done. |
@bilal-naeem-confiz can we have some news about this pull request ? |
What's the status of this PR? Would really like to see that integrated. Happy to help if there are any ToDos left. |
@stiller-leser @KevinLoiseau |
@bilal-naeem-confiz Have you got some news on this pull request ? |
For now I created a fork here: https://github.com/stiller-leser/fog-azure-rm that contains the changes. Would be awesome to see this PR merged though. |
@KevinLoiseau do you happen to have an example on how to actually create a snapshot? This is missing in the documentation of the README. EDIT: Nevermind, got it to work:
And to create a disk from the snapshot:
|
@bilal-naeem-confiz @maham-nazir-confiz This is the single PR which contains each functionalities, as you asked.