@@ -33,6 +33,11 @@ def __init__(self,
3333 self .auth = auth
3434 self .auth_admin = auth_admin
3535
36+ @endpoint ("" )
37+ def get_root (self ):
38+ """Get the api root"""
39+ return self ._get (endpoint , jsonify = True )
40+
3641
3742 @use_admin_auth
3843 @endpoint ("providers/" )
@@ -135,6 +140,14 @@ def create_blueprint(self, blueprint, provider="ec2"):
135140 return self ._post (endpoint , data = json .dumps (blueprint ), jsonify = True )
136141
137142
143+ @endpoint ("blueprints/{blueprint_id}/" )
144+ def delete_blueprint (self , blueprint_id ):
145+ result = self ._delete (endpoint , jsonify = True )
146+ if result is None :
147+ raise BlueprintException ("Blueprint %s not found" % blueprint_id )
148+ else :
149+ return result
150+
138151 @use_admin_auth
139152 @endpoint ("security_groups/" )
140153 def create_security_group (self , name , description , cloud_provider , is_default = True ):
@@ -149,6 +162,11 @@ def create_security_group(self, name, description, cloud_provider, is_default=Tr
149162 return self ._post (endpoint , data = json .dumps (data ), jsonify = True )
150163
151164
165+ @endpoint ("settings/" )
166+ def get_public_key (self ):
167+ """Get the public key for the logged in uesr"""
168+ return self ._get (endpoint , jsonify = True )['public_key' ]
169+
152170 @endpoint ("settings/" )
153171 def set_public_key (self , public_key ):
154172 """Upload a public key for our user. public_key can be the actual key, a
@@ -275,6 +293,12 @@ def get_stack_hosts(self, stack_id):
275293 return self ._get (endpoint , jsonify = True )['results' ]
276294
277295
296+ @endpoint ("blueprints/" )
297+ def get_blueprints (self ):
298+ """Returns all the blueprints"""
299+ return self ._get (endpoint , jsonify = True )['results' ]
300+
301+
278302 @endpoint ("blueprints/{blueprint_id}/" )
279303 def get_blueprint (self , blueprint_id ):
280304 """Return info for a specific blueprint_id"""
0 commit comments