Skip to content
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

[LIBCLOUD-703] packet bare metal cloud provider integration #527

Conversation

crunchywelch
Copy link

I humbly submit this PR which adds support for our bare metal cloud hosting platform, Packet. Let me know if this looks ok, or if it requires additional work. The JIRA issue is here:

https://issues.apache.org/jira/browse/LIBCLOUD-703

Thanks!

@crunchywelch crunchywelch force-pushed the LIBCLOUD-703_packet_driver branch 4 times, most recently from a4bb91a to d526287 Compare May 22, 2015 20:44
@crunchywelch
Copy link
Author

I have faxed in my ICLA today as well. Thanks!

@Kami
Copy link
Member

Kami commented May 22, 2015

Great, thanks.

I will try to have a look ASAP (hopefully over the weekend).

method='DELETE')
return res.status == httplib.OK

def list_ssh_keys(self):
Copy link
Member

Choose a reason for hiding this comment

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

Looks like you should be able to implement ssh key management functionality using key pair management methods which are part of the libcloud standard API - https://github.com/apache/libcloud/blob/trunk/libcloud/compute/base.py#L1183

This also means getting rid of SSHKey class in favor of libcloud.compute.base.KeyPair.

In your case, you can use store id in the name attribute and description in the extra dict.

Copy link
Author

Choose a reason for hiding this comment

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

cool, works for me

@crunchywelch
Copy link
Author

thanks @Kami, will make some adjustments!

@crunchywelch crunchywelch force-pushed the LIBCLOUD-703_packet_driver branch from d526287 to f3bd4a5 Compare May 23, 2015 16:55
@crunchywelch crunchywelch force-pushed the LIBCLOUD-703_packet_driver branch from f3bd4a5 to 762d803 Compare May 23, 2015 16:57
@crunchywelch
Copy link
Author

Ok, I think I got all those notes, lmk if you see anything else I should adjust!

Cheers,

@Kami
Copy link
Member

Kami commented May 24, 2015

I tries to test the driver using a dummy token and looks like an API returns 404 on invalid token. Something like 401 would be better and then Libcloud would also correctly throw InvalidCreds exception.

Or maybe exception is related to the project not existing? In any case, 401 would be more appropriate (and hopefully token validation happens before project validation anyway) :)

# -------- begin 140127380731600 request ----------
curl -i -X GET -H 'Host: api.packet.net' -H 'X-LC-Request-ID: 140127380731600' -H 'Accept-Encoding: gzip,deflate' -H 'X-Consumer-Token: kcrhMn7hwG8Ceo2hAhGFa2qpxLBvVHxEjS9ue8iqmsNkeeB2iQgMq4dNc1893pYu' -H 'X-Auth-Token: accesskeyid' -H 'Content-Type: application/json' -H 'User-Agent: libcloud/0.17.1-dev (Packet) ' --compress 'https://api.packet.net:443/projects/aaaaa/devices?include=plan'
# -------- begin 140127380731600:140127380758680 response ----------
HTTP/1.1 404 Not Found
Status: 404 Not Found
X-Request-Id: ec216d58-04b5-432b-92ad-60efc377e9fd
X-Xss-Protection: 1; mode=block
X-Content-Type-Options: nosniff
Transfer-Encoding: chunked
Server: nginx/1.6.2
X-Runtime: 0.005357
Cache-Control: no-cache
Date: Sun, 24 May 2015 14:49:02 GMT
X-Frame-Options: SAMEORIGIN
Content-Type: application/json; charset=utf-8

15
{"error":"Not found"}
0

# -------- end 140127380731600:140127380758680 response ----------

@asfgit asfgit closed this in 4d51ede May 24, 2015
@Kami
Copy link
Member

Kami commented May 24, 2015

I made a minor change (projectid, project_id -> ex_project_id since project id argument is not part of the standard API) and merged driver into trunk.

Thanks.

@crunchywelch
Copy link
Author

great, thanks ! Do I need to provide the patch on the jira issue next? Looking at step 11 here:

http://libcloud.readthedocs.org/en/latest/development.html

@Kami
Copy link
Member

Kami commented May 24, 2015

No, it's fine, I already merged it using a patch from Github :)

@crunchywelch
Copy link
Author

Sweet, thanks man! And thank you for being a maintainer!

On Sun, May 24, 2015 at 5:26 PM, Tomaz Muraus notifications@github.com
wrote:

No, it's fine, I already merged it using a patch from Github :)


Reply to this email directly or view it on GitHub
#527 (comment).

Aaron Welch

SVP of Product

212.933.9785 x301
welch@packet.net

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants