# Need help to implement some functions using the nexus Integration API

**URL:** <https://community.sonatype.com/t/need-help-to-implement-some-functions-using-the-nexus-integration-api/1121>\
**Category:** Sonatype Nexus Repository\
**Created:** [January 28, 2019, 4:09pm UTC](https://community.sonatype.com/t/need-help-to-implement-some-functions-using-the-nexus-integration-api/1121 "2019-01-28T16:09:36Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![atselvan](https://avatars.discourse-cdn.com/v4/letter/a/3ab097/32.png) [@atselvan](https://community.sonatype.com/u/atselvan)\
**Post date:** [January 28, 2019, 4:09pm UTC](https://community.sonatype.com/t/need-help-to-implement-some-functions-using-the-nexus-integration-api/1121/1 "2019-01-28T16:09:36Z")

</div>

- How can I Get the members of an existing group repository and Add members to a existing group repository.
- How can I modify additional properties of a repository. Like:  
- Online status  
- Adding a clean-up policy to the repo  
- Additional remote storage properties of a proxy repo (Check the screenshot attached)

How to configure the security part, I need to implement below tasks:  
- add content selectors  
- add custom privileges using the content selectors  
- add custom roles adding the privileges : guess the addRole() function covers this. \> Does this role sync with the a LDAP role?  
- add additional privileges or roles to an existing role  
- delete content selectors, privileges and roles

My Code: [GitHub - atselvan/nexus3-repository-cli: Nexus 3 CLI](https://github.com/atselvan/nexus3-repository-cli)

---

<div class="post-metadata">

**Author:** ![nickcook](https://yyz1.discourse-cdn.com/flex047/user_avatar/community.sonatype.com/nickcook/32/399_2.png) [@nickcook](https://community.sonatype.com/u/nickcook)\
**Post date:** [January 29, 2019, 10:44pm UTC](https://community.sonatype.com/t/need-help-to-implement-some-functions-using-the-nexus-integration-api/1121/2 "2019-01-29T22:44:52Z")

</div>

Hi Allen,

Take a look at this project:

> **[ansible-nexus3-oss/files/groovy at master · savoirfairelinux/ansible-nexus3-oss](https://github.com/savoirfairelinux/ansible-nexus3-oss/tree/master/files/groovy)**
>
> master/files/groovy

It has some examples with roles and privileges as well as LDAP leveraging the Integration API. That might be enough to get you going. Let me know if it works out for you.

Cheers,

Nick

---

<div class="post-metadata">

**Author:** ![atselvan](https://avatars.discourse-cdn.com/v4/letter/a/3ab097/32.png) [@atselvan](https://community.sonatype.com/u/atselvan)\
**Post date:** [January 29, 2019, 11:12pm UTC](https://community.sonatype.com/t/need-help-to-implement-some-functions-using-the-nexus-integration-api/1121/3 "2019-01-29T23:12:18Z")

</div>

Hi @nickcook,

Thanks much for your reply. I have already gone through the mentioned repository and the security related functions there did not meet all my needs.

Found this GIST online, [A groovy script to create Content Selectors, privileges, and roles programmatically via the Nexus Repository Manager 3 Scripting API. · GitHub](https://gist.github.com/nblair/1a0e05713c3edb7e5360c2b0222c7623) - I think this one will help, not sure if it helps completely yet.

Regards,  
Allan Selvan
