original_docstring: CloneMultipleVolumes enables you to create a clone of a group of specified volumes. You can assign a consistent set of characteristics
docstring: CloneMultipleVolumes enables you to create a clone of a group of specified volumes. You can assign a consistent set of characteristics
docstring_tokens: CloneMultipleVolumes enables you to create a clone of a group of specified volumes . You can assign a consistent set of characteristics
code: def clonemultiple(ctx,
             # Mandatory main parameter
             volumes,
             # Mandatory subparameter of a mandatory main parameter (Not fully decomposed)
             volumeid,
             # Non mandatory subparameter of a mandatory main parameter (not fully decomposed)
             accessvolumes = None,
             # Non mandatory subparameter of a mandatory main parameter (not fully decomposed)
             name = None,
             # Non mandatory subparameter of a mandatory main parameter (not fully decomposed)
             newaccountidvolumes = None,
             # Non mandatory subparameter of a mandatory main parameter (not fully decomposed)
             newsize = None,
             # Non mandatory subparameter of a mandatory main parameter (not fully decomposed)
             attributes = None,
             # Optional main parameter
             access = None,
             # Optional main parameter
             groupsnapshotid = None,
             # Optional main parameter
             newaccountid = None):
      """CloneMultipleVolumes enables you to create a clone of a group of specified volumes. You can assign a consistent set of characteristics"""
      """to a group of multiple volumes when they are cloned together."""
      """Before using groupSnapshotID to clone the volumes in a group snapshot, you must create the group snapshot by using the"""
      """CreateGroupSnapshot API method or the Element OS Web UI. Using groupSnapshotID is optional when cloning multiple volumes."""
      """Note: Cloning multiple volumes is allowed if cluster fullness is at stage 2 or 3. Clones are not created when cluster fullness is"""
      """at stage 4 or 5."""
  
      
  
      cli_utils.establish_connection(ctx)
      
      # If we have a submember that's an attributes array, we need to handle it.
      attributes_json = [simplejson.loads(v) if v is not None else None for v in attributes]
      
  
      volumesArray = None
      if len(volumes) == 1 and volumeid[0] is None and accessvolumes[0] is None and name[0] is None and newaccountidvolumes[0] is None and newsize[0] is None and attributes_json[0] is None:
          volumesArray = []
      elif(volumes is not None and volumes != ()):
          volumesArray = []
          try:
              for i, _volumes in enumerate(volumes):
                  attributes_json = None
                  if attributes[i] != None:
                      attributes_json = simplejson.loads(attributes[i])
                  volumesArray.append(CloneMultipleVolumeParams(volume_id=volumeid[i], access=accessvolumes[i], name=name[i], new_account_id=newaccountidvolumes[i], new_size=newsize[i], attributes=attributes_json, ))
          except Exception as e:
              ctx.logger.error(e.__str__())
              exit(1)
      
      
      
      
  
      
  
      ctx.logger.info(""": """"""volumes = """ + str(volumesArray)+";" + """access = """+str(access)+";" + """groupsnapshotid = """+str(groupsnapshotid)+";" + """newaccountid = """+str(newaccountid)+""";"""+"")
      try:
          _CloneMultipleVolumesResult = ctx.element.clone_multiple_volumes(volumes=volumesArray, access=access, group_snapshot_id=groupsnapshotid, new_account_id=newaccountid)
      except common.ApiServerError as e:
          ctx.logger.error(e.message)
          exit()
      except BaseException as e:
          ctx.logger.error(e.__str__())
          exit()
      if ctx.json:
          print(simplejson.dumps(simplejson.loads(_CloneMultipleVolumesResult), indent=4))
          return
      else:
          cli_utils.print_result(_CloneMultipleVolumesResult, ctx.logger, as_json=ctx.json, as_pickle=ctx.pickle, depth=ctx.depth, filter_tree=ctx.filter_tree)
code_tokens: def clonemultiple ( ctx , volumes , volumeid , accessvolumes = None , name = None , newaccountidvolumes = None , newsize = None , attributes = None , access = None , groupsnapshotid = None , newaccountid = None ) : """to a group of multiple volumes when they are cloned together.""" """Before using groupSnapshotID to clone the volumes in a group snapshot, you must create the group snapshot by using the""" """CreateGroupSnapshot API method or the Element OS Web UI. Using groupSnapshotID is optional when cloning multiple volumes.""" """Note: Cloning multiple volumes is allowed if cluster fullness is at stage 2 or 3. Clones are not created when cluster fullness is""" """at stage 4 or 5.""" cli_utils . establish_connection ( ctx ) attributes_json = [ simplejson . loads ( v ) if v is not None else None for v in attributes ] volumesArray = None if len ( volumes ) == 1 and volumeid [ 0 ] is None and accessvolumes [ 0 ] is None and name [ 0 ] is None and newaccountidvolumes [ 0 ] is None and newsize [ 0 ] is None and attributes_json [ 0 ] is None : volumesArray = [ ] elif ( volumes is not None and volumes != ( ) ) : volumesArray = [ ] try : for i , _volumes in enumerate ( volumes ) : attributes_json = None if attributes [ i ] != None : attributes_json = simplejson . loads ( attributes [ i ] ) volumesArray . append ( CloneMultipleVolumeParams ( volume_id = volumeid [ i ] , access = accessvolumes [ i ] , name = name [ i ] , new_account_id = newaccountidvolumes [ i ] , new_size = newsize [ i ] , attributes = attributes_json , ) ) except Exception as e : ctx . logger . error ( e . __str__ ( ) ) exit ( 1 ) ctx . logger . info ( """: """ """volumes = """ + str ( volumesArray ) + ";" + """access = """ + str ( access ) + ";" + """groupsnapshotid = """ + str ( groupsnapshotid ) + ";" + """newaccountid = """ + str ( newaccountid ) + """;""" + "" ) try : _CloneMultipleVolumesResult = ctx . element . clone_multiple_volumes ( volumes = volumesArray , access = access , group_snapshot_id = groupsnapshotid , new_account_id = newaccountid ) except common . ApiServerError as e : ctx . logger . error ( e . message ) exit ( ) except BaseException as e : ctx . logger . error ( e . __str__ ( ) ) exit ( ) if ctx . json : print ( simplejson . dumps ( simplejson . loads ( _CloneMultipleVolumesResult ) , indent = 4 ) ) return else : cli_utils . print_result ( _CloneMultipleVolumesResult , ctx . logger , as_json = ctx . json , as_pickle = ctx . pickle , depth = ctx . depth , filter_tree = ctx . filter_tree )
short_docstring: CloneMultipleVolumes enables you to create a clone of a group of specified volumes.
short_docstring_tokens: CloneMultipleVolumes enables you to create a clone of a group of specified volumes .
comment: # Mandatory main parameter$SEP$# Mandatory subparameter of a mandatory main parameter (Not fully decomposed)$SEP$# Non mandatory subparameter of a mandatory main parameter (not fully decomposed)$SEP$# Non mandatory subparameter of a mandatory main parameter (not fully decomposed)$SEP$# Non mandatory subparameter of a mandatory main parameter (not fully decomposed)$SEP$# Non mandatory subparameter of a mandatory main parameter (not fully decomposed)$SEP$# Non mandatory subparameter of a mandatory main parameter (not fully decomposed)$SEP$# Optional main parameter$SEP$# Optional main parameter$SEP$# Optional main parameter$SEP$"""CloneMultipleVolumes enables you to create a clone of a group of specified volumes. You can assign a consistent set of characteristics"""$SEP$"""to a group of multiple volumes when they are cloned together."""$SEP$"""Before using groupSnapshotID to clone the volumes in a group snapshot, you must create the group snapshot by using the"""$SEP$"""CreateGroupSnapshot API method or the Element OS Web UI. Using groupSnapshotID is optional when cloning multiple volumes."""$SEP$"""Note: Cloning multiple volumes is allowed if cluster fullness is at stage 2 or 3. Clones are not created when cluster fullness is"""$SEP$"""at stage 4 or 5."""$SEP$# If we have a submember that's an attributes array, we need to handle it.