Exemplo n.º 1
0
def create(module, result, payload={}):
    if module.params["action"] == "import":
        call_result = api_client.post_file(
            module.client,
            new_url(module),
            payload,
            file_path=module.params["file_path"],
            file_name=module.params["file"])
    else:
        call_result = api_client.post(module.client, new_url(module), payload)
    result["axapi_calls"].append(call_result)
    result["modified_values"].update(**call_result["response_body"])
    result["changed"] = True
    return result
Exemplo n.º 2
0
def create(module, result, payload={}):
    if module.params["action"] == "import":
        call_result = api_client.post_file(
            module.client,
            new_url(module),
            payload,
            file_path=module.params["file_path"],
            file_name=module.params["file"])
    else:
        call_result = api_client.post(module.client, new_url(module), payload)
    result["axapi_calls"].append(call_result)
    # Cert endpoints don't return anything so return request values intead
    result["modified_values"].update(**call_result["request_body"]["ca-cert"])
    result["changed"] = True
    return result