Ejemplo n.º 1
0
def given_the_created_notify_rule_in_the_in_the_group1_with_the_following_parameters(
        step, server_id):
    world.cpu = None
    world.mem = None
    world.hdd = None
    world.net = None
    world.server_id = server_id

    for examples in step.hashes:
        rule_body = Rule_Utils.create_notify_specific_rule(
            body=examples['body'],
            email=examples['email'],
            name=examples['name'],
            cpu_value=examples['cpu_value'],
            cpu_operand=examples['cpu_operand'],
            mem_value=examples['mem_value'],
            mem_operand=examples['mem_operand'],
            hdd_value=examples['hdd_value'],
            hdd_operand=examples['hdd_operand'],
            net_value=examples['net_value'],
            net_operand=examples['net_operand'])

        req = api_utils.create_rule(tenant_id=world.tenant_id,
                                    server_id=world.server_id,
                                    body=rule_body)
        world.rule_id = req.json()[RULE_ID]
Ejemplo n.º 2
0
def given_the_created_notify_rule_in_the_in_the_group1_with_the_following_parameters(
        context, server_id):
    context.cpu = None
    context.mem = None
    context.hdd = None
    context.net = None
    context.server_id = server_id

    for examples in context.table.rows:
        rule_body = Rule_Utils.create_notify_specific_rule(
            body=examples['body'],
            email=examples['email'],
            name=examples['name'],
            cpu_value=examples['cpu_value'],
            cpu_operand=examples['cpu_operand'],
            mem_value=examples['mem_value'],
            mem_operand=examples['mem_operand'],
            hdd_value=examples['hdd_value'],
            hdd_operand=examples['hdd_operand'],
            net_value=examples['net_value'],
            net_operand=examples['net_operand'])

        req = api_utils.create_rule(tenant_id=context.tenant_id,
                                    server_id=context.server_id,
                                    body=rule_body)
        context.rule_id = req.json()[RULE_ID]
Ejemplo n.º 3
0
def update_non_existent_rule(step, another_rule):

    body = Rule_Utils.create_notify_specific_rule()
    world.req = api_utils.update_rule(tenant_id=world.tenant_id,
                                      server_id=world.server_id,
                                      body=body,
                                      rule_id=another_rule,
                                      headers=world.headers)
Ejemplo n.º 4
0
def update_non_existent_rule(context, another_rule):

    body = Rule_Utils.create_notify_specific_rule()
    context.req = api_utils.update_rule(tenant_id=context.tenant_id,
                                        server_id=context.server_id,
                                        body=body,
                                        rule_id=another_rule,
                                        headers=context.headers)
Ejemplo n.º 5
0
def given_group1_of_rules_created_in_group2(step, number_rules, server_id):

    world.server_id = server_id
    world.number_rules = int(number_rules)
    for x in range(world.number_rules):
        rule_body = Rule_Utils.create_notify_specific_rule()
        req = api_utils.create_rule(world.tenant_id, world.server_id, body=rule_body)
        assert_true(req.ok, HTTP_CODE_NOT_OK.format(req.status_code, req.content))
        rule_id = req.json()[RULE_ID]
        world.rules.append(rule_body)
Ejemplo n.º 6
0
def given_group1_of_rules_created_in_group2(step, number_rules, server_id):

    world.server_id = server_id
    world.number_rules = int(number_rules)
    for x in range(world.number_rules):
        rule_body = Rule_Utils.create_notify_specific_rule()
        req = api_utils.create_rule(world.tenant_id, world.server_id, body=rule_body)
        assert_true(req.ok, HTTP_CODE_NOT_OK.format(req.status_code, req.content))
        rule_id = req.json()[RULE_ID]
        world.rules.append(rule_body)
Ejemplo n.º 7
0
def given_the_created_notify_rule_in_the_in_the_group1_with_the_following_parameters(step, server_id):
    world.cpu = None
    world.mem = None
    world.server_id = server_id

    for examples in step.hashes:
        rule_body = Rule_Utils.create_notify_specific_rule(body=examples['body'],
                                                           email=examples['email'],
                                                           name=examples['name'],
                                                           cpu_value=examples['cpu_value'],
                                                           cpu_operand=examples['cpu_operand'],
                                                           mem_value=examples['mem_value'],
                                                           mem_operand=examples['mem_operand'])

        req = api_utils.create_rule(tenant_id=world.tenant_id, server_id=world.server_id, body=rule_body)
        world.rule_id = req.json()[RULE_ID]
Ejemplo n.º 8
0
def given_the_created_notify_rule_in_the_in_the_group1_with_the_following_parameters(context, server_id):
    context.cpu = None
    context.mem = None
    context.hdd = None
    context.net = None
    context.server_id = server_id

    for examples in context.table.rows:
        rule_body = Rule_Utils.create_notify_specific_rule(body=examples['body'],
                                                           email=examples['email'],
                                                           name=examples['name'],
                                                           cpu_value=examples['cpu_value'],
                                                           cpu_operand=examples['cpu_operand'],
                                                           mem_value=examples['mem_value'],
                                                           mem_operand=examples['mem_operand'],
                                                           hdd_value=examples['hdd_value'],
                                                           hdd_operand=examples['hdd_operand'],
                                                           net_value=examples['net_value'],
                                                           net_operand=examples['net_operand'])

        req = api_utils.create_rule(tenant_id=context.tenant_id, server_id=context.server_id, body=rule_body)
        context.rule_id = req.json()[RULE_ID]
Ejemplo n.º 9
0
def update_non_existent_rule(step, another_rule):

    body = Rule_Utils.create_notify_specific_rule()
    world.req = api_utils.update_rule(tenant_id=world.tenant_id, server_id=world.server_id, body=body,
                                      rule_id=another_rule, headers=world.headers)
Ejemplo n.º 10
0
def update_non_existent_rule(context, another_rule):

    body = Rule_Utils.create_notify_specific_rule()
    context.req = api_utils.update_rule(tenant_id=context.tenant_id, server_id=context.server_id, body=body,
                                        rule_id=another_rule, headers=context.headers)