# -*- coding: utf-8 -*-
############################################################
#
# Autogenerated by the KBase type compiler -
# any changes made here will be overwritten
#
############################################################

from __future__ import print_function

# the following is a hack to get the baseclient to import whether we're in a
# package or not. This makes pep8 unhappy hence the annotations.
try:
    # baseclient and this client are in a package
    from .baseclient import BaseClient as _BaseClient  # @UnusedImport
except ImportError:
    # no they aren't
    from baseclient import BaseClient as _BaseClient  # @Reimport


class execution_engine2(object):
    def __init__(
        self,
        url=None,
        timeout=30 * 60,
        user_id=None,
        password=None,
        token=None,
        ignore_authrc=False,
        trust_all_ssl_certificates=False,
        auth_svc="https://ci.kbase.us/services/auth/api/legacy/KBase/Sessions/Login",
    ):
        if url is None:
            raise ValueError("A url is required")
        self._service_ver = None
        self._client = _BaseClient(
            url,
            timeout=timeout,
            user_id=user_id,
            password=password,
            token=token,
            ignore_authrc=ignore_authrc,
            trust_all_ssl_certificates=trust_all_ssl_certificates,
            auth_svc=auth_svc,
        )

    def list_config(self, context=None):
        """
        Returns the service configuration, including URL endpoints and timeouts.
        The returned values are:
        external-url - string - url of this service
        kbase-endpoint - string - url of the services endpoint for the KBase environment
        workspace-url - string - Workspace service url
        catalog-url - string - catalog service url
        shock-url - string - shock service url
        handle-url - string - handle service url
        auth-service-url - string - legacy auth service url
        auth-service-url-v2 - string - current auth service url
        auth-service-url-allow-insecure - boolean string (true or false) - whether to allow insecure requests
        scratch - string - local path to scratch directory
        executable - string - name of Job Runner executable
        docker_timeout - int - time in seconds before a job will be timed out and terminated
        initial_dir - string - initial dir for HTCondor to search for passed input/output files
        transfer_input_files - initial list of files to transfer to HTCondor for job running
        :returns: instance of mapping from String to String
        """
        return self._client.call_method(
            "execution_engine2.list_config", [], self._service_ver, context
        )

    def ver(self, context=None):
        """
        Returns the current running version of the execution_engine2 servicve as a semantic version string.
        :returns: instance of String
        """
        return self._client.call_method(
            "execution_engine2.ver", [], self._service_ver, context
        )

    def status(self, context=None):
        """
        Simply check the status of this service to see queue details
        :returns: instance of type "Status" (A structure representing the
           Execution Engine status git_commit - the Git hash of the version
           of the module. version - the semantic version for the module.
           service - the name of the service. server_time - the current
           server timestamp since epoch # TODO - add some or all of the
           following reboot_mode - if 1, then in the process of rebooting
           stopping_mode - if 1, then in the process of stopping
           running_tasks_total - number of total running jobs
           running_tasks_per_user - mapping from user id to number of running
           jobs for that user tasks_in_queue - number of jobs in the queue
           that are not running) -> structure: parameter "git_commit" of
           String, parameter "version" of String, parameter "service" of
           String, parameter "server_time" of Double
        """
        return self._client.call_method(
            "execution_engine2.status", [], self._service_ver, context
        )

    def run_job(self, params, context=None):
        """
        Start a new job (long running method of service registered in ServiceRegistery).
        Such job runs Docker image for this service in script mode.
        :param params: instance of type "RunJobParams" (method - service
           defined in standard JSON RPC way, typically it's module name from
           spec-file followed by '.' and name of funcdef from spec-file
           corresponding to running method (e.g.
           'KBaseTrees.construct_species_tree' from trees service); params -
           the parameters of the method that performed this call; Optional
           parameters: service_ver - specific version of deployed service,
           last version is used if this parameter is not defined rpc_context
           - context of current method call including nested call history
           remote_url - run remote service call instead of local command line
           execution. source_ws_objects - denotes the workspace objects that
           will serve as a source of data when running the SDK method. These
           references will be added to the autogenerated provenance. app_id -
           the id of the Narrative application running this job (e.g.
           repo/name) mapping<string, string> meta - user defined metadata to
           associate with the job. wsid - an optional workspace id to
           associate with the job. This is passed to the workspace service,
           which will share the job based on the permissions of the workspace
           rather than owner of the job parent_job_id - UJS id of the parent
           of a batch job. Sub jobs will add this id to the NJS database
           under the field "parent_job_id" ======= These are optional
           parameters that are currently allowed if you have the
           KBASE_CONCIERGE/KBASE_FULL_SERVICE roles ======= @optional
           request_cpu @optional request_memory_mb @optional request_disk_mb
           @optional request_clientgroup @optional
           request_staging_volume_mounts @optional
           request_refdata_volume_mounts) -> structure: parameter "method" of
           String, parameter "params" of list of unspecified object,
           parameter "service_ver" of String, parameter "rpc_context" of type
           "RpcContext" (call_stack - upstream calls details including nested
           service calls and parent jobs where calls are listed in order from
           outer to inner.) -> structure: parameter "call_stack" of list of
           type "MethodCall" (time - the time the call was started; method -
           service defined in standard JSON RPC way, typically it's module
           name from spec-file followed by '.' and name of funcdef from
           spec-file corresponding to running method (e.g.
           'KBaseTrees.construct_species_tree' from trees service); job_id -
           job id if method is asynchronous (optional field).) -> structure:
           parameter "time" of type "timestamp" (A time in the format
           YYYY-MM-DDThh:mm:ssZ, where Z is either the character Z
           (representing the UTC timezone) or the difference in time to UTC
           in the format +/-HHMM, eg: 2012-12-17T23:24:06-0500 (EST time)
           2013-04-03T08:56:32+0000 (UTC time) 2013-04-03T08:56:32Z (UTC
           time)), parameter "method" of String, parameter "job_id" of type
           "job_id" (A job id.), parameter "run_id" of String, parameter
           "remote_url" of String, parameter "source_ws_objects" of list of
           type "wsref" (A workspace object reference of the form X/Y or
           X/Y/Z, where X is the workspace name or id, Y is the object name
           or id, Z is the version, which is optional.), parameter "app_id"
           of String, parameter "meta" of mapping from String to String,
           parameter "wsid" of Long, parameter "parent_job_id" of String,
           parameter "request_cpu" of Long, parameter "request_memory_mb" of
           Long, parameter "request_disk_mb" of Long, parameter
           "request_clientgroup" of String, parameter
           "request_staging_volume_mounts" of list of String, parameter
           "request_refdata_volume_mounts" of list of String
        :returns: instance of type "job_id" (A job id.)
        """
        return self._client.call_method(
            "execution_engine2.run_job", [params], self._service_ver, context
        )

    def run_job_as_admin(self, params, as_admin, context=None):
        """
        :param params: instance of type "RunJobParams" (method - service
           defined in standard JSON RPC way, typically it's module name from
           spec-file followed by '.' and name of funcdef from spec-file
           corresponding to running method (e.g.
           'KBaseTrees.construct_species_tree' from trees service); params -
           the parameters of the method that performed this call; Optional
           parameters: service_ver - specific version of deployed service,
           last version is used if this parameter is not defined rpc_context
           - context of current method call including nested call history
           remote_url - run remote service call instead of local command line
           execution. source_ws_objects - denotes the workspace objects that
           will serve as a source of data when running the SDK method. These
           references will be added to the autogenerated provenance. app_id -
           the id of the Narrative application running this job (e.g.
           repo/name) mapping<string, string> meta - user defined metadata to
           associate with the job. wsid - an optional workspace id to
           associate with the job. This is passed to the workspace service,
           which will share the job based on the permissions of the workspace
           rather than owner of the job parent_job_id - UJS id of the parent
           of a batch job. Sub jobs will add this id to the NJS database
           under the field "parent_job_id" ======= These are optional
           parameters that are currently allowed if you have the
           KBASE_CONCIERGE/KBASE_FULL_SERVICE roles ======= @optional
           request_cpu @optional request_memory_mb @optional request_disk_mb
           @optional request_clientgroup @optional
           request_staging_volume_mounts @optional
           request_refdata_volume_mounts) -> structure: parameter "method" of
           String, parameter "params" of list of unspecified object,
           parameter "service_ver" of String, parameter "rpc_context" of type
           "RpcContext" (call_stack - upstream calls details including nested
           service calls and parent jobs where calls are listed in order from
           outer to inner.) -> structure: parameter "call_stack" of list of
           type "MethodCall" (time - the time the call was started; method -
           service defined in standard JSON RPC way, typically it's module
           name from spec-file followed by '.' and name of funcdef from
           spec-file corresponding to running method (e.g.
           'KBaseTrees.construct_species_tree' from trees service); job_id -
           job id if method is asynchronous (optional field).) -> structure:
           parameter "time" of type "timestamp" (A time in the format
           YYYY-MM-DDThh:mm:ssZ, where Z is either the character Z
           (representing the UTC timezone) or the difference in time to UTC
           in the format +/-HHMM, eg: 2012-12-17T23:24:06-0500 (EST time)
           2013-04-03T08:56:32+0000 (UTC time) 2013-04-03T08:56:32Z (UTC
           time)), parameter "method" of String, parameter "job_id" of type
           "job_id" (A job id.), parameter "run_id" of String, parameter
           "remote_url" of String, parameter "source_ws_objects" of list of
           type "wsref" (A workspace object reference of the form X/Y or
           X/Y/Z, where X is the workspace name or id, Y is the object name
           or id, Z is the version, which is optional.), parameter "app_id"
           of String, parameter "meta" of mapping from String to String,
           parameter "wsid" of Long, parameter "parent_job_id" of String,
           parameter "request_cpu" of Long, parameter "request_memory_mb" of
           Long, parameter "request_disk_mb" of Long, parameter
           "request_clientgroup" of String, parameter
           "request_staging_volume_mounts" of list of String, parameter
           "request_refdata_volume_mounts" of list of String
        :param as_admin: instance of type "boolean" (@range [0,1])
        :returns: instance of type "job_id" (A job id.)
        """
        return self._client.call_method(
            "execution_engine2.run_job_as_admin",
            [params, as_admin],
            self._service_ver,
            context,
        )

    def get_job_params(self, job_id, context=None):
        """
        Get job params necessary for job execution
        :param job_id: instance of type "job_id" (A job id.)
        :returns: instance of type "RunJobParams" (method - service defined
           in standard JSON RPC way, typically it's module name from
           spec-file followed by '.' and name of funcdef from spec-file
           corresponding to running method (e.g.
           'KBaseTrees.construct_species_tree' from trees service); params -
           the parameters of the method that performed this call; Optional
           parameters: service_ver - specific version of deployed service,
           last version is used if this parameter is not defined rpc_context
           - context of current method call including nested call history
           remote_url - run remote service call instead of local command line
           execution. source_ws_objects - denotes the workspace objects that
           will serve as a source of data when running the SDK method. These
           references will be added to the autogenerated provenance. app_id -
           the id of the Narrative application running this job (e.g.
           repo/name) mapping<string, string> meta - user defined metadata to
           associate with the job. wsid - an optional workspace id to
           associate with the job. This is passed to the workspace service,
           which will share the job based on the permissions of the workspace
           rather than owner of the job parent_job_id - UJS id of the parent
           of a batch job. Sub jobs will add this id to the NJS database
           under the field "parent_job_id" ======= These are optional
           parameters that are currently allowed if you have the
           KBASE_CONCIERGE/KBASE_FULL_SERVICE roles ======= @optional
           request_cpu @optional request_memory_mb @optional request_disk_mb
           @optional request_clientgroup @optional
           request_staging_volume_mounts @optional
           request_refdata_volume_mounts) -> structure: parameter "method" of
           String, parameter "params" of list of unspecified object,
           parameter "service_ver" of String, parameter "rpc_context" of type
           "RpcContext" (call_stack - upstream calls details including nested
           service calls and parent jobs where calls are listed in order from
           outer to inner.) -> structure: parameter "call_stack" of list of
           type "MethodCall" (time - the time the call was started; method -
           service defined in standard JSON RPC way, typically it's module
           name from spec-file followed by '.' and name of funcdef from
           spec-file corresponding to running method (e.g.
           'KBaseTrees.construct_species_tree' from trees service); job_id -
           job id if method is asynchronous (optional field).) -> structure:
           parameter "time" of type "timestamp" (A time in the format
           YYYY-MM-DDThh:mm:ssZ, where Z is either the character Z
           (representing the UTC timezone) or the difference in time to UTC
           in the format +/-HHMM, eg: 2012-12-17T23:24:06-0500 (EST time)
           2013-04-03T08:56:32+0000 (UTC time) 2013-04-03T08:56:32Z (UTC
           time)), parameter "method" of String, parameter "job_id" of type
           "job_id" (A job id.), parameter "run_id" of String, parameter
           "remote_url" of String, parameter "source_ws_objects" of list of
           type "wsref" (A workspace object reference of the form X/Y or
           X/Y/Z, where X is the workspace name or id, Y is the object name
           or id, Z is the version, which is optional.), parameter "app_id"
           of String, parameter "meta" of mapping from String to String,
           parameter "wsid" of Long, parameter "parent_job_id" of String,
           parameter "request_cpu" of Long, parameter "request_memory_mb" of
           Long, parameter "request_disk_mb" of Long, parameter
           "request_clientgroup" of String, parameter
           "request_staging_volume_mounts" of list of String, parameter
           "request_refdata_volume_mounts" of list of String
        """
        return self._client.call_method(
            "execution_engine2.get_job_params", [job_id], self._service_ver, context
        )

    def get_job_params_as_admin(self, job_id, as_admin, context=None):
        """
        :param job_id: instance of type "job_id" (A job id.)
        :param as_admin: instance of type "boolean" (@range [0,1])
        :returns: instance of type "RunJobParams" (method - service defined
           in standard JSON RPC way, typically it's module name from
           spec-file followed by '.' and name of funcdef from spec-file
           corresponding to running method (e.g.
           'KBaseTrees.construct_species_tree' from trees service); params -
           the parameters of the method that performed this call; Optional
           parameters: service_ver - specific version of deployed service,
           last version is used if this parameter is not defined rpc_context
           - context of current method call including nested call history
           remote_url - run remote service call instead of local command line
           execution. source_ws_objects - denotes the workspace objects that
           will serve as a source of data when running the SDK method. These
           references will be added to the autogenerated provenance. app_id -
           the id of the Narrative application running this job (e.g.
           repo/name) mapping<string, string> meta - user defined metadata to
           associate with the job. wsid - an optional workspace id to
           associate with the job. This is passed to the workspace service,
           which will share the job based on the permissions of the workspace
           rather than owner of the job parent_job_id - UJS id of the parent
           of a batch job. Sub jobs will add this id to the NJS database
           under the field "parent_job_id" ======= These are optional
           parameters that are currently allowed if you have the
           KBASE_CONCIERGE/KBASE_FULL_SERVICE roles ======= @optional
           request_cpu @optional request_memory_mb @optional request_disk_mb
           @optional request_clientgroup @optional
           request_staging_volume_mounts @optional
           request_refdata_volume_mounts) -> structure: parameter "method" of
           String, parameter "params" of list of unspecified object,
           parameter "service_ver" of String, parameter "rpc_context" of type
           "RpcContext" (call_stack - upstream calls details including nested
           service calls and parent jobs where calls are listed in order from
           outer to inner.) -> structure: parameter "call_stack" of list of
           type "MethodCall" (time - the time the call was started; method -
           service defined in standard JSON RPC way, typically it's module
           name from spec-file followed by '.' and name of funcdef from
           spec-file corresponding to running method (e.g.
           'KBaseTrees.construct_species_tree' from trees service); job_id -
           job id if method is asynchronous (optional field).) -> structure:
           parameter "time" of type "timestamp" (A time in the format
           YYYY-MM-DDThh:mm:ssZ, where Z is either the character Z
           (representing the UTC timezone) or the difference in time to UTC
           in the format +/-HHMM, eg: 2012-12-17T23:24:06-0500 (EST time)
           2013-04-03T08:56:32+0000 (UTC time) 2013-04-03T08:56:32Z (UTC
           time)), parameter "method" of String, parameter "job_id" of type
           "job_id" (A job id.), parameter "run_id" of String, parameter
           "remote_url" of String, parameter "source_ws_objects" of list of
           type "wsref" (A workspace object reference of the form X/Y or
           X/Y/Z, where X is the workspace name or id, Y is the object name
           or id, Z is the version, which is optional.), parameter "app_id"
           of String, parameter "meta" of mapping from String to String,
           parameter "wsid" of Long, parameter "parent_job_id" of String,
           parameter "request_cpu" of Long, parameter "request_memory_mb" of
           Long, parameter "request_disk_mb" of Long, parameter
           "request_clientgroup" of String, parameter
           "request_staging_volume_mounts" of list of String, parameter
           "request_refdata_volume_mounts" of list of String
        """
        return self._client.call_method(
            "execution_engine2.get_job_params_as_admin",
            [job_id, as_admin],
            self._service_ver,
            context,
        )

    def update_job_status(self, params, context=None):
        """
        :param params: instance of type "UpdateJobStatusParams" (job_id - a
           job id status - the new status to set for the job.) -> structure:
           parameter "job_id" of type "job_id" (A job id.), parameter
           "status" of String
        :returns: instance of type "job_id" (A job id.)
        """
        return self._client.call_method(
            "execution_engine2.update_job_status", [params], self._service_ver, context
        )

    def update_job_status_as_admin(self, params, as_admin, context=None):
        """
        :param params: instance of type "UpdateJobStatusParams" (job_id - a
           job id status - the new status to set for the job.) -> structure:
           parameter "job_id" of type "job_id" (A job id.), parameter
           "status" of String
        :param as_admin: instance of type "boolean" (@range [0,1])
        :returns: instance of type "job_id" (A job id.)
        """
        return self._client.call_method(
            "execution_engine2.update_job_status_as_admin",
            [params, as_admin],
            self._service_ver,
            context,
        )

    def add_job_logs(self, job_id, lines, context=None):
        """
        :param job_id: instance of type "job_id" (A job id.)
        :param lines: instance of list of type "LogLine" (line - string - a
           string to set for the log line. is_error - int - if 1, then this
           line should be treated as an error, default 0 ts - int - a
           timestamp since epoch in milliseconds for the log line (optional)
           @optional ts) -> structure: parameter "line" of String, parameter
           "is_error" of type "boolean" (@range [0,1]), parameter "ts" of Long
        :returns: instance of Long
        """
        return self._client.call_method(
            "execution_engine2.add_job_logs",
            [job_id, lines],
            self._service_ver,
            context,
        )

    def add_job_logs_as_admin(self, job_id, lines, as_admin, context=None):
        """
        :param job_id: instance of type "job_id" (A job id.)
        :param lines: instance of list of type "LogLine" (line - string - a
           string to set for the log line. is_error - int - if 1, then this
           line should be treated as an error, default 0 ts - int - a
           timestamp since epoch in milliseconds for the log line (optional)
           @optional ts) -> structure: parameter "line" of String, parameter
           "is_error" of type "boolean" (@range [0,1]), parameter "ts" of Long
        :param as_admin: instance of type "boolean" (@range [0,1])
        :returns: instance of Long
        """
        return self._client.call_method(
            "execution_engine2.add_job_logs_as_admin",
            [job_id, lines, as_admin],
            self._service_ver,
            context,
        )

    def get_job_logs(self, params, context=None):
        """
        :param params: instance of type "GetJobLogsParams" (skip_lines -
           optional parameter, number of lines to skip (in case they were
           already loaded before).) -> structure: parameter "job_id" of type
           "job_id" (A job id.), parameter "skip_lines" of Long
        :returns: instance of type "GetJobLogsResults" (last_line_number -
           common number of lines (including those in skip_lines parameter),
           this number can be used as next skip_lines value to skip already
           loaded lines next time.) -> structure: parameter "lines" of list
           of type "LogLine" (line - string - a string to set for the log
           line. is_error - int - if 1, then this line should be treated as
           an error, default 0 ts - int - a timestamp since epoch in
           milliseconds for the log line (optional) @optional ts) ->
           structure: parameter "line" of String, parameter "is_error" of
           type "boolean" (@range [0,1]), parameter "ts" of Long, parameter
           "last_line_number" of Long
        """
        return self._client.call_method(
            "execution_engine2.get_job_logs", [params], self._service_ver, context
        )

    def get_job_logs_as_admin(self, params, as_admin, context=None):
        """
        :param params: instance of type "GetJobLogsParams" (skip_lines -
           optional parameter, number of lines to skip (in case they were
           already loaded before).) -> structure: parameter "job_id" of type
           "job_id" (A job id.), parameter "skip_lines" of Long
        :param as_admin: instance of type "boolean" (@range [0,1])
        :returns: instance of type "GetJobLogsResults" (last_line_number -
           common number of lines (including those in skip_lines parameter),
           this number can be used as next skip_lines value to skip already
           loaded lines next time.) -> structure: parameter "lines" of list
           of type "LogLine" (line - string - a string to set for the log
           line. is_error - int - if 1, then this line should be treated as
           an error, default 0 ts - int - a timestamp since epoch in
           milliseconds for the log line (optional) @optional ts) ->
           structure: parameter "line" of String, parameter "is_error" of
           type "boolean" (@range [0,1]), parameter "ts" of Long, parameter
           "last_line_number" of Long
        """
        return self._client.call_method(
            "execution_engine2.get_job_logs_as_admin",
            [params, as_admin],
            self._service_ver,
            context,
        )

    def finish_job(self, params, context=None):
        """
        Register results of already started job
        :param params: instance of type "FinishJobParams" (job_id - string -
           the id of the job to mark completed or finished with an error
           error_message - string - optional unless job is finished with an
           error error_code - int - optional unless job finished with an
           error error - JsonRpcError - optional output from SDK Job
           Containers job_output - job output if job completed successfully)
           -> structure: parameter "job_id" of type "job_id" (A job id.),
           parameter "error_message" of String, parameter "error_code" of
           Long, parameter "error" of type "JsonRpcError" (Error block of
           JSON RPC response) -> structure: parameter "name" of String,
           parameter "code" of Long, parameter "message" of String, parameter
           "error" of String, parameter "job_output" of unspecified object
        """
        return self._client.call_method(
            "execution_engine2.finish_job", [params], self._service_ver, context
        )

    def finish_job_as_admin(self, params, as_admin, context=None):
        """
        :param params: instance of type "FinishJobParams" (job_id - string -
           the id of the job to mark completed or finished with an error
           error_message - string - optional unless job is finished with an
           error error_code - int - optional unless job finished with an
           error error - JsonRpcError - optional output from SDK Job
           Containers job_output - job output if job completed successfully)
           -> structure: parameter "job_id" of type "job_id" (A job id.),
           parameter "error_message" of String, parameter "error_code" of
           Long, parameter "error" of type "JsonRpcError" (Error block of
           JSON RPC response) -> structure: parameter "name" of String,
           parameter "code" of Long, parameter "message" of String, parameter
           "error" of String, parameter "job_output" of unspecified object
        :param as_admin: instance of type "boolean" (@range [0,1])
        """
        return self._client.call_method(
            "execution_engine2.finish_job_as_admin",
            [params, as_admin],
            self._service_ver,
            context,
        )

    def start_job(self, params, context=None):
        """
        :param params: instance of type "StartJobParams" (skip_estimation:
           default true. If set true, job will set to running status skipping
           estimation step) -> structure: parameter "job_id" of type "job_id"
           (A job id.), parameter "skip_estimation" of type "boolean" (@range
           [0,1])
        """
        return self._client.call_method(
            "execution_engine2.start_job", [params], self._service_ver, context
        )

    def start_job_as_admin(self, params, as_admin, context=None):
        """
        :param params: instance of type "StartJobParams" (skip_estimation:
           default true. If set true, job will set to running status skipping
           estimation step) -> structure: parameter "job_id" of type "job_id"
           (A job id.), parameter "skip_estimation" of type "boolean" (@range
           [0,1])
        :param as_admin: instance of type "boolean" (@range [0,1])
        """
        return self._client.call_method(
            "execution_engine2.start_job_as_admin",
            [params, as_admin],
            self._service_ver,
            context,
        )

    def check_job(self, params, context=None):
        """
        get current status of a job
        :param params: instance of type "CheckJobParams" (exclude_fields:
           exclude certain fields to return. default None. exclude_fields
           strings can be one of fiedls defined in
           execution_engine2.db.models.models.Job) -> structure: parameter
           "job_id" of type "job_id" (A job id.), parameter "exclude_fields"
           of list of String
        :returns: instance of type "JobState" (job_id - string - id of the
           job user - string - user who started the job wsid - int - optional
           id of the workspace where the job is bound authstrat - string -
           what strategy used to authenticate the job job_input - object -
           inputs to the job (from the run_job call)  ## TODO - verify
           updated - int - timestamp since epoch in milliseconds of the last
           time the status was updated running - int - timestamp since epoch
           in milliseconds of when it entered the running state created - int
           - timestamp since epoch in milliseconds when the job was created
           finished - int - timestamp since epoch in milliseconds when the
           job was finished status - string - status of the job. one of the
           following: created - job has been created in the service
           estimating - an estimation job is running to estimate resources
           required for the main job, and which queue should be used queued -
           job is queued to be run running - job is running on a worker node
           completed - job was completed successfully error - job is no
           longer running, but failed with an error terminated - job is no
           longer running, terminated either due to user cancellation, admin
           cancellation, or some automated task error_code - int - internal
           reason why the job is an error. one of the following: 0 - unknown
           1 - job crashed 2 - job terminated by automation 3 - job ran over
           time limit 4 - job was missing its automated output document 5 -
           job authentication token expired errormsg - string - message (e.g.
           stacktrace) accompanying an errored job error - object - the
           JSON-RPC error package that accompanies the error code and message
           terminated_code - int - internal reason why a job was terminated,
           one of: 0 - user cancellation 1 - admin cancellation 2 -
           terminated by some automatic process @optional error @optional
           error_code @optional errormsg @optional terminated_code @optional
           estimating @optional running @optional finished) -> structure:
           parameter "job_id" of type "job_id" (A job id.), parameter "user"
           of String, parameter "authstrat" of String, parameter "wsid" of
           Long, parameter "status" of String, parameter "job_input" of type
           "RunJobParams" (method - service defined in standard JSON RPC way,
           typically it's module name from spec-file followed by '.' and name
           of funcdef from spec-file corresponding to running method (e.g.
           'KBaseTrees.construct_species_tree' from trees service); params -
           the parameters of the method that performed this call; Optional
           parameters: service_ver - specific version of deployed service,
           last version is used if this parameter is not defined rpc_context
           - context of current method call including nested call history
           remote_url - run remote service call instead of local command line
           execution. source_ws_objects - denotes the workspace objects that
           will serve as a source of data when running the SDK method. These
           references will be added to the autogenerated provenance. app_id -
           the id of the Narrative application running this job (e.g.
           repo/name) mapping<string, string> meta - user defined metadata to
           associate with the job. wsid - an optional workspace id to
           associate with the job. This is passed to the workspace service,
           which will share the job based on the permissions of the workspace
           rather than owner of the job parent_job_id - UJS id of the parent
           of a batch job. Sub jobs will add this id to the NJS database
           under the field "parent_job_id" ======= These are optional
           parameters that are currently allowed if you have the
           KBASE_CONCIERGE/KBASE_FULL_SERVICE roles ======= @optional
           request_cpu @optional request_memory_mb @optional request_disk_mb
           @optional request_clientgroup @optional
           request_staging_volume_mounts @optional
           request_refdata_volume_mounts) -> structure: parameter "method" of
           String, parameter "params" of list of unspecified object,
           parameter "service_ver" of String, parameter "rpc_context" of type
           "RpcContext" (call_stack - upstream calls details including nested
           service calls and parent jobs where calls are listed in order from
           outer to inner.) -> structure: parameter "call_stack" of list of
           type "MethodCall" (time - the time the call was started; method -
           service defined in standard JSON RPC way, typically it's module
           name from spec-file followed by '.' and name of funcdef from
           spec-file corresponding to running method (e.g.
           'KBaseTrees.construct_species_tree' from trees service); job_id -
           job id if method is asynchronous (optional field).) -> structure:
           parameter "time" of type "timestamp" (A time in the format
           YYYY-MM-DDThh:mm:ssZ, where Z is either the character Z
           (representing the UTC timezone) or the difference in time to UTC
           in the format +/-HHMM, eg: 2012-12-17T23:24:06-0500 (EST time)
           2013-04-03T08:56:32+0000 (UTC time) 2013-04-03T08:56:32Z (UTC
           time)), parameter "method" of String, parameter "job_id" of type
           "job_id" (A job id.), parameter "run_id" of String, parameter
           "remote_url" of String, parameter "source_ws_objects" of list of
           type "wsref" (A workspace object reference of the form X/Y or
           X/Y/Z, where X is the workspace name or id, Y is the object name
           or id, Z is the version, which is optional.), parameter "app_id"
           of String, parameter "meta" of mapping from String to String,
           parameter "wsid" of Long, parameter "parent_job_id" of String,
           parameter "request_cpu" of Long, parameter "request_memory_mb" of
           Long, parameter "request_disk_mb" of Long, parameter
           "request_clientgroup" of String, parameter
           "request_staging_volume_mounts" of list of String, parameter
           "request_refdata_volume_mounts" of list of String, parameter
           "created" of Long, parameter "queued" of Long, parameter
           "estimating" of Long, parameter "running" of Long, parameter
           "finished" of Long, parameter "updated" of Long, parameter "error"
           of type "JsonRpcError" (Error block of JSON RPC response) ->
           structure: parameter "name" of String, parameter "code" of Long,
           parameter "message" of String, parameter "error" of String,
           parameter "error_code" of Long, parameter "errormsg" of String,
           parameter "terminated_code" of Long
        """
        return self._client.call_method(
            "execution_engine2.check_job", [params], self._service_ver, context
        )

    def check_job_as_admin(self, params, as_admin, context=None):
        """
        :param params: instance of type "CheckJobParams" (exclude_fields:
           exclude certain fields to return. default None. exclude_fields
           strings can be one of fiedls defined in
           execution_engine2.db.models.models.Job) -> structure: parameter
           "job_id" of type "job_id" (A job id.), parameter "exclude_fields"
           of list of String
        :param as_admin: instance of type "boolean" (@range [0,1])
        :returns: instance of type "JobState" (job_id - string - id of the
           job user - string - user who started the job wsid - int - optional
           id of the workspace where the job is bound authstrat - string -
           what strategy used to authenticate the job job_input - object -
           inputs to the job (from the run_job call)  ## TODO - verify
           updated - int - timestamp since epoch in milliseconds of the last
           time the status was updated running - int - timestamp since epoch
           in milliseconds of when it entered the running state created - int
           - timestamp since epoch in milliseconds when the job was created
           finished - int - timestamp since epoch in milliseconds when the
           job was finished status - string - status of the job. one of the
           following: created - job has been created in the service
           estimating - an estimation job is running to estimate resources
           required for the main job, and which queue should be used queued -
           job is queued to be run running - job is running on a worker node
           completed - job was completed successfully error - job is no
           longer running, but failed with an error terminated - job is no
           longer running, terminated either due to user cancellation, admin
           cancellation, or some automated task error_code - int - internal
           reason why the job is an error. one of the following: 0 - unknown
           1 - job crashed 2 - job terminated by automation 3 - job ran over
           time limit 4 - job was missing its automated output document 5 -
           job authentication token expired errormsg - string - message (e.g.
           stacktrace) accompanying an errored job error - object - the
           JSON-RPC error package that accompanies the error code and message
           terminated_code - int - internal reason why a job was terminated,
           one of: 0 - user cancellation 1 - admin cancellation 2 -
           terminated by some automatic process @optional error @optional
           error_code @optional errormsg @optional terminated_code @optional
           estimating @optional running @optional finished) -> structure:
           parameter "job_id" of type "job_id" (A job id.), parameter "user"
           of String, parameter "authstrat" of String, parameter "wsid" of
           Long, parameter "status" of String, parameter "job_input" of type
           "RunJobParams" (method - service defined in standard JSON RPC way,
           typically it's module name from spec-file followed by '.' and name
           of funcdef from spec-file corresponding to running method (e.g.
           'KBaseTrees.construct_species_tree' from trees service); params -
           the parameters of the method that performed this call; Optional
           parameters: service_ver - specific version of deployed service,
           last version is used if this parameter is not defined rpc_context
           - context of current method call including nested call history
           remote_url - run remote service call instead of local command line
           execution. source_ws_objects - denotes the workspace objects that
           will serve as a source of data when running the SDK method. These
           references will be added to the autogenerated provenance. app_id -
           the id of the Narrative application running this job (e.g.
           repo/name) mapping<string, string> meta - user defined metadata to
           associate with the job. wsid - an optional workspace id to
           associate with the job. This is passed to the workspace service,
           which will share the job based on the permissions of the workspace
           rather than owner of the job parent_job_id - UJS id of the parent
           of a batch job. Sub jobs will add this id to the NJS database
           under the field "parent_job_id" ======= These are optional
           parameters that are currently allowed if you have the
           KBASE_CONCIERGE/KBASE_FULL_SERVICE roles ======= @optional
           request_cpu @optional request_memory_mb @optional request_disk_mb
           @optional request_clientgroup @optional
           request_staging_volume_mounts @optional
           request_refdata_volume_mounts) -> structure: parameter "method" of
           String, parameter "params" of list of unspecified object,
           parameter "service_ver" of String, parameter "rpc_context" of type
           "RpcContext" (call_stack - upstream calls details including nested
           service calls and parent jobs where calls are listed in order from
           outer to inner.) -> structure: parameter "call_stack" of list of
           type "MethodCall" (time - the time the call was started; method -
           service defined in standard JSON RPC way, typically it's module
           name from spec-file followed by '.' and name of funcdef from
           spec-file corresponding to running method (e.g.
           'KBaseTrees.construct_species_tree' from trees service); job_id -
           job id if method is asynchronous (optional field).) -> structure:
           parameter "time" of type "timestamp" (A time in the format
           YYYY-MM-DDThh:mm:ssZ, where Z is either the character Z
           (representing the UTC timezone) or the difference in time to UTC
           in the format +/-HHMM, eg: 2012-12-17T23:24:06-0500 (EST time)
           2013-04-03T08:56:32+0000 (UTC time) 2013-04-03T08:56:32Z (UTC
           time)), parameter "method" of String, parameter "job_id" of type
           "job_id" (A job id.), parameter "run_id" of String, parameter
           "remote_url" of String, parameter "source_ws_objects" of list of
           type "wsref" (A workspace object reference of the form X/Y or
           X/Y/Z, where X is the workspace name or id, Y is the object name
           or id, Z is the version, which is optional.), parameter "app_id"
           of String, parameter "meta" of mapping from String to String,
           parameter "wsid" of Long, parameter "parent_job_id" of String,
           parameter "request_cpu" of Long, parameter "request_memory_mb" of
           Long, parameter "request_disk_mb" of Long, parameter
           "request_clientgroup" of String, parameter
           "request_staging_volume_mounts" of list of String, parameter
           "request_refdata_volume_mounts" of list of String, parameter
           "created" of Long, parameter "queued" of Long, parameter
           "estimating" of Long, parameter "running" of Long, parameter
           "finished" of Long, parameter "updated" of Long, parameter "error"
           of type "JsonRpcError" (Error block of JSON RPC response) ->
           structure: parameter "name" of String, parameter "code" of Long,
           parameter "message" of String, parameter "error" of String,
           parameter "error_code" of Long, parameter "errormsg" of String,
           parameter "terminated_code" of Long
        """
        return self._client.call_method(
            "execution_engine2.check_job_as_admin",
            [params, as_admin],
            self._service_ver,
            context,
        )

    def check_jobs(self, params, context=None):
        """
        :param params: instance of type "CheckJobsParams" (As in check_job,
           exclude_fields strings can be used to exclude fields. see
           CheckJobParams for allowed strings. return_list - optional, return
           list of job state if set to 1. Otherwise return a dict. Default
           1.) -> structure: parameter "job_ids" of list of type "job_id" (A
           job id.), parameter "exclude_fields" of list of String, parameter
           "return_list" of type "boolean" (@range [0,1])
        :returns: instance of type "CheckJobsResults" (job_states - states of
           jobs could be mapping<job_id, JobState> or list<JobState>) ->
           structure: parameter "job_states" of list of type "JobState"
           (job_id - string - id of the job user - string - user who started
           the job wsid - int - optional id of the workspace where the job is
           bound authstrat - string - what strategy used to authenticate the
           job job_input - object - inputs to the job (from the run_job call)
           ## TODO - verify updated - int - timestamp since epoch in
           milliseconds of the last time the status was updated running - int
           - timestamp since epoch in milliseconds of when it entered the
           running state created - int - timestamp since epoch in
           milliseconds when the job was created finished - int - timestamp
           since epoch in milliseconds when the job was finished status -
           string - status of the job. one of the following: created - job
           has been created in the service estimating - an estimation job is
           running to estimate resources required for the main job, and which
           queue should be used queued - job is queued to be run running -
           job is running on a worker node completed - job was completed
           successfully error - job is no longer running, but failed with an
           error terminated - job is no longer running, terminated either due
           to user cancellation, admin cancellation, or some automated task
           error_code - int - internal reason why the job is an error. one of
           the following: 0 - unknown 1 - job crashed 2 - job terminated by
           automation 3 - job ran over time limit 4 - job was missing its
           automated output document 5 - job authentication token expired
           errormsg - string - message (e.g. stacktrace) accompanying an
           errored job error - object - the JSON-RPC error package that
           accompanies the error code and message terminated_code - int -
           internal reason why a job was terminated, one of: 0 - user
           cancellation 1 - admin cancellation 2 - terminated by some
           automatic process @optional error @optional error_code @optional
           errormsg @optional terminated_code @optional estimating @optional
           running @optional finished) -> structure: parameter "job_id" of
           type "job_id" (A job id.), parameter "user" of String, parameter
           "authstrat" of String, parameter "wsid" of Long, parameter
           "status" of String, parameter "job_input" of type "RunJobParams"
           (method - service defined in standard JSON RPC way, typically it's
           module name from spec-file followed by '.' and name of funcdef
           from spec-file corresponding to running method (e.g.
           'KBaseTrees.construct_species_tree' from trees service); params -
           the parameters of the method that performed this call; Optional
           parameters: service_ver - specific version of deployed service,
           last version is used if this parameter is not defined rpc_context
           - context of current method call including nested call history
           remote_url - run remote service call instead of local command line
           execution. source_ws_objects - denotes the workspace objects that
           will serve as a source of data when running the SDK method. These
           references will be added to the autogenerated provenance. app_id -
           the id of the Narrative application running this job (e.g.
           repo/name) mapping<string, string> meta - user defined metadata to
           associate with the job. wsid - an optional workspace id to
           associate with the job. This is passed to the workspace service,
           which will share the job based on the permissions of the workspace
           rather than owner of the job parent_job_id - UJS id of the parent
           of a batch job. Sub jobs will add this id to the NJS database
           under the field "parent_job_id" ======= These are optional
           parameters that are currently allowed if you have the
           KBASE_CONCIERGE/KBASE_FULL_SERVICE roles ======= @optional
           request_cpu @optional request_memory_mb @optional request_disk_mb
           @optional request_clientgroup @optional
           request_staging_volume_mounts @optional
           request_refdata_volume_mounts) -> structure: parameter "method" of
           String, parameter "params" of list of unspecified object,
           parameter "service_ver" of String, parameter "rpc_context" of type
           "RpcContext" (call_stack - upstream calls details including nested
           service calls and parent jobs where calls are listed in order from
           outer to inner.) -> structure: parameter "call_stack" of list of
           type "MethodCall" (time - the time the call was started; method -
           service defined in standard JSON RPC way, typically it's module
           name from spec-file followed by '.' and name of funcdef from
           spec-file corresponding to running method (e.g.
           'KBaseTrees.construct_species_tree' from trees service); job_id -
           job id if method is asynchronous (optional field).) -> structure:
           parameter "time" of type "timestamp" (A time in the format
           YYYY-MM-DDThh:mm:ssZ, where Z is either the character Z
           (representing the UTC timezone) or the difference in time to UTC
           in the format +/-HHMM, eg: 2012-12-17T23:24:06-0500 (EST time)
           2013-04-03T08:56:32+0000 (UTC time) 2013-04-03T08:56:32Z (UTC
           time)), parameter "method" of String, parameter "job_id" of type
           "job_id" (A job id.), parameter "run_id" of String, parameter
           "remote_url" of String, parameter "source_ws_objects" of list of
           type "wsref" (A workspace object reference of the form X/Y or
           X/Y/Z, where X is the workspace name or id, Y is the object name
           or id, Z is the version, which is optional.), parameter "app_id"
           of String, parameter "meta" of mapping from String to String,
           parameter "wsid" of Long, parameter "parent_job_id" of String,
           parameter "request_cpu" of Long, parameter "request_memory_mb" of
           Long, parameter "request_disk_mb" of Long, parameter
           "request_clientgroup" of String, parameter
           "request_staging_volume_mounts" of list of String, parameter
           "request_refdata_volume_mounts" of list of String, parameter
           "created" of Long, parameter "queued" of Long, parameter
           "estimating" of Long, parameter "running" of Long, parameter
           "finished" of Long, parameter "updated" of Long, parameter "error"
           of type "JsonRpcError" (Error block of JSON RPC response) ->
           structure: parameter "name" of String, parameter "code" of Long,
           parameter "message" of String, parameter "error" of String,
           parameter "error_code" of Long, parameter "errormsg" of String,
           parameter "terminated_code" of Long
        """
        return self._client.call_method(
            "execution_engine2.check_jobs", [params], self._service_ver, context
        )

    def check_jobs_as_admin(self, params, as_admin, context=None):
        """
        :param params: instance of type "CheckJobsParams" (As in check_job,
           exclude_fields strings can be used to exclude fields. see
           CheckJobParams for allowed strings. return_list - optional, return
           list of job state if set to 1. Otherwise return a dict. Default
           1.) -> structure: parameter "job_ids" of list of type "job_id" (A
           job id.), parameter "exclude_fields" of list of String, parameter
           "return_list" of type "boolean" (@range [0,1])
        :param as_admin: instance of type "boolean" (@range [0,1])
        :returns: instance of type "CheckJobsResults" (job_states - states of
           jobs could be mapping<job_id, JobState> or list<JobState>) ->
           structure: parameter "job_states" of list of type "JobState"
           (job_id - string - id of the job user - string - user who started
           the job wsid - int - optional id of the workspace where the job is
           bound authstrat - string - what strategy used to authenticate the
           job job_input - object - inputs to the job (from the run_job call)
           ## TODO - verify updated - int - timestamp since epoch in
           milliseconds of the last time the status was updated running - int
           - timestamp since epoch in milliseconds of when it entered the
           running state created - int - timestamp since epoch in
           milliseconds when the job was created finished - int - timestamp
           since epoch in milliseconds when the job was finished status -
           string - status of the job. one of the following: created - job
           has been created in the service estimating - an estimation job is
           running to estimate resources required for the main job, and which
           queue should be used queued - job is queued to be run running -
           job is running on a worker node completed - job was completed
           successfully error - job is no longer running, but failed with an
           error terminated - job is no longer running, terminated either due
           to user cancellation, admin cancellation, or some automated task
           error_code - int - internal reason why the job is an error. one of
           the following: 0 - unknown 1 - job crashed 2 - job terminated by
           automation 3 - job ran over time limit 4 - job was missing its
           automated output document 5 - job authentication token expired
           errormsg - string - message (e.g. stacktrace) accompanying an
           errored job error - object - the JSON-RPC error package that
           accompanies the error code and message terminated_code - int -
           internal reason why a job was terminated, one of: 0 - user
           cancellation 1 - admin cancellation 2 - terminated by some
           automatic process @optional error @optional error_code @optional
           errormsg @optional terminated_code @optional estimating @optional
           running @optional finished) -> structure: parameter "job_id" of
           type "job_id" (A job id.), parameter "user" of String, parameter
           "authstrat" of String, parameter "wsid" of Long, parameter
           "status" of String, parameter "job_input" of type "RunJobParams"
           (method - service defined in standard JSON RPC way, typically it's
           module name from spec-file followed by '.' and name of funcdef
           from spec-file corresponding to running method (e.g.
           'KBaseTrees.construct_species_tree' from trees service); params -
           the parameters of the method that performed this call; Optional
           parameters: service_ver - specific version of deployed service,
           last version is used if this parameter is not defined rpc_context
           - context of current method call including nested call history
           remote_url - run remote service call instead of local command line
           execution. source_ws_objects - denotes the workspace objects that
           will serve as a source of data when running the SDK method. These
           references will be added to the autogenerated provenance. app_id -
           the id of the Narrative application running this job (e.g.
           repo/name) mapping<string, string> meta - user defined metadata to
           associate with the job. wsid - an optional workspace id to
           associate with the job. This is passed to the workspace service,
           which will share the job based on the permissions of the workspace
           rather than owner of the job parent_job_id - UJS id of the parent
           of a batch job. Sub jobs will add this id to the NJS database
           under the field "parent_job_id" ======= These are optional
           parameters that are currently allowed if you have the
           KBASE_CONCIERGE/KBASE_FULL_SERVICE roles ======= @optional
           request_cpu @optional request_memory_mb @optional request_disk_mb
           @optional request_clientgroup @optional
           request_staging_volume_mounts @optional
           request_refdata_volume_mounts) -> structure: parameter "method" of
           String, parameter "params" of list of unspecified object,
           parameter "service_ver" of String, parameter "rpc_context" of type
           "RpcContext" (call_stack - upstream calls details including nested
           service calls and parent jobs where calls are listed in order from
           outer to inner.) -> structure: parameter "call_stack" of list of
           type "MethodCall" (time - the time the call was started; method -
           service defined in standard JSON RPC way, typically it's module
           name from spec-file followed by '.' and name of funcdef from
           spec-file corresponding to running method (e.g.
           'KBaseTrees.construct_species_tree' from trees service); job_id -
           job id if method is asynchronous (optional field).) -> structure:
           parameter "time" of type "timestamp" (A time in the format
           YYYY-MM-DDThh:mm:ssZ, where Z is either the character Z
           (representing the UTC timezone) or the difference in time to UTC
           in the format +/-HHMM, eg: 2012-12-17T23:24:06-0500 (EST time)
           2013-04-03T08:56:32+0000 (UTC time) 2013-04-03T08:56:32Z (UTC
           time)), parameter "method" of String, parameter "job_id" of type
           "job_id" (A job id.), parameter "run_id" of String, parameter
           "remote_url" of String, parameter "source_ws_objects" of list of
           type "wsref" (A workspace object reference of the form X/Y or
           X/Y/Z, where X is the workspace name or id, Y is the object name
           or id, Z is the version, which is optional.), parameter "app_id"
           of String, parameter "meta" of mapping from String to String,
           parameter "wsid" of Long, parameter "parent_job_id" of String,
           parameter "request_cpu" of Long, parameter "request_memory_mb" of
           Long, parameter "request_disk_mb" of Long, parameter
           "request_clientgroup" of String, parameter
           "request_staging_volume_mounts" of list of String, parameter
           "request_refdata_volume_mounts" of list of String, parameter
           "created" of Long, parameter "queued" of Long, parameter
           "estimating" of Long, parameter "running" of Long, parameter
           "finished" of Long, parameter "updated" of Long, parameter "error"
           of type "JsonRpcError" (Error block of JSON RPC response) ->
           structure: parameter "name" of String, parameter "code" of Long,
           parameter "message" of String, parameter "error" of String,
           parameter "error_code" of Long, parameter "errormsg" of String,
           parameter "terminated_code" of Long
        """
        return self._client.call_method(
            "execution_engine2.check_jobs_as_admin",
            [params, as_admin],
            self._service_ver,
            context,
        )

    def check_workspace_jobs(self, params, context=None):
        """
        :param params: instance of type "CheckWorkspaceJobsParams" (Check
           status of all jobs in a given workspace. Only checks jobs that
           have been associated with a workspace at their creation.
           return_list - optional, return list of job state if set to 1.
           Otherwise return a dict. Default 0.) -> structure: parameter
           "workspace_id" of String, parameter "exclude_fields" of list of
           String, parameter "return_list" of type "boolean" (@range [0,1])
        :returns: instance of type "CheckJobsResults" (job_states - states of
           jobs could be mapping<job_id, JobState> or list<JobState>) ->
           structure: parameter "job_states" of list of type "JobState"
           (job_id - string - id of the job user - string - user who started
           the job wsid - int - optional id of the workspace where the job is
           bound authstrat - string - what strategy used to authenticate the
           job job_input - object - inputs to the job (from the run_job call)
           ## TODO - verify updated - int - timestamp since epoch in
           milliseconds of the last time the status was updated running - int
           - timestamp since epoch in milliseconds of when it entered the
           running state created - int - timestamp since epoch in
           milliseconds when the job was created finished - int - timestamp
           since epoch in milliseconds when the job was finished status -
           string - status of the job. one of the following: created - job
           has been created in the service estimating - an estimation job is
           running to estimate resources required for the main job, and which
           queue should be used queued - job is queued to be run running -
           job is running on a worker node completed - job was completed
           successfully error - job is no longer running, but failed with an
           error terminated - job is no longer running, terminated either due
           to user cancellation, admin cancellation, or some automated task
           error_code - int - internal reason why the job is an error. one of
           the following: 0 - unknown 1 - job crashed 2 - job terminated by
           automation 3 - job ran over time limit 4 - job was missing its
           automated output document 5 - job authentication token expired
           errormsg - string - message (e.g. stacktrace) accompanying an
           errored job error - object - the JSON-RPC error package that
           accompanies the error code and message terminated_code - int -
           internal reason why a job was terminated, one of: 0 - user
           cancellation 1 - admin cancellation 2 - terminated by some
           automatic process @optional error @optional error_code @optional
           errormsg @optional terminated_code @optional estimating @optional
           running @optional finished) -> structure: parameter "job_id" of
           type "job_id" (A job id.), parameter "user" of String, parameter
           "authstrat" of String, parameter "wsid" of Long, parameter
           "status" of String, parameter "job_input" of type "RunJobParams"
           (method - service defined in standard JSON RPC way, typically it's
           module name from spec-file followed by '.' and name of funcdef
           from spec-file corresponding to running method (e.g.
           'KBaseTrees.construct_species_tree' from trees service); params -
           the parameters of the method that performed this call; Optional
           parameters: service_ver - specific version of deployed service,
           last version is used if this parameter is not defined rpc_context
           - context of current method call including nested call history
           remote_url - run remote service call instead of local command line
           execution. source_ws_objects - denotes the workspace objects that
           will serve as a source of data when running the SDK method. These
           references will be added to the autogenerated provenance. app_id -
           the id of the Narrative application running this job (e.g.
           repo/name) mapping<string, string> meta - user defined metadata to
           associate with the job. wsid - an optional workspace id to
           associate with the job. This is passed to the workspace service,
           which will share the job based on the permissions of the workspace
           rather than owner of the job parent_job_id - UJS id of the parent
           of a batch job. Sub jobs will add this id to the NJS database
           under the field "parent_job_id" ======= These are optional
           parameters that are currently allowed if you have the
           KBASE_CONCIERGE/KBASE_FULL_SERVICE roles ======= @optional
           request_cpu @optional request_memory_mb @optional request_disk_mb
           @optional request_clientgroup @optional
           request_staging_volume_mounts @optional
           request_refdata_volume_mounts) -> structure: parameter "method" of
           String, parameter "params" of list of unspecified object,
           parameter "service_ver" of String, parameter "rpc_context" of type
           "RpcContext" (call_stack - upstream calls details including nested
           service calls and parent jobs where calls are listed in order from
           outer to inner.) -> structure: parameter "call_stack" of list of
           type "MethodCall" (time - the time the call was started; method -
           service defined in standard JSON RPC way, typically it's module
           name from spec-file followed by '.' and name of funcdef from
           spec-file corresponding to running method (e.g.
           'KBaseTrees.construct_species_tree' from trees service); job_id -
           job id if method is asynchronous (optional field).) -> structure:
           parameter "time" of type "timestamp" (A time in the format
           YYYY-MM-DDThh:mm:ssZ, where Z is either the character Z
           (representing the UTC timezone) or the difference in time to UTC
           in the format +/-HHMM, eg: 2012-12-17T23:24:06-0500 (EST time)
           2013-04-03T08:56:32+0000 (UTC time) 2013-04-03T08:56:32Z (UTC
           time)), parameter "method" of String, parameter "job_id" of type
           "job_id" (A job id.), parameter "run_id" of String, parameter
           "remote_url" of String, parameter "source_ws_objects" of list of
           type "wsref" (A workspace object reference of the form X/Y or
           X/Y/Z, where X is the workspace name or id, Y is the object name
           or id, Z is the version, which is optional.), parameter "app_id"
           of String, parameter "meta" of mapping from String to String,
           parameter "wsid" of Long, parameter "parent_job_id" of String,
           parameter "request_cpu" of Long, parameter "request_memory_mb" of
           Long, parameter "request_disk_mb" of Long, parameter
           "request_clientgroup" of String, parameter
           "request_staging_volume_mounts" of list of String, parameter
           "request_refdata_volume_mounts" of list of String, parameter
           "created" of Long, parameter "queued" of Long, parameter
           "estimating" of Long, parameter "running" of Long, parameter
           "finished" of Long, parameter "updated" of Long, parameter "error"
           of type "JsonRpcError" (Error block of JSON RPC response) ->
           structure: parameter "name" of String, parameter "code" of Long,
           parameter "message" of String, parameter "error" of String,
           parameter "error_code" of Long, parameter "errormsg" of String,
           parameter "terminated_code" of Long
        """
        return self._client.call_method(
            "execution_engine2.check_workspace_jobs",
            [params],
            self._service_ver,
            context,
        )

    def check_workspace_jobs_as_admin(self, params, as_admin, context=None):
        """
        :param params: instance of type "CheckWorkspaceJobsParams" (Check
           status of all jobs in a given workspace. Only checks jobs that
           have been associated with a workspace at their creation.
           return_list - optional, return list of job state if set to 1.
           Otherwise return a dict. Default 0.) -> structure: parameter
           "workspace_id" of String, parameter "exclude_fields" of list of
           String, parameter "return_list" of type "boolean" (@range [0,1])
        :param as_admin: instance of type "boolean" (@range [0,1])
        :returns: instance of type "CheckJobsResults" (job_states - states of
           jobs could be mapping<job_id, JobState> or list<JobState>) ->
           structure: parameter "job_states" of list of type "JobState"
           (job_id - string - id of the job user - string - user who started
           the job wsid - int - optional id of the workspace where the job is
           bound authstrat - string - what strategy used to authenticate the
           job job_input - object - inputs to the job (from the run_job call)
           ## TODO - verify updated - int - timestamp since epoch in
           milliseconds of the last time the status was updated running - int
           - timestamp since epoch in milliseconds of when it entered the
           running state created - int - timestamp since epoch in
           milliseconds when the job was created finished - int - timestamp
           since epoch in milliseconds when the job was finished status -
           string - status of the job. one of the following: created - job
           has been created in the service estimating - an estimation job is
           running to estimate resources required for the main job, and which
           queue should be used queued - job is queued to be run running -
           job is running on a worker node completed - job was completed
           successfully error - job is no longer running, but failed with an
           error terminated - job is no longer running, terminated either due
           to user cancellation, admin cancellation, or some automated task
           error_code - int - internal reason why the job is an error. one of
           the following: 0 - unknown 1 - job crashed 2 - job terminated by
           automation 3 - job ran over time limit 4 - job was missing its
           automated output document 5 - job authentication token expired
           errormsg - string - message (e.g. stacktrace) accompanying an
           errored job error - object - the JSON-RPC error package that
           accompanies the error code and message terminated_code - int -
           internal reason why a job was terminated, one of: 0 - user
           cancellation 1 - admin cancellation 2 - terminated by some
           automatic process @optional error @optional error_code @optional
           errormsg @optional terminated_code @optional estimating @optional
           running @optional finished) -> structure: parameter "job_id" of
           type "job_id" (A job id.), parameter "user" of String, parameter
           "authstrat" of String, parameter "wsid" of Long, parameter
           "status" of String, parameter "job_input" of type "RunJobParams"
           (method - service defined in standard JSON RPC way, typically it's
           module name from spec-file followed by '.' and name of funcdef
           from spec-file corresponding to running method (e.g.
           'KBaseTrees.construct_species_tree' from trees service); params -
           the parameters of the method that performed this call; Optional
           parameters: service_ver - specific version of deployed service,
           last version is used if this parameter is not defined rpc_context
           - context of current method call including nested call history
           remote_url - run remote service call instead of local command line
           execution. source_ws_objects - denotes the workspace objects that
           will serve as a source of data when running the SDK method. These
           references will be added to the autogenerated provenance. app_id -
           the id of the Narrative application running this job (e.g.
           repo/name) mapping<string, string> meta - user defined metadata to
           associate with the job. wsid - an optional workspace id to
           associate with the job. This is passed to the workspace service,
           which will share the job based on the permissions of the workspace
           rather than owner of the job parent_job_id - UJS id of the parent
           of a batch job. Sub jobs will add this id to the NJS database
           under the field "parent_job_id" ======= These are optional
           parameters that are currently allowed if you have the
           KBASE_CONCIERGE/KBASE_FULL_SERVICE roles ======= @optional
           request_cpu @optional request_memory_mb @optional request_disk_mb
           @optional request_clientgroup @optional
           request_staging_volume_mounts @optional
           request_refdata_volume_mounts) -> structure: parameter "method" of
           String, parameter "params" of list of unspecified object,
           parameter "service_ver" of String, parameter "rpc_context" of type
           "RpcContext" (call_stack - upstream calls details including nested
           service calls and parent jobs where calls are listed in order from
           outer to inner.) -> structure: parameter "call_stack" of list of
           type "MethodCall" (time - the time the call was started; method -
           service defined in standard JSON RPC way, typically it's module
           name from spec-file followed by '.' and name of funcdef from
           spec-file corresponding to running method (e.g.
           'KBaseTrees.construct_species_tree' from trees service); job_id -
           job id if method is asynchronous (optional field).) -> structure:
           parameter "time" of type "timestamp" (A time in the format
           YYYY-MM-DDThh:mm:ssZ, where Z is either the character Z
           (representing the UTC timezone) or the difference in time to UTC
           in the format +/-HHMM, eg: 2012-12-17T23:24:06-0500 (EST time)
           2013-04-03T08:56:32+0000 (UTC time) 2013-04-03T08:56:32Z (UTC
           time)), parameter "method" of String, parameter "job_id" of type
           "job_id" (A job id.), parameter "run_id" of String, parameter
           "remote_url" of String, parameter "source_ws_objects" of list of
           type "wsref" (A workspace object reference of the form X/Y or
           X/Y/Z, where X is the workspace name or id, Y is the object name
           or id, Z is the version, which is optional.), parameter "app_id"
           of String, parameter "meta" of mapping from String to String,
           parameter "wsid" of Long, parameter "parent_job_id" of String,
           parameter "request_cpu" of Long, parameter "request_memory_mb" of
           Long, parameter "request_disk_mb" of Long, parameter
           "request_clientgroup" of String, parameter
           "request_staging_volume_mounts" of list of String, parameter
           "request_refdata_volume_mounts" of list of String, parameter
           "created" of Long, parameter "queued" of Long, parameter
           "estimating" of Long, parameter "running" of Long, parameter
           "finished" of Long, parameter "updated" of Long, parameter "error"
           of type "JsonRpcError" (Error block of JSON RPC response) ->
           structure: parameter "name" of String, parameter "code" of Long,
           parameter "message" of String, parameter "error" of String,
           parameter "error_code" of Long, parameter "errormsg" of String,
           parameter "terminated_code" of Long
        """
        return self._client.call_method(
            "execution_engine2.check_workspace_jobs_as_admin",
            [params, as_admin],
            self._service_ver,
            context,
        )

    def cancel_job(self, params, context=None):
        """
        Cancels a job. This results in the status becoming "terminated" with termination_code 0.
        :param params: instance of type "CancelJobParams" (cancel_and_sigterm
           "" Reasons for why the job was cancelled Current Default is
           `terminated_by_user 0` so as to not update narrative client
           terminated_by_user = 0 terminated_by_admin = 1
           terminated_by_automation = 2 "" job_id job_id @optional
           terminated_code) -> structure: parameter "job_id" of type "job_id"
           (A job id.), parameter "terminated_code" of Long
        """
        return self._client.call_method(
            "execution_engine2.cancel_job", [params], self._service_ver, context
        )

    def cancel_job_as_admin(self, params, as_admin, context=None):
        """
        :param params: instance of type "CancelJobParams" (cancel_and_sigterm
           "" Reasons for why the job was cancelled Current Default is
           `terminated_by_user 0` so as to not update narrative client
           terminated_by_user = 0 terminated_by_admin = 1
           terminated_by_automation = 2 "" job_id job_id @optional
           terminated_code) -> structure: parameter "job_id" of type "job_id"
           (A job id.), parameter "terminated_code" of Long
        :param as_admin: instance of type "boolean" (@range [0,1])
        """
        return self._client.call_method(
            "execution_engine2.cancel_job_as_admin",
            [params, as_admin],
            self._service_ver,
            context,
        )

    def check_job_canceled(self, params, context=None):
        """
        Check whether a job has been canceled. This method is lightweight compared to check_job.
        :param params: instance of type "CancelJobParams" (cancel_and_sigterm
           "" Reasons for why the job was cancelled Current Default is
           `terminated_by_user 0` so as to not update narrative client
           terminated_by_user = 0 terminated_by_admin = 1
           terminated_by_automation = 2 "" job_id job_id @optional
           terminated_code) -> structure: parameter "job_id" of type "job_id"
           (A job id.), parameter "terminated_code" of Long
        :returns: instance of type "CheckJobCanceledResult" (job_id - id of
           job running method finished - indicates whether job is done
           (including error/cancel cases) or not canceled - whether the job
           is canceled or not. ujs_url - url of UserAndJobState service used
           by job service) -> structure: parameter "job_id" of type "job_id"
           (A job id.), parameter "finished" of type "boolean" (@range
           [0,1]), parameter "canceled" of type "boolean" (@range [0,1]),
           parameter "ujs_url" of String
        """
        return self._client.call_method(
            "execution_engine2.check_job_canceled", [params], self._service_ver, context
        )

    def check_job_canceled_as_admin(self, params, as_admin, context=None):
        """
        :param params: instance of type "CancelJobParams" (cancel_and_sigterm
           "" Reasons for why the job was cancelled Current Default is
           `terminated_by_user 0` so as to not update narrative client
           terminated_by_user = 0 terminated_by_admin = 1
           terminated_by_automation = 2 "" job_id job_id @optional
           terminated_code) -> structure: parameter "job_id" of type "job_id"
           (A job id.), parameter "terminated_code" of Long
        :param as_admin: instance of type "boolean" (@range [0,1])
        :returns: instance of type "CheckJobCanceledResult" (job_id - id of
           job running method finished - indicates whether job is done
           (including error/cancel cases) or not canceled - whether the job
           is canceled or not. ujs_url - url of UserAndJobState service used
           by job service) -> structure: parameter "job_id" of type "job_id"
           (A job id.), parameter "finished" of type "boolean" (@range
           [0,1]), parameter "canceled" of type "boolean" (@range [0,1]),
           parameter "ujs_url" of String
        """
        return self._client.call_method(
            "execution_engine2.check_job_canceled_as_admin",
            [params, as_admin],
            self._service_ver,
            context,
        )

    def get_job_status(self, job_id, context=None):
        """
        Just returns the status string for a job of a given id.
        :param job_id: instance of type "job_id" (A job id.)
        :returns: instance of type "GetJobStatusResult" -> structure:
           parameter "status" of String
        """
        return self._client.call_method(
            "execution_engine2.get_job_status", [job_id], self._service_ver, context
        )

    def get_job_status_as_admin(self, job_id, as_admin, context=None):
        """
        :param job_id: instance of type "job_id" (A job id.)
        :param as_admin: instance of type "boolean" (@range [0,1])
        :returns: instance of type "GetJobStatusResult" -> structure:
           parameter "status" of String
        """
        return self._client.call_method(
            "execution_engine2.get_job_status_as_admin",
            [job_id, as_admin],
            self._service_ver,
            context,
        )

    def check_jobs_date_range_for_user(self, params, context=None):
        """
        :param params: instance of type "CheckJobsDateRangeParams" (Check job
           for all jobs in a given date/time range for all users (Admin
           function) float start_time; # Filter based on creation timestamp
           since epoch float end_time; # Filter based on creation timestamp
           since epoch list<string> projection; # A list of fields to include
           in the projection, default ALL See "Projection Fields"
           list<string> filter; # A list of simple filters to "AND" together,
           such as error_code=1, wsid=1234, terminated_code = 1 int limit; #
           The maximum number of records to return string user; # Optional.
           Defaults off of your token @optional projection @optional filter
           @optional limit @optional user @optional offset @optional
           ascending) -> structure: parameter "start_time" of Double,
           parameter "end_time" of Double, parameter "projection" of list of
           String, parameter "filter" of list of String, parameter "limit" of
           Long, parameter "user" of String, parameter "offset" of Long,
           parameter "ascending" of type "boolean" (@range [0,1])
        :returns: instance of type "CheckJobsResults" (job_states - states of
           jobs could be mapping<job_id, JobState> or list<JobState>) ->
           structure: parameter "job_states" of list of type "JobState"
           (job_id - string - id of the job user - string - user who started
           the job wsid - int - optional id of the workspace where the job is
           bound authstrat - string - what strategy used to authenticate the
           job job_input - object - inputs to the job (from the run_job call)
           ## TODO - verify updated - int - timestamp since epoch in
           milliseconds of the last time the status was updated running - int
           - timestamp since epoch in milliseconds of when it entered the
           running state created - int - timestamp since epoch in
           milliseconds when the job was created finished - int - timestamp
           since epoch in milliseconds when the job was finished status -
           string - status of the job. one of the following: created - job
           has been created in the service estimating - an estimation job is
           running to estimate resources required for the main job, and which
           queue should be used queued - job is queued to be run running -
           job is running on a worker node completed - job was completed
           successfully error - job is no longer running, but failed with an
           error terminated - job is no longer running, terminated either due
           to user cancellation, admin cancellation, or some automated task
           error_code - int - internal reason why the job is an error. one of
           the following: 0 - unknown 1 - job crashed 2 - job terminated by
           automation 3 - job ran over time limit 4 - job was missing its
           automated output document 5 - job authentication token expired
           errormsg - string - message (e.g. stacktrace) accompanying an
           errored job error - object - the JSON-RPC error package that
           accompanies the error code and message terminated_code - int -
           internal reason why a job was terminated, one of: 0 - user
           cancellation 1 - admin cancellation 2 - terminated by some
           automatic process @optional error @optional error_code @optional
           errormsg @optional terminated_code @optional estimating @optional
           running @optional finished) -> structure: parameter "job_id" of
           type "job_id" (A job id.), parameter "user" of String, parameter
           "authstrat" of String, parameter "wsid" of Long, parameter
           "status" of String, parameter "job_input" of type "RunJobParams"
           (method - service defined in standard JSON RPC way, typically it's
           module name from spec-file followed by '.' and name of funcdef
           from spec-file corresponding to running method (e.g.
           'KBaseTrees.construct_species_tree' from trees service); params -
           the parameters of the method that performed this call; Optional
           parameters: service_ver - specific version of deployed service,
           last version is used if this parameter is not defined rpc_context
           - context of current method call including nested call history
           remote_url - run remote service call instead of local command line
           execution. source_ws_objects - denotes the workspace objects that
           will serve as a source of data when running the SDK method. These
           references will be added to the autogenerated provenance. app_id -
           the id of the Narrative application running this job (e.g.
           repo/name) mapping<string, string> meta - user defined metadata to
           associate with the job. wsid - an optional workspace id to
           associate with the job. This is passed to the workspace service,
           which will share the job based on the permissions of the workspace
           rather than owner of the job parent_job_id - UJS id of the parent
           of a batch job. Sub jobs will add this id to the NJS database
           under the field "parent_job_id" ======= These are optional
           parameters that are currently allowed if you have the
           KBASE_CONCIERGE/KBASE_FULL_SERVICE roles ======= @optional
           request_cpu @optional request_memory_mb @optional request_disk_mb
           @optional request_clientgroup @optional
           request_staging_volume_mounts @optional
           request_refdata_volume_mounts) -> structure: parameter "method" of
           String, parameter "params" of list of unspecified object,
           parameter "service_ver" of String, parameter "rpc_context" of type
           "RpcContext" (call_stack - upstream calls details including nested
           service calls and parent jobs where calls are listed in order from
           outer to inner.) -> structure: parameter "call_stack" of list of
           type "MethodCall" (time - the time the call was started; method -
           service defined in standard JSON RPC way, typically it's module
           name from spec-file followed by '.' and name of funcdef from
           spec-file corresponding to running method (e.g.
           'KBaseTrees.construct_species_tree' from trees service); job_id -
           job id if method is asynchronous (optional field).) -> structure:
           parameter "time" of type "timestamp" (A time in the format
           YYYY-MM-DDThh:mm:ssZ, where Z is either the character Z
           (representing the UTC timezone) or the difference in time to UTC
           in the format +/-HHMM, eg: 2012-12-17T23:24:06-0500 (EST time)
           2013-04-03T08:56:32+0000 (UTC time) 2013-04-03T08:56:32Z (UTC
           time)), parameter "method" of String, parameter "job_id" of type
           "job_id" (A job id.), parameter "run_id" of String, parameter
           "remote_url" of String, parameter "source_ws_objects" of list of
           type "wsref" (A workspace object reference of the form X/Y or
           X/Y/Z, where X is the workspace name or id, Y is the object name
           or id, Z is the version, which is optional.), parameter "app_id"
           of String, parameter "meta" of mapping from String to String,
           parameter "wsid" of Long, parameter "parent_job_id" of String,
           parameter "request_cpu" of Long, parameter "request_memory_mb" of
           Long, parameter "request_disk_mb" of Long, parameter
           "request_clientgroup" of String, parameter
           "request_staging_volume_mounts" of list of String, parameter
           "request_refdata_volume_mounts" of list of String, parameter
           "created" of Long, parameter "queued" of Long, parameter
           "estimating" of Long, parameter "running" of Long, parameter
           "finished" of Long, parameter "updated" of Long, parameter "error"
           of type "JsonRpcError" (Error block of JSON RPC response) ->
           structure: parameter "name" of String, parameter "code" of Long,
           parameter "message" of String, parameter "error" of String,
           parameter "error_code" of Long, parameter "errormsg" of String,
           parameter "terminated_code" of Long
        """
        return self._client.call_method(
            "execution_engine2.check_jobs_date_range_for_user",
            [params],
            self._service_ver,
            context,
        )

    def check_jobs_date_range_for_user_as_admin(self, params, as_admin, context=None):
        """
        :param params: instance of type "CheckJobsDateRangeParams" (Check job
           for all jobs in a given date/time range for all users (Admin
           function) float start_time; # Filter based on creation timestamp
           since epoch float end_time; # Filter based on creation timestamp
           since epoch list<string> projection; # A list of fields to include
           in the projection, default ALL See "Projection Fields"
           list<string> filter; # A list of simple filters to "AND" together,
           such as error_code=1, wsid=1234, terminated_code = 1 int limit; #
           The maximum number of records to return string user; # Optional.
           Defaults off of your token @optional projection @optional filter
           @optional limit @optional user @optional offset @optional
           ascending) -> structure: parameter "start_time" of Double,
           parameter "end_time" of Double, parameter "projection" of list of
           String, parameter "filter" of list of String, parameter "limit" of
           Long, parameter "user" of String, parameter "offset" of Long,
           parameter "ascending" of type "boolean" (@range [0,1])
        :param as_admin: instance of type "boolean" (@range [0,1])
        :returns: instance of type "CheckJobsResults" (job_states - states of
           jobs could be mapping<job_id, JobState> or list<JobState>) ->
           structure: parameter "job_states" of list of type "JobState"
           (job_id - string - id of the job user - string - user who started
           the job wsid - int - optional id of the workspace where the job is
           bound authstrat - string - what strategy used to authenticate the
           job job_input - object - inputs to the job (from the run_job call)
           ## TODO - verify updated - int - timestamp since epoch in
           milliseconds of the last time the status was updated running - int
           - timestamp since epoch in milliseconds of when it entered the
           running state created - int - timestamp since epoch in
           milliseconds when the job was created finished - int - timestamp
           since epoch in milliseconds when the job was finished status -
           string - status of the job. one of the following: created - job
           has been created in the service estimating - an estimation job is
           running to estimate resources required for the main job, and which
           queue should be used queued - job is queued to be run running -
           job is running on a worker node completed - job was completed
           successfully error - job is no longer running, but failed with an
           error terminated - job is no longer running, terminated either due
           to user cancellation, admin cancellation, or some automated task
           error_code - int - internal reason why the job is an error. one of
           the following: 0 - unknown 1 - job crashed 2 - job terminated by
           automation 3 - job ran over time limit 4 - job was missing its
           automated output document 5 - job authentication token expired
           errormsg - string - message (e.g. stacktrace) accompanying an
           errored job error - object - the JSON-RPC error package that
           accompanies the error code and message terminated_code - int -
           internal reason why a job was terminated, one of: 0 - user
           cancellation 1 - admin cancellation 2 - terminated by some
           automatic process @optional error @optional error_code @optional
           errormsg @optional terminated_code @optional estimating @optional
           running @optional finished) -> structure: parameter "job_id" of
           type "job_id" (A job id.), parameter "user" of String, parameter
           "authstrat" of String, parameter "wsid" of Long, parameter
           "status" of String, parameter "job_input" of type "RunJobParams"
           (method - service defined in standard JSON RPC way, typically it's
           module name from spec-file followed by '.' and name of funcdef
           from spec-file corresponding to running method (e.g.
           'KBaseTrees.construct_species_tree' from trees service); params -
           the parameters of the method that performed this call; Optional
           parameters: service_ver - specific version of deployed service,
           last version is used if this parameter is not defined rpc_context
           - context of current method call including nested call history
           remote_url - run remote service call instead of local command line
           execution. source_ws_objects - denotes the workspace objects that
           will serve as a source of data when running the SDK method. These
           references will be added to the autogenerated provenance. app_id -
           the id of the Narrative application running this job (e.g.
           repo/name) mapping<string, string> meta - user defined metadata to
           associate with the job. wsid - an optional workspace id to
           associate with the job. This is passed to the workspace service,
           which will share the job based on the permissions of the workspace
           rather than owner of the job parent_job_id - UJS id of the parent
           of a batch job. Sub jobs will add this id to the NJS database
           under the field "parent_job_id" ======= These are optional
           parameters that are currently allowed if you have the
           KBASE_CONCIERGE/KBASE_FULL_SERVICE roles ======= @optional
           request_cpu @optional request_memory_mb @optional request_disk_mb
           @optional request_clientgroup @optional
           request_staging_volume_mounts @optional
           request_refdata_volume_mounts) -> structure: parameter "method" of
           String, parameter "params" of list of unspecified object,
           parameter "service_ver" of String, parameter "rpc_context" of type
           "RpcContext" (call_stack - upstream calls details including nested
           service calls and parent jobs where calls are listed in order from
           outer to inner.) -> structure: parameter "call_stack" of list of
           type "MethodCall" (time - the time the call was started; method -
           service defined in standard JSON RPC way, typically it's module
           name from spec-file followed by '.' and name of funcdef from
           spec-file corresponding to running method (e.g.
           'KBaseTrees.construct_species_tree' from trees service); job_id -
           job id if method is asynchronous (optional field).) -> structure:
           parameter "time" of type "timestamp" (A time in the format
           YYYY-MM-DDThh:mm:ssZ, where Z is either the character Z
           (representing the UTC timezone) or the difference in time to UTC
           in the format +/-HHMM, eg: 2012-12-17T23:24:06-0500 (EST time)
           2013-04-03T08:56:32+0000 (UTC time) 2013-04-03T08:56:32Z (UTC
           time)), parameter "method" of String, parameter "job_id" of type
           "job_id" (A job id.), parameter "run_id" of String, parameter
           "remote_url" of String, parameter "source_ws_objects" of list of
           type "wsref" (A workspace object reference of the form X/Y or
           X/Y/Z, where X is the workspace name or id, Y is the object name
           or id, Z is the version, which is optional.), parameter "app_id"
           of String, parameter "meta" of mapping from String to String,
           parameter "wsid" of Long, parameter "parent_job_id" of String,
           parameter "request_cpu" of Long, parameter "request_memory_mb" of
           Long, parameter "request_disk_mb" of Long, parameter
           "request_clientgroup" of String, parameter
           "request_staging_volume_mounts" of list of String, parameter
           "request_refdata_volume_mounts" of list of String, parameter
           "created" of Long, parameter "queued" of Long, parameter
           "estimating" of Long, parameter "running" of Long, parameter
           "finished" of Long, parameter "updated" of Long, parameter "error"
           of type "JsonRpcError" (Error block of JSON RPC response) ->
           structure: parameter "name" of String, parameter "code" of Long,
           parameter "message" of String, parameter "error" of String,
           parameter "error_code" of Long, parameter "errormsg" of String,
           parameter "terminated_code" of Long
        """
        return self._client.call_method(
            "execution_engine2.check_jobs_date_range_for_user_as_admin",
            [params, as_admin],
            self._service_ver,
            context,
        )

    def check_jobs_date_range_for_all(self, params, context=None):
        """
        :param params: instance of type "CheckJobsDateRangeParams" (Check job
           for all jobs in a given date/time range for all users (Admin
           function) float start_time; # Filter based on creation timestamp
           since epoch float end_time; # Filter based on creation timestamp
           since epoch list<string> projection; # A list of fields to include
           in the projection, default ALL See "Projection Fields"
           list<string> filter; # A list of simple filters to "AND" together,
           such as error_code=1, wsid=1234, terminated_code = 1 int limit; #
           The maximum number of records to return string user; # Optional.
           Defaults off of your token @optional projection @optional filter
           @optional limit @optional user @optional offset @optional
           ascending) -> structure: parameter "start_time" of Double,
           parameter "end_time" of Double, parameter "projection" of list of
           String, parameter "filter" of list of String, parameter "limit" of
           Long, parameter "user" of String, parameter "offset" of Long,
           parameter "ascending" of type "boolean" (@range [0,1])
        :returns: instance of type "CheckJobsResults" (job_states - states of
           jobs could be mapping<job_id, JobState> or list<JobState>) ->
           structure: parameter "job_states" of list of type "JobState"
           (job_id - string - id of the job user - string - user who started
           the job wsid - int - optional id of the workspace where the job is
           bound authstrat - string - what strategy used to authenticate the
           job job_input - object - inputs to the job (from the run_job call)
           ## TODO - verify updated - int - timestamp since epoch in
           milliseconds of the last time the status was updated running - int
           - timestamp since epoch in milliseconds of when it entered the
           running state created - int - timestamp since epoch in
           milliseconds when the job was created finished - int - timestamp
           since epoch in milliseconds when the job was finished status -
           string - status of the job. one of the following: created - job
           has been created in the service estimating - an estimation job is
           running to estimate resources required for the main job, and which
           queue should be used queued - job is queued to be run running -
           job is running on a worker node completed - job was completed
           successfully error - job is no longer running, but failed with an
           error terminated - job is no longer running, terminated either due
           to user cancellation, admin cancellation, or some automated task
           error_code - int - internal reason why the job is an error. one of
           the following: 0 - unknown 1 - job crashed 2 - job terminated by
           automation 3 - job ran over time limit 4 - job was missing its
           automated output document 5 - job authentication token expired
           errormsg - string - message (e.g. stacktrace) accompanying an
           errored job error - object - the JSON-RPC error package that
           accompanies the error code and message terminated_code - int -
           internal reason why a job was terminated, one of: 0 - user
           cancellation 1 - admin cancellation 2 - terminated by some
           automatic process @optional error @optional error_code @optional
           errormsg @optional terminated_code @optional estimating @optional
           running @optional finished) -> structure: parameter "job_id" of
           type "job_id" (A job id.), parameter "user" of String, parameter
           "authstrat" of String, parameter "wsid" of Long, parameter
           "status" of String, parameter "job_input" of type "RunJobParams"
           (method - service defined in standard JSON RPC way, typically it's
           module name from spec-file followed by '.' and name of funcdef
           from spec-file corresponding to running method (e.g.
           'KBaseTrees.construct_species_tree' from trees service); params -
           the parameters of the method that performed this call; Optional
           parameters: service_ver - specific version of deployed service,
           last version is used if this parameter is not defined rpc_context
           - context of current method call including nested call history
           remote_url - run remote service call instead of local command line
           execution. source_ws_objects - denotes the workspace objects that
           will serve as a source of data when running the SDK method. These
           references will be added to the autogenerated provenance. app_id -
           the id of the Narrative application running this job (e.g.
           repo/name) mapping<string, string> meta - user defined metadata to
           associate with the job. wsid - an optional workspace id to
           associate with the job. This is passed to the workspace service,
           which will share the job based on the permissions of the workspace
           rather than owner of the job parent_job_id - UJS id of the parent
           of a batch job. Sub jobs will add this id to the NJS database
           under the field "parent_job_id" ======= These are optional
           parameters that are currently allowed if you have the
           KBASE_CONCIERGE/KBASE_FULL_SERVICE roles ======= @optional
           request_cpu @optional request_memory_mb @optional request_disk_mb
           @optional request_clientgroup @optional
           request_staging_volume_mounts @optional
           request_refdata_volume_mounts) -> structure: parameter "method" of
           String, parameter "params" of list of unspecified object,
           parameter "service_ver" of String, parameter "rpc_context" of type
           "RpcContext" (call_stack - upstream calls details including nested
           service calls and parent jobs where calls are listed in order from
           outer to inner.) -> structure: parameter "call_stack" of list of
           type "MethodCall" (time - the time the call was started; method -
           service defined in standard JSON RPC way, typically it's module
           name from spec-file followed by '.' and name of funcdef from
           spec-file corresponding to running method (e.g.
           'KBaseTrees.construct_species_tree' from trees service); job_id -
           job id if method is asynchronous (optional field).) -> structure:
           parameter "time" of type "timestamp" (A time in the format
           YYYY-MM-DDThh:mm:ssZ, where Z is either the character Z
           (representing the UTC timezone) or the difference in time to UTC
           in the format +/-HHMM, eg: 2012-12-17T23:24:06-0500 (EST time)
           2013-04-03T08:56:32+0000 (UTC time) 2013-04-03T08:56:32Z (UTC
           time)), parameter "method" of String, parameter "job_id" of type
           "job_id" (A job id.), parameter "run_id" of String, parameter
           "remote_url" of String, parameter "source_ws_objects" of list of
           type "wsref" (A workspace object reference of the form X/Y or
           X/Y/Z, where X is the workspace name or id, Y is the object name
           or id, Z is the version, which is optional.), parameter "app_id"
           of String, parameter "meta" of mapping from String to String,
           parameter "wsid" of Long, parameter "parent_job_id" of String,
           parameter "request_cpu" of Long, parameter "request_memory_mb" of
           Long, parameter "request_disk_mb" of Long, parameter
           "request_clientgroup" of String, parameter
           "request_staging_volume_mounts" of list of String, parameter
           "request_refdata_volume_mounts" of list of String, parameter
           "created" of Long, parameter "queued" of Long, parameter
           "estimating" of Long, parameter "running" of Long, parameter
           "finished" of Long, parameter "updated" of Long, parameter "error"
           of type "JsonRpcError" (Error block of JSON RPC response) ->
           structure: parameter "name" of String, parameter "code" of Long,
           parameter "message" of String, parameter "error" of String,
           parameter "error_code" of Long, parameter "errormsg" of String,
           parameter "terminated_code" of Long
        """
        return self._client.call_method(
            "execution_engine2.check_jobs_date_range_for_all",
            [params],
            self._service_ver,
            context,
        )

    def check_jobs_date_range_for_all_as_admin(self, params, as_admin, context=None):
        """
        :param params: instance of type "CheckJobsDateRangeParams" (Check job
           for all jobs in a given date/time range for all users (Admin
           function) float start_time; # Filter based on creation timestamp
           since epoch float end_time; # Filter based on creation timestamp
           since epoch list<string> projection; # A list of fields to include
           in the projection, default ALL See "Projection Fields"
           list<string> filter; # A list of simple filters to "AND" together,
           such as error_code=1, wsid=1234, terminated_code = 1 int limit; #
           The maximum number of records to return string user; # Optional.
           Defaults off of your token @optional projection @optional filter
           @optional limit @optional user @optional offset @optional
           ascending) -> structure: parameter "start_time" of Double,
           parameter "end_time" of Double, parameter "projection" of list of
           String, parameter "filter" of list of String, parameter "limit" of
           Long, parameter "user" of String, parameter "offset" of Long,
           parameter "ascending" of type "boolean" (@range [0,1])
        :param as_admin: instance of type "boolean" (@range [0,1])
        :returns: instance of type "CheckJobsResults" (job_states - states of
           jobs could be mapping<job_id, JobState> or list<JobState>) ->
           structure: parameter "job_states" of list of type "JobState"
           (job_id - string - id of the job user - string - user who started
           the job wsid - int - optional id of the workspace where the job is
           bound authstrat - string - what strategy used to authenticate the
           job job_input - object - inputs to the job (from the run_job call)
           ## TODO - verify updated - int - timestamp since epoch in
           milliseconds of the last time the status was updated running - int
           - timestamp since epoch in milliseconds of when it entered the
           running state created - int - timestamp since epoch in
           milliseconds when the job was created finished - int - timestamp
           since epoch in milliseconds when the job was finished status -
           string - status of the job. one of the following: created - job
           has been created in the service estimating - an estimation job is
           running to estimate resources required for the main job, and which
           queue should be used queued - job is queued to be run running -
           job is running on a worker node completed - job was completed
           successfully error - job is no longer running, but failed with an
           error terminated - job is no longer running, terminated either due
           to user cancellation, admin cancellation, or some automated task
           error_code - int - internal reason why the job is an error. one of
           the following: 0 - unknown 1 - job crashed 2 - job terminated by
           automation 3 - job ran over time limit 4 - job was missing its
           automated output document 5 - job authentication token expired
           errormsg - string - message (e.g. stacktrace) accompanying an
           errored job error - object - the JSON-RPC error package that
           accompanies the error code and message terminated_code - int -
           internal reason why a job was terminated, one of: 0 - user
           cancellation 1 - admin cancellation 2 - terminated by some
           automatic process @optional error @optional error_code @optional
           errormsg @optional terminated_code @optional estimating @optional
           running @optional finished) -> structure: parameter "job_id" of
           type "job_id" (A job id.), parameter "user" of String, parameter
           "authstrat" of String, parameter "wsid" of Long, parameter
           "status" of String, parameter "job_input" of type "RunJobParams"
           (method - service defined in standard JSON RPC way, typically it's
           module name from spec-file followed by '.' and name of funcdef
           from spec-file corresponding to running method (e.g.
           'KBaseTrees.construct_species_tree' from trees service); params -
           the parameters of the method that performed this call; Optional
           parameters: service_ver - specific version of deployed service,
           last version is used if this parameter is not defined rpc_context
           - context of current method call including nested call history
           remote_url - run remote service call instead of local command line
           execution. source_ws_objects - denotes the workspace objects that
           will serve as a source of data when running the SDK method. These
           references will be added to the autogenerated provenance. app_id -
           the id of the Narrative application running this job (e.g.
           repo/name) mapping<string, string> meta - user defined metadata to
           associate with the job. wsid - an optional workspace id to
           associate with the job. This is passed to the workspace service,
           which will share the job based on the permissions of the workspace
           rather than owner of the job parent_job_id - UJS id of the parent
           of a batch job. Sub jobs will add this id to the NJS database
           under the field "parent_job_id" ======= These are optional
           parameters that are currently allowed if you have the
           KBASE_CONCIERGE/KBASE_FULL_SERVICE roles ======= @optional
           request_cpu @optional request_memory_mb @optional request_disk_mb
           @optional request_clientgroup @optional
           request_staging_volume_mounts @optional
           request_refdata_volume_mounts) -> structure: parameter "method" of
           String, parameter "params" of list of unspecified object,
           parameter "service_ver" of String, parameter "rpc_context" of type
           "RpcContext" (call_stack - upstream calls details including nested
           service calls and parent jobs where calls are listed in order from
           outer to inner.) -> structure: parameter "call_stack" of list of
           type "MethodCall" (time - the time the call was started; method -
           service defined in standard JSON RPC way, typically it's module
           name from spec-file followed by '.' and name of funcdef from
           spec-file corresponding to running method (e.g.
           'KBaseTrees.construct_species_tree' from trees service); job_id -
           job id if method is asynchronous (optional field).) -> structure:
           parameter "time" of type "timestamp" (A time in the format
           YYYY-MM-DDThh:mm:ssZ, where Z is either the character Z
           (representing the UTC timezone) or the difference in time to UTC
           in the format +/-HHMM, eg: 2012-12-17T23:24:06-0500 (EST time)
           2013-04-03T08:56:32+0000 (UTC time) 2013-04-03T08:56:32Z (UTC
           time)), parameter "method" of String, parameter "job_id" of type
           "job_id" (A job id.), parameter "run_id" of String, parameter
           "remote_url" of String, parameter "source_ws_objects" of list of
           type "wsref" (A workspace object reference of the form X/Y or
           X/Y/Z, where X is the workspace name or id, Y is the object name
           or id, Z is the version, which is optional.), parameter "app_id"
           of String, parameter "meta" of mapping from String to String,
           parameter "wsid" of Long, parameter "parent_job_id" of String,
           parameter "request_cpu" of Long, parameter "request_memory_mb" of
           Long, parameter "request_disk_mb" of Long, parameter
           "request_clientgroup" of String, parameter
           "request_staging_volume_mounts" of list of String, parameter
           "request_refdata_volume_mounts" of list of String, parameter
           "created" of Long, parameter "queued" of Long, parameter
           "estimating" of Long, parameter "running" of Long, parameter
           "finished" of Long, parameter "updated" of Long, parameter "error"
           of type "JsonRpcError" (Error block of JSON RPC response) ->
           structure: parameter "name" of String, parameter "code" of Long,
           parameter "message" of String, parameter "error" of String,
           parameter "error_code" of Long, parameter "errormsg" of String,
           parameter "terminated_code" of Long
        """
        return self._client.call_method(
            "execution_engine2.check_jobs_date_range_for_all_as_admin",
            [params, as_admin],
            self._service_ver,
            context,
        )

    def is_admin(self, context=None):
        """
        Check if current user has ee2 admin rights.
        :returns: instance of type "boolean" (@range [0,1])
        """
        return self._client.call_method(
            "execution_engine2.is_admin", [], self._service_ver, context
        )

    def get_admin_permission(self, context=None):
        """
        Check if current user has ee2 admin rights.
        If so, return the type of rights and their roles
        :returns: instance of type "AdminRolesResults" (str permission; # One
           of 'r|w|x' (('read' | 'write' | 'none'))) -> structure: parameter
           "permission" of String
        """
        return self._client.call_method(
            "execution_engine2.get_admin_permission", [], self._service_ver, context
        )
