List of all available groovy functions in Nexus3
Asked Answered
H

3

5

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.

Hetti answered 18/4, 2018 at 10:48 Comment(0)
W
8

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

Wondering answered 18/4, 2018 at 15:19 Comment(0)
C
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.

Cincture answered 18/4, 2018 at 15:14 Comment(0)
G
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

Gehenna answered 5/1, 2020 at 9:13 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.