| Summary: | deltacloud-client should throw an exception if an action fails | ||
|---|---|---|---|
| Product: | [Retired] CloudForms Cloud Engine | Reporter: | Chris Lalancette <clalance> |
| Component: | rubygem-deltacloud-client | Assignee: | Michal Fojtik <mfojtik> |
| Status: | CLOSED ERRATA | QA Contact: | Ronelle Landy <rlandy> |
| Severity: | medium | Docs Contact: | |
| Priority: | unspecified | ||
| Version: | 1.0.0 | CC: | akarol, dajohnso, deltacloud-maint, dgao, rananda, ssachdev, whayutin |
| Target Milestone: | rc | ||
| Target Release: | --- | ||
| Hardware: | Unspecified | ||
| OS: | Unspecified | ||
| Whiteboard: | |||
| Fixed In Version: | Doc Type: | Bug Fix | |
| Doc Text: | Story Points: | --- | |
| Clone Of: | Environment: | ||
| Last Closed: | 2012-05-15 19:39:08 UTC | Type: | --- |
| Regression: | --- | Mount Type: | --- |
| Documentation: | --- | CRM: | |
| Verified Versions: | Category: | --- | |
| oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
| Cloudforms Team: | --- | Target Upstream Version: | |
|
Description
Chris Lalancette
2011-10-07 19:00:35 UTC
adding ce-sprint-next bugs to ce-sprint Can we close this as NOTABUG? explain why this is not a bug, why is the jira open From JIRA:
Which IMHO is the correct way. Simply the method is not available (not exists) for current instance of the Instance. To check if current instance support '.start!' operation (same for stop!, reboot!, etc..) you can do following:
instance.respond_to? :start!
Eventually you can call:
instance.actions
This should return following:
[["stop", "http://localhost:3002/api/instances/ed84016a-a000-4007-adeb-cde73d0f58a6/stop"], ["create_image", "http://localhost:3002/api/images;instance_id=ed84016a-a000-4007-adeb-cde73d0f58a6"]]
Copying comments from corresponding JIRA: DTACLOUD-89 Closing this JIRA issue out. Deltacloud does report when actions are not supported on an instance in a particular state: Example: executing 'start' on a RUNNING instance <error status='405' url='/api/instances/bf388696-55a4-4fb2-b2d8-170416651a28/start?format=xml'> <message> Requested method not allowed </message> <method> POST </method> </error> and executing GET /api/instance/:id will show the supported actions for the instance in its current state: <actions> <link href='http://server:3001/api/instances/bf388696-55a4-4fb2-b2d8-170416651a28/stop' method='post' rel='stop' /> <link href='http://server:3001/api/images;instance_id=bf388696-55a4-4fb2-b2d8-170416651a28' method='post' rel='create_image' /> </actions> so comments (in Comment 5 above) are verified. Will add testing for client responses to backend errors. Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory, and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. http://rhn.redhat.com/errata/RHEA-2012-0593.html |