Comment 7 for bug 1785223

Revision history for this message
Ian Booth (wallyworld) wrote :

@anastasia, the correct API NewControllerAPIRoot() is being used (offers uses a controller facade).

The issue was simply that the api call to query the offers on the target controller omitted the owner of the model hosting the offer (hence the not found error).

@jacekn, note that juju offers command requires admin access to the model hosting the offer. It is for use by admins to allow visibility of who is connected to the offer and other such info. As a general user, who has been granted read access to the offer (or consume access), you should use the find-offers command to query a given controller to see what offers are available. If the user has read access, they can see the offers but not consume. You can specify a controller name to find all offers on a given controller, or a specific model name to find offers in just that model.

$ juju help find-offers
Usage: juju find-offers [options]

Summary:
Find offered application endpoints.

Details:
Find which offered application endpoints are available to the current user.

This command is aimed for a user who wants to discover what endpoints are available to them.

Examples:
   $ juju find-offers
   $ juju find-offers mycontroller:
   $ juju find-offers fred/prod
   $ juju find-offers --interface mysql
   $ juju find-offers --url fred/prod.db2
   $ juju find-offers --offer db2