Coder Social home page Coder Social logo

Comments (4)

federicaagostini avatar federicaagostini commented on September 4, 2024

Hi, this is a paginated view of users when the itemsPerPage is set to 10.

To check the complete list of users please increment startIndex by 10, such as

https://wlcg.cloud.cnaf.infn.it/iam/account/search?startIndex=11

from iam.

sigau avatar sigau commented on September 4, 2024

hi,

Thank you for your response.
Is it possible to include all the group or user information in a single command?
Currently, we use a script that parses the JSON file obtained from the command and performs certain actions on our server side (like create a account for some indigoIAM users for one or multiple specific tools based on their group on indigo IAM) . Having one JSON file containing all the necessary data would make it easier for us (like all the user or all the group) , especially when dealing with multiple users (e.g., 200 users represent 20 json files), as we wouldn't have to manually concatenate individual files because to parse the json file everything should be in the "Resources": [...] part .

Thank you for your attention to this matter.

from iam.

rmiccoli avatar rmiccoli commented on September 4, 2024

Hi,

you can write a simple script to put all accounts/groups in a single JSON file or use the SCIM API which is not paginated (doc. https://indigo-iam.github.io/v/v1.8.2/docs/reference/api/scim-api/#get-scimusers).

Example script:

import requests, json
token = 'XXX'

headers = {"Authorization": "Bearer %s" % token}

results = []
startIndex = 1
totalResults = Y  # total number of users
itemsPerPage = 10
while(startIndex < totalResults):
    list_url = "https://<your-iam-instance>/iam/account/search?startIndex=%d" % startIndex
    resp = requests.get(list_url, headers=headers)
    data = resp.json()
    startIndex += itemsPerPage
    for user in data['Resources']:
        results.append(user)
with open('accounts.json', 'w+') as fp:
    fp.write(json.dumps(results))

from iam.

sigau avatar sigau commented on September 4, 2024

Thank you that exactly what I was trying to do !
thank you very much @rmiccoli and @federicaagostini

from iam.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.