[ 
https://issues.apache.org/jira/browse/DTACLOUD-214?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13566377#comment-13566377
 ] 

Dies Koper commented on DTACLOUD-214:
-------------------------------------

This code has moved to server/lib/deltacloud/helpers/deltacloud_helper.rb.
I created a patch to move the code but:
1. Not sure if providers are dealing with the errors correctly. The API tests 
didn't find any issues but I found that the fgcp driver would return different 
error codes so we likely have no tests in place.
2. This code returns 405 (Not Allowed) while Marios has recently been 
introducing 409 (Conflict) in similar cases. Again, making this change could 
uncover other inconsistencies.

I'd therefore like to reconsider my initial suggestion: extract and move the 
state retrieval code to a separate method that we can override with more 
efficient calls for providers that benefit from it.
This can be performed (and tested) per provider so less chance of introducing 
unintended API changes.
                
> instance start/stop/destroy makes many calls to backend (depending on 
> provider)
> -------------------------------------------------------------------------------
>
>                 Key: DTACLOUD-214
>                 URL: https://issues.apache.org/jira/browse/DTACLOUD-214
>             Project: DeltaCloud
>          Issue Type: Improvement
>          Components: Server
>            Reporter: Dies Koper
>            Assignee: David Lutterkort
>            Priority: Minor
>         Attachments: 
> 0001-extract-code-to-check-instance-state-to-separate-met.patch, 
> 0001-leave-it-up-to-the-driver-to-return-405-error-Method.patch
>
>
> Before performing an action on an instance, DC retrieves the current instance 
> state to confirm it is in a valid state to perform the requested action.
> It does this by calling the instance() API. On some drivers, at least FGCP's, 
> this operation makes a number of calls to the backend: one to get the 
> instance attributes such as its name, one to get the state, one to get its 
> assigned public IP address(es), one to get the initial password, etc.
> While all it needs is the state.
> If we extract and move the state retrieval code to a separate method we can 
> override it with more efficient calls for providers that benefit from it.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Reply via email to