def create_backend_set(lb_client, module):
    backen_end_set_input_details = dict({
        'backends':
        module.params.get('backends', None),
        'health_checker':
        module.params.get('health_checker'),
        'policy':
        module.params.get('policy'),
        'session_persistence_configuration':
        module.params.get('session_persistence_configuration', None),
        'ssl_configuration':
        module.params.get('ssl_configuration', None)
    })
    name = module.params.get('name')
    lb_id = module.params.get('load_balancer_id')
    get_logger().info("Creating backend set %s in the load balancer %s", name,
                      lb_id)
    backend_set_details = oci_lb_utils.create_backend_sets(
        dict({name: backen_end_set_input_details})).get(name)
    create_backend_set_details = CreateBackendSetDetails()
    for attribute in create_backend_set_details.attribute_map:
        create_backend_set_details.__setattr__(
            attribute, getattr(backend_set_details, attribute, None))
    create_backend_set_details.name = name
    result = oci_lb_utils.create_or_update_lb_resources_and_wait(
        resource_type="backend_set",
        function=lb_client.create_backend_set,
        kwargs_function={
            'create_backend_set_details': create_backend_set_details,
            'load_balancer_id': lb_id
        },
        lb_client=lb_client,
        get_fn=lb_client.get_backend_set,
        kwargs_get={
            'load_balancer_id': lb_id,
            'backend_set_name': name
        },
        module=module)
    get_logger().info(
        "Successfully created backend set %s in the load balancer %s", name,
        lb_id)

    return result
def create_backend_set(lb_client, module):
    backen_end_set_input_details = dict(
        {
            "backends": module.params.get("backends", None),
            "health_checker": module.params.get("health_checker"),
            "policy": module.params.get("policy"),
            "session_persistence_configuration": module.params.get(
                "session_persistence_configuration", None
            ),
            "ssl_configuration": module.params.get("ssl_configuration", None),
        }
    )
    name = module.params.get("name")
    lb_id = module.params.get("load_balancer_id")
    get_logger().info("Creating backend set %s in the load balancer %s", name, lb_id)
    backend_set_details = oci_lb_utils.create_backend_sets(
        dict({name: backen_end_set_input_details})
    ).get(name)
    create_backend_set_details = CreateBackendSetDetails()
    for attribute in create_backend_set_details.attribute_map:
        create_backend_set_details.__setattr__(
            attribute, getattr(backend_set_details, attribute, None)
        )
    create_backend_set_details.name = name
    result = oci_lb_utils.create_or_update_lb_resources_and_wait(
        resource_type="backend_set",
        function=lb_client.create_backend_set,
        kwargs_function={
            "create_backend_set_details": create_backend_set_details,
            "load_balancer_id": lb_id,
        },
        lb_client=lb_client,
        get_fn=lb_client.get_backend_set,
        kwargs_get={"load_balancer_id": lb_id, "backend_set_name": name},
        module=module,
    )
    get_logger().info(
        "Successfully created backend set %s in the load balancer %s", name, lb_id
    )

    return result