Uploaded image for project: 'Libcloud'
  1. Libcloud
  2. LIBCLOUD-392

Add support for keypairs management in the OpenStack driver

    Details

      Description

      Add the following methods to the OpenStack driver:

      • ex_list_keypairs
      • ex_create_keypair
      • ex_delete_keypair

      An OpenStackKeyPair object will also be needed.
      This object will contain the following members:

      • name
      • fingerprint
      • public_key
      • private_key (optional)

        Activity

        Hide
        jc2k John Carr added a comment -

        sebastien goasguen recently worked on these methods to CloudStack, and I have been tweaking the equivalent methods for EC2. It we be good if we good try and align and OpenStack tweaks so that all 3 drivers work similarly - so I write a script using them and they work for all 3 drivers.

        Currently the EC2 driver has the following:

        • ex_create_keypair
        • ex_import_keypair_from_string
        • ex_import_keypair
        • ex_find_or_import_keypair_by_key_material (I'd like to shorten the name to just ex_find_or_import_keypair)
        • ex_list_keypairs
        • ex_describe_keypair (Should be renamed ex_get_keypair to be more consistent with other API's?)

        These should be deprecated and removed IMO:

        • ex_describe_all_keypairs (Should really be marked as deprecated)
        • ex_describe_keypairs (Should really be marked as deprecated)

        It doesn't currently have an ex_delete_keypair, but it should.

        Right now the EC2 methods operate on and return dictionary objects that look a bit like this dict(keyName='key_name', keyFingerprint='00:...'). I would quite like to add a shared NodeAuthKeypair object that could be used for this API for all 3 drivers. This could also be passed in to methods that take an auth parameter instead of ex_keyname.

        Maybe we could remove ex_ from the front of some of these methods?

        Show
        jc2k John Carr added a comment - sebastien goasguen recently worked on these methods to CloudStack, and I have been tweaking the equivalent methods for EC2. It we be good if we good try and align and OpenStack tweaks so that all 3 drivers work similarly - so I write a script using them and they work for all 3 drivers. Currently the EC2 driver has the following: ex_create_keypair ex_import_keypair_from_string ex_import_keypair ex_find_or_import_keypair_by_key_material (I'd like to shorten the name to just ex_find_or_import_keypair) ex_list_keypairs ex_describe_keypair (Should be renamed ex_get_keypair to be more consistent with other API's?) These should be deprecated and removed IMO: ex_describe_all_keypairs (Should really be marked as deprecated) ex_describe_keypairs (Should really be marked as deprecated) It doesn't currently have an ex_delete_keypair, but it should. Right now the EC2 methods operate on and return dictionary objects that look a bit like this dict(keyName='key_name', keyFingerprint='00:...'). I would quite like to add a shared NodeAuthKeypair object that could be used for this API for all 3 drivers. This could also be passed in to methods that take an auth parameter instead of ex_keyname. Maybe we could remove ex_ from the front of some of these methods?
        Hide
        schaubl L. Schaub added a comment -

        In respect with this, I will create two new methods

        • ex_import_keypair
        • ex_import_keypair_from_string

        I agree with you that it would be nice to create a shared NodeAuthKeypair object.
        But I think it's an extra step and I will not have time to do this.

        So I will create a OpenStackKeyPair object which will be simple to rename to NodeAuthKeypair and to move to the correct location.

        Show
        schaubl L. Schaub added a comment - In respect with this, I will create two new methods ex_import_keypair ex_import_keypair_from_string I agree with you that it would be nice to create a shared NodeAuthKeypair object. But I think it's an extra step and I will not have time to do this. So I will create a OpenStackKeyPair object which will be simple to rename to NodeAuthKeypair and to move to the correct location.
        Hide
        schaubl L. Schaub added a comment -

        The GitHub pull request is available at https://github.com/apache/libcloud/pull/145

        Show
        schaubl L. Schaub added a comment - The GitHub pull request is available at https://github.com/apache/libcloud/pull/145
        Hide
        kami Tomaz Muraus added a comment -

        Sorry for the delay.

        I've checked the pull request and it looks good. There is only a minor issue with the argument names in the ex_import_keypair and ex_import_keypair_from_string method (names aren't consistent with other drivers, e.g. https://github.com/apache/libcloud/blob/trunk/libcloud/compute/drivers/ec2.py#L746) which needs to be fixed before the patch can be merged.

        Show
        kami Tomaz Muraus added a comment - Sorry for the delay. I've checked the pull request and it looks good. There is only a minor issue with the argument names in the ex_import_keypair and ex_import_keypair_from_string method (names aren't consistent with other drivers, e.g. https://github.com/apache/libcloud/blob/trunk/libcloud/compute/drivers/ec2.py#L746 ) which needs to be fixed before the patch can be merged.
        Show
        schaubl L. Schaub added a comment - I did the requested changes ( https://github.com/schaubl/libcloud/commit/c6be9480d53527d00196d6511c82a98f98292528 )
        Hide
        jira-bot ASF subversion and git services added a comment -

        Commit aadbd4c3eeadd391262cda664303e2f3d5564eed in branch refs/heads/trunk from L. Schaub
        [ https://git-wip-us.apache.org/repos/asf?p=libcloud.git;h=aadbd4c ]

        LIBCLOUD-392: Add support for keypairs management in the OpenStack driver.

        Signed-off-by: Tomaz Muraus <tomaz@apache.org>

        Show
        jira-bot ASF subversion and git services added a comment - Commit aadbd4c3eeadd391262cda664303e2f3d5564eed in branch refs/heads/trunk from L. Schaub [ https://git-wip-us.apache.org/repos/asf?p=libcloud.git;h=aadbd4c ] LIBCLOUD-392 : Add support for keypairs management in the OpenStack driver. Signed-off-by: Tomaz Muraus <tomaz@apache.org>
        Hide
        kami Tomaz Muraus added a comment -

        Patch merged into trunk.

        Thanks!

        Show
        kami Tomaz Muraus added a comment - Patch merged into trunk. Thanks!

          People

          • Assignee:
            kami Tomaz Muraus
            Reporter:
            schaubl L. Schaub
          • Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Time Tracking

              Estimated:
              Original Estimate - 168h
              168h
              Remaining:
              Remaining Estimate - 168h
              168h
              Logged:
              Time Spent - Not Specified
              Not Specified

                Development