# IbmWorkloadSchedulerApi.AgentApi

All URIs are relative to *https://localhost/ibm/TWSWebUI/Simple/rest*

Method | HTTP request | Description
------------- | ------------- | -------------
[**listAgents**](AgentApi.md#listAgents) | **GET** /Agent | List of agents


<a name="listAgents"></a>
# **listAgents**
> [Agent] listAgents(tenantId, opts)

List of agents

Return the list of agents connected to the workload environment. 

### 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.AgentApi();

var tenantId = "tenantId_example"; // String | The id of the Tenant that is making the call

var opts = { 
  '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.
};

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
apiInstance.listAgents(tenantId, opts, callback);
```

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **tenantId** | **String**| The id of the Tenant that is making the call | 
 **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] 

### Return type

[**[Agent]**](Agent.md)

### Authorization

[basicAuth](../README.md#basicAuth)

### HTTP request headers

 - **Content-Type**: Not defined
 - **Accept**: application/json

