diff --git a/lib/fba_tools/authclient.py b/lib/fba_tools/authclient.py index 9a15713..3bdf984 100644 --- a/lib/fba_tools/authclient.py +++ b/lib/fba_tools/authclient.py @@ -57,7 +57,7 @@ class KBaseAuth(object): A very basic KBase auth client for the Python server. ''' - _LOGIN_URL = 'https://kbase.us/services/authorization/Sessions/Login' + _LOGIN_URL = 'https://kbase.us/services/auth/api/legacy/KBase/Sessions/Login' def __init__(self, auth_url=None): ''' @@ -84,7 +84,7 @@ def get_user(self, token): ret.raise_for_status() raise ValueError('Error connecting to auth service: {} {}\n{}' .format(ret.status_code, ret.reason, - err['error_msg'])) + err['error']['message'])) user = ret.json()['user_id'] self._cache.add_valid_token(token, user) diff --git a/lib/fba_tools/fba_toolsClient.pm b/lib/fba_tools/fba_toolsClient.pm index 8eb3392..517654d 100644 --- a/lib/fba_tools/fba_toolsClient.pm +++ b/lib/fba_tools/fba_toolsClient.pm @@ -1623,12 +1623,10 @@ Identifies reactions in the model that are not mass balanced $params is a fba_tools.PredictAuxotrophyParams $results is a fba_tools.PredictAuxotrophyResults PredictAuxotrophyParams is a reference to a hash where the following keys are defined: - genome_id has a value which is a fba_tools.genome_id - media_output_id has a value which is a fba_tools.media_id + genome_ids has a value which is a reference to a list where each element is a fba_tools.genome_id genome_workspace has a value which is a fba_tools.workspace_name workspace has a value which is a fba_tools.workspace_name genome_id is a string -media_id is a string workspace_name is a string PredictAuxotrophyResults is a reference to a hash where the following keys are defined: new_report_ref has a value which is a fba_tools.ws_report_id @@ -1643,12 +1641,10 @@ ws_report_id is a string $params is a fba_tools.PredictAuxotrophyParams $results is a fba_tools.PredictAuxotrophyResults PredictAuxotrophyParams is a reference to a hash where the following keys are defined: - genome_id has a value which is a fba_tools.genome_id - media_output_id has a value which is a fba_tools.media_id + genome_ids has a value which is a reference to a list where each element is a fba_tools.genome_id genome_workspace has a value which is a fba_tools.workspace_name workspace has a value which is a fba_tools.workspace_name genome_id is a string -media_id is a string workspace_name is a string PredictAuxotrophyResults is a reference to a hash where the following keys are defined: new_report_ref has a value which is a fba_tools.ws_report_id @@ -2426,7 +2422,9 @@ ModelObjectSelectionParams is a reference to a hash where the following keys are workspace_name has a value which is a string model_name has a value which is a string save_to_shock has a value which is a fba_tools.boolean + fulldb has a value which is a fba_tools.bool boolean is an int +bool is an int File is a reference to a hash where the following keys are defined: path has a value which is a string shock_id has a value which is a string @@ -2443,7 +2441,9 @@ ModelObjectSelectionParams is a reference to a hash where the following keys are workspace_name has a value which is a string model_name has a value which is a string save_to_shock has a value which is a fba_tools.boolean + fulldb has a value which is a fba_tools.bool boolean is an int +bool is an int File is a reference to a hash where the following keys are defined: path has a value which is a string shock_id has a value which is a string @@ -2524,7 +2524,9 @@ ModelObjectSelectionParams is a reference to a hash where the following keys are workspace_name has a value which is a string model_name has a value which is a string save_to_shock has a value which is a fba_tools.boolean + fulldb has a value which is a fba_tools.bool boolean is an int +bool is an int File is a reference to a hash where the following keys are defined: path has a value which is a string shock_id has a value which is a string @@ -2541,7 +2543,9 @@ ModelObjectSelectionParams is a reference to a hash where the following keys are workspace_name has a value which is a string model_name has a value which is a string save_to_shock has a value which is a fba_tools.boolean + fulldb has a value which is a fba_tools.bool boolean is an int +bool is an int File is a reference to a hash where the following keys are defined: path has a value which is a string shock_id has a value which is a string @@ -2622,7 +2626,9 @@ ModelObjectSelectionParams is a reference to a hash where the following keys are workspace_name has a value which is a string model_name has a value which is a string save_to_shock has a value which is a fba_tools.boolean + fulldb has a value which is a fba_tools.bool boolean is an int +bool is an int ModelTsvFiles is a reference to a hash where the following keys are defined: compounds_file has a value which is a fba_tools.File reactions_file has a value which is a fba_tools.File @@ -2642,7 +2648,9 @@ ModelObjectSelectionParams is a reference to a hash where the following keys are workspace_name has a value which is a string model_name has a value which is a string save_to_shock has a value which is a fba_tools.boolean + fulldb has a value which is a fba_tools.bool boolean is an int +bool is an int ModelTsvFiles is a reference to a hash where the following keys are defined: compounds_file has a value which is a fba_tools.File reactions_file has a value which is a fba_tools.File @@ -6586,8 +6594,7 @@ new_report_ref has a value which is a fba_tools.ws_report_id
 a reference to a hash where the following keys are defined:
-genome_id has a value which is a fba_tools.genome_id
-media_output_id has a value which is a fba_tools.media_id
+genome_ids has a value which is a reference to a list where each element is a fba_tools.genome_id
 genome_workspace has a value which is a fba_tools.workspace_name
 workspace has a value which is a fba_tools.workspace_name
 
@@ -6598,8 +6605,7 @@ workspace has a value which is a fba_tools.workspace_name
 =begin text
 
 a reference to a hash where the following keys are defined:
-genome_id has a value which is a fba_tools.genome_id
-media_output_id has a value which is a fba_tools.media_id
+genome_ids has a value which is a reference to a list where each element is a fba_tools.genome_id
 genome_workspace has a value which is a fba_tools.workspace_name
 workspace has a value which is a fba_tools.workspace_name
 
@@ -7138,6 +7144,7 @@ a reference to a hash where the following keys are defined:
 workspace_name has a value which is a string
 model_name has a value which is a string
 save_to_shock has a value which is a fba_tools.boolean
+fulldb has a value which is a fba_tools.bool
 
 
@@ -7149,6 +7156,7 @@ a reference to a hash where the following keys are defined: workspace_name has a value which is a string model_name has a value which is a string save_to_shock has a value which is a fba_tools.boolean +fulldb has a value which is a fba_tools.bool =end text diff --git a/lib/fba_tools/fba_toolsClient.py b/lib/fba_tools/fba_toolsClient.py index 1dc619e..573d8c7 100644 --- a/lib/fba_tools/fba_toolsClient.py +++ b/lib/fba_tools/fba_toolsClient.py @@ -403,12 +403,11 @@ def predict_auxotrophy(self, params, context=None): """ Identifies reactions in the model that are not mass balanced :param params: instance of type "PredictAuxotrophyParams" -> - structure: parameter "genome_id" of type "genome_id" (A string - representing a Genome id.), parameter "media_output_id" of type - "media_id" (A string representing a Media id.), parameter - "genome_workspace" of type "workspace_name" (A string representing - a workspace name.), parameter "workspace" of type "workspace_name" - (A string representing a workspace name.) + structure: parameter "genome_ids" of list of type "genome_id" (A + string representing a Genome id.), parameter "genome_workspace" of + type "workspace_name" (A string representing a workspace name.), + parameter "workspace" of type "workspace_name" (A string + representing a workspace name.) :returns: instance of type "PredictAuxotrophyResults" -> structure: parameter "new_report_ref" of type "ws_report_id" (The workspace ID for a Report object @id ws KBaseReport.Report) @@ -565,7 +564,8 @@ def model_to_excel_file(self, model, context=None): :param model: instance of type "ModelObjectSelectionParams" -> structure: parameter "workspace_name" of String, parameter "model_name" of String, parameter "save_to_shock" of type - "boolean" (A boolean - 0 for false, 1 for true. @range (0, 1)) + "boolean" (A boolean - 0 for false, 1 for true. @range (0, 1)), + parameter "fulldb" of type "bool" (A binary boolean) :returns: instance of type "File" -> structure: parameter "path" of String, parameter "shock_id" of String """ @@ -578,7 +578,8 @@ def model_to_sbml_file(self, model, context=None): :param model: instance of type "ModelObjectSelectionParams" -> structure: parameter "workspace_name" of String, parameter "model_name" of String, parameter "save_to_shock" of type - "boolean" (A boolean - 0 for false, 1 for true. @range (0, 1)) + "boolean" (A boolean - 0 for false, 1 for true. @range (0, 1)), + parameter "fulldb" of type "bool" (A binary boolean) :returns: instance of type "File" -> structure: parameter "path" of String, parameter "shock_id" of String """ @@ -591,7 +592,8 @@ def model_to_tsv_file(self, model, context=None): :param model: instance of type "ModelObjectSelectionParams" -> structure: parameter "workspace_name" of String, parameter "model_name" of String, parameter "save_to_shock" of type - "boolean" (A boolean - 0 for false, 1 for true. @range (0, 1)) + "boolean" (A boolean - 0 for false, 1 for true. @range (0, 1)), + parameter "fulldb" of type "bool" (A binary boolean) :returns: instance of type "ModelTsvFiles" -> structure: parameter "compounds_file" of type "File" -> structure: parameter "path" of String, parameter "shock_id" of String, parameter "reactions_file" diff --git a/lib/fba_tools/fba_toolsImpl.pm b/lib/fba_tools/fba_toolsImpl.pm index b28c36c..095be06 100644 --- a/lib/fba_tools/fba_toolsImpl.pm +++ b/lib/fba_tools/fba_toolsImpl.pm @@ -1780,12 +1780,10 @@ sub check_model_mass_balance $params is a fba_tools.PredictAuxotrophyParams $results is a fba_tools.PredictAuxotrophyResults PredictAuxotrophyParams is a reference to a hash where the following keys are defined: - genome_id has a value which is a fba_tools.genome_id - media_output_id has a value which is a fba_tools.media_id + genome_ids has a value which is a reference to a list where each element is a fba_tools.genome_id genome_workspace has a value which is a fba_tools.workspace_name workspace has a value which is a fba_tools.workspace_name genome_id is a string -media_id is a string workspace_name is a string PredictAuxotrophyResults is a reference to a hash where the following keys are defined: new_report_ref has a value which is a fba_tools.ws_report_id @@ -1800,12 +1798,10 @@ ws_report_id is a string $params is a fba_tools.PredictAuxotrophyParams $results is a fba_tools.PredictAuxotrophyResults PredictAuxotrophyParams is a reference to a hash where the following keys are defined: - genome_id has a value which is a fba_tools.genome_id - media_output_id has a value which is a fba_tools.media_id + genome_ids has a value which is a reference to a list where each element is a fba_tools.genome_id genome_workspace has a value which is a fba_tools.workspace_name workspace has a value which is a fba_tools.workspace_name genome_id is a string -media_id is a string workspace_name is a string PredictAuxotrophyResults is a reference to a hash where the following keys are defined: new_report_ref has a value which is a fba_tools.ws_report_id @@ -2609,7 +2605,9 @@ ModelObjectSelectionParams is a reference to a hash where the following keys are workspace_name has a value which is a string model_name has a value which is a string save_to_shock has a value which is a fba_tools.boolean + fulldb has a value which is a fba_tools.bool boolean is an int +bool is an int File is a reference to a hash where the following keys are defined: path has a value which is a string shock_id has a value which is a string @@ -2626,7 +2624,9 @@ ModelObjectSelectionParams is a reference to a hash where the following keys are workspace_name has a value which is a string model_name has a value which is a string save_to_shock has a value which is a fba_tools.boolean + fulldb has a value which is a fba_tools.bool boolean is an int +bool is an int File is a reference to a hash where the following keys are defined: path has a value which is a string shock_id has a value which is a string @@ -2701,7 +2701,9 @@ ModelObjectSelectionParams is a reference to a hash where the following keys are workspace_name has a value which is a string model_name has a value which is a string save_to_shock has a value which is a fba_tools.boolean + fulldb has a value which is a fba_tools.bool boolean is an int +bool is an int File is a reference to a hash where the following keys are defined: path has a value which is a string shock_id has a value which is a string @@ -2718,7 +2720,9 @@ ModelObjectSelectionParams is a reference to a hash where the following keys are workspace_name has a value which is a string model_name has a value which is a string save_to_shock has a value which is a fba_tools.boolean + fulldb has a value which is a fba_tools.bool boolean is an int +bool is an int File is a reference to a hash where the following keys are defined: path has a value which is a string shock_id has a value which is a string @@ -2789,7 +2793,9 @@ ModelObjectSelectionParams is a reference to a hash where the following keys are workspace_name has a value which is a string model_name has a value which is a string save_to_shock has a value which is a fba_tools.boolean + fulldb has a value which is a fba_tools.bool boolean is an int +bool is an int ModelTsvFiles is a reference to a hash where the following keys are defined: compounds_file has a value which is a fba_tools.File reactions_file has a value which is a fba_tools.File @@ -2809,7 +2815,9 @@ ModelObjectSelectionParams is a reference to a hash where the following keys are workspace_name has a value which is a string model_name has a value which is a string save_to_shock has a value which is a fba_tools.boolean + fulldb has a value which is a fba_tools.bool boolean is an int +bool is an int ModelTsvFiles is a reference to a hash where the following keys are defined: compounds_file has a value which is a fba_tools.File reactions_file has a value which is a fba_tools.File @@ -6540,8 +6548,7 @@ new_report_ref has a value which is a fba_tools.ws_report_id
 a reference to a hash where the following keys are defined:
-genome_id has a value which is a fba_tools.genome_id
-media_output_id has a value which is a fba_tools.media_id
+genome_ids has a value which is a reference to a list where each element is a fba_tools.genome_id
 genome_workspace has a value which is a fba_tools.workspace_name
 workspace has a value which is a fba_tools.workspace_name
 
@@ -6552,8 +6559,7 @@ workspace has a value which is a fba_tools.workspace_name
 =begin text
 
 a reference to a hash where the following keys are defined:
-genome_id has a value which is a fba_tools.genome_id
-media_output_id has a value which is a fba_tools.media_id
+genome_ids has a value which is a reference to a list where each element is a fba_tools.genome_id
 genome_workspace has a value which is a fba_tools.workspace_name
 workspace has a value which is a fba_tools.workspace_name
 
@@ -7092,6 +7098,7 @@ a reference to a hash where the following keys are defined:
 workspace_name has a value which is a string
 model_name has a value which is a string
 save_to_shock has a value which is a fba_tools.boolean
+fulldb has a value which is a fba_tools.bool
 
 
@@ -7103,6 +7110,7 @@ a reference to a hash where the following keys are defined: workspace_name has a value which is a string model_name has a value which is a string save_to_shock has a value which is a fba_tools.boolean +fulldb has a value which is a fba_tools.bool =end text diff --git a/lib/src/us/kbase/fbatools/ModelObjectSelectionParams.java b/lib/src/us/kbase/fbatools/ModelObjectSelectionParams.java index 55391c4..1b57e88 100644 --- a/lib/src/us/kbase/fbatools/ModelObjectSelectionParams.java +++ b/lib/src/us/kbase/fbatools/ModelObjectSelectionParams.java @@ -21,7 +21,8 @@ @JsonPropertyOrder({ "workspace_name", "model_name", - "save_to_shock" + "save_to_shock", + "fulldb" }) public class ModelObjectSelectionParams { @@ -31,6 +32,8 @@ public class ModelObjectSelectionParams { private String modelName; @JsonProperty("save_to_shock") private Long saveToShock; + @JsonProperty("fulldb") + private Long fulldb; private Map additionalProperties = new HashMap(); @JsonProperty("workspace_name") @@ -78,6 +81,21 @@ public ModelObjectSelectionParams withSaveToShock(Long saveToShock) { return this; } + @JsonProperty("fulldb") + public Long getFulldb() { + return fulldb; + } + + @JsonProperty("fulldb") + public void setFulldb(Long fulldb) { + this.fulldb = fulldb; + } + + public ModelObjectSelectionParams withFulldb(Long fulldb) { + this.fulldb = fulldb; + return this; + } + @JsonAnyGetter public Map getAdditionalProperties() { return this.additionalProperties; @@ -90,7 +108,7 @@ public void setAdditionalProperties(String name, Object value) { @Override public String toString() { - return ((((((((("ModelObjectSelectionParams"+" [workspaceName=")+ workspaceName)+", modelName=")+ modelName)+", saveToShock=")+ saveToShock)+", additionalProperties=")+ additionalProperties)+"]"); + return ((((((((((("ModelObjectSelectionParams"+" [workspaceName=")+ workspaceName)+", modelName=")+ modelName)+", saveToShock=")+ saveToShock)+", fulldb=")+ fulldb)+", additionalProperties=")+ additionalProperties)+"]"); } } diff --git a/lib/src/us/kbase/fbatools/PredictAuxotrophyParams.java b/lib/src/us/kbase/fbatools/PredictAuxotrophyParams.java index d848e15..60346cb 100644 --- a/lib/src/us/kbase/fbatools/PredictAuxotrophyParams.java +++ b/lib/src/us/kbase/fbatools/PredictAuxotrophyParams.java @@ -2,6 +2,7 @@ package us.kbase.fbatools; import java.util.HashMap; +import java.util.List; import java.util.Map; import javax.annotation.Generated; import com.fasterxml.jackson.annotation.JsonAnyGetter; @@ -19,96 +20,78 @@ @JsonInclude(JsonInclude.Include.NON_NULL) @Generated("com.googlecode.jsonschema2pojo") @JsonPropertyOrder({ - "genome_id", - "media_output_id", + "genome_ids", "genome_workspace", "workspace" }) public class PredictAuxotrophyParams { - @JsonProperty("genome_id") - private String genomeId; - @JsonProperty("media_output_id") - private String mediaOutputId; + @JsonProperty("genome_ids") + private List genomeIds; @JsonProperty("genome_workspace") - private String genomeWorkspace; + private java.lang.String genomeWorkspace; @JsonProperty("workspace") - private String workspace; - private Map additionalProperties = new HashMap(); + private java.lang.String workspace; + private Map additionalProperties = new HashMap(); - @JsonProperty("genome_id") - public String getGenomeId() { - return genomeId; + @JsonProperty("genome_ids") + public List getGenomeIds() { + return genomeIds; } - @JsonProperty("genome_id") - public void setGenomeId(String genomeId) { - this.genomeId = genomeId; + @JsonProperty("genome_ids") + public void setGenomeIds(List genomeIds) { + this.genomeIds = genomeIds; } - public PredictAuxotrophyParams withGenomeId(String genomeId) { - this.genomeId = genomeId; - return this; - } - - @JsonProperty("media_output_id") - public String getMediaOutputId() { - return mediaOutputId; - } - - @JsonProperty("media_output_id") - public void setMediaOutputId(String mediaOutputId) { - this.mediaOutputId = mediaOutputId; - } - - public PredictAuxotrophyParams withMediaOutputId(String mediaOutputId) { - this.mediaOutputId = mediaOutputId; + public PredictAuxotrophyParams withGenomeIds(List genomeIds) { + this.genomeIds = genomeIds; return this; } @JsonProperty("genome_workspace") - public String getGenomeWorkspace() { + public java.lang.String getGenomeWorkspace() { return genomeWorkspace; } @JsonProperty("genome_workspace") - public void setGenomeWorkspace(String genomeWorkspace) { + public void setGenomeWorkspace(java.lang.String genomeWorkspace) { this.genomeWorkspace = genomeWorkspace; } - public PredictAuxotrophyParams withGenomeWorkspace(String genomeWorkspace) { + public PredictAuxotrophyParams withGenomeWorkspace(java.lang.String genomeWorkspace) { this.genomeWorkspace = genomeWorkspace; return this; } @JsonProperty("workspace") - public String getWorkspace() { + public java.lang.String getWorkspace() { return workspace; } @JsonProperty("workspace") - public void setWorkspace(String workspace) { + public void setWorkspace(java.lang.String workspace) { this.workspace = workspace; } - public PredictAuxotrophyParams withWorkspace(String workspace) { + public PredictAuxotrophyParams withWorkspace(java.lang.String workspace) { this.workspace = workspace; return this; } @JsonAnyGetter - public Map getAdditionalProperties() { + public Map getAdditionalProperties() { return this.additionalProperties; } @JsonAnySetter - public void setAdditionalProperties(String name, Object value) { + public void setAdditionalProperties(java.lang.String name, Object value) { this.additionalProperties.put(name, value); } @Override - public String toString() { - return ((((((((((("PredictAuxotrophyParams"+" [genomeId=")+ genomeId)+", mediaOutputId=")+ mediaOutputId)+", genomeWorkspace=")+ genomeWorkspace)+", workspace=")+ workspace)+", additionalProperties=")+ additionalProperties)+"]"); + public java.lang.String toString() { + return ((((((((("PredictAuxotrophyParams"+" [genomeIds=")+ genomeIds)+", genomeWorkspace=")+ genomeWorkspace)+", workspace=")+ workspace)+", additionalProperties=")+ additionalProperties)+"]"); } } diff --git a/scripts/prepare_deploy_cfg.py b/scripts/prepare_deploy_cfg.py index 395343f..e5b2032 100644 --- a/scripts/prepare_deploy_cfg.py +++ b/scripts/prepare_deploy_cfg.py @@ -1,6 +1,9 @@ import sys +import os +import os.path from jinja2 import Template from ConfigParser import ConfigParser +import StringIO if __name__ == "__main__": if len(sys.argv) != 3: @@ -12,7 +15,29 @@ text = file.read() t = Template(text) config = ConfigParser() - config.read(sys.argv[2]) + if os.path.isfile(sys.argv[2]): + config.read(sys.argv[2]) + elif "KBASE_ENDPOINT" in os.environ: + kbase_endpoint = os.environ.get("KBASE_ENDPOINT") + props = "[global]\n" + \ + "kbase_endpoint = " + kbase_endpoint + "\n" + \ + "job_service_url = " + kbase_endpoint + "/userandjobstate\n" + \ + "workspace_url = " + kbase_endpoint + "/ws\n" + \ + "shock_url = " + kbase_endpoint + "/shock-api\n" + \ + "handle_url = " + kbase_endpoint + "/handle_service\n" + \ + "srv_wiz_url = " + kbase_endpoint + "/service_wizard\n" + \ + "njsw_url = " + kbase_endpoint + "/njs_wrapper\n" + if "AUTH_SERVICE_URL" in os.environ: + props += "auth_service_url = " + os.environ.get("AUTH_SERVICE_URL") + "\n" + props += "auth_service_url_allow_insecure = " + \ + os.environ.get("AUTH_SERVICE_URL_ALLOW_INSECURE", "false") + "\n" + for key in os.environ: + if key.startswith('KBASE_SECURE_CONFIG_PARAM_'): + param_name = key[len('KBASE_SECURE_CONFIG_PARAM_'):] + props += param_name + " = " + os.environ.get(key) + "\n" + config.readfp(StringIO.StringIO(props)) + else: + raise ValueError('Neither ' + sys.argv[2] + ' file nor KBASE_ENDPOINT env-variable found') props = dict(config.items("global")) output = t.render(props) with open(sys.argv[1] + ".orig", 'w') as f: