Академический Документы
Профессиональный Документы
Культура Документы
The scope of this project is to create a Python microservice using the eventify framework to
collect the following datapoints from the Google Compute Engine API documented here:
https://cloud.google.com/compute/docs/api/how-tos/authorization
https://cloud.google.com/compute/docs/reference/latest/regions/list
https://cloud.google.com/compute/docs/reference/latest/machineTypes/list
{
name: name of the data point we would like to collect for a given machine
type
description: description of the data point
type_title: the underlying data type the point should be collected in
}
https://bpaste.net/show/044ae52dc5bb
It should be noted that not all data points may be available for each Google Compute
Engine machine type.
https://cloud.google.com/compute/docs/machine-types
https://cloud.google.com/compute/docs/reference/latest/machineTypes#resource
https://cloud.google.com/compute/pricing#machinetype
https://cloud.google.com/compute/docs/cpu-platforms
https://cloud.google.com/compute/docs/disks/
https://cloud.google.com/compute/docs/regions-zones/regions-zones
There may be other relevant documentation available via the Google Compute Engine
website.
The goal of this project is to collect all of available data points from each region of Google
Compute Engine via API and normalize the data into the names of the data points per the
JSON document above. For each normalized machine type it should then be published by
creating a new event using the eventify framework which is detailed below.
General software requirements
Use the eventify module (https://github.com/eventifyio/eventify)
Use Python 3.6 (https://www.python.org/downloads/release/python-362/)
Middleware availability
All required middleware has been setup and is running and available via socket.opless.io.
This is ephemeral middleware and will not store any data to disk but is provided to you to
enhance development efforts. The configuration of this middleware is provided below
during the boilerplate section.
Boilerplate code
The following code examples are setup to assist you in the development of the project
described above.
def run():
"""
Run an eventify service
"""
Service(
config_file='config.json',
handlers=[Collector]
).start()
if __name__ == '__main__':
run()
class GoogleCollector:
"""
Google Specific Collector
"""
async def collect_vm_data(self):
print('...collecting data from gce api...')
await asyncio.sleep(1)
def __init__(self):
"""
Service initialization
"""
print('...service initialized...')
Acceptance criteria
Upon review of the provided source code and verification that the code properly collects the data points
available from Google Compute Engine API the following will be checked:
1. Pylint scoring
2. Provided code uses eventify
3. Provided code publishes events to the middleware provided
4. Manual check that the data received is correct based on what is documented in the ui for the
given machine types.