{"id":22302691,"url":"https://github.com/dataoneorg/d1_client_bash","last_synced_at":"2025-03-26T00:28:32.002Z","repository":{"id":71253768,"uuid":"41757940","full_name":"DataONEorg/d1_client_bash","owner":"DataONEorg","description":"A collection of command line scripts for interaction with DataONE services.","archived":false,"fork":false,"pushed_at":"2015-10-15T11:58:35.000Z","size":268,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":30,"default_branch":"master","last_synced_at":"2025-01-30T21:17:24.358Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/DataONEorg.png","metadata":{"files":{"readme":"README.rst","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-09-01T19:11:23.000Z","updated_at":"2020-05-21T15:33:25.000Z","dependencies_parsed_at":"2023-03-10T17:30:40.525Z","dependency_job_id":null,"html_url":"https://github.com/DataONEorg/d1_client_bash","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DataONEorg%2Fd1_client_bash","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DataONEorg%2Fd1_client_bash/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DataONEorg%2Fd1_client_bash/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DataONEorg%2Fd1_client_bash/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/DataONEorg","download_url":"https://codeload.github.com/DataONEorg/d1_client_bash/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245565213,"owners_count":20636257,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-12-03T18:40:50.277Z","updated_at":"2025-03-26T00:28:31.955Z","avatar_url":"https://github.com/DataONEorg.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"README for d1_client_bash\n=========================\n\nThese bash scripts offer command line convenience for basic interaction with\nDataONE CNs and MNs without the need for Java or Python libraries.\n\nNote:\n\n* There's pretty much no error checking \n\n* There is minimal dependence on schema structures since the content is extract \n  with (mostly) namespace independent xpath\n\n\nInstallation\n------------\n\n1. Install curl_\n\n2. Install XMLstarlet_\n\n3. ``cd`` to this folder and do stuff\n\n\n.. _curl: http://curl.haxx.se/\n\n.. _XMLstarlet: http://xmlstar.sourceforge.net/ \n\n\nCommands\n--------\n\n\n:cndiff: A utility for environment administrators for comparing identifiers across Coordianting Nodes\n\n:d1create: Create an object on a DataONE Member Node\n\n:d1createsysmeta: Create system metadata for an object\n\n:d1dns: A utility for DataONE administrators to show the current DNS situation for DataONE environments\n\n:d1escapesolrterm: Escapes a term for inclusion in a solr query.\n\n:d1formats: List the object formats registered in a DataONE environment.\n\n:d1get: Retrieve an object from a DataONE node\n\n:d1listobjects: Report on objects available on a DataONE node.\n\n:d1logrecords: Retrieve log records from a node.\n\n:d1mysubject.py: A Python script that parses a PEM certificate and reports the subject string as expected by DataONE services\n\n:d1noderegister: Used by node operators to register a node in a DataONE environment\n\n:d1nodes: List the nodes in a DataONE environment\n\n:d1nodeupdate: Used by node operators to notify Coordinating Nodes of a change in the node description information\n\n:d1piddiff: Report on the difference in PIDs between two nodes (typically a MN and a CN)\n\n:d1pidinfo: Lookup information about a PID.\n\n:d1ping: Perform a ping operation on a DataONE node\n\n:d1resolve: Resolve the location of an identifier\n\n:d1search: Search the solr index available on a Coordinating Node\n\n:d1subject: Wrapper for the d1mysubject.py script\n\n:d1sysmeta: Show the System Metadata for an object\n\n\n\nExamples\n--------\n\nExample: List all nodes::\n\n  $ ./d1_listnodes\n  ID  Name  BaseURL\n  cn-dev  cn_dev  http://cn-dev.dataone.org/cn/ \n  http://mn-dev.dataone.org DataONESamples  http://mn-dev.dataone.org/mn/ \n  http://dev-dryad-mn.dataone.org dryad http://dev-dryad-mn.dataone.org/mn/ \n  http://daacmn.dataone.utk.edu ornldaac  http://daacmn.dataone.utk.edu/mn/ \n  http://knb-mn.ecoinformatics.org  knb http://knb-mn.ecoinformatics.org/knb/ \n  http://cn-unm-1.dataone.org cn-unm-1  http://cn-unm-1.dataone.org/cn/ \n  http://cn-ucsb-1.dataone.org  cn-ucsb-1 http://cn-ucsb-1.dataone.org/cn/ \n  http://cn-orc-1.dataone.org cn-orc-1  http://cn-orc-1.dataone.org/cn/ \n\n\nExample: Low level (HTTP) ping of nodes::\n\n  $ ./d1_ping\n  OK  CODE=200  ID=cn-dev   URL=http://cn-dev.dataone.org/cn/ \n  FAIL  CODE=000  ID=http://mn-dev.dataone.org  URL=http://mn-dev.dataone.org/mn/ \n  FAIL  CODE=404  ID=http://dev-dryad-mn.dataone.org  URL=http://dev-dryad-mn.dataone.org/mn/ \n  FAIL  CODE=404  ID=http://daacmn.dataone.utk.edu  URL=http://daacmn.dataone.utk.edu/mn/ \n  FAIL  CODE=503  ID=http://knb-mn.ecoinformatics.org   URL=http://knb-mn.ecoinformatics.org/knb/ \n  OK  CODE=200  ID=http://cn-unm-1.dataone.org  URL=http://cn-unm-1.dataone.org/cn/ \n  OK  CODE=200  ID=http://cn-ucsb-1.dataone.org   URL=http://cn-ucsb-1.dataone.org/cn/ \n  OK  CODE=200  ID=http://cn-orc-1.dataone.org  URL=http://cn-orc-1.dataone.org/cn/ \n\n\nExample: List objects::\n\n  $ ./d1_listobjects \n  START=0 COUNT=16 TOTAL=16\n  test201030214278702 12 text/csv\n  knb:testid:2010302142651722 12 eml://ecoinformatics.org/eml-2.1.0\n  knb:testid:2010302123624795 12 text/csv\n  knb:testid:2010302142527155 12 text/csv\n  knb:testid:2010302142228258 12 text/csv\n  knb:testid:2010302125029284 12 text/csv\n  knb:testid:2010302142227709 12 text/csv\n  test2010302125226397 12 text/csv\n  knb:testid:2010302142527649 12 text/csv\n  knb:testid:2010302125028653 12 text/csv\n  test20103021236250 12 text/csv\n  knb:testid:2010302123624165 12 text/csv\n  knb:testid:201030212381820 12 eml://ecoinformatics.org/eml-2.1.0\n  knb:testid:2010302142353879 12 eml://ecoinformatics.org/eml-2.1.0\n  knb:testid:201030212525850 12 eml://ecoinformatics.org/eml-2.1.0\n  test2010302142413245 12 text/csv\n\n\nExample: Resolve object identifier to holding nodes::\n\n  $ ./d1_resolve knb:testid:2010302142227709\n  cn-dev\n\n\nExample: Get system metadata for an object:\n\n  $ ./d1_getsysm knb:testid:2010302142227709\n  \u003c?xml version=\"1.0\" encoding=\"UTF-8\"?\u003e\n  \u003cd1:systemMetadata xmlns:d1=\"http://dataone.org/service/types/SystemMetadata/0.5\"\u003e\n    \u003cidentifier\u003eknb:testid:2010302142227709\u003c/identifier\u003e\n    \u003cobjectFormat\u003etext/csv\u003c/objectFormat\u003e\n    \u003csize\u003e12\u003c/size\u003e\n    \u003csubmitter\u003euid=jones,o=NCEAS,dc=ecoinformatics,dc=org\u003c/submitter\u003e\n    \u003crightsHolder\u003euid=jones,o=NCEAS,dc=ecoinformatics,dc=org\u003c/rightsHolder\u003e\n    \u003cchecksum algorithm=\"SHA-256\"\u003e4d6537f48d2967725bfcc7a9f0d5094ce4088e0975fcd3f1a361f15f46e49f83\u003c/checksum\u003e\n    \u003cdateUploaded\u003e2010-10-29T21:22:27.71Z\u003c/dateUploaded\u003e\n    \u003cdateSysMetadataModified\u003e2010-10-29T21:22:27.921Z\u003c/dateSysMetadataModified\u003e\n    \u003coriginMemberNode\u003emn1\u003c/originMemberNode\u003e\n    \u003cauthoritativeMemberNode\u003emn1\u003c/authoritativeMemberNode\u003e\n    \u003creplica\u003e\n      \u003creplicaMemberNode\u003ecn-dev\u003c/replicaMemberNode\u003e\n      \u003creplicationStatus\u003ecompleted\u003c/replicationStatus\u003e\n      \u003creplicaVerified\u003e2010-10-29T21:22:27.71Z\u003c/replicaVerified\u003e\n    \u003c/replica\u003e\n  \u003c/d1:systemMetadata\u003e\n\n\nExample: Download an object to local disk::\n\n  $ ./d1_get knb:testid:2010302142227709 /tmp/temp_object\n  http://cn-dev.dataone.org/cn/object/knb%3Atestid%3A2010302142227709\n    % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current\n                                   Dload  Upload   Total   Spent    Left  Speed\n  100 45924    0 45924    0     0  63719      0 --:--:-- --:--:-- --:--:-- 75532\n  Output saved to /tmp/temp_object\n\n  $ head -20 /tmp/temp_object\n  ## file name :ht90e66:                archival media:\n  ##\n  ##\n  ## The use of any parts of these data requires\n  ## written permission from:  David Tilman (Head PI)\n  ##\n  ## C/O LTER Data Manager\n  ## Ecology, Evolution and Behavior\n  ## University of Minnesota, 318 Church St. S.E., MPLS, MN 55455\n  ##\n  ## Header format[Column(i) : variable abbreviation : variable description :format]\n  ##\n  ##\n  ## Column01 : field    : Field number/letter                                     :int[%2d]\n  ## Column02 : expt     : Experiment number                                       :int[%2d]\n  ## Column03 : plot     : Plot number                                             :int[%3d]\n  ## Column04 : trt      : Treatment                                               :int[%1d]\n  ## Column05 : taxon    : Species Taxon code                                      :int[%3d]\n  ## Column06 : date     : Sampling date                                           :int[%6d]\n  ## Column07 : seedsrc  : Seed source                                             :char[%9s]\n\n\nExample: Create System Metadata and Upload a Document to a Member Node\n\n::\n  $ echo \"This is a test document.\" \u003e test.txt\n\n  $ d1login\n  \n    ... Browser session, shibCILaunchGSCA.jnlp saved to ~/Downloads\n\n    2015-10-02T13:12:01-0400 INFO: Certificate file: /tmp/x509up_u501\n    /tmp/x509up_u501\n\n  $ cp /tmp/x509up_501 .\n  $ d1createsysmetadata -E x509up_u501 -i \"test.001\" -f \"text/plain\" test.txt \u003e sysmeta.xml\n  $ d1create -b \"https://my.member.node/mn\" -E x509up_u501 sysmeta.xml test.txt\n\n     \n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdataoneorg%2Fd1_client_bash","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdataoneorg%2Fd1_client_bash","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdataoneorg%2Fd1_client_bash/lists"}