Skip to content

Feature/add snapshot functionalities#362

Open
KevinLoiseau wants to merge 18 commits intofog:masterfrom
KevinLoiseau:feature/add_snapshot_functionalities
Open

Feature/add snapshot functionalities#362
KevinLoiseau wants to merge 18 commits intofog:masterfrom
KevinLoiseau:feature/add_snapshot_functionalities

Conversation

@KevinLoiseau
Copy link
Contributor

@bilal-naeem-confiz @maham-nazir-confiz This is the single PR which contains each functionalities, as you asked.

Copy link
Contributor

@bilal-naeem-confiz bilal-naeem-confiz left a 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.

Copy link
Contributor

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

Copy link
Contributor

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.

Copy link
Contributor

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)
Copy link
Contributor

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

Copy link
Contributor

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.

Copy link
Contributor

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.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Typo in Resource

@KevinLoiseau
Copy link
Contributor Author

KevinLoiseau commented Jan 30, 2018

@bilal-naeem-confiz Excuse the tardly reply. Your requests are been done.

@KevinLoiseau
Copy link
Contributor Author

@bilal-naeem-confiz can we have some news about this pull request ?
Thanks in advance.

@stiller-leser
Copy link

What's the status of this PR? Would really like to see that integrated. Happy to help if there are any ToDos left.

@bilal-naeem-confiz
Copy link
Contributor

@stiller-leser @KevinLoiseau
Let me go through this PR one more time and then I'll merge it.

@KevinLoiseau
Copy link
Contributor Author

@bilal-naeem-confiz Have you got some news on this pull request ?
Thanks in advance.

@stiller-leser
Copy link

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.

@stiller-leser
Copy link

stiller-leser commented Nov 19, 2018

@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:

@connection.create_or_update_snapshot({
        name: snapshot_name,
        location: location,
        resource_group_name: resource_group,
        creation_data: {
          create_option: "Copy",
          source_uri: disk.id
        }
})

And to create a disk from the snapshot:


@connection.managed_disks.create(
        name: disk_name,
        location: location,
        resource_group_name: resource_group,
        # See https://docs.microsoft.com/en-us/azure/storage/common/storage-redundancy-lrs
        account_type: 'Standard_LRS',
        creation_data: {
          create_option: 'Copy',
          source_uri: snapshot.id
        },
        disk_size_gb: snapshot.disk_size_gb,
)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants

Comments