Closed khaounen closed 2 months ago
Hello @khaounen the correct path is
https://terrakube-api.awnen.com/api/v1/organizations/140206a1-b498-4a04-840c-ed1e3c8cdf37/provider
You are missing the "api/v1" part
By the way you didnt find any RestController
because for some part of the code we are using elide so we only define the database entity and the framework takes care of generating all the CRUD endpoints
Thank you again for your quick reply I'm getting "Unknow Collection Organization" in the response now, Is this because of the organization ID I copied from the URL? This is the the URL to access my org https://terrakube-ui.awnen.com/organizations/140206a1-b498-4a04-840c-ed1e3c8cdf37/workspaces
So I used 140206a1-b498-4a04-840c-ed1e3c8cdf37
as organization ID, isn't this correct?
curl -XPOST https://terrakube-api.awnen.com/api/v1/organizations/140206a1-b498-4a04-840c-ed1e3c8cdf37/provider -H "Content-Type: application/vnd.api+json" -H "Authorization: Bearer xxxxxx" -d '{
"data": {
"type": "provider",
"attributes": {
"name": "random",
"description": "random provider"
}
}
}'
{"errors":[{"detail":"Unknown collection organizations"}]}
It is organization
not organizations
in the path
The correct way should be
curl -X POST https://terrakube-api.awnen.com/api/v1/organization/140206a1-b498-4a04-840c-ed1e3c8cdf37/provider -H "Content-Type: application/vnd.api+json" -H "Authorization: Bearer xxxxxx" -d '{
"data": {
"type": "provider",
"attributes": {
"name": "random",
"description": "random provider"
}
}
}
Oh my bad! its fixed but looks like the user I'm connecting with (member of TERRAKUBE_ADMIN) doesn't have the right to create the provider in the organization
{"errors":[{"detail":"CreatePermission Denied"}]}
Maybe another group needed for this?
TERRAKUBE_ADMIN
The TERRAKUBE_ADMIN group can only manage teams and create organization inside Terrakube,
If you want to use that team to manage workspace, providers, modules, etc you will have to add that team to the teams organization setting.
You can follow this:
https://docs.terrakube.io/user-guide/organizations/team-management
Ok great! thank you again, I'm closing my ticket as there is no bug from the api side, its more from the post I was doing, thank you again, I'll check the doc and give it a try later
EDIT:
Checked quickly the link you've sent me,
I only needed to create a team called TERRAKUBE_ADMIN and check Manage providers
, and now the Post is working
Bug description 🐞
Hi @alfespa17 and thank you for the detailed documentation you added to publish a private provider https://github.com/AzBuilder/docs/blob/main/user-guide/private-registry/using-providers.md
I've tried it today but I'm getting a 404 error, not sure from where comes this error
Steps to reproduce
Go to user settings -> create an api token and generate API TOKEN to call the api
Create an organization
Create provider inside organization
Expected behavior
return code status code
200
or201
maybe?Example repository
No response
Anything else?
I tried to check in the @RestController classes in the api project to find the provider endpoint but couldn't find it? maybe it was moved somewhere else? or removed completely?