'Creates OperationContract for deleteServerGroup.
To verify the operation, we just check that the GCP managed instance group
is no longer visible on GCP (or is in the process of terminating).'

def delete_server_group(self):

    bindings = self.bindings
    group_name = '{app}-{stack}-v000'.format(app=self.TEST_APP, stack=bindings['TEST_STACK'])
    payload = self.agent.make_json_payload_from_kwargs(job=[{'cloudProvider': 'gce', 'serverGroupName': group_name, 'region': bindings['TEST_GCE_REGION'], 'zone': bindings['TEST_GCE_ZONE'], 'type': 'destroyServerGroup', 'regions': [bindings['TEST_GCE_REGION']], 'zones': [bindings['TEST_GCE_ZONE']], 'credentials': bindings['SPINNAKER_GOOGLE_ACCOUNT'], 'user': '[anonymous]'}], application=self.TEST_APP, description=('DestroyServerGroup:    ' + group_name))
    builder = gcp.GcpContractBuilder(self.gcp_observer)
    builder.new_clause_builder('Managed    Instance    Group    Removed').inspect_resource('instanceGroupManagers', group_name).EXPECT(ov_factory.error_list_contains(gcp.HttpErrorPredicate(http_code=404))).OR(ov_factory.value_list_path_contains('targetSize', jp.NUM_EQ(0)))
    builder.new_clause_builder('Instances    Are    Removed', retryable_for_secs=30).list_resource('instances').EXPECT(ov_factory.value_list_path_excludes('name', jp.STR_SUBSTR(group_name)))
    return st.OperationContract(self.new_post_operation(title='delete    server    group', data=payload, path='tasks'), contract=builder.build())
