Skip to content

Setting access control via API not working? #12594

Closed Answered by Nick-Portainer
awillinger-work asked this question in Help
Discussion options

You must be logged in to vote

Hi @awillinger-work Those labels aren't for use with the API. they are for stacks deployed outside of Portainer. You would want to run a PUT request to the /resource_controls/{id} endpoint using the ResourceControl.Id returned when the container is created.

https://app.swaggerhub.com/apis/portainer/portainer-ee/2.27.1#/resource_controls/ResourceControlUpdate

For example, if my container creation response is

{
    "Id": "24538bfb8992615879fd8a745fb9828dfce25a37d917a1af1af93917b1607e9e",
    "Portainer": {
        "ResourceControl": {
            "Id": 6,
...

I would make a PUT request to /resource_controls/6 and specify the setup I wanted (private, with team 7 to have access), team 7 bein…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@awillinger-work
Comment options

Answer selected by Nick-Portainer
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Help
Labels
None yet
2 participants