Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

destroy user not working for etcd api v2 #280

Open
avishi-tr opened this issue Jan 22, 2025 · 0 comments
Open

destroy user not working for etcd api v2 #280

avishi-tr opened this issue Jan 22, 2025 · 0 comments

Comments

@avishi-tr
Copy link

Hi ,
using the restapi, I need to create and destroy user in etcd server with rest api v2 .
The create works well, but the destroy keeps returning "unexpected response code '400': {"message":"Invalid path"}"

resource "restapi_object" "create_user" {
create_method = "PUT"
provider = restapi.restapi_headers
path = "/v2/auth/users/${local.etcd_user_name}"
data = jsonencode({
id = "1"
user = "${local.etcd_user_name}"
password = "${local.etcd_user_password}"
})
destroy_method = "DELETE"
destroy_path = "/v2/auth/users/${local.etcd_user_name}"
}

When using a simple curl command the user is deleted .

curl -X DELETE http://$ETCD_URL:2379/v2/auth/users/$ETCD_USER_NAME/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant