Ejemplo n.º 1
0
def group_instances_resize(count):
    return API_Compute(Configuration(service=settings.UI_SERVICE,
                                     project=settings.UI_PROJECT),
                       auth='service').instanceGroupManagers().resize(
                           project=settings.UI_PROJECT,
                           zone=settings.UI_ZONE,
                           instanceGroupManager='starthinker-worker-group',
                           size=count).execute()
Ejemplo n.º 2
0
def group_instances_resize(count):
    project.initialize(_service=settings.UI_SERVICE,
                       _project=settings.UI_PROJECT)
    return API_Compute('service').instanceGroupManagers().resize(
        project=settings.UI_PROJECT,
        zone=settings.UI_ZONE,
        instanceGroupManager='starthinker-worker-group',
        size=count).execute()
Ejemplo n.º 3
0
def group_instances_list(statuses=[]):
    project.initialize(_service=settings.UI_SERVICE,
                       _project=settings.UI_PROJECT)
    return API_Compute(
        'service', iterate=True).instanceGroupManagers().listManagedInstances(
            project=settings.UI_PROJECT,
            zone=settings.UI_ZONE,
            instanceGroupManager='starthinker-worker-group',
            filter=' OR '.join(
                ['(instanceStatus = "%s")' % status for status in statuses]),
            orderBy="creationTimestamp desc").execute()
Ejemplo n.º 4
0
def group_instances_delete(name):
    project.initialize(_service=settings.UI_SERVICE,
                       _project=settings.UI_PROJECT)
    return API_Compute('service').instanceGroupManagers().deleteInstances(
        project=settings.UI_PROJECT,
        zone=settings.UI_ZONE,
        instanceGroupManager='starthinker-worker-group',
        body={
            'instances': ['zones/%s/instances/%s' % (settings.UI_ZONE, name)],
            "type": "PROACTIVE"
        }).execute()
Ejemplo n.º 5
0
def group_instances_delete(name):
    return API_Compute(
        Configuration(service=settings.UI_SERVICE,
                      project=settings.UI_PROJECT),
        auth='service').instanceGroupManagers().deleteInstances(
            project=settings.UI_PROJECT,
            zone=settings.UI_ZONE,
            instanceGroupManager='starthinker-worker-group',
            body={
                'instances':
                ['zones/%s/instances/%s' % (settings.UI_ZONE, name)],
                'type': 'PROACTIVE'
            }).execute()