This PR introduces a third provider, "Example", to Control along with all associated functions. Unlike the existing providers which utilise their own APIs, Example retrieves its data via Control API. Further information on Control API may be found here.
Some of aspects of this provider function differently/with more quirks than the existing Azure and AWS providers due to limitations in Control:
All providers in control are required to have security_id and security_key credentials. This works fine for AWS and Azure, but not Example since it does not have any credentials besides project name. Example takes some dummy values for these to prevent errors, but this should be addressed in a future branch abstracting the providers.
Control currently only supports USD and GBP currencies, and assumes that all instances in each compute group share the same currency. The example provider will take the first currency type it sees and assume that for all instances in the group, but this should be addressed in a future branch which abstracts Control's currency system.
Control supports the use of AWS regions/Azure resource groups to help their respective APIs. Example does have a region field for instances, but it isn't required by the API at all so this functionality is mostly redundant for the provider.
There is room in some services to reduce the number of API calls required - my aim with this branch was to generally match the structure of existing providers as much as possible, I imagine that future work on an abstract provider class may be able to retrieve the same data with fewer individual calls.
This PR also fixes some bugs in Control I encountered along the way:
Fixed a rare bug in which instance types could have underscores in their names replaced.
Fixed currency conversion rates defaulting to 0 instead of the actual default values.
Fixed the sign-out button not working.
Noted that compute group names are not allowed to contain - characters and cause strange behaviour when they do. Fixing this is outside the scope of this branch but the system which generates/reads instance IDs could do with a rework to prevent this being an issue.
This PR introduces a third provider, "Example", to Control along with all associated functions. Unlike the existing providers which utilise their own APIs, Example retrieves its data via Control API. Further information on Control API may be found here.
Some of aspects of this provider function differently/with more quirks than the existing Azure and AWS providers due to limitations in Control:
security_id
andsecurity_key
credentials. This works fine for AWS and Azure, but not Example since it does not have any credentials besides project name. Example takes some dummy values for these to prevent errors, but this should be addressed in a future branch abstracting the providers.region
field for instances, but it isn't required by the API at all so this functionality is mostly redundant for the provider.This PR also fixes some bugs in Control I encountered along the way:
-
characters and cause strange behaviour when they do. Fixing this is outside the scope of this branch but the system which generates/reads instance IDs could do with a rework to prevent this being an issue.