- if (state) path += '/' + state
-
- return path
-}
-
-function getJobsList (url: string, accessToken: string, state?: JobState) {
- const path = buildJobsUrl(state)
-
- return request(url)
- .get(path)
- .set('Accept', 'application/json')
- .set('Authorization', 'Bearer ' + accessToken)
- .expect(HttpStatusCode.OK_200)
- .expect('Content-Type', /json/)
-}
-
-function getJobsListPaginationAndSort (options: {
- url: string
- accessToken: string
- start: number
- count: number
- sort: string
- state?: JobState
- jobType?: JobType
-}) {
- const { url, accessToken, state, start, count, sort, jobType } = options
- const path = buildJobsUrl(state)
-
- const query = {
- start,
- count,
- sort,
- jobType
- }
-
- return makeGetRequest({
- url,
- path,
- token: accessToken,
- statusCodeExpected: HttpStatusCode.OK_200,
- query
- })
-}
-
-async function waitJobs (serversArg: ServerInfo[] | ServerInfo) {