if stack.Type == portainer.DockerSwarmStack || stack.Type == portainer.DockerComposeStack {
            resourceControl, err := handler.DataStore.ResourceControl().ResourceControlByResourceIDAndType(stackutils.ResourceControlID(stack.EndpointID, stack.Name), portainer.StackResourceControl)
            if err != nil {
                return httperror.InternalServerError("Unable to retrieve a resource control associated to the stack", err)
            }