/ libcloud Public
[LIBCLOUD-873] Updated ProfitBricks Compute Driver (REST api v3) #938
Add this suggestion to a batch that can be applied as a single commit. This suggestion is invalid because no changes were made to the code. Suggestions cannot be applied while the pull request is closed. Suggestions cannot be applied while viewing a subset of changes. Only one suggestion per line can be applied in a batch. Add this suggestion to a batch that can be applied as a single commit. Applying suggestions on deleted lines is not supported. You must change the existing code in this line in order to create a valid suggestion. Outdated suggestions cannot be applied. This suggestion has been applied or marked resolved. Suggestions cannot be applied from pending reviews. Suggestions cannot be applied on multi-line comments. Suggestions cannot be applied while the pull request is queued to merge.
Updating the ProfitBricks compute driver to work with the REST api (v3)
This PR includes changes to the ProfitBricks compute driver to drop support for the old SOAP api (now end of life) and provide support for v3 of the REST api.
All public operations provided by the new REST api are supported in this driver.
New test fixtures have been added and all tests have been amended.
A change has been added to the libcloud/common/base.py file to ensure that a request that returns with a HTTP status of 202 is not flagged as a failed request. Before this, only 200 and 201 were flagged as successful requests.
Checklist (tick everything that applies)
Code linting for the compute driver implementation and the accompanying test file has been completed using the
Documentation has been updated consisting of examples of using all core and extended functionality specific to ProfitBricks. A demo file with instructions on creating two servers has been put together and these will be published on the ProfitBricks community website.
All test fixtures for api calls have been added in JSON format, replacing the older XML fixtures. All tests are passing.
Summary of changes
Refactoring the compute driver to remove support for the EOL SOAP api and modifying api calls to use the REST api (v3).
Removing XML test fixtures and replacing them with JSON fixtures.
Providing wrappers for all new functionality provided in v3 of the Cloud API.
Addressing an issue in libcloud/common/base.py where a http status code of 202 would not be flagged as a successful request.