'Creates OperationContract for createServerGroup.
To verify the operation, we just check that the AWS Auto Scaling Group
for the server group was created.'

def create_server_group(self):

    bindings = self.bindings
    group_name = '{app}-{stack}-v000'.format(app=self.TEST_APP, stack=bindings['TEST_STACK'])
    region = bindings['TEST_AWS_REGION']
    avail_zones = [(region + 'a'), (region + 'b')]
    test_security_group_id = bindings['TEST_AWS_SECURITY_GROUP_ID']
    test_security_group_id = 'default'
    payload = self.agent.make_json_payload_from_kwargs(job=[{'type': 'createServerGroup', 'cloudProvider': 'aws', 'application': self.TEST_APP, 'credentials': bindings['SPINNAKER_AWS_ACCOUNT'], 'strategy': '', 'capacity': {'min': 2, 'max': 2, 'desired': 2}, 'targetHealthyDeployPercentage': 100, 'loadBalancers': [self.lb_name], 'cooldown': 8, 'healthCheckType': 'EC2', 'healthCheckGracePeriod': 40, 'instanceMonitoring': False, 'ebsOptimized': False, 'iamRole': bindings['AWS_IAM_ROLE'], 'terminationPolicies': ['Default'], 'availabilityZones': {region: avail_zones}, 'keyPair': bindings['TEST_AWS_KEYPAIR'], 'suspendedProcesses': [], 'subnetType': 'internal    (defaultvpc)', 'securityGroups': [test_security_group_id], 'virtualizationType': 'paravirtual', 'stack': bindings['TEST_STACK'], 'freeFormDetails': '', 'amiName': bindings['TEST_AWS_AMI'], 'instanceType': 'm1.small', 'useSourceCapacity': False, 'account': bindings['SPINNAKER_AWS_ACCOUNT'], 'user': '[anonymous]'}], description=('Create    Server    Group    in    ' + group_name), application=self.TEST_APP)
    builder = aws.AwsPythonContractBuilder(self.aws_observer)
    builder.new_clause_builder('Auto    Server    Group    Added', retryable_for_secs=30).call_method(self.autoscaling_client.describe_auto_scaling_groups, AutoScalingGroupNames=[group_name]).EXPECT(ov_factory.value_list_path_contains('AutoScalingGroups', jp.LIST_MATCHES([jp.DICT_MATCHES({'MaxSize': jp.NUM_EQ(2)})])))
    return st.OperationContract(self.new_post_operation(title='create_server_group', data=payload, path='tasks'), contract=builder.build())
