iWork

class iWork(conn)

Note

Deprecated: Will be removed in the next major version.

Arguments
iWork.getDataArea(lib, area, length, cb)

Note

Deprecated: Will be removed in the next major version.

Retrieves the contents of a data area. IBM i API: QWCRDTAA

Arguments
  • lib (string) – The library name.

  • area (string) – The data area name.

  • length (string) – The length of the data to retrieve.

  • cb (getDataAreaCallback) – The callback function.

iWork.getJobInfo(jobName, userName, jobNumber, cb)

Note

Deprecated: Will be removed in the next major version.

Retrieves info about the specified job. IBM i API: QUSRJOBI

Arguments
  • jobName (string) – The job name.

  • userName (string) – The username.

  • jobNumber (string) – The job number.

  • cb (getJobInfoCallback) – The callback function.

iWork.getJobStatus(jobId, cb)

Note

Deprecated: Will be removed in the next major version.

Retrieves the status of the specified job. IBM i API: QWCRJBST

Arguments
iWork.getSysStatus(cb)

Note

Deprecated: Will be removed in the next major version.

Retrieves basic system status. IBM i API: QWCRSSTS

Arguments
iWork.getSysStatusExt(cb)

Note

Deprecated: Will be removed in the next major version.

Retrieves detailed system status. IBM i API: QWCRSSTS

Arguments
iWork.getSysValue(sysValue, cb)

Note

Deprecated: Will be removed in the next major version.

Retrieves the specified system value. IBM i API: QWCRSVAL

Arguments
getSysValueCallback(error, output)
Arguments
  • error (Error|null) – the error object if an error occured or null.

  • output (string|null) – This is the system value if successful or null when an error occurs.

getSysStatusCallback(error, output)
Arguments
  • error (Error|null) – the error object if an error occured or null.

  • output (getSysStatusOutput|null) – This is an object if successful or null when an error occurs.

getSysStatusOutput()

getSysStatus Output Object

Arguments
  • Current_date_and_time (string) –

  • System_name (string) –

  • Users_currently_signed_on (string) –

  • Users_temporarily_signed_off_(disconnected) (string) –

  • Users_suspended_by_system_request (string) –

  • Users_suspended_by_group_jobs (string) –

  • Users_signed_off_with_printer_output_waiting_to_print (string) –

  • Batch_jobs_waiting_for_messages (string) –

  • Batch_jobs_running (string) –

  • Batch_jobs_held_while_running (string) –

  • Batch_jobs_ending (string) –

  • Batch_jobs_waiting_to_run_or_already_scheduled (string) –

  • Batch_jobs_held_on_a_job_queue (string) –

  • Batch_jobs_on_a_held_job_queue (string) –

  • Batch_jobs_on_an_unassigned_job_queue (string) –

  • Batch_jobs_ended_with_printer_output_waiting_to_print (string) –

getSysStatusExtCallback(error, output)
Arguments
  • error (Error|null) – the error object if an error occured or null.

  • output (getSysStatusExtOutput|null) – This is an object if successful or null when an error occurs.

getSysStatusExtOutput()

getSysStatusExt Output Object

Arguments
  • Current_date_and_time (string) –

  • System_name (string) –

  • Elapsed_time (string) –

  • Restricted_state_flag (string) –

  • %_processing_unit_used (string) –

  • Jobs_in_system (string) –

  • %_permanent_addresses (string) –

  • %_temporary_addresses (string) –

  • System_ASP (string) –

  • %_system_ASP_used (string) –

  • Total_auxiliary_storage (string) –

  • Current_unprotected_storage_used (string) –

  • Maximum_unprotected_storage_used (string) –

  • %_DB_capability (string) –

  • Main_storage_size (string) –

  • Number_of_partitions (string) –

  • Partition_identifier (string) –

  • Current_processing_capacity (string) –

  • Processor_sharing_attribute (string) –

  • Number_of_processors (string) –

  • Active_jobs_in_system (string) –

  • Active_threads_in_system (string) –

  • Maximum_jobs_in_system (string) –

  • %_temporary_256MB_segments_used (string) –

  • %_temporary_4GB_segments_used (string) –

  • %_permanent_256MB_segments_used (string) –

  • %_permanent_4GB_segments_used (string) –

  • %_current_interactive_performance (string) –

  • %_uncapped_CPU_capacity_used (string) –

  • %_shared_processor_pool_used (string) –

  • Main_storage_size_(long) (string) –

getJobStatusCallback(error, output)
Arguments
  • error (Error|null) – the error object if an error occured or null.

  • output (getJobStatusOutput|null) – This is an object if successful or null when an error occurs.

getJobStatusOutput()

getJobStatus Output Object

Arguments
  • Job_status (string) –

  • Fully_qualified_job_name (string) –

getJobInfoCallback(error, output)
Arguments
  • error (Error|null) – the error object if an error occured or null.

  • output (getJobInfoOutput|null) – This is an object if successful or null when an error occurs.

getJobInfoOutput()

getJobInfo Output Object

Arguments
  • Job_name (string) –

  • User_name (string) –

  • Job_number (string) –

  • Job_status (string) –

  • Job_type (string) –

  • Job_subtype (string) –

  • Subsystem_description_name (string) –

  • Run_priority_(job) (string) –

  • System_pool_identifier (string) –

  • Processing_unit_time_used,_if_less_than_2,147,483,647_milliseconds (string) –

  • Number_of_auxiliary_I/O_requests,_if_less_than_2,147,483,647 (string) –

  • Number_of_interactive_transactions (string) –

  • Response_time_total (string) –

  • Function_type (string) –

  • Function_name (string) –

  • Active_job_status (string) –

  • Number_of_database_lock_waits (string) –

  • Number_of_internal_machine_lock_waits (string) –

  • Number_of_nondatabase_lock_waits (string) –

  • Time_spent_on_database_lock_waits (string) –

  • Time_spent_on_internal_machine_lock_waits (string) –

  • Time_spent_on_nondatabase_lock_waits (string) –

  • Current_system_pool_identifier (string) –

  • Thread_count (string) –

  • Processing_unit_time_used_-_total_for_the_job (string) –

  • Number_of_auxiliary_I/O_requests (string) –

  • Processing_unit_time_used_for_database_-_total_for_the_job (string) –

  • Page_faults (string) –

  • Active_job_status_for_jobs_ending (string) –

  • Memory_pool_name (string) –

  • Message_reply (string) –

  • Message_key,_when_active_job_waiting_for_a_message (string) –

  • Message_queue_name,_when_active_job_waiting_for_a_message (string) –

  • Message_queue_library_name,_when_active_job_waiting_for_a_message (string) –

  • Message_queue_library_ASP_device_name,_when_active_job_waiting_for_a_message (string) –

getDataAreaCallback(error, output)
Arguments
  • error (Error|null) – the error object if an error occured or null.

  • output (getDataAreaOutput|null) – This is an object if successful or null when an error occurs.

getDataAreaOutput()

getDataArea Output Object

Arguments
  • Type_of_value_returned (string) –

  • Library_name (string) –

  • Length_of_value_returned (string) –

  • Number_of_decimal_positions (string) –

  • Value (string) –

Examples

Retrieve a system value

const { Connection, iWork } = require('itoolkit');

const connection = new Connection({
  transport: 'ssh',
  transportOptions: { host: 'myhost', username: 'myuser', password: 'mypassword' },
});

const work = new iWork(connection);

work.getSysValue('QCCSID', (error, output) => {
  if (error) {
    throw error;
  }
  console.log(`QCCSID = ${output}`);
});

Retrieve basic system status

const { Connection, iWork } = require('itoolkit');

const connection = new Connection({
  transport: 'ssh',
  transportOptions: { host: 'myhost', username: 'myuser', password: 'mypassword' },
});

const work = new iWork(connection);

work.getSysStatus((error, output) => {
  if (error) {
    throw error;
  }
  console.log((output));
});

Retrieve extended system status

const { Connection, iWork } = require('itoolkit');

const connection = new Connection({
  transport: 'ssh',
  transportOptions: { host: 'myhost', username: 'myuser', password: 'mypassword' },
});

const work = new iWork(connection);

work.getSysStatusExt((error, output) => {
  if (error) {
    throw error;
  }
  console.log(output);
});

Retrieve job status

const { Connection, iWork } = require('itoolkit');

const connection = new Connection({
  transport: 'ssh',
  transportOptions: { host: 'myhost', username: 'myuser', password: 'mypassword' },
});

const work = new iWork(connection);

work.getJobStatus('jobid', (error, output) => {
  if (error) {
    throw error;
  }
  console.log(output);
});

Retrieve job info

const { Connection, iWork } = require('itoolkit');

const connection = new Connection({
  transport: 'ssh',
  transportOptions: { host: 'myhost', username: 'myuser', password: 'mypassword' },
});

const work = new iWork(connection);

work.getJobInfo('jobname', 'user', 'jobnumber', (error, output) => {
  if (error) {
    throw error;
  }
  console.log(output);
});

Retrieve the contents of a data area

const { Connection, iWork } = require('itoolkit');

const connection = new Connection({
  transport: 'ssh',
  transportOptions: { host: 'myhost', username: 'myuser', password: 'mypassword' },
});

const work = new iWork(connection);

work.getDataArea('mylibrary', 'mydataarea', 100, (error, output) => {
  if (error) {
    throw error;
  }
  console.log(output);
});