예제 #1
0
 def _execute_update_access_policy(self, operation):
     pid = operation["parameters"]["identifier"]
     policy = self._create_access_policy(operation)
     client = d1_cli.impl.client.CLICNClient(
         **self._cn_client_connect_params_from_operation(operation))
     sys_meta = client.getSystemMetadata(pid)
     client.setAccessPolicy(pid, policy, sys_meta.serialVersion)
예제 #2
0
 def _execute_update_access_policy(self, operation):
     pid = operation["parameters"]["identifier"]
     policy = self._create_access_policy(operation)
     client = d1_cli.impl.client.CLICNClient(
         **self._cn_client_connect_params_from_operation(operation)
     )
     sys_meta = client.getSystemMetadata(pid)
     client.setAccessPolicy(pid, policy, sys_meta.serialVersion)
예제 #3
0
 def system_metadata_get(self, pid, path):
     sysmeta_pyxb = None
     try:
         client = d1_cli.impl.client.CLICNClient(
             **self._cn_client_connect_params_from_session())
         sysmeta_pyxb = client.getSystemMetadata(pid)
     except d1_common.types.exceptions.DataONEException:
         pass
     if sysmeta_pyxb is None:
         try:
             client = d1_cli.impl.client.CLIMNClient(
                 **self._mn_client_connect_params_from_session())
             sysmeta_pyxb = client.getSystemMetadata(pid)
         except d1_common.types.exceptions.DataONEException:
             pass
     if sysmeta_pyxb is None:
         raise d1_cli.impl.exceptions.CLIError(
             "Unable to get System Metadata: {}".format(pid))
     self._system_metadata_print(sysmeta_pyxb, path)
예제 #4
0
 def system_metadata_get(self, pid, path):
     sysmeta_pyxb = None
     try:
         client = d1_cli.impl.client.CLICNClient(
             **self._cn_client_connect_params_from_session()
         )
         sysmeta_pyxb = client.getSystemMetadata(pid)
     except d1_common.types.exceptions.DataONEException:
         pass
     if sysmeta_pyxb is None:
         try:
             client = d1_cli.impl.client.CLIMNClient(
                 **self._mn_client_connect_params_from_session()
             )
             sysmeta_pyxb = client.getSystemMetadata(pid)
         except d1_common.types.exceptions.DataONEException:
             pass
     if sysmeta_pyxb is None:
         raise d1_cli.impl.exceptions.CLIError(
             "Unable to get System Metadata: {}".format(pid)
         )
     self._system_metadata_print(sysmeta_pyxb, path)