4

Where can I find the groovy API documentation containing the list of available function for Sonatype Nexus 3?

I saw the web page below which describes

  • core
  • repository
  • blobStore
  • security

https://help.sonatype.com/repomanager3/rest-and-integration-api/script-api/writing-scripts#app

... but how to know what to put after security, for example security.securitySystem.changePassword?

Thanks.

Samuel Mutel
  • 79
  • 3
  • 10

3 Answers3

7

I too had looked for the specific functions for a while but didn't find any official documentation, so I went straight to the code looking for the functions:

Here are some samples that may help: https://github.com/sonatype/nexus-book-examples/tree/nexus-3.x/scripting.

The links were taken from this page: https://books.sonatype.com/nexus-book/3.0/reference/scripting.html#scripting-configuration

1

You should read the code itself, a good start would be Nexus3 Cookbook since it has explanations from the Nexus3 Cookbook and examples.

For API examples you can read up on them at API Examples.

wiredniko
  • 2,491
  • 3
  • 19
  • 37
1
  1. System > Tasks > Create Task of Type : Admin - Execute Script.

    • Task name: Get all repo methods
    • Language: groovy
    • Source:

      log.info(
         repository.getClass().
           declaredMethods.
             findAll{ !it.synthetic}*.name.join(', ')
      
      )
      
  2. Run the Task

  3. Check logs in : Support > Logging > Log Viewer

Abdennour TOUMI
  • 87,526
  • 38
  • 249
  • 254