Portainer icon

Portainer

Interact with Portainer via API

Actions190

Resource Controls → Resource Control Create

AI-generated

Overview

This node allows you to create a new resource control in Portainer by sending the specified details as a JSON body. Resource controls in Portainer are used to manage access permissions and restrictions on various resources, making this node useful for automating the setup of access policies within your container management environment.

Common scenarios include:

  • Automating the creation of access controls when provisioning new resources.
  • Integrating resource permission management into CI/CD pipelines.
  • Managing user or team access programmatically without manual intervention.

Example: You can use this node to create a resource control that restricts access to a specific container or stack by providing the appropriate JSON configuration in the "Body" property.

Properties

Name Meaning
Body The JSON string containing the details of the resource control to be created. This should include all necessary fields as defined by the Portainer API for resource controls.

Output

The node outputs the response from the Portainer API after creating the resource control. The json output field contains the details of the newly created resource control, typically including its ID, associated resource information, and access control settings.

If the API returns binary data (unlikely in this context), it would represent raw response content, but primarily the output is JSON structured data representing the created resource control.

Dependencies

  • Requires an active connection to a Portainer instance via its API.
  • Needs an API authentication token or key configured in the node credentials to authorize requests.
  • The base URL of the Portainer API must be provided in the credentials configuration.

Troubleshooting

  • Invalid JSON in Body: If the "Body" property contains malformed JSON, the API will reject the request. Ensure the JSON string is correctly formatted.
  • Authentication Errors: Missing or invalid API credentials will cause authorization failures. Verify that the API key/token and URL are correctly set.
  • API Endpoint Issues: If the Portainer API URL is incorrect or the service is unreachable, the node will fail to connect. Check network connectivity and endpoint correctness.
  • Permission Denied: The API user may lack sufficient privileges to create resource controls. Confirm the API user's permissions in Portainer.

Links and References

Discussion