| OLD | NEW |
| 1 # Copyright 2015 The LUCI Authors. All rights reserved. | 1 # Copyright 2015 The LUCI Authors. All rights reserved. |
| 2 # Use of this source code is governed by the Apache v2.0 license that can be | 2 # Use of this source code is governed under the Apache License, Version 2.0 |
| 3 # found in the LICENSE file. | 3 # that can be found in the LICENSE file. |
| 4 | 4 |
| 5 """Wrapper around GCE REST API.""" | 5 """Wrapper around GCE REST API.""" |
| 6 | 6 |
| 7 import json | 7 import json |
| 8 import re | 8 import re |
| 9 | 9 |
| 10 from components import net | 10 from components import net |
| 11 | 11 |
| 12 | 12 |
| 13 AUTH_SCOPES = [ | 13 AUTH_SCOPES = [ |
| (...skipping 577 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 591 def machine_type_to_num_cpus(machine_type): | 591 def machine_type_to_num_cpus(machine_type): |
| 592 """Given a machine type returns its number of CPUs.""" | 592 """Given a machine type returns its number of CPUs.""" |
| 593 assert machine_type in MACHINE_TYPES, machine_type | 593 assert machine_type in MACHINE_TYPES, machine_type |
| 594 return MACHINE_TYPES[machine_type]['cpus'] | 594 return MACHINE_TYPES[machine_type]['cpus'] |
| 595 | 595 |
| 596 | 596 |
| 597 def machine_type_to_memory(machine_type): | 597 def machine_type_to_memory(machine_type): |
| 598 """Given a machine type returns its memory in GB.""" | 598 """Given a machine type returns its memory in GB.""" |
| 599 assert machine_type in MACHINE_TYPES, machine_type | 599 assert machine_type in MACHINE_TYPES, machine_type |
| 600 return MACHINE_TYPES[machine_type]['memory'] | 600 return MACHINE_TYPES[machine_type]['memory'] |
| OLD | NEW |