2022-05-30 18:52:00 +02:00

78 lines
1.9 KiB
JavaScript

/**
* Flamenco manager
* Render Farm manager API
*
* The version of the OpenAPI document: 1.0.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*
*/
import ApiClient from "../ApiClient";
import WorkerList from '../model/WorkerList';
/**
* WorkerMgt service.
* @module manager/WorkerMgtApi
* @version 0.0.0
*/
export default class WorkerMgtApi {
/**
* Constructs a new WorkerMgtApi.
* @alias module:manager/WorkerMgtApi
* @class
* @param {module:ApiClient} [apiClient] Optional API client implementation to use,
* default to {@link module:ApiClient#instance} if unspecified.
*/
constructor(apiClient) {
this.apiClient = apiClient || ApiClient.instance;
}
/**
* Get list of workers.
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/WorkerList} and HTTP response
*/
fetchWorkersWithHttpInfo() {
let postBody = null;
let pathParams = {
};
let queryParams = {
};
let headerParams = {
};
let formParams = {
};
let authNames = [];
let contentTypes = [];
let accepts = ['application/json'];
let returnType = WorkerList;
return this.apiClient.callApi(
'/api/worker-mgt/workers', 'GET',
pathParams, queryParams, headerParams, formParams, postBody,
authNames, contentTypes, accepts, returnType, null
);
}
/**
* Get list of workers.
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/WorkerList}
*/
fetchWorkers() {
return this.fetchWorkersWithHttpInfo()
.then(function(response_and_data) {
return response_and_data.data;
});
}
}