Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change cn actions to d1_python #26

Open
iannesbitt opened this issue Jun 2, 2023 · 2 comments
Open

Change cn actions to d1_python #26

iannesbitt opened this issue Jun 2, 2023 · 2 comments
Assignees
Labels
enhancement New feature or request v0.1.2 Version 0.1.2 item
Milestone

Comments

@iannesbitt
Copy link
Contributor

All of the commands that use curl have corresponding functions in the d1_client package. The onboarding script should be able to create a session then use it to create and validate subjects, and register nodes.

@iannesbitt iannesbitt self-assigned this Jun 2, 2023
@iannesbitt
Copy link
Contributor Author

This will supersede #24 and #25.

@iannesbitt
Copy link
Contributor Author

iannesbitt commented Aug 15, 2023

In addition to tools available in d1_python, we can make use of the following functions in DataONE_Operations:

  • once schema.org is found to comply to standards, node approval can be handled using approveNode rather than the current method which requires manual manipulation of a Java binary LDAP interface:
    import d1_admin_tools.d1_node_properties as d1_node
    nodeid = 'urn:node:mnTestCANWIN'
    ldappass = 'password'
    d1_node.approveNode(node_id=nodeid, ldap_pass=ldappass, approval=True)
  • setting the four CN_ properties listed under the Preferred Custom Properties heading on this page (CN_node_name, CN_operational_status, CN_info_url, and CN_logo_url) can presumably be done using setNodesProperties:
    # assuming same imports and definitions as above
    node_prop_dict = {
        'urn:node:mnTestCANWIN': {'CN_node_name': 'Canadian Watershed Information Network',
                                  'CN_operational_status': 'operational',
                                  'CN_info_url': 'https://canwin-datahub.ad.umanitoba.ca/',
                                  'CN_logo_url': 'https://raw.githubusercontent.com/DataONEorg/member-node-info/master/production/graphics/web/CANWIN.png',}
    }
    con = d1_node.getLDAPConnection(password=ldappass)
    d1_node.setNodesProperties(con=con, nodes_properties=node_prop_dict)
    An example configuration for mnTestHAKAI_IYS that uses these four newer CN_ properties is available by doing curl -k "https://cn-stage.test.dataone.org/cn/v2/node/urn:node:mnTestHAKAI_IYS" | xml fo

@iannesbitt iannesbitt added the v0.1.2 Version 0.1.2 item label Oct 4, 2023
@iannesbitt iannesbitt added this to the 0.1.2 milestone Oct 4, 2023
@iannesbitt iannesbitt added the enhancement New feature or request label Oct 4, 2023
iannesbitt added a commit that referenced this issue Aug 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request v0.1.2 Version 0.1.2 item
Projects
None yet
Development

No branches or pull requests

1 participant