# IbmWorkloadSchedulerApi.ProcessApi

All URIs are relative to *https://localhost/ibm/TWSWebUI/Simple/rest*

Method | HTTP request | Description
------------- | ------------- | -------------
[**createCronProcess**](ProcessApi.md#createCronProcess) | **POST** /Process/CronProcess | Create process with cron rule
[**createProcess**](ProcessApi.md#createProcess) | **POST** /Process | Create a Process
[**deleteProcess**](ProcessApi.md#deleteProcess) | **DELETE** /Process/{PROCESS_ID} | Delete a Process
[**getProcess**](ProcessApi.md#getProcess) | **GET** /Process/{PROCESS_ID} | Get Process info
[**listProcess**](ProcessApi.md#listProcess) | **GET** /Process | Lists Processes in a library.
[**runNowProcess**](ProcessApi.md#runNowProcess) | **PUT** /Process/{PROCESS_ID}/Actions/RunNow | Run the process immediately
[**toggleProcessStatus**](ProcessApi.md#toggleProcessStatus) | **PUT** /Process/{PROCESS_ID}/Actions/ToggleStatus | Enable or disable a process
[**updateProcess**](ProcessApi.md#updateProcess) | **PUT** /Process/{PROCESS_ID} | Update a process


<a name="createCronProcess"></a>
# **createCronProcess**
> Process createCronProcess(body, tenantId, opts)

Create process with cron rule

Create a process using a cron rule to generate triggers. 

### Example
```javascript
var IbmWorkloadSchedulerApi = require('ibm-workload-scheduler-api');
var defaultClient = IbmWorkloadSchedulerApi.ApiClient.default;

// Configure HTTP basic authorization: basicAuth
var basicAuth = defaultClient.authentications['basicAuth'];
basicAuth.username = 'YOUR USERNAME';
basicAuth.password = 'YOUR PASSWORD';

var apiInstance = new IbmWorkloadSchedulerApi.ProcessApi();

var body = new IbmWorkloadSchedulerApi.CronProcess(); // CronProcess | The CronProcess to create.

var tenantId = "tenantId_example"; // String | The id of the Tenant that is making the call

var opts = { 
  'engineName': "engineName_example", // String | The name of the engine to connect to. Leave default in cloud environments
  'engineOwner': "engineOwner_example" // String | The owner of the engine definition. Leave default in cloud environments.
};

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
apiInstance.createCronProcess(body, tenantId, opts, callback);
```

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **body** | [**CronProcess**](CronProcess.md)| The CronProcess to create. | 
 **tenantId** | **String**| The id of the Tenant that is making the call | 
 **engineName** | **String**| The name of the engine to connect to. Leave default in cloud environments | [optional] 
 **engineOwner** | **String**| The owner of the engine definition. Leave default in cloud environments. | [optional] 

### Return type

[**Process**](Process.md)

### Authorization

[basicAuth](../README.md#basicAuth)

### HTTP request headers

 - **Content-Type**: application/json
 - **Accept**: application/json

<a name="createProcess"></a>
# **createProcess**
> Process createProcess(body, tenantId, opts)

Create a Process

Create a new Process. 

### Example
```javascript
var IbmWorkloadSchedulerApi = require('ibm-workload-scheduler-api');
var defaultClient = IbmWorkloadSchedulerApi.ApiClient.default;

// Configure HTTP basic authorization: basicAuth
var basicAuth = defaultClient.authentications['basicAuth'];
basicAuth.username = 'YOUR USERNAME';
basicAuth.password = 'YOUR PASSWORD';

var apiInstance = new IbmWorkloadSchedulerApi.ProcessApi();

var body = new IbmWorkloadSchedulerApi.Process(); // Process | The Process to create.

var tenantId = "tenantId_example"; // String | The id of the Tenant that is making the call

var opts = { 
  'engineName': "engineName_example", // String | The name of the engine to connect to. Leave default in cloud environments
  'engineOwner': "engineOwner_example" // String | The owner of the engine definition. Leave default in cloud environments.
};

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
apiInstance.createProcess(body, tenantId, opts, callback);
```

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **body** | [**Process**](Process.md)| The Process to create. | 
 **tenantId** | **String**| The id of the Tenant that is making the call | 
 **engineName** | **String**| The name of the engine to connect to. Leave default in cloud environments | [optional] 
 **engineOwner** | **String**| The owner of the engine definition. Leave default in cloud environments. | [optional] 

### Return type

[**Process**](Process.md)

### Authorization

[basicAuth](../README.md#basicAuth)

### HTTP request headers

 - **Content-Type**: application/json
 - **Accept**: application/json

<a name="deleteProcess"></a>
# **deleteProcess**
> deleteProcess(PROCESS_ID, tenantId, opts)

Delete a Process

Delete a Process. 

### Example
```javascript
var IbmWorkloadSchedulerApi = require('ibm-workload-scheduler-api');
var defaultClient = IbmWorkloadSchedulerApi.ApiClient.default;

// Configure HTTP basic authorization: basicAuth
var basicAuth = defaultClient.authentications['basicAuth'];
basicAuth.username = 'YOUR USERNAME';
basicAuth.password = 'YOUR PASSWORD';

var apiInstance = new IbmWorkloadSchedulerApi.ProcessApi();

var PROCESS_ID = "PROCESS_ID_example"; // String | The ID of the process to delete.

var tenantId = "tenantId_example"; // String | The id of the Tenant that is making the call

var opts = { 
  'engineName': "engineName_example", // String | The name of the engine to connect to. Leave default in cloud environments
  'engineOwner': "engineOwner_example" // String | The owner of the engine definition. Leave default in cloud environments.
};

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully.');
  }
};
apiInstance.deleteProcess(PROCESS_ID, tenantId, opts, callback);
```

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **PROCESS_ID** | **String**| The ID of the process to delete. | 
 **tenantId** | **String**| The id of the Tenant that is making the call | 
 **engineName** | **String**| The name of the engine to connect to. Leave default in cloud environments | [optional] 
 **engineOwner** | **String**| The owner of the engine definition. Leave default in cloud environments. | [optional] 

### Return type

null (empty response body)

### Authorization

[basicAuth](../README.md#basicAuth)

### HTTP request headers

 - **Content-Type**: Not defined
 - **Accept**: application/json, mediatype/HTML

<a name="getProcess"></a>
# **getProcess**
> Process getProcess(PROCESS_ID, tenantId, opts)

Get Process info

Get the Process identified by the ID. 

### Example
```javascript
var IbmWorkloadSchedulerApi = require('ibm-workload-scheduler-api');
var defaultClient = IbmWorkloadSchedulerApi.ApiClient.default;

// Configure HTTP basic authorization: basicAuth
var basicAuth = defaultClient.authentications['basicAuth'];
basicAuth.username = 'YOUR USERNAME';
basicAuth.password = 'YOUR PASSWORD';

var apiInstance = new IbmWorkloadSchedulerApi.ProcessApi();

var PROCESS_ID = "PROCESS_ID_example"; // String | The ID of the process to retrieve.

var tenantId = "tenantId_example"; // String | The id of the Tenant that is making the call

var opts = { 
  'engineName': "engineName_example", // String | The name of the engine to connect to. Leave default in cloud environments
  'engineOwner': "engineOwner_example" // String | The owner of the engine definition. Leave default in cloud environments.
};

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
apiInstance.getProcess(PROCESS_ID, tenantId, opts, callback);
```

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **PROCESS_ID** | **String**| The ID of the process to retrieve. | 
 **tenantId** | **String**| The id of the Tenant that is making the call | 
 **engineName** | **String**| The name of the engine to connect to. Leave default in cloud environments | [optional] 
 **engineOwner** | **String**| The owner of the engine definition. Leave default in cloud environments. | [optional] 

### Return type

[**Process**](Process.md)

### Authorization

[basicAuth](../README.md#basicAuth)

### HTTP request headers

 - **Content-Type**: Not defined
 - **Accept**: application/json

<a name="listProcess"></a>
# **listProcess**
> [Process] listProcess(processlibraryid, tenantId, opts)

Lists Processes in a library.

Get the list of the processes belonging to a certain library. No more of 1000 elements will be returned by this API. 

### Example
```javascript
var IbmWorkloadSchedulerApi = require('ibm-workload-scheduler-api');
var defaultClient = IbmWorkloadSchedulerApi.ApiClient.default;

// Configure HTTP basic authorization: basicAuth
var basicAuth = defaultClient.authentications['basicAuth'];
basicAuth.username = 'YOUR USERNAME';
basicAuth.password = 'YOUR PASSWORD';

var apiInstance = new IbmWorkloadSchedulerApi.ProcessApi();

var processlibraryid = "processlibraryid_example"; // String | The Library ID.

var tenantId = "tenantId_example"; // String | The id of the Tenant that is making the call

var opts = { 
  'processName': "processName_example", // String | The process name for filtering. When using this option, no processlibraryid must be specified.
  'sort': "sort_example", // String | Sort services based on name..
  'engineName': "engineName_example", // String | The name of the engine to connect to. Leave default in cloud environments
  'engineOwner': "engineOwner_example", // String | The owner of the engine definition. Leave default in cloud environments.
  'startRange': 56, // Integer | The index of the first element to retrieve. It is zero based.
  'endRange': 56 // Integer | The index of the last element to retrieve. If the element does not exist, are retrieved elements from startRange to the maximum possible value.
};

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
apiInstance.listProcess(processlibraryid, tenantId, opts, callback);
```

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **processlibraryid** | **String**| The Library ID. | 
 **tenantId** | **String**| The id of the Tenant that is making the call | 
 **processName** | **String**| The process name for filtering. When using this option, no processlibraryid must be specified. | [optional] 
 **sort** | **String**| Sort services based on name.. | [optional] 
 **engineName** | **String**| The name of the engine to connect to. Leave default in cloud environments | [optional] 
 **engineOwner** | **String**| The owner of the engine definition. Leave default in cloud environments. | [optional] 
 **startRange** | **Integer**| The index of the first element to retrieve. It is zero based. | [optional] 
 **endRange** | **Integer**| The index of the last element to retrieve. If the element does not exist, are retrieved elements from startRange to the maximum possible value. | [optional] 

### Return type

[**[Process]**](Process.md)

### Authorization

[basicAuth](../README.md#basicAuth)

### HTTP request headers

 - **Content-Type**: Not defined
 - **Accept**: application/json

<a name="runNowProcess"></a>
# **runNowProcess**
> &#39;String&#39; runNowProcess(PROCESS_ID, tenantId, opts)

Run the process immediately

Submit the request to run the process immediately. 

### Example
```javascript
var IbmWorkloadSchedulerApi = require('ibm-workload-scheduler-api');
var defaultClient = IbmWorkloadSchedulerApi.ApiClient.default;

// Configure HTTP basic authorization: basicAuth
var basicAuth = defaultClient.authentications['basicAuth'];
basicAuth.username = 'YOUR USERNAME';
basicAuth.password = 'YOUR PASSWORD';

var apiInstance = new IbmWorkloadSchedulerApi.ProcessApi();

var PROCESS_ID = "PROCESS_ID_example"; // String | The ID of the process to retrieve.

var tenantId = "tenantId_example"; // String | The id of the Tenant that is making the call

var opts = { 
  'parameters': "parameters_example", // String | The parameters with which the process run
  'engineName': "engineName_example", // String | The name of the engine to connect to. Leave default in cloud environments
  'engineOwner': "engineOwner_example" // String | The owner of the engine definition. Leave default in cloud environments.
};

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
apiInstance.runNowProcess(PROCESS_ID, tenantId, opts, callback);
```

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **PROCESS_ID** | **String**| The ID of the process to retrieve. | 
 **tenantId** | **String**| The id of the Tenant that is making the call | 
 **parameters** | **String**| The parameters with which the process run | [optional] 
 **engineName** | **String**| The name of the engine to connect to. Leave default in cloud environments | [optional] 
 **engineOwner** | **String**| The owner of the engine definition. Leave default in cloud environments. | [optional] 

### Return type

**&#39;String&#39;**

### Authorization

[basicAuth](../README.md#basicAuth)

### HTTP request headers

 - **Content-Type**: Not defined
 - **Accept**: application/json

<a name="toggleProcessStatus"></a>
# **toggleProcessStatus**
> toggleProcessStatus(PROCESS_ID, tenantId, opts)

Enable or disable a process

Enable or disable a process. An enabled process is disabled, while a disabled one is enabled. 

### Example
```javascript
var IbmWorkloadSchedulerApi = require('ibm-workload-scheduler-api');
var defaultClient = IbmWorkloadSchedulerApi.ApiClient.default;

// Configure HTTP basic authorization: basicAuth
var basicAuth = defaultClient.authentications['basicAuth'];
basicAuth.username = 'YOUR USERNAME';
basicAuth.password = 'YOUR PASSWORD';

var apiInstance = new IbmWorkloadSchedulerApi.ProcessApi();

var PROCESS_ID = "PROCESS_ID_example"; // String | The ID of the process to enable or disable.

var tenantId = "tenantId_example"; // String | The id of the Tenant that is making the call

var opts = { 
  'engineName': "engineName_example", // String | The name of the engine to connect to. Leave default in cloud environments
  'engineOwner': "engineOwner_example" // String | The owner of the engine definition. Leave default in cloud environments.
};

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully.');
  }
};
apiInstance.toggleProcessStatus(PROCESS_ID, tenantId, opts, callback);
```

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **PROCESS_ID** | **String**| The ID of the process to enable or disable. | 
 **tenantId** | **String**| The id of the Tenant that is making the call | 
 **engineName** | **String**| The name of the engine to connect to. Leave default in cloud environments | [optional] 
 **engineOwner** | **String**| The owner of the engine definition. Leave default in cloud environments. | [optional] 

### Return type

null (empty response body)

### Authorization

[basicAuth](../README.md#basicAuth)

### HTTP request headers

 - **Content-Type**: Not defined
 - **Accept**: application/json

<a name="updateProcess"></a>
# **updateProcess**
> updateProcess(PROCESS_ID, body, tenantId, opts)

Update a process

Update a Process. 

### Example
```javascript
var IbmWorkloadSchedulerApi = require('ibm-workload-scheduler-api');
var defaultClient = IbmWorkloadSchedulerApi.ApiClient.default;

// Configure HTTP basic authorization: basicAuth
var basicAuth = defaultClient.authentications['basicAuth'];
basicAuth.username = 'YOUR USERNAME';
basicAuth.password = 'YOUR PASSWORD';

var apiInstance = new IbmWorkloadSchedulerApi.ProcessApi();

var PROCESS_ID = "PROCESS_ID_example"; // String | The ID of the process to retrieve.

var body = new IbmWorkloadSchedulerApi.Process(); // Process | The Process to update.

var tenantId = "tenantId_example"; // String | The id of the Tenant that is making the call

var opts = { 
  'engineName': "engineName_example", // String | The name of the engine to connect to. Leave default in cloud environments
  'engineOwner': "engineOwner_example" // String | The owner of the engine definition. Leave default in cloud environments.
};

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully.');
  }
};
apiInstance.updateProcess(PROCESS_ID, body, tenantId, opts, callback);
```

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **PROCESS_ID** | **String**| The ID of the process to retrieve. | 
 **body** | [**Process**](Process.md)| The Process to update. | 
 **tenantId** | **String**| The id of the Tenant that is making the call | 
 **engineName** | **String**| The name of the engine to connect to. Leave default in cloud environments | [optional] 
 **engineOwner** | **String**| The owner of the engine definition. Leave default in cloud environments. | [optional] 

### Return type

null (empty response body)

### Authorization

[basicAuth](../README.md#basicAuth)

### HTTP request headers

 - **Content-Type**: Not defined
 - **Accept**: application/json

