From 8616ca775bd0c3e0ba6ba6ab9d06b29a56576464 Mon Sep 17 00:00:00 2001 From: Yi Yi Date: Tue, 9 Jun 2020 15:52:17 +0800 Subject: [PATCH 01/24] fix get job config tests --- .gitignore | 1 + tests/common/apiTestCases.ts | 5 ++++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 9cbe992..df923da 100644 --- a/.gitignore +++ b/.gitignore @@ -5,3 +5,4 @@ node_modules .vscode/settings.json .tests/ .lib/ +lib/ diff --git a/tests/common/apiTestCases.ts b/tests/common/apiTestCases.ts index 01dcbc2..b7b9c71 100644 --- a/tests/common/apiTestCases.ts +++ b/tests/common/apiTestCases.ts @@ -876,7 +876,10 @@ export const ApiDefaultTestCases: {[key: string]: IApiTestCase} = { type: 'raw', value: 'sdk_test_nonexist_job' } - ] + ], + response: { + statusCode: 404 + } } } ], From b93a19e4071861f863351348a4f5bf331cf2849f Mon Sep 17 00:00:00 2001 From: Yi Yi Date: Thu, 11 Jun 2020 14:36:19 +0800 Subject: [PATCH 02/24] update --- .github/workflows/int_bed_api_tests.yml | 0 tests/api_tests/v2/api.v2.spec.ts | 17 +++-- tests/common/apiTestCaseGenerator.ts | 14 +++- tests/unit_tests/v2/v2.specdraft.ts | 99 +++++++++++++++++++++++++ 4 files changed, 122 insertions(+), 8 deletions(-) create mode 100644 .github/workflows/int_bed_api_tests.yml create mode 100644 tests/unit_tests/v2/v2.specdraft.ts diff --git a/.github/workflows/int_bed_api_tests.yml b/.github/workflows/int_bed_api_tests.yml new file mode 100644 index 0000000..e69de29 diff --git a/tests/api_tests/v2/api.v2.spec.ts b/tests/api_tests/v2/api.v2.spec.ts index f24d862..ce418ab 100644 --- a/tests/api_tests/v2/api.v2.spec.ts +++ b/tests/api_tests/v2/api.v2.spec.ts @@ -6,6 +6,7 @@ import ajv, { Ajv } from 'ajv'; import * as chai from 'chai'; import { expect } from 'chai'; import dirtyChai from 'dirty-chai'; +import nock from 'nock'; import apiTestCaseJson from '../../../.tests/apiTestCase.json'; import { IApiOperation, IApiTestCase } from '../../common/apiTestCaseGenerator'; @@ -114,7 +115,7 @@ function skipTest(operation: IApiOperation): boolean { return false; } -function getClientName(tag: string): string { +export function getClientName(tag: string): string { const words: string[] = tag.split(' '); if (words.length === 1) { return tag; @@ -123,9 +124,13 @@ function getClientName(tag: string): string { return words[0] + words[1].charAt(0).toUpperCase() + words[1].slice(1); } -async function runOperation( - operation: IApiOperation, operationResults?: IOperationResults +export async function runOperation( + operation: IApiOperation, operationResults?: IOperationResults, mock?: any ): Promise { + if (mock) { + nock() + } + const client: any = operation.cluster ? (new OpenPAIClient(operation.cluster) as any)[operation.tag!] : openPAIClient[getClientName(operation.tag!)]; @@ -175,13 +180,13 @@ async function runOperation( return res; } -async function runOperations( - operations?: IApiOperation[], operationResults?: IOperationResults +export async function runOperations( + operations?: IApiOperation[], operationResults?: IOperationResults, mock?: any ): Promise { const result: any[] = []; if (operations) { for (const operation of operations) { - const res: any = await runOperation(operation, operationResults); + const res: any = await runOperation(operation, operationResults, mock); if (res) { result.push(res); } diff --git a/tests/common/apiTestCaseGenerator.ts b/tests/common/apiTestCaseGenerator.ts index 4ff002d..d34e9c2 100644 --- a/tests/common/apiTestCaseGenerator.ts +++ b/tests/common/apiTestCaseGenerator.ts @@ -14,9 +14,17 @@ import { ApiDefaultTestCases } from './apiTestCases'; export class ApiTestCaseGenerator { public async generate( swaggerPath: string = 'src/api/v2/swagger.yaml', outputPath?: string - ): Promise { + ): Promise<{ + tests: IApiTestCase[], + map: { + [key: string]: string + } + }> { const api: any = await swaggerParser.dereference(swaggerPath); const tests: IApiTestCase[] = []; + const map: { + [key: string]: string + } = {}; for (const path of Object.keys(api.paths)) { const ops: any = api.paths[path]; @@ -25,6 +33,8 @@ export class ApiTestCaseGenerator { continue; } + map[ops[type].operationId] = type; + const responseCodes: string[] = Object.keys(ops[type].responses); const correctCode: string | undefined = responseCodes.find(code => code.startsWith('20')); @@ -97,7 +107,7 @@ export class ApiTestCaseGenerator { fs.writeFileSync(outputPath, JSON.stringify(tests)); } - return tests; + return { tests, map }; } } diff --git a/tests/unit_tests/v2/v2.specdraft.ts b/tests/unit_tests/v2/v2.specdraft.ts new file mode 100644 index 0000000..772aae8 --- /dev/null +++ b/tests/unit_tests/v2/v2.specdraft.ts @@ -0,0 +1,99 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { IPAICluster, IPAIClusterInfo, OpenPAIClient } from '@api/v2'; +import ajv, { Ajv } from 'ajv'; +import * as chai from 'chai'; +import { expect } from 'chai'; +import dirtyChai from 'dirty-chai'; +import nock from 'nock'; + +import apiTestCaseJson from '../../../.tests/apiTestCase.json'; +import { runOperation, runOperations } from '../../api_tests/v2/api.v2.spec.js'; +import { IApiOperation, IApiTestCase } from '../../common/apiTestCaseGenerator'; +import { CustomizedTests } from '../../common/apiTestCases'; +import { TestCluster } from '../../common/testCluster'; + +/** + * End to end tests for OpenPAI API v2. + */ +let ajvInstance: Ajv; +let openPAIClient: any; +let clusterInfo: IPAIClusterInfo; + +// A revoked jwt token, from user: sdk_test +const testToken: string = + 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VybmFtZSI6InNka190ZXN0IiwiYXBwbGljYXRpb24iOmZhbHN' + + 'lLCJpYXQiOjE1ODk3NzE3NDMsImV4cCI6MTU5MDM3NjU0M30.LxDbmzzhhEQ0SKHOFkNFzstEdxCfTgDnu7nZE7Nm-hA'; + +const testUrl: string = 'https://openpai.test/rest-server'; + +const apiGetClusterInfo: string = '/api/v2/info'; + +const testCluster: IPAICluster = { + rest_server_uri: testUrl, + username: 'sdk_test', + password: 'test_password', + token: testToken +}; + +chai.use(dirtyChai); +before(async () => { + ajvInstance = new ajv({ nullable: true }); + openPAIClient = new OpenPAIClient(TestCluster.cluster); + clusterInfo = await openPAIClient.api.getClusterInfo(); +}); + +for (const test of apiTestCaseJson as IApiTestCase[]) { + let beforeEachResults: any[]; + let beforeResults: any[]; + const testResults: any[] = []; + + describe(test.description!, () => { + beforeEach(async () => beforeEachResults = await runOperations(test.beforeEach)); + before(async () => beforeResults = await runOperations(test.before)); + + for (const testItem of test.tests) { + it (testItem.description || test.description || 'unknown test', async () => { + if (testItem.customizedTest) { + return; + /*await (CustomizedTests as any)[testItem.customizedTest]( + testItem, + { + beforeEachResults, + beforeResults, + testResults + } + );*/ + } else { + const res: any = await runOperation( + testItem.operation!, + { + beforeEachResults, + beforeResults, + testResults + } + ); + if (res) { + testResults.push(res); + } + } + }); + } + + after(async () => await runOperations( + test.after, + { + beforeEachResults, + beforeResults, + testResults + })); + afterEach(async () => await runOperations( + test.afterEach, + { + beforeEachResults, + beforeResults, + testResults + })); + }); +} From 03f7dcf19e38d57f1d069320db01d5ecc216e0b0 Mon Sep 17 00:00:00 2001 From: Yi Yi Date: Fri, 12 Jun 2020 19:02:50 +0800 Subject: [PATCH 03/24] add examples and mock --- .tests/apiTestCase.json | 2 +- .tests/clusters.json | 8 +- package.json | 3 +- src/api/v2/swagger.yaml | 111 +++++++++++++++++++ tests/api_tests/v2/api.v2.spec.ts | 103 ++--------------- tests/common/apiTestCaseGenerator.ts | 41 ++++--- tests/common/apiTestCases.ts | 2 +- tests/common/apiTestRunner.ts | 158 +++++++++++++++++++++++++++ tests/unit_tests/v2/v2.specdraft.ts | 30 +++-- 9 files changed, 336 insertions(+), 122 deletions(-) create mode 100644 tests/common/apiTestRunner.ts diff --git a/.tests/apiTestCase.json b/.tests/apiTestCase.json index fe51488..562285d 100644 --- a/.tests/apiTestCase.json +++ b/.tests/apiTestCase.json @@ -1 +1 @@ -[] +{"tests":[{"description":"get /api/v2/info","tests":[{"operation":{"tag":"api","operationId":"getClusterInfo","parameters":[],"response":{"statusCode":200,"schema":{"type":"object","properties":{"name":{"type":"string","description":"PAI RESTfulAPI"},"version":{"type":"string","description":"cluster version in v0.X.0 format"},"launcherType":{"type":"string","enum":["yarn","k8s"]},"authnMethod":{"type":"string","enum":["basic","OIDC"]}},"required":["name","version","launcherType","authnMethod"]},"contentType":"application/json"}}}],"schemas":{"200":{"description":"Succeeded","content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","description":"PAI RESTfulAPI"},"version":{"type":"string","description":"cluster version in v0.X.0 format"},"launcherType":{"type":"string","enum":["yarn","k8s"]},"authnMethod":{"type":"string","enum":["basic","OIDC"]}},"required":["name","version","launcherType","authnMethod"]},"example":{"name":"PAI RESTful API","version":"v1.0.1","launcherType":"k8s","authnMethod":"basic"}}}}}},{"before":[{"tag":"token","operationId":"createApplicationToken"}],"tests":[{"description":"Get tokens with user token","operation":{"tag":"token","operationId":"getTokens","parameters":[],"response":{"statusCode":200,"schema":{"type":"object","properties":{"tokens":{"type":"array","items":{"type":"string"},"description":"JWT string list"}},"required":["tokens"]},"contentType":"application/json"}}},{"description":"Get tokens with unauthorized token","customizedTest":"getTokensWithUnauthorizedUser","operation":{"tag":"token","operationId":"getTokens","parameters":[],"response":{"statusCode":200,"schema":{"type":"object","properties":{"tokens":{"type":"array","items":{"type":"string"},"description":"JWT string list"}},"required":["tokens"]},"contentType":"application/json"}}}],"after":[{"tag":"token","operationId":"deleteToken","parameters":[{"type":"fromResult","resultType":"beforeResults","resultPath":["token"],"resultIndex":0}]}],"schemas":{"200":{"description":"Succeeded","content":{"application/json":{"schema":{"type":"object","properties":{"tokens":{"type":"array","items":{"type":"string"},"description":"JWT string list"}},"required":["tokens"]},"example":{"tokens":["JWT Token Example"]}}}},"401":{"description":"UnauthorizedUserError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"UnauthorizedUserError":{"value":{"code":"UnauthorizedUserError","message":"Guest is not allowed to do this operation."}}}}}}},"description":"get /api/v2/tokens"},{"before":[{"tag":"token","operationId":"createApplicationToken"}],"tests":[{"operation":{"parameters":[{"type":"fromResult","resultType":"beforeResults","resultPath":["token"],"resultIndex":0}],"tag":"token","operationId":"deleteToken","response":{"statusCode":200,"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"contentType":"application/json"}}}],"schemas":{"200":{"description":"Succeeded","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"example":{"message":"revoke successfully"}}}},"401":{"description":"UnauthorizedUserError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"UnauthorizedUserError":{"value":{"code":"UnauthorizedUserError","message":"Guest is not allowed to do this operation."}}}}}},"403":{"description":"ForbiddenUserError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"ForbiddenUserError":{"value":{"code":"ForbiddenUserError","message":"Non-admin is not allow to do this operation."}},"ForbiddenTokenError":{"value":{"code":"ForbiddenUserError","message":"Applications are not allowed to do this operation."}}}}}}},"description":"delete /api/v2/tokens/{token}"},{"tests":[{"operation":{"tag":"token","operationId":"createApplicationToken","parameters":[],"response":{"statusCode":200,"schema":{"type":"object","properties":{"token":{"type":"string","description":"your access token"},"application":{"type":"boolean","description":"true"}}},"contentType":"application/json"}}}],"after":[{"tag":"token","operationId":"deleteToken","parameters":[{"type":"fromResult","resultType":"testResults","resultPath":["token"],"resultIndex":0}]}],"schemas":{"200":{"description":"Succeeded","content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string","description":"your access token"},"application":{"type":"boolean","description":"true"}}},"example":{"token":"JWT Token Example","application":true}}}},"401":{"description":"UnauthorizedUserError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"UnauthorizedUserError":{"value":{"code":"UnauthorizedUserError","message":"Guest is not allowed to do this operation."}}}}}}},"description":"post /api/v2/tokens/application"},{"description":"get /api/v2/authn/oidc/login","tests":[{"operation":{"tag":"authn","operationId":"oidcLogin","parameters":[]}}],"schemas":{"302":{"description":"Redirect"}}},{"description":"get /api/v2/authn/oidc/logout","tests":[{"operation":{"tag":"authn","operationId":"oidcLogout","parameters":[]}}],"schemas":{"302":{"description":"Redirect"}}},{"tests":[{"description":"login with correct username and password","operation":{"parameters":[{"type":"raw","value":"sdk_test"},{"type":"raw","value":"pwd"}],"tag":"authn","operationId":"basicLogin","response":{"statusCode":200,"schema":{"type":"object","properties":{"token":{"type":"string","description":"your access token"},"user":{"type":"string","description":"username"},"admin":{"type":"boolean","description":"true if user is admin"}},"required":["token","user","admin"]},"contentType":"application/json"}}},{"description":"login with non-existent username","operation":{"parameters":[{"type":"raw","value":"nonexistentuser"},{"type":"raw","value":"password"}],"response":{"statusCode":400,"expectResult":{"code":"NoUserError","message":"User nonexistentuser is not found."},"schema":{"description":"NoUserError or IncorrectPassworkError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]}}}}},"tag":"authn","operationId":"basicLogin"}},{"description":"login with incorrect password","operation":{"parameters":[{"type":"raw","value":"sdk_test"},{"type":"raw","value":"incorrectpassword"}],"response":{"statusCode":400,"expectResult":{"code":"IncorrectPasswordError","message":"Password is incorrect."},"schema":{"description":"NoUserError or IncorrectPassworkError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]}}}}},"tag":"authn","operationId":"basicLogin"}}],"after":[{"tag":"token","operationId":"deleteToken","parameters":[{"type":"fromResult","resultType":"testResults","resultPath":["token"],"resultIndex":0}]}],"schemas":{"200":{"description":"Succeeded","content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string","description":"your access token"},"user":{"type":"string","description":"username"},"admin":{"type":"boolean","description":"true if user is admin"}},"required":["token","user","admin"]},"example":{"token":"JWT Token Example","user":"user","admin":true}}}},"400":{"description":"NoUserError or IncorrectPassworkError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]}}}},"404":{"description":"NoUserError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"NoUserError":{"value":{"code":"NoUserError","message":"User {user} is not found."}}}}}}},"description":"post /api/v2/authn/basic/login"},{"before":[{"tag":"authn","operationId":"basicLogin","parameters":[{"type":"raw","value":"sdk_test"},{"type":"raw","value":"pwd"}]}],"tests":[{"description":"Logout with correct token","customizedTest":"logoutWithCorrectToken","operation":{"tag":"authn","operationId":"basicLogout","parameters":[],"response":{"statusCode":200,"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"contentType":"application/json"}}},{"description":"Logout with incorrect token","customizedTest":"logoutWithIncorrectToken","operation":{"tag":"authn","operationId":"basicLogout","parameters":[],"response":{"statusCode":200,"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"contentType":"application/json"}}}],"schemas":{"200":{"description":"Succeeded","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"example":{"message":"Logout successfully"}}}},"401":{"description":"UnauthorizedUserError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"UnauthorizedUserError":{"value":{"code":"UnauthorizedUserError","message":"Guest is not allowed to do this operation."}}}}}},"403":{"description":"ForbiddenUserError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"ForbiddenUserError":{"value":{"code":"ForbiddenUserError","message":"Non-admin is not allow to do this operation."}},"ForbiddenTokenError":{"value":{"code":"ForbiddenUserError","message":"Applications are not allowed to do this operation."}}}}}}},"description":"delete /api/v2/authn/basic/logout"},{"before":[{"tag":"token","operationId":"createApplicationToken"}],"tests":[{"description":"Create a user","operation":{"tag":"user","operationId":"createUser","parameters":[{"type":"raw","value":{"username":"sdk_test_user","password":"test_password"}}],"response":{"statusCode":201,"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"contentType":"application/json"}}},{"description":"Create a conflict user","operation":{"tag":"user","operationId":"createUser","parameters":[{"type":"raw","value":{"username":"sdk_test_user","password":"test_password"}}],"response":{"statusCode":409,"schema":{"description":"ConflictUserError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"ConflictUserError":{"value":{"code":"ConflictUserError","message":"User name {user} already exists."}}}}}}}}},{"description":"Create a user by application token","customizedTest":"createUserByApplicationToken","operation":{"tag":"user","operationId":"createUser","parameters":[],"response":{"statusCode":201,"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"contentType":"application/json"}}},{"description":"Create a user by non-admin user token","customizedTest":"createUserByNonadminToken","operation":{"tag":"user","operationId":"createUser","parameters":[],"response":{"statusCode":201,"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"contentType":"application/json"}}}],"after":[{"tag":"user","operationId":"deleteUser","parameters":[{"type":"raw","value":"sdk_test_user"}],"response":{"statusCode":200,"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"contentType":"application/json"}},{"tag":"token","operationId":"deleteToken","parameters":[{"type":"fromResult","resultType":"beforeResults","resultPath":["token"],"resultIndex":0}]}],"schemas":{"201":{"description":"Succeeded","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"example":{"message":"User is created successfully"}}}},"401":{"description":"UnauthorizedUserError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"UnauthorizedUserError":{"value":{"code":"UnauthorizedUserError","message":"Guest is not allowed to do this operation."}}}}}},"403":{"description":"ForbiddenUserError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"ForbiddenUserError":{"value":{"code":"ForbiddenUserError","message":"Non-admin is not allow to do this operation."}},"ForbiddenTokenError":{"value":{"code":"ForbiddenUserError","message":"Applications are not allowed to do this operation."}}}}}},"409":{"description":"ConflictUserError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"ConflictUserError":{"value":{"code":"ConflictUserError","message":"User name {user} already exists."}}}}}},"500":{"description":"UnknownError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"UnknownError":{"value":{"code":"UnknownError","message":"Internal error message."}}}}}}},"description":"post /api/v2/users"},{"description":"get /api/v2/users","tests":[{"operation":{"tag":"user","operationId":"getAllUser","parameters":[],"response":{"statusCode":200,"schema":{"description":"Array with all users in the system.","type":"array","items":{"type":"object","properties":{"username":{"type":"string","description":"user name"},"admin":{"type":"boolean","description":"Admin or not."},"virtualCluster":{"type":"array","description":"The list of virtualCluster which the user can access.","items":{"type":"string","description":"virtual cluster name."}},"storageConfig":{"type":"array","description":"storageconfig string arry","items":{"type":"string"}},"email":{"type":"string","description":"email address"},"extension":{"type":"object","description":"extension field."}},"required":["username","admin","virtualCluster","storageConfig","email","extension"]}},"contentType":"application/json"}}}],"schemas":{"200":{"description":"Succeeded","content":{"application/json":{"schema":{"description":"Array with all users in the system.","type":"array","items":{"type":"object","properties":{"username":{"type":"string","description":"user name"},"admin":{"type":"boolean","description":"Admin or not."},"virtualCluster":{"type":"array","description":"The list of virtualCluster which the user can access.","items":{"type":"string","description":"virtual cluster name."}},"storageConfig":{"type":"array","description":"storageconfig string arry","items":{"type":"string"}},"email":{"type":"string","description":"email address"},"extension":{"type":"object","description":"extension field."}},"required":["username","admin","virtualCluster","storageConfig","email","extension"]}},"example":[{"username":"username","admin":true,"virtualCluster":[],"storageConfig":[],"email":"email@test.com","extension":{}}]}}},"500":{"description":"UnknownError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"UnknownError":{"value":{"code":"UnknownError","message":"Internal error message."}}}}}}}},{"before":[{"tag":"user","operationId":"createUser","parameters":[{"type":"raw","value":{"username":"sdk_test_user","password":"test_password"}}],"response":{"statusCode":201,"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"contentType":"application/json"}},{"tag":"token","operationId":"createApplicationToken"}],"tests":[{"description":"Update a user, patch: true","operation":{"parameters":[{"type":"raw","value":{"username":"sdk_test_user","email":"new_email@test1.com"}}],"tag":"user","operationId":"updateUser","response":{"statusCode":201,"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"contentType":"application/json"}}},{"description":"Update a user, patch: false","operation":{"parameters":[{"type":"raw","value":{"username":"sdk_test_user","email":"new_email@test2.com","virtualCluster":["default"],"admin":false,"password":"new_test_password","extension":{}}},{"type":"raw","value":false}],"tag":"user","operationId":"updateUser","response":{"statusCode":201,"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"contentType":"application/json"}}},{"description":"Update a non-existent user","operation":{"parameters":[{"type":"raw","value":{"username":"non_exist_user","email":"new_email@test1.com"}}],"response":{"statusCode":404,"schema":{"description":"NoUserError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"NoUserError":{"value":{"code":"NoUserError","message":"User {user} is not found."}}}}}}},"tag":"user","operationId":"updateUser"}},{"description":"Update a user by application token","customizedTest":"updateUserByApplicationToken","operation":{"tag":"user","operationId":"updateUser","parameters":[],"response":{"statusCode":201,"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"contentType":"application/json"}}},{"description":"Update a user by non-admin user token","customizedTest":"updateUserByNonadminToken","operation":{"tag":"user","operationId":"updateUser","parameters":[],"response":{"statusCode":201,"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"contentType":"application/json"}}}],"after":[{"tag":"user","operationId":"deleteUser","parameters":[{"type":"raw","value":"sdk_test_user"}],"response":{"statusCode":200,"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"contentType":"application/json"}},{"tag":"token","operationId":"deleteToken","parameters":[{"type":"fromResult","resultType":"beforeResults","resultPath":["token"],"resultIndex":1}]}],"schemas":{"201":{"description":"Succeeded","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"example":{"message":"update group {username} successfully."}}}},"401":{"description":"UnauthorizedUserError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"UnauthorizedUserError":{"value":{"code":"UnauthorizedUserError","message":"Guest is not allowed to do this operation."}}}}}},"403":{"description":"ForbiddenUserError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"ForbiddenUserError":{"value":{"code":"ForbiddenUserError","message":"Non-admin is not allow to do this operation."}},"ForbiddenTokenError":{"value":{"code":"ForbiddenUserError","message":"Applications are not allowed to do this operation."}}}}}},"404":{"description":"NoUserError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"NoUserError":{"value":{"code":"NoUserError","message":"User {user} is not found."}}}}}},"500":{"description":"UnknownError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"UnknownError":{"value":{"code":"UnknownError","message":"Internal error message."}}}}}}},"description":"put /api/v2/users"},{"tests":[{"description":"Update user self, patch: true","operation":{"parameters":[{"type":"raw","value":{"username":"sdk_test","email":"new_email@test1.com"}}],"tag":"user","operationId":"updateUserSelf","response":{"statusCode":201,"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"contentType":"application/json"}}},{"description":"Update user self, patch: false","operation":{"parameters":[{"type":"raw","value":{"username":"sdk_test","email":"new_email@test2.com","oldPassword":"pwd","newPassword":"pwd"}},{"type":"raw","value":false}],"tag":"user","operationId":"updateUserSelf","response":{"statusCode":201,"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"contentType":"application/json"}}},{"description":"Update user self with incorrect username","operation":{"parameters":[{"type":"raw","value":{"username":"incorrect_username","email":"new_email@test1.com"}}],"response":{"statusCode":403,"schema":{"description":"ForbiddenUserError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"ForbiddenUserError":{"value":{"code":"ForbiddenUserError","message":"Non-admin is not allow to do this operation."}},"ForbiddenTokenError":{"value":{"code":"ForbiddenUserError","message":"Applications are not allowed to do this operation."}}}}}}},"tag":"user","operationId":"updateUserSelf"}}],"schemas":{"201":{"description":"Succeeded","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"example":{"message":"update group {username} successfully."}}}},"401":{"description":"UnauthorizedUserError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"UnauthorizedUserError":{"value":{"code":"UnauthorizedUserError","message":"Guest is not allowed to do this operation."}}}}}},"403":{"description":"ForbiddenUserError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"ForbiddenUserError":{"value":{"code":"ForbiddenUserError","message":"Non-admin is not allow to do this operation."}},"ForbiddenTokenError":{"value":{"code":"ForbiddenUserError","message":"Applications are not allowed to do this operation."}}}}}},"404":{"description":"NoUserError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"NoUserError":{"value":{"code":"NoUserError","message":"User {user} is not found."}}}}}},"500":{"description":"UnknownError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"UnknownError":{"value":{"code":"UnknownError","message":"Internal error message."}}}}}}},"description":"put /api/v2/users/me"},{"tests":[{"operation":{"parameters":[{"type":"raw","value":"sdk_test"}],"tag":"user","operationId":"getUser","response":{"statusCode":200,"schema":{"type":"object","properties":{"username":{"type":"string","description":"user name"},"admin":{"type":"boolean","description":"Admin or not."},"virtualCluster":{"type":"array","description":"The list of virtualCluster which the user can access.","items":{"type":"string","description":"virtual cluster name."}},"storageConfig":{"type":"array","description":"storageconfig string arry","items":{"type":"string"}},"email":{"type":"string","description":"email address"},"extension":{"type":"object","description":"extension field."}},"required":["username","admin","virtualCluster","storageConfig","email","extension"]},"contentType":"application/json"}}}],"schemas":{"200":{"description":"Succeeded","content":{"application/json":{"schema":{"type":"object","properties":{"username":{"type":"string","description":"user name"},"admin":{"type":"boolean","description":"Admin or not."},"virtualCluster":{"type":"array","description":"The list of virtualCluster which the user can access.","items":{"type":"string","description":"virtual cluster name."}},"storageConfig":{"type":"array","description":"storageconfig string arry","items":{"type":"string"}},"email":{"type":"string","description":"email address"},"extension":{"type":"object","description":"extension field."}},"required":["username","admin","virtualCluster","storageConfig","email","extension"]},"example":{"username":"username","admin":true,"virtualCluster":[],"storageConfig":[],"email":"email@test.com","extension":{}}}}},"401":{"description":"UnauthorizedUserError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"UnauthorizedUserError":{"value":{"code":"UnauthorizedUserError","message":"Guest is not allowed to do this operation."}}}}}},"404":{"description":"NoUserError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"NoUserError":{"value":{"code":"NoUserError","message":"User {user} is not found."}}}}}},"500":{"description":"UnknownError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"UnknownError":{"value":{"code":"UnknownError","message":"Internal error message."}}}}}}},"description":"get /api/v2/users/{user}"},{"before":[{"tag":"user","operationId":"createUser","parameters":[{"type":"raw","value":{"username":"sdk_test_user","password":"test_password"}}],"response":{"statusCode":201,"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"contentType":"application/json"}},{"tag":"token","operationId":"createApplicationToken"}],"tests":[{"description":"Delete a user","operation":{"tag":"user","operationId":"deleteUser","parameters":[{"type":"raw","value":"sdk_test_user"}],"response":{"statusCode":200,"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"contentType":"application/json"}}},{"description":"Delete a non-existent user","operation":{"parameters":[{"type":"raw","value":"non_exist_user"}],"response":{"statusCode":404,"schema":{"description":"NoUserError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"NoUserError":{"value":{"code":"NoUserError","message":"User {user} is not found."}}}}}}},"tag":"user","operationId":"deleteUser"}},{"description":"Delete a user by application token","customizedTest":"deleteUserByApplicationToken","operation":{"tag":"user","operationId":"deleteUser","parameters":[],"response":{"statusCode":200,"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"contentType":"application/json"}}},{"description":"Delete a user by non-admin user token","customizedTest":"deleteUserByNonadminToken","operation":{"tag":"user","operationId":"deleteUser","parameters":[],"response":{"statusCode":200,"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"contentType":"application/json"}}}],"after":[{"tag":"token","operationId":"deleteToken","parameters":[{"type":"fromResult","resultType":"beforeResults","resultPath":["token"],"resultIndex":1}]}],"schemas":{"200":{"description":"Succeeded","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"example":{"message":"user is removed successfully"}}}},"401":{"description":"UnauthorizedUserError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"UnauthorizedUserError":{"value":{"code":"UnauthorizedUserError","message":"Guest is not allowed to do this operation."}}}}}},"403":{"description":"ForbiddenUserError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"ForbiddenUserError":{"value":{"code":"ForbiddenUserError","message":"Non-admin is not allow to do this operation."}},"ForbiddenTokenError":{"value":{"code":"ForbiddenUserError","message":"Applications are not allowed to do this operation."}}}}}},"404":{"description":"NoUserError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"NoUserError":{"value":{"code":"NoUserError","message":"User {user} is not found."}}}}}},"500":{"description":"UnknownError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"UnknownError":{"value":{"code":"UnknownError","message":"Internal error message."}}}}}}},"description":"delete /api/v2/users/{user}"},{"before":[{"tag":"token","operationId":"createApplicationToken"},{"tag":"user","operationId":"createUser","parameters":[{"type":"raw","value":{"username":"sdk_test_user","password":"test_password"}}],"response":{"statusCode":201,"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"contentType":"application/json"}},{"tag":"group","operationId":"createGroup","parameters":[{"type":"raw","value":{"groupname":"sdktestgroup"}}],"response":{"statusCode":201,"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"contentType":"application/json"}}],"tests":[{"description":"Add a group to a user's grouplist","operation":{"parameters":[{"type":"raw","value":"sdk_test_user"},{"type":"raw","value":"sdktestgroup"}],"tag":"user","operationId":"updateUserGroup","response":{"statusCode":201,"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"contentType":"application/json"}}},{"description":"Add a group to a non-existent user's grouplist","operation":{"parameters":[{"type":"raw","value":"non_exist_user"},{"type":"raw","value":"sdktestgroup"}],"response":{"statusCode":404,"schema":{"description":"NoUserError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"NoUserError":{"value":{"code":"NoUserError","message":"User {user} is not found."}}}}}}},"tag":"user","operationId":"updateUserGroup"}},{"description":"Add a group to a user's grouplist by application token","customizedTest":"updateUserGroupByApplicationToken","operation":{"tag":"user","operationId":"updateUserGroup","parameters":[],"response":{"statusCode":201,"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"contentType":"application/json"}}},{"description":"Add a group to a user's grouplist by non-admin user token","customizedTest":"updateUserGroupByNonadminToken","operation":{"tag":"user","operationId":"updateUserGroup","parameters":[],"response":{"statusCode":201,"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"contentType":"application/json"}}}],"after":[{"tag":"token","operationId":"deleteToken","parameters":[{"type":"fromResult","resultType":"beforeResults","resultPath":["token"],"resultIndex":0}]},{"tag":"user","operationId":"deleteUser","parameters":[{"type":"raw","value":"sdk_test_user"}],"response":{"statusCode":200,"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"contentType":"application/json"}},{"tag":"group","operationId":"deleteGroup","parameters":[{"type":"raw","value":"sdktestgroup"}],"response":{"statusCode":201,"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"contentType":"application/json"}}],"schemas":{"201":{"description":"Succeeded","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"example":{"message":"User {username} is added into group {groupname}"}}}},"401":{"description":"UnauthorizedUserError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"UnauthorizedUserError":{"value":{"code":"UnauthorizedUserError","message":"Guest is not allowed to do this operation."}}}}}},"403":{"description":"ForbiddenUserError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"ForbiddenUserError":{"value":{"code":"ForbiddenUserError","message":"Non-admin is not allow to do this operation."}},"ForbiddenTokenError":{"value":{"code":"ForbiddenUserError","message":"Applications are not allowed to do this operation."}}}}}},"404":{"description":"NoUserError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"NoUserError":{"value":{"code":"NoUserError","message":"User {user} is not found."}}}}}},"500":{"description":"UnknownError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"UnknownError":{"value":{"code":"UnknownError","message":"Internal error message."}}}}}}},"description":"put /api/v2/users/{user}/group/"},{"before":[{"tag":"token","operationId":"createApplicationToken"},{"tag":"user","operationId":"createUser","parameters":[{"type":"raw","value":{"username":"sdk_test_user","password":"test_password"}}],"response":{"statusCode":201,"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"contentType":"application/json"}},{"tag":"group","operationId":"createGroup","parameters":[{"type":"raw","value":{"groupname":"sdktestgroup"}}],"response":{"statusCode":201,"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"contentType":"application/json"}},{"tag":"user","operationId":"updateUserGroup","parameters":[{"type":"raw","value":"sdk_test_user"},{"type":"raw","value":"sdktestgroup"}]}],"tests":[{"description":"Remove a group to a user's grouplist","operation":{"parameters":[{"type":"raw","value":"sdk_test_user"},{"type":"raw","value":"sdktestgroup"}],"tag":"user","operationId":"deleteUserGroup","response":{"statusCode":201,"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"contentType":"application/json"}}},{"description":"Remove a group to a non-existent user's grouplist","operation":{"parameters":[{"type":"raw","value":"non_exist_user"},{"type":"raw","value":"sdktestgroup"}],"response":{"statusCode":404,"schema":{"description":"NoUserError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"NoUserError":{"value":{"code":"NoUserError","message":"User {user} is not found."}}}}}}},"tag":"user","operationId":"deleteUserGroup"}},{"description":"Remove a group to a user's grouplist by application token","customizedTest":"deleteUserGroupByApplicationToken","operation":{"tag":"user","operationId":"deleteUserGroup","parameters":[],"response":{"statusCode":201,"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"contentType":"application/json"}}},{"description":"Remove a group to a user's grouplist by non-admin user token","customizedTest":"deleteUserGroupByNonadminToken","operation":{"tag":"user","operationId":"deleteUserGroup","parameters":[],"response":{"statusCode":201,"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"contentType":"application/json"}}}],"after":[{"tag":"token","operationId":"deleteToken","parameters":[{"type":"fromResult","resultType":"beforeResults","resultPath":["token"],"resultIndex":0}]},{"tag":"user","operationId":"deleteUser","parameters":[{"type":"raw","value":"sdk_test_user"}],"response":{"statusCode":200,"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"contentType":"application/json"}},{"tag":"group","operationId":"deleteGroup","parameters":[{"type":"raw","value":"sdktestgroup"}],"response":{"statusCode":201,"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"contentType":"application/json"}}],"schemas":{"201":{"description":"Succeeded","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"example":{"message":"User {username} is removed from group {groupname}"}}}},"401":{"description":"UnauthorizedUserError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"UnauthorizedUserError":{"value":{"code":"UnauthorizedUserError","message":"Guest is not allowed to do this operation."}}}}}},"403":{"description":"ForbiddenUserError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"ForbiddenUserError":{"value":{"code":"ForbiddenUserError","message":"Non-admin is not allow to do this operation."}},"ForbiddenTokenError":{"value":{"code":"ForbiddenUserError","message":"Applications are not allowed to do this operation."}}}}}},"404":{"description":"NoUserError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"NoUserError":{"value":{"code":"NoUserError","message":"User {user} is not found."}}}}}},"500":{"description":"UnknownError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"UnknownError":{"value":{"code":"UnknownError","message":"Internal error message."}}}}}}},"description":"delete /api/v2/users/{user}/group/"},{"before":[{"tag":"token","operationId":"createApplicationToken"},{"tag":"user","operationId":"createUser","parameters":[{"type":"raw","value":{"username":"sdk_test_user","password":"test_password"}}],"response":{"statusCode":201,"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"contentType":"application/json"}}],"tests":[{"description":"Replace a user's grouplist","operation":{"parameters":[{"type":"raw","value":"sdk_test_user"},{"type":"raw","value":["default"]}],"tag":"user","operationId":"updateUserGrouplist","response":{"statusCode":201,"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"contentType":"application/json"}}},{"description":"Replace a non-existent user's grouplist","operation":{"parameters":[{"type":"raw","value":"non_exist_user"},{"type":"raw","value":["default"]}],"response":{"statusCode":404,"schema":{"description":"NoUserError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"NoUserError":{"value":{"code":"NoUserError","message":"User {user} is not found."}}}}}}},"tag":"user","operationId":"updateUserGrouplist"}},{"description":"Replace a user's grouplist by application token","customizedTest":"updateUserGrouplistByApplicationToken","operation":{"tag":"user","operationId":"updateUserGrouplist","parameters":[],"response":{"statusCode":201,"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"contentType":"application/json"}}},{"description":"Replace a user's grouplist by non-admin user token","customizedTest":"updateUserGrouplistByNonadminToken","operation":{"tag":"user","operationId":"updateUserGrouplist","parameters":[],"response":{"statusCode":201,"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"contentType":"application/json"}}}],"after":[{"tag":"token","operationId":"deleteToken","parameters":[{"type":"fromResult","resultType":"beforeResults","resultPath":["token"],"resultIndex":0}]},{"tag":"user","operationId":"deleteUser","parameters":[{"type":"raw","value":"sdk_test_user"}],"response":{"statusCode":200,"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"contentType":"application/json"}}],"schemas":{"201":{"description":"Succeeded","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"example":{"message":"update user grouplist successfully."}}}},"401":{"description":"UnauthorizedUserError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"UnauthorizedUserError":{"value":{"code":"UnauthorizedUserError","message":"Guest is not allowed to do this operation."}}}}}},"403":{"description":"ForbiddenUserError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"ForbiddenUserError":{"value":{"code":"ForbiddenUserError","message":"Non-admin is not allow to do this operation."}},"ForbiddenTokenError":{"value":{"code":"ForbiddenUserError","message":"Applications are not allowed to do this operation."}}}}}},"404":{"description":"NoUserError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"NoUserError":{"value":{"code":"NoUserError","message":"User {user} is not found."}}}}}},"500":{"description":"UnknownError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"UnknownError":{"value":{"code":"UnknownError","message":"Internal error message."}}}}}}},"description":"put /api/v2/users/{user}/grouplist/"},{"description":"get /api/v2/groups","tests":[{"operation":{"tag":"group","operationId":"getAllGroup","parameters":[],"response":{"statusCode":200,"schema":{"description":"Array with all groups in the system.","type":"array","items":{"type":"object","properties":{"groupname":{"type":"string","description":"group name"},"description":{"type":"string","description":"description for the group"},"externalName":{"type":"string","description":"the external group name binding with the group in OpenPAI"},"extension":{"type":"object"}}}},"contentType":"application/json"}}}],"schemas":{"200":{"description":"Succeeded","content":{"application/json":{"schema":{"description":"Array with all groups in the system.","type":"array","items":{"type":"object","properties":{"groupname":{"type":"string","description":"group name"},"description":{"type":"string","description":"description for the group"},"externalName":{"type":"string","description":"the external group name binding with the group in OpenPAI"},"extension":{"type":"object"}}}},"example":[{"groupname":"groupName","description":"description","externalName":"externalName","extension":{}}]}}},"500":{"description":"UnknownError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"UnknownError":{"value":{"code":"UnknownError","message":"Internal error message."}}}}}}}},{"tests":[{"operation":{"tag":"group","operationId":"createGroup","parameters":[{"type":"raw","value":{"groupname":"sdktestgroup"}}],"response":{"statusCode":201,"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"contentType":"application/json"}}}],"after":[{"tag":"group","operationId":"deleteGroup","parameters":[{"type":"raw","value":"sdktestgroup"}],"response":{"statusCode":201,"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"contentType":"application/json"}}],"schemas":{"201":{"description":"Succeeded","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"example":{"message":"group is created successfully"}}}},"401":{"description":"UnauthorizedUserError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"UnauthorizedUserError":{"value":{"code":"UnauthorizedUserError","message":"Guest is not allowed to do this operation."}}}}}},"403":{"description":"ForbiddenUserError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"ForbiddenUserError":{"value":{"code":"ForbiddenUserError","message":"Non-admin is not allow to do this operation."}},"ForbiddenTokenError":{"value":{"code":"ForbiddenUserError","message":"Applications are not allowed to do this operation."}}}}}},"500":{"description":"UnknownError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"UnknownError":{"value":{"code":"UnknownError","message":"Internal error message."}}}}}}},"description":"post /api/v2/groups"},{"before":[{"tag":"group","operationId":"createGroup","parameters":[{"type":"raw","value":{"groupname":"sdktestgroup"}}],"response":{"statusCode":201,"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"contentType":"application/json"}}],"tests":[{"operation":{"parameters":[{"type":"raw","value":{"data":{"groupname":"sdktestgroup","description":"test update group"},"patch":true}}],"tag":"group","operationId":"updateGroup","response":{"statusCode":201,"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"contentType":"application/json"}}}],"after":[{"tag":"group","operationId":"deleteGroup","parameters":[{"type":"raw","value":"sdktestgroup"}],"response":{"statusCode":201,"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"contentType":"application/json"}}],"schemas":{"201":{"description":"Succeeded","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"example":{"message":"update group {groupname} successfully."}}}},"401":{"description":"UnauthorizedUserError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"UnauthorizedUserError":{"value":{"code":"UnauthorizedUserError","message":"Guest is not allowed to do this operation."}}}}}},"403":{"description":"ForbiddenUserError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"ForbiddenUserError":{"value":{"code":"ForbiddenUserError","message":"Non-admin is not allow to do this operation."}},"ForbiddenTokenError":{"value":{"code":"ForbiddenUserError","message":"Applications are not allowed to do this operation."}}}}}},"404":{"description":"NoGroupError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"NoGroupError":{"value":{"code":"NoGroupError","message":"Group {groupname} is not found."}}}}}},"500":{"description":"UnknownError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"UnknownError":{"value":{"code":"UnknownError","message":"Internal error message."}}}}}}},"description":"put /api/v2/groups"},{"before":[{"tag":"group","operationId":"createGroup","parameters":[{"type":"raw","value":{"groupname":"sdktestgroup"}}],"response":{"statusCode":201,"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"contentType":"application/json"}}],"tests":[{"operation":{"parameters":[{"type":"raw","value":"sdktestgroup"}],"tag":"group","operationId":"getGroup","response":{"statusCode":200,"schema":{"type":"object","properties":{"groupname":{"type":"string","description":"group name"},"description":{"type":"string","description":"description for the group"},"externalName":{"type":"string","description":"the external group name binding with the group in OpenPAI"},"extension":{"type":"object"}},"required":["groupname","description","externalName","extension"]},"contentType":"application/json"}}}],"after":[{"tag":"group","operationId":"deleteGroup","parameters":[{"type":"raw","value":"sdktestgroup"}],"response":{"statusCode":201,"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"contentType":"application/json"}}],"schemas":{"200":{"description":"Succeeded","content":{"application/json":{"schema":{"type":"object","properties":{"groupname":{"type":"string","description":"group name"},"description":{"type":"string","description":"description for the group"},"externalName":{"type":"string","description":"the external group name binding with the group in OpenPAI"},"extension":{"type":"object"}},"required":["groupname","description","externalName","extension"]},"example":{"groupname":"groupName","description":"description","externalName":"externalName","extension":{}}}}},"401":{"description":"UnauthorizedUserError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"UnauthorizedUserError":{"value":{"code":"UnauthorizedUserError","message":"Guest is not allowed to do this operation."}}}}}},"404":{"description":"NoGroupError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"NoGroupError":{"value":{"code":"NoGroupError","message":"Group {groupname} is not found."}}}}}},"500":{"description":"UnknownError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"UnknownError":{"value":{"code":"UnknownError","message":"Internal error message."}}}}}}},"description":"get /api/v2/groups/{group}"},{"before":[{"tag":"group","operationId":"createGroup","parameters":[{"type":"raw","value":{"groupname":"sdktestgroup"}}],"response":{"statusCode":201,"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"contentType":"application/json"}}],"tests":[{"operation":{"tag":"group","operationId":"deleteGroup","parameters":[{"type":"raw","value":"sdktestgroup"}],"response":{"statusCode":201,"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"contentType":"application/json"}}}],"schemas":{"201":{"description":"Succeeded","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"example":{"message":"group is removed successfully"}}}},"401":{"description":"UnauthorizedUserError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"UnauthorizedUserError":{"value":{"code":"UnauthorizedUserError","message":"Guest is not allowed to do this operation."}}}}}},"403":{"description":"ForbiddenUserError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"ForbiddenUserError":{"value":{"code":"ForbiddenUserError","message":"Non-admin is not allow to do this operation."}},"ForbiddenTokenError":{"value":{"code":"ForbiddenUserError","message":"Applications are not allowed to do this operation."}}}}}},"500":{"description":"UnknownError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"UnknownError":{"value":{"code":"UnknownError","message":"Internal error message."}}}}}}},"description":"delete /api/v2/groups/{group}"},{"description":"get /api/v2/groups/{group}/userlist","tests":[{"operation":{"tag":"group","operationId":"getGroupMembers","parameters":[],"response":{"statusCode":200,"schema":{"description":"Array with all users in the group.","type":"array","items":{"type":"object","properties":{"username":{"type":"string","description":"user name"},"clusterAdmin":{"type":"boolean","description":"Cluster admin or not."}}}},"contentType":"application/json"}}}],"schemas":{"200":{"description":"Succeeded","content":{"application/json":{"schema":{"description":"Array with all users in the group.","type":"array","items":{"type":"object","properties":{"username":{"type":"string","description":"user name"},"clusterAdmin":{"type":"boolean","description":"Cluster admin or not."}}}},"example":[{"username":"username","clusterAdmin":false}]}}},"401":{"description":"UnauthorizedUserError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"UnauthorizedUserError":{"value":{"code":"UnauthorizedUserError","message":"Guest is not allowed to do this operation."}}}}}},"500":{"description":"UnknownError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"UnknownError":{"value":{"code":"UnknownError","message":"Internal error message."}}}}}}}},{"description":"get /api/v2/virtual-clusters","tests":[{"operation":{"tag":"virtual cluster","operationId":"listVirtualClusters","parameters":[],"response":{"statusCode":200,"schema":{"type":"object","additionalProperties":{"type":"object","properties":{"capacity":{"type":"number","description":"capacity percentage this virtual cluster can use of entire cluster"},"usedCapacity":{"type":"number","description":"used capacity percentage this virtual cluster can use of entire cluster"},"maxCapacity":{"type":"number","description":"max capacity percentage this virtual cluster can use of entire cluster"},"dedicated":{"type":"boolean","description":"dedicated virtual cluster or not"},"resourcesUsed":{"type":"object","description":"used resources","properties":{"cpu":{"type":"integer","description":"used cpu number"},"vCores":{"type":"integer","description":"same as cpu"},"memory":{"type":"integer","description":"used memory in MB"},"gpu":{"type":"integer","description":"used gpu number"},"GPUs":{"type":"integer","description":"same as gpu"}}},"resourcesGuaranteed":{"type":"object","description":"guaranteed resources, including used and free","properties":{"cpu":{"type":"integer","description":"guaranteed cpu number"},"vCores":{"type":"integer","description":"same as cpu"},"memory":{"type":"integer","description":"guaranteed memory in MB"},"gpu":{"type":"integer","description":"guaranteed gpu number"},"GPUs":{"type":"integer","description":"same as gpu"}}},"resourcesTotal":{"type":"object","description":"total resources, including guaranteed and bad","properties":{"cpu":{"type":"integer","description":"total cpu number"},"vCores":{"type":"integer","description":"same as cpu"},"memory":{"type":"integer","description":"total memory in MB"},"gpu":{"type":"integer","description":"total gpu number"},"GPUs":{"type":"integer","description":"same as gpu"}}}},"required":["capacity","usedCapacity","maxCapacity","resourcesUsed","resourcesGuaranteed","resourcesTotal"]}},"contentType":"application/json"}}}],"schemas":{"200":{"description":"Succeeded","content":{"application/json":{"schema":{"type":"object","additionalProperties":{"type":"object","properties":{"capacity":{"type":"number","description":"capacity percentage this virtual cluster can use of entire cluster"},"usedCapacity":{"type":"number","description":"used capacity percentage this virtual cluster can use of entire cluster"},"maxCapacity":{"type":"number","description":"max capacity percentage this virtual cluster can use of entire cluster"},"dedicated":{"type":"boolean","description":"dedicated virtual cluster or not"},"resourcesUsed":{"type":"object","description":"used resources","properties":{"cpu":{"type":"integer","description":"used cpu number"},"vCores":{"type":"integer","description":"same as cpu"},"memory":{"type":"integer","description":"used memory in MB"},"gpu":{"type":"integer","description":"used gpu number"},"GPUs":{"type":"integer","description":"same as gpu"}}},"resourcesGuaranteed":{"type":"object","description":"guaranteed resources, including used and free","properties":{"cpu":{"type":"integer","description":"guaranteed cpu number"},"vCores":{"type":"integer","description":"same as cpu"},"memory":{"type":"integer","description":"guaranteed memory in MB"},"gpu":{"type":"integer","description":"guaranteed gpu number"},"GPUs":{"type":"integer","description":"same as gpu"}}},"resourcesTotal":{"type":"object","description":"total resources, including guaranteed and bad","properties":{"cpu":{"type":"integer","description":"total cpu number"},"vCores":{"type":"integer","description":"same as cpu"},"memory":{"type":"integer","description":"total memory in MB"},"gpu":{"type":"integer","description":"total gpu number"},"GPUs":{"type":"integer","description":"same as gpu"}}}},"required":["capacity","usedCapacity","maxCapacity","resourcesUsed","resourcesGuaranteed","resourcesTotal"]}}}}},"500":{"description":"UnknownError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"UnknownError":{"value":{"code":"UnknownError","message":"Internal error message."}}}}}}}},{"tests":[{"operation":{"parameters":[{"type":"raw","value":"default"}],"tag":"virtual cluster","operationId":"getVirtualCluster","response":{"statusCode":200,"schema":{"type":"object","properties":{"capacity":{"type":"number","description":"capacity percentage this virtual cluster can use of entire cluster"},"usedCapacity":{"type":"number","description":"used capacity percentage this virtual cluster can use of entire cluster"},"maxCapacity":{"type":"number","description":"max capacity percentage this virtual cluster can use of entire cluster"},"dedicated":{"type":"boolean","description":"dedicated virtual cluster or not"},"resourcesUsed":{"type":"object","description":"used resources","properties":{"cpu":{"type":"integer","description":"used cpu number"},"vCores":{"type":"integer","description":"same as cpu"},"memory":{"type":"integer","description":"used memory in MB"},"gpu":{"type":"integer","description":"used gpu number"},"GPUs":{"type":"integer","description":"same as gpu"}}},"resourcesGuaranteed":{"type":"object","description":"guaranteed resources, including used and free","properties":{"cpu":{"type":"integer","description":"guaranteed cpu number"},"vCores":{"type":"integer","description":"same as cpu"},"memory":{"type":"integer","description":"guaranteed memory in MB"},"gpu":{"type":"integer","description":"guaranteed gpu number"},"GPUs":{"type":"integer","description":"same as gpu"}}},"resourcesTotal":{"type":"object","description":"total resources, including guaranteed and bad","properties":{"cpu":{"type":"integer","description":"total cpu number"},"vCores":{"type":"integer","description":"same as cpu"},"memory":{"type":"integer","description":"total memory in MB"},"gpu":{"type":"integer","description":"total gpu number"},"GPUs":{"type":"integer","description":"same as gpu"}}}},"required":["capacity","usedCapacity","maxCapacity","resourcesUsed","resourcesGuaranteed","resourcesTotal"]},"contentType":"application/json"}}}],"schemas":{"200":{"description":"Succeeded","content":{"application/json":{"schema":{"type":"object","properties":{"capacity":{"type":"number","description":"capacity percentage this virtual cluster can use of entire cluster"},"usedCapacity":{"type":"number","description":"used capacity percentage this virtual cluster can use of entire cluster"},"maxCapacity":{"type":"number","description":"max capacity percentage this virtual cluster can use of entire cluster"},"dedicated":{"type":"boolean","description":"dedicated virtual cluster or not"},"resourcesUsed":{"type":"object","description":"used resources","properties":{"cpu":{"type":"integer","description":"used cpu number"},"vCores":{"type":"integer","description":"same as cpu"},"memory":{"type":"integer","description":"used memory in MB"},"gpu":{"type":"integer","description":"used gpu number"},"GPUs":{"type":"integer","description":"same as gpu"}}},"resourcesGuaranteed":{"type":"object","description":"guaranteed resources, including used and free","properties":{"cpu":{"type":"integer","description":"guaranteed cpu number"},"vCores":{"type":"integer","description":"same as cpu"},"memory":{"type":"integer","description":"guaranteed memory in MB"},"gpu":{"type":"integer","description":"guaranteed gpu number"},"GPUs":{"type":"integer","description":"same as gpu"}}},"resourcesTotal":{"type":"object","description":"total resources, including guaranteed and bad","properties":{"cpu":{"type":"integer","description":"total cpu number"},"vCores":{"type":"integer","description":"same as cpu"},"memory":{"type":"integer","description":"total memory in MB"},"gpu":{"type":"integer","description":"total gpu number"},"GPUs":{"type":"integer","description":"same as gpu"}}}},"required":["capacity","usedCapacity","maxCapacity","resourcesUsed","resourcesGuaranteed","resourcesTotal"]},"example":{"capacity":70,"usedCapacity":30,"dedicated":false,"resourcesUsed":{"cpu":1,"memory":1024,"gpu":1,"vCores":1,"GPUs":1},"resourcesGuaranteed":{"cpu":2,"memory":2048,"gpu":2,"vCores":2,"GPUs":2},"resourcesTotal":{"cpu":2,"memory":2048,"gpu":2,"vCores":2,"GPUs":2},"maxCapacity":70}}}},"404":{"description":"NoVirtualClusterError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"NoVirtualClusterError":{"value":{"code":"NoVirtualClusterError","message":"Virtual cluster {vc} is not found."}}}}}},"500":{"description":"UnknownError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"UnknownError":{"value":{"code":"UnknownError","message":"Internal error message."}}}}}}},"description":"get /api/v2/virtual-clusters/{vc}"},{"description":"get /api/v2/storages","tests":[{"operation":{"tag":"storage","operationId":"getStorages","parameters":[],"response":{"statusCode":200,"schema":{"type":"object","description":"summary of configured PV storage","properties":{"storages":{"type":"array","items":{"type":"object","description":"summary of each storage","properties":{"name":{"type":"string"},"share":{"type":"boolean"},"volumeName":{"type":"string"}},"required":["name","share","volumeName"]}}},"required":["storages"]},"contentType":"application/json"}}}],"schemas":{"200":{"description":"Succeeded","content":{"application/json":{"schema":{"type":"object","description":"summary of configured PV storage","properties":{"storages":{"type":"array","items":{"type":"object","description":"summary of each storage","properties":{"name":{"type":"string"},"share":{"type":"boolean"},"volumeName":{"type":"string"}},"required":["name","share","volumeName"]}}},"required":["storages"]},"example":{"storages":[{"name":"name","share":true,"volumeName":"volumeName"}]}}}},"500":{"description":"UnknownError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"UnknownError":{"value":{"code":"UnknownError","message":"Internal error message."}}}}}}}},{"before":[{"tag":"storage","operationId":"getStorages"}],"tests":[{"operation":{"parameters":[{"type":"fromResult","resultType":"beforeResults","resultPath":["storages",0,"name"],"resultIndex":0}],"tag":"storage","operationId":"getStorage","response":{"statusCode":200,"schema":{"type":"object","description":"detail of configured PV storage","properties":{"name":{"type":"string"},"share":{"type":"boolean"},"volumeName":{"type":"string"},"type":{"type":"string","enum":["nfs","samba","azureFile","azureBlob","other","unknown"]},"data":{"anyOf":[{"type":"object","description":"nfs type","properties":{"server":{"type":"string"},"path":{"type":"string"}},"required":["server","path"]},{"type":"object","description":"samba type","properties":{"address":{"type":"string"},"username":{"type":"string"},"password":{"type":"string"}},"required":["address"]},{"type":"object","description":"azureFile type","properties":{"shareName":{"type":"string"},"accountName":{"type":"string"},"accountKey":{"type":"string"}},"required":["shareName"]},{"type":"object","description":"azureBlob type","properties":{"containerName":{"type":"string"},"accountName":{"type":"string"},"accountKey":{"type":"string"},"accountSASToken":{"type":"string"}},"required":["containerName"]},{"type":"object","description":"other/unknown type","properties":{}}]},"secretName":{"type":"string"},"mountOptions":{"type":"array","items":{"type":"string"}}},"required":["name","share","volumeName","type","data"]},"contentType":"application/json"}}}],"schemas":{"200":{"description":"Succeeded","content":{"application/json":{"schema":{"type":"object","description":"detail of configured PV storage","properties":{"name":{"type":"string"},"share":{"type":"boolean"},"volumeName":{"type":"string"},"type":{"type":"string","enum":["nfs","samba","azureFile","azureBlob","other","unknown"]},"data":{"anyOf":[{"type":"object","description":"nfs type","properties":{"server":{"type":"string"},"path":{"type":"string"}},"required":["server","path"]},{"type":"object","description":"samba type","properties":{"address":{"type":"string"},"username":{"type":"string"},"password":{"type":"string"}},"required":["address"]},{"type":"object","description":"azureFile type","properties":{"shareName":{"type":"string"},"accountName":{"type":"string"},"accountKey":{"type":"string"}},"required":["shareName"]},{"type":"object","description":"azureBlob type","properties":{"containerName":{"type":"string"},"accountName":{"type":"string"},"accountKey":{"type":"string"},"accountSASToken":{"type":"string"}},"required":["containerName"]},{"type":"object","description":"other/unknown type","properties":{}}]},"secretName":{"type":"string"},"mountOptions":{"type":"array","items":{"type":"string"}}},"required":["name","share","volumeName","type","data"]},"example":{"name":"nfs-storage-name","share":true,"volumeName":"nfs-volume-name","type":"nfs","data":{"server":"","path":"/data"}}}}},"403":{"description":"ForbiddenUserError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"ForbiddenUserError":{"value":{"code":"ForbiddenUserError","message":"User {user} is not allowed to access {storage}."}}}}}},"404":{"description":"NoStorageError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"NoVirtualClusterError":{"value":{"code":"NoStorageError","message":"Storage {storage} is not found."}}}}}},"500":{"description":"UnknownError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"UnknownError":{"value":{"code":"UnknownError","message":"Internal error message."}}}}}}},"description":"get /api/v2/storages/{storage}"},{"tests":[{"operation":{"tag":"job","operationId":"createJob","parameters":[{"type":"raw","value":{"contributor":"OpenPAI","description":"# Serving a TensorFlow MNIST Digit Recognition Model\nThis example shows you how to use TensorFlow Serving components to export a trained TensorFlow model\nand use the standard tensorflow_model_server to serve it on OpenPAI.\nThis example uses the simple Softmax Regression model introduced in the TensorFlow tutorial for handwritten image (MNIST data) classification.\nReference https://www.tensorflow.org/tfx/serving/serving_basic.\n","name":"sdk_test_jobb0968e37","parameters":{"modelPath":"/tmp/mnist_model"},"prerequisites":[{"contributor":"OpenPAI","description":"This is an [example TensorFlow Serving Docker image on OpenPAI](https://github.com/Microsoft/pai/tree/master/examples/serving).\n","name":"tf_serving_example","protocolVersion":2,"type":"dockerimage","uri":"openpai/pai.example.tensorflow-serving","version":"1.0-r1.4"}],"protocolVersion":2,"taskRoles":{"worker":{"commands":["bazel-bin/tensorflow_serving/example/mnist_saved_model <% $parameters.modelPath %>","tensorflow_model_server --port=$PAI_CONTAINER_HOST_model_server_PORT_LIST --model_name=mnist --model_base_path=<% $parameters.modelPath %>"],"dockerImage":"tf_serving_example","instances":1,"resourcePerInstance":{"cpu":4,"gpu":1,"memoryMB":8192,"ports":{"model_server":1}}}},"type":"job","version":"1.0"}}],"response":{"statusCode":202,"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"contentType":"application/json"}}}],"after":[{"tag":"job","operationId":"updateJobExecutionType","parameters":[{"type":"raw","value":"sdk_test"},{"type":"raw","value":"sdk_test_jobb0968e37"},{"type":"raw","value":"STOP"}]}],"schemas":{"202":{"description":"Succeeded","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"example":{"message":"update job {job} successfully"}}}},"400":{"description":"NoVirtualClusterError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"NoVirtualClusterError":{"value":{"code":"NoVirtualClusterError","message":"Virtual cluster {vc} is not found."}}}}}},"403":{"description":"ForbiddenUserError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"ForbiddenUserError":{"value":{"code":"ForbiddenUserError","message":"Non-admin is not allow to do this operation."}},"ForbiddenTokenError":{"value":{"code":"ForbiddenUserError","message":"Applications are not allowed to do this operation."}}}}}},"409":{"description":"ConflictJobError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"ConflictJobError":{"value":{"code":"ConflictJobError","message":"Job name {job} already exists."}}}}}},"500":{"description":"UnknownError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"UnknownError":{"value":{"code":"UnknownError","message":"Internal error message."}}}}}}},"description":"post /api/v2/jobs"},{"description":"get /api/v2/jobs","tests":[{"operation":{"tag":"job","operationId":"listJobs","parameters":[],"response":{"statusCode":200,"schema":{"type":"array","description":"job summary list","items":{"type":"object","properties":{"name":{"type":"string","description":"job name"},"username":{"type":"string","description":"user name or \"unknown\""},"state":{"type":"string","description":"general job state","enum":["WAITING","RUNNING","STOPPING","STOPPED","SUCCEEDED","FAILED","UNKNOWN"]},"subState":{"type":"string","description":"job state in framework controller","enum":["AttemptCreationPending","AttemptCreationRequested","AttemptPreparing","AttemptRunning","AttemptDeletionPending","AttemptDeletionRequested","AttemptDeleting","AttemptCompleted","Completed"]},"executionType":{"type":"string","description":"start or stop","enum":["START","STOP"]},"retries":{"type":"integer","description":"job retried times"},"retryDetails":{"type":"object","properties":{"user":{"type":"integer"},"platform":{"type":"integer"},"resource":{"type":"integer"}}},"retryDelayTime":{"type":"integer","nullable":true,"description":"retry delay time"},"createdTime":{"type":"integer","description":"job created time, in number of milliseconds since the Unix Epoch."},"completedTime":{"type":"integer","nullable":true,"description":"job completed time, in number of milliseconds since the Unix Epoch."},"appExitCode":{"type":"integer","nullable":true,"description":"job exit code"},"virtualCluster":{"type":"string","description":"virtual cluster to which the job submitted, or \"unknown\""},"totalGpuNumber":{"type":"integer","description":"total gpu number used in the job"},"totalTaskNumber":{"type":"integer","description":"total task number used in the job"},"totalTaskRoleNumber":{"type":"integer","description":"total task role number used in the job"},"debugId":{"type":"string","description":"md5 hash name for the job in framework controller, used for debug purpose"}},"required":["name","username","virtualCluster","state","subState","executionType","retries","createdTime","completedTime","appExitCode"]}},"contentType":"application/json"}}}],"schemas":{"200":{"description":"Succeeded","content":{"application/json":{"schema":{"type":"array","description":"job summary list","items":{"type":"object","properties":{"name":{"type":"string","description":"job name"},"username":{"type":"string","description":"user name or \"unknown\""},"state":{"type":"string","description":"general job state","enum":["WAITING","RUNNING","STOPPING","STOPPED","SUCCEEDED","FAILED","UNKNOWN"]},"subState":{"type":"string","description":"job state in framework controller","enum":["AttemptCreationPending","AttemptCreationRequested","AttemptPreparing","AttemptRunning","AttemptDeletionPending","AttemptDeletionRequested","AttemptDeleting","AttemptCompleted","Completed"]},"executionType":{"type":"string","description":"start or stop","enum":["START","STOP"]},"retries":{"type":"integer","description":"job retried times"},"retryDetails":{"type":"object","properties":{"user":{"type":"integer"},"platform":{"type":"integer"},"resource":{"type":"integer"}}},"retryDelayTime":{"type":"integer","nullable":true,"description":"retry delay time"},"createdTime":{"type":"integer","description":"job created time, in number of milliseconds since the Unix Epoch."},"completedTime":{"type":"integer","nullable":true,"description":"job completed time, in number of milliseconds since the Unix Epoch."},"appExitCode":{"type":"integer","nullable":true,"description":"job exit code"},"virtualCluster":{"type":"string","description":"virtual cluster to which the job submitted, or \"unknown\""},"totalGpuNumber":{"type":"integer","description":"total gpu number used in the job"},"totalTaskNumber":{"type":"integer","description":"total task number used in the job"},"totalTaskRoleNumber":{"type":"integer","description":"total task role number used in the job"},"debugId":{"type":"string","description":"md5 hash name for the job in framework controller, used for debug purpose"}},"required":["name","username","virtualCluster","state","subState","executionType","retries","createdTime","completedTime","appExitCode"]}},"example":[{"name":"job name","username":"user name","state":"SUCCEEDED","subState":"Completed","executionType":"STOP","retries":0,"createdTime":0,"completedTime":0,"appExitCode":0,"virtualCluster":"unknown"}]}}},"500":{"description":"UnknownError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"UnknownError":{"value":{"code":"UnknownError","message":"Internal error message."}}}}}}}},{"before":[{"tag":"job","operationId":"createJob","parameters":[{"type":"raw","value":{"contributor":"OpenPAI","description":"# Serving a TensorFlow MNIST Digit Recognition Model\nThis example shows you how to use TensorFlow Serving components to export a trained TensorFlow model\nand use the standard tensorflow_model_server to serve it on OpenPAI.\nThis example uses the simple Softmax Regression model introduced in the TensorFlow tutorial for handwritten image (MNIST data) classification.\nReference https://www.tensorflow.org/tfx/serving/serving_basic.\n","name":"sdk_test_jobbe30565d","parameters":{"modelPath":"/tmp/mnist_model"},"prerequisites":[{"contributor":"OpenPAI","description":"This is an [example TensorFlow Serving Docker image on OpenPAI](https://github.com/Microsoft/pai/tree/master/examples/serving).\n","name":"tf_serving_example","protocolVersion":2,"type":"dockerimage","uri":"openpai/pai.example.tensorflow-serving","version":"1.0-r1.4"}],"protocolVersion":2,"taskRoles":{"worker":{"commands":["bazel-bin/tensorflow_serving/example/mnist_saved_model <% $parameters.modelPath %>","tensorflow_model_server --port=$PAI_CONTAINER_HOST_model_server_PORT_LIST --model_name=mnist --model_base_path=<% $parameters.modelPath %>"],"dockerImage":"tf_serving_example","instances":1,"resourcePerInstance":{"cpu":4,"gpu":1,"memoryMB":8192,"ports":{"model_server":1}}}},"type":"job","version":"1.0"}}]}],"tests":[{"description":"Get a job detail","operation":{"parameters":[{"type":"raw","value":"sdk_test"},{"type":"raw","value":"sdk_test_jobbe30565d"}],"tag":"job","operationId":"getJob","response":{"statusCode":200,"schema":{"type":"object","description":"job details","properties":{"name":{"type":"string","description":"job name"},"jobStatus":{"type":"object","description":"job status","properties":{"username":{"type":"string","description":"user name or \"unknown\""},"state":{"type":"string","description":"general job state","enum":["WAITING","RUNNING","STOPPING","STOPPED","SUCCEEDED","FAILED","UNKNOWN"]},"subState":{"type":"string","description":"job state in framework controller","enum":["AttemptCreationPending","AttemptCreationRequested","AttemptPreparing","AttemptRunning","AttemptDeletionPending","AttemptDeletionRequested","AttemptDeleting","AttemptCompleted","Completed"]},"executionType":{"type":"string","description":"start or stop","enum":["START","STOP"]},"retries":{"type":"integer","description":"job retried times"},"retryDetails":{"type":"object","properties":{"user":{"type":"integer"},"platform":{"type":"integer"},"resource":{"type":"integer"}}},"retryDelayTime":{"type":"integer","nullable":true,"description":"retry delay time"},"createdTime":{"type":"integer","description":"job created time, in number of milliseconds since the Unix Epoch."},"completedTime":{"type":"integer","nullable":true,"description":"job completed time, in number of milliseconds since the Unix Epoch."},"appId":{"type":"string","description":"unique id for the job"},"appLaunchedTime":{"type":"integer","nullable":true,"description":"job launched time for last attempt, in number of milliseconds since the Unix Epoch."},"appCompletedTime":{"type":"integer","nullable":true,"description":"job completed time for last attempt, in number of milliseconds since the Unix Epoch. to get durations for last attempt:\n wholeDuration = completedTime - createdTime;\n runningDuration = appCompletedTime - appLaunchedTime;\n waitingDuration = wholeDuration - runningDuration.\nto get durations for all attempts:\n runningDuration = sum(appCompletedTime - appLaunchedTime) for all attempts.\n"},"appExitCode":{"type":"integer","nullable":true,"description":"job exit code"},"appExitSpec":{"type":"object","nullable":true,"description":"job exit spec","properties":{"code":{"type":"integer"},"phrase":{"type":"string"},"issuer":{"type":"string"},"causer":{"type":"string"},"type":{"type":"string"},"stage":{"type":"string"},"behavior":{"type":"string"},"reaction":{"type":"string"},"repro":{"type":"array","items":{"type":"string"}}}},"appExitDiagnostics":{"type":"string","nullable":true,"description":"job exit diagnostics"},"appExitMessages":{"type":"object","nullable":true,"properties":{"container":{"type":"string","nullable":true},"runtime":{"type":"string","nullable":true},"launcher":{"type":"string","nullable":true}}},"appExitTriggerMessage":{"type":"string","nullable":true,"description":"job completion message"},"appExitTriggerTaskRoleName":{"type":"string","nullable":true,"description":"task role name which triggered job completion"},"appExitTriggerTaskIndex":{"type":"integer","nullable":true,"description":"task index which triggered job completion"},"appExitType":{"type":"string","nullable":true,"description":"job completion type"},"virtualCluster":{"type":"string","description":"virtual cluster to which the job submitted, or \"unknown\""}},"required":["username","virtualCluster","state","subState","executionType","retries","createdTime","completedTime","appId","appLaunchedTime","appCompletedTime","appExitCode"]},"taskRoles":{"type":"object","additionalProperties":{"type":"object","description":"task role status","properties":{"taskRoleStatus":{"type":"object","properties":{"name":{"type":"string","description":"task role name"}},"required":["name"]},"taskStatuses":{"type":"array","description":"task statuses in the task role","items":{"type":"object","properties":{"taskIndex":{"type":"integer","description":"task index"},"taskState":{"type":"string","description":"task state","enum":["WAITING","RUNNING","STOPPING","STOPPED","SUCCEEDED","FAILED","UNKNOWN"]},"containerId":{"type":"string","description":"uid of the task container"},"containerIp":{"type":"string","description":"ip of the task container"},"containerPorts":{"type":"object","description":"ports of the task container"},"containerGpus":{"type":"string","nullable":true,"description":"gpu of the task container"},"containerLog":{"type":"string","description":"log url of the task container"},"containerExitCode":{"type":"integer","nullable":true,"description":"exit code the task container"}}}}},"required":["taskRoleStatus","taskStatuses"]}},"debugId":{"type":"string","description":"md5 hash name for the job in framework controller, used for debug purpose"}},"required":["name","jobStatus","taskRoles"]},"contentType":"application/json"}}},{"description":"Get nonexist job detail","operation":{"parameters":[{"type":"raw","value":"sdk_test"},{"type":"raw","value":"sdk_test_nonexist_job"}],"response":{"statusCode":404,"schema":{"description":"NoJobError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"NoJobError":{"value":{"code":"NoJobError","message":"Job {job} is not found."}}}}}}},"tag":"job","operationId":"getJob"}}],"after":[{"tag":"job","operationId":"updateJobExecutionType","parameters":[{"type":"raw","value":"sdk_test"},{"type":"raw","value":"sdk_test_jobbe30565d"},{"type":"raw","value":"STOP"}]}],"schemas":{"200":{"description":"Succeeded","content":{"application/json":{"schema":{"type":"object","description":"job details","properties":{"name":{"type":"string","description":"job name"},"jobStatus":{"type":"object","description":"job status","properties":{"username":{"type":"string","description":"user name or \"unknown\""},"state":{"type":"string","description":"general job state","enum":["WAITING","RUNNING","STOPPING","STOPPED","SUCCEEDED","FAILED","UNKNOWN"]},"subState":{"type":"string","description":"job state in framework controller","enum":["AttemptCreationPending","AttemptCreationRequested","AttemptPreparing","AttemptRunning","AttemptDeletionPending","AttemptDeletionRequested","AttemptDeleting","AttemptCompleted","Completed"]},"executionType":{"type":"string","description":"start or stop","enum":["START","STOP"]},"retries":{"type":"integer","description":"job retried times"},"retryDetails":{"type":"object","properties":{"user":{"type":"integer"},"platform":{"type":"integer"},"resource":{"type":"integer"}}},"retryDelayTime":{"type":"integer","nullable":true,"description":"retry delay time"},"createdTime":{"type":"integer","description":"job created time, in number of milliseconds since the Unix Epoch."},"completedTime":{"type":"integer","nullable":true,"description":"job completed time, in number of milliseconds since the Unix Epoch."},"appId":{"type":"string","description":"unique id for the job"},"appLaunchedTime":{"type":"integer","nullable":true,"description":"job launched time for last attempt, in number of milliseconds since the Unix Epoch."},"appCompletedTime":{"type":"integer","nullable":true,"description":"job completed time for last attempt, in number of milliseconds since the Unix Epoch. to get durations for last attempt:\n wholeDuration = completedTime - createdTime;\n runningDuration = appCompletedTime - appLaunchedTime;\n waitingDuration = wholeDuration - runningDuration.\nto get durations for all attempts:\n runningDuration = sum(appCompletedTime - appLaunchedTime) for all attempts.\n"},"appExitCode":{"type":"integer","nullable":true,"description":"job exit code"},"appExitSpec":{"type":"object","nullable":true,"description":"job exit spec","properties":{"code":{"type":"integer"},"phrase":{"type":"string"},"issuer":{"type":"string"},"causer":{"type":"string"},"type":{"type":"string"},"stage":{"type":"string"},"behavior":{"type":"string"},"reaction":{"type":"string"},"repro":{"type":"array","items":{"type":"string"}}}},"appExitDiagnostics":{"type":"string","nullable":true,"description":"job exit diagnostics"},"appExitMessages":{"type":"object","nullable":true,"properties":{"container":{"type":"string","nullable":true},"runtime":{"type":"string","nullable":true},"launcher":{"type":"string","nullable":true}}},"appExitTriggerMessage":{"type":"string","nullable":true,"description":"job completion message"},"appExitTriggerTaskRoleName":{"type":"string","nullable":true,"description":"task role name which triggered job completion"},"appExitTriggerTaskIndex":{"type":"integer","nullable":true,"description":"task index which triggered job completion"},"appExitType":{"type":"string","nullable":true,"description":"job completion type"},"virtualCluster":{"type":"string","description":"virtual cluster to which the job submitted, or \"unknown\""}},"required":["username","virtualCluster","state","subState","executionType","retries","createdTime","completedTime","appId","appLaunchedTime","appCompletedTime","appExitCode"]},"taskRoles":{"type":"object","additionalProperties":{"type":"object","description":"task role status","properties":{"taskRoleStatus":{"type":"object","properties":{"name":{"type":"string","description":"task role name"}},"required":["name"]},"taskStatuses":{"type":"array","description":"task statuses in the task role","items":{"type":"object","properties":{"taskIndex":{"type":"integer","description":"task index"},"taskState":{"type":"string","description":"task state","enum":["WAITING","RUNNING","STOPPING","STOPPED","SUCCEEDED","FAILED","UNKNOWN"]},"containerId":{"type":"string","description":"uid of the task container"},"containerIp":{"type":"string","description":"ip of the task container"},"containerPorts":{"type":"object","description":"ports of the task container"},"containerGpus":{"type":"string","nullable":true,"description":"gpu of the task container"},"containerLog":{"type":"string","description":"log url of the task container"},"containerExitCode":{"type":"integer","nullable":true,"description":"exit code the task container"}}}}},"required":["taskRoleStatus","taskStatuses"]}},"debugId":{"type":"string","description":"md5 hash name for the job in framework controller, used for debug purpose"}},"required":["name","jobStatus","taskRoles"]},"example":{"name":"job name","jobStatus":{"username":"user name","state":"SUCCEEDED","subState":"Completed","executionType":"STOP","retries":0,"createdTime":0,"completedTime":0,"appId":"id","appLaunchedTime":0,"appCompletedTime":0,"appExitCode":0,"virtualCluster":"unknown"},"taskRoles":{"taskrole":{"taskRoleStatus":{"name":"task role name"},"taskStatuses":[{"taskIndex":0,"taskState":"SUCCEEDED"}]}}}}}},"404":{"description":"NoJobError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"NoJobError":{"value":{"code":"NoJobError","message":"Job {job} is not found."}}}}}},"500":{"description":"UnknownError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"UnknownError":{"value":{"code":"UnknownError","message":"Internal error message."}}}}}}},"description":"get /api/v2/jobs/{user}~{job}"},{"before":[{"tag":"job","operationId":"createJob","parameters":[{"type":"raw","value":{"contributor":"OpenPAI","description":"# Serving a TensorFlow MNIST Digit Recognition Model\nThis example shows you how to use TensorFlow Serving components to export a trained TensorFlow model\nand use the standard tensorflow_model_server to serve it on OpenPAI.\nThis example uses the simple Softmax Regression model introduced in the TensorFlow tutorial for handwritten image (MNIST data) classification.\nReference https://www.tensorflow.org/tfx/serving/serving_basic.\n","name":"sdk_test_job1ff7f5d3","parameters":{"modelPath":"/tmp/mnist_model"},"prerequisites":[{"contributor":"OpenPAI","description":"This is an [example TensorFlow Serving Docker image on OpenPAI](https://github.com/Microsoft/pai/tree/master/examples/serving).\n","name":"tf_serving_example","protocolVersion":2,"type":"dockerimage","uri":"openpai/pai.example.tensorflow-serving","version":"1.0-r1.4"}],"protocolVersion":2,"taskRoles":{"worker":{"commands":["bazel-bin/tensorflow_serving/example/mnist_saved_model <% $parameters.modelPath %>","tensorflow_model_server --port=$PAI_CONTAINER_HOST_model_server_PORT_LIST --model_name=mnist --model_base_path=<% $parameters.modelPath %>"],"dockerImage":"tf_serving_example","instances":1,"resourcePerInstance":{"cpu":4,"gpu":1,"memoryMB":8192,"ports":{"model_server":1}}}},"type":"job","version":"1.0"}}]}],"tests":[{"description":"Get a job config","operation":{"parameters":[{"type":"raw","value":"sdk_test"},{"type":"raw","value":"sdk_test_job1ff7f5d3"}],"tag":"job","operationId":"getJobConfig","response":{"statusCode":200,"schema":{"type":"object","description":"openpai job protocol","properties":{"protocolVersion":{"oneOf":[{"type":"number"},{"type":"string"}],"description":"Protocol version, current version is 2."},"name":{"type":"string","maxLength":255,"description":"String in ^[a-zA-Z0-9_-]+$ format, no longer than 255 characters."},"type":{"type":"string","description":"Component type, should be \"job\" here."},"version":{"type":"string","description":"Component version, default is latest."},"contributor":{"type":"string"},"description":{"type":"string"},"prerequisites":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"type":{"type":"string","enum":["data","script","dockerimage","output"]},"version":{"type":"string"},"contributor":{"type":"string"},"description":{"type":"string"},"auth":{"type":"object","properties":{"username":{"type":"string"},"password":{"type":"string"},"registryuri":{"type":"string"}}},"uri":{"oneOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}]}}}},"parameters":{"type":"object","additionalProperties":true},"secrets":{"type":"object","additionalProperties":true},"jobRetryCount":{"type":"integer","description":"Default is 0."},"taskRoles":{"type":"object","additionalProperties":{"type":"object","properties":{"instances":{"type":"integer","description":"Default is 1, instances of a taskRole, no less than 1."},"completion":{"type":"object","description":"Completion poclicy for the job.","properties":{"minFailedInstances":{"type":"integer"},"minSucceededInstances":{"type":"integer"}}},"taskRetryCount":{"type":"integer","description":"Default is 0."},"dockerImage":{"type":"string","description":"Should reference to a dockerimage defined in prerequisites."},"data":{"type":"string"},"output":{"type":"string"},"script":{"type":"string"},"extraContainerOptions":{"type":"object","properties":{"shmMB":{"type":"integer","description":"Config the /dev/shm in a docker container."},"infiniband":{"type":"boolean","description":"Use InfiniBand devices or not in a docker container."}}},"resourcePerInstance":{"type":"object","properties":{"cpu":{"type":"integer","description":"CPU number, unit is CPU vcore."},"memoryMB":{"type":"integer","description":"Memory number, unit is MB."},"gpu":{"type":"integer","description":"GPU number, unit is GPU card."},"ports":{"type":"object","additionalProperties":{"type":"integer","description":"Port number for the port label."}}}},"commands":{"type":"array","items":{"type":"string"}}},"required":["dockerImage","resourcePerInstance","commands"]}},"deployments":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"taskRoles":{"type":"object","additionalProperties":{"type":"object","properties":{"preCommands":{"type":"array","items":{"type":"string"}},"postCommands":{"type":"array","items":{"type":"string"}}}}}}}},"defaults":{"type":"object","description":"Default cluster specific settings.","properties":{"virtualCluster":{"type":"string"},"deployment":{"type":"string"}}},"extras":{"type":"object","description":"Extra field, save any information that plugin may use.","properties":{"submitFrom":{"type":"string"},"hivedScheduler":{"type":"object","properties":{"jobPriorityClass":{"type":"string"},"taskRoles":{"type":"object","additionalProperties":{"type":"object","properties":{"skuType":{"type":"string"},"affinityGroupName":{"type":"string"}}}}}}}}},"required":["protocolVersion","name","type","taskRoles"]},"contentType":"text/yaml"}}},{"description":"Get nonexist job config","operation":{"parameters":[{"type":"raw","value":"sdk_test"},{"type":"raw","value":"sdk_test_nonexist_job"}],"response":{"statusCode":404,"schema":{"description":"NoJobError or NoJobConfigError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"NoJobError":{"value":{"code":"NoJobError","message":"Job {job} is not found."}},"NoJobConfigError":{"value":{"code":"NoJobConfigError","message":"Config of job {job} is not found."}}}}}}},"tag":"job","operationId":"getJobConfig"}}],"after":[{"tag":"job","operationId":"updateJobExecutionType","parameters":[{"type":"raw","value":"sdk_test"},{"type":"raw","value":"sdk_test_job1ff7f5d3"},{"type":"raw","value":"STOP"}]}],"schemas":{"200":{"description":"Succeeded","content":{"text/yaml":{"schema":{"type":"object","description":"openpai job protocol","properties":{"protocolVersion":{"oneOf":[{"type":"number"},{"type":"string"}],"description":"Protocol version, current version is 2."},"name":{"type":"string","maxLength":255,"description":"String in ^[a-zA-Z0-9_-]+$ format, no longer than 255 characters."},"type":{"type":"string","description":"Component type, should be \"job\" here."},"version":{"type":"string","description":"Component version, default is latest."},"contributor":{"type":"string"},"description":{"type":"string"},"prerequisites":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"type":{"type":"string","enum":["data","script","dockerimage","output"]},"version":{"type":"string"},"contributor":{"type":"string"},"description":{"type":"string"},"auth":{"type":"object","properties":{"username":{"type":"string"},"password":{"type":"string"},"registryuri":{"type":"string"}}},"uri":{"oneOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}]}}}},"parameters":{"type":"object","additionalProperties":true},"secrets":{"type":"object","additionalProperties":true},"jobRetryCount":{"type":"integer","description":"Default is 0."},"taskRoles":{"type":"object","additionalProperties":{"type":"object","properties":{"instances":{"type":"integer","description":"Default is 1, instances of a taskRole, no less than 1."},"completion":{"type":"object","description":"Completion poclicy for the job.","properties":{"minFailedInstances":{"type":"integer"},"minSucceededInstances":{"type":"integer"}}},"taskRetryCount":{"type":"integer","description":"Default is 0."},"dockerImage":{"type":"string","description":"Should reference to a dockerimage defined in prerequisites."},"data":{"type":"string"},"output":{"type":"string"},"script":{"type":"string"},"extraContainerOptions":{"type":"object","properties":{"shmMB":{"type":"integer","description":"Config the /dev/shm in a docker container."},"infiniband":{"type":"boolean","description":"Use InfiniBand devices or not in a docker container."}}},"resourcePerInstance":{"type":"object","properties":{"cpu":{"type":"integer","description":"CPU number, unit is CPU vcore."},"memoryMB":{"type":"integer","description":"Memory number, unit is MB."},"gpu":{"type":"integer","description":"GPU number, unit is GPU card."},"ports":{"type":"object","additionalProperties":{"type":"integer","description":"Port number for the port label."}}}},"commands":{"type":"array","items":{"type":"string"}}},"required":["dockerImage","resourcePerInstance","commands"]}},"deployments":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"taskRoles":{"type":"object","additionalProperties":{"type":"object","properties":{"preCommands":{"type":"array","items":{"type":"string"}},"postCommands":{"type":"array","items":{"type":"string"}}}}}}}},"defaults":{"type":"object","description":"Default cluster specific settings.","properties":{"virtualCluster":{"type":"string"},"deployment":{"type":"string"}}},"extras":{"type":"object","description":"Extra field, save any information that plugin may use.","properties":{"submitFrom":{"type":"string"},"hivedScheduler":{"type":"object","properties":{"jobPriorityClass":{"type":"string"},"taskRoles":{"type":"object","additionalProperties":{"type":"object","properties":{"skuType":{"type":"string"},"affinityGroupName":{"type":"string"}}}}}}}}},"required":["protocolVersion","name","type","taskRoles"]}}}},"404":{"description":"NoJobError or NoJobConfigError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"NoJobError":{"value":{"code":"NoJobError","message":"Job {job} is not found."}},"NoJobConfigError":{"value":{"code":"NoJobConfigError","message":"Config of job {job} is not found."}}}}}},"500":{"description":"UnknownError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"UnknownError":{"value":{"code":"UnknownError","message":"Internal error message."}}}}}}},"description":"get /api/v2/jobs/{user}~{job}/config"},{"before":[{"tag":"job","operationId":"createJob","parameters":[{"type":"raw","value":{"contributor":"OpenPAI","description":"# Serving a TensorFlow MNIST Digit Recognition Model\nThis example shows you how to use TensorFlow Serving components to export a trained TensorFlow model\nand use the standard tensorflow_model_server to serve it on OpenPAI.\nThis example uses the simple Softmax Regression model introduced in the TensorFlow tutorial for handwritten image (MNIST data) classification.\nReference https://www.tensorflow.org/tfx/serving/serving_basic.\n","name":"sdk_test_jobe5b9a31a","parameters":{"modelPath":"/tmp/mnist_model"},"prerequisites":[{"contributor":"OpenPAI","description":"This is an [example TensorFlow Serving Docker image on OpenPAI](https://github.com/Microsoft/pai/tree/master/examples/serving).\n","name":"tf_serving_example","protocolVersion":2,"type":"dockerimage","uri":"openpai/pai.example.tensorflow-serving","version":"1.0-r1.4"}],"protocolVersion":2,"taskRoles":{"worker":{"commands":["bazel-bin/tensorflow_serving/example/mnist_saved_model <% $parameters.modelPath %>","tensorflow_model_server --port=$PAI_CONTAINER_HOST_model_server_PORT_LIST --model_name=mnist --model_base_path=<% $parameters.modelPath %>"],"dockerImage":"tf_serving_example","instances":1,"resourcePerInstance":{"cpu":4,"gpu":1,"memoryMB":8192,"ports":{"model_server":1}}}},"type":"job","version":"1.0"}}]}],"tests":[{"description":"update job execution type to STOP","operation":{"tag":"job","operationId":"updateJobExecutionType","parameters":[{"type":"raw","value":"sdk_test"},{"type":"raw","value":"sdk_test_jobe5b9a31a"},{"type":"raw","value":"STOP"}],"response":{"statusCode":202,"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"contentType":"application/json"}}},{"description":"update job execution type to START","operation":{"tag":"job","operationId":"updateJobExecutionType","parameters":[{"type":"raw","value":"sdk_test"},{"type":"raw","value":"sdk_test_jobe5b9a31a"},{"type":"raw","value":"START"}],"response":{"statusCode":202,"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"contentType":"application/json"}}}],"after":[{"tag":"job","operationId":"updateJobExecutionType","parameters":[{"type":"raw","value":"sdk_test"},{"type":"raw","value":"sdk_test_jobe5b9a31a"},{"type":"raw","value":"STOP"}]}],"schemas":{"202":{"description":"Succeeded","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"example":{"message":"execute job {job} successfully"}}}},"404":{"description":"NoJobError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"NoJobError":{"value":{"code":"NoJobError","message":"Job {job} is not found."}}}}}},"500":{"description":"UnknownError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"UnknownError":{"value":{"code":"UnknownError","message":"Internal error message."}}}}}}},"description":"put /api/v2/jobs/{user}~{job}/exectionType"},{"description":"get /api/v2/jobs/{user}~{job}/job-attempts/healthz","tests":[{"operation":{"tag":"job history","operationId":"getJobAttemptsHealthz","parameters":[],"response":{"statusCode":200}}}],"schemas":{"200":{"description":"OK"},"501":{"description":"Not healthy"}}},{"before":[{"tag":"job","operationId":"createJob","parameters":[{"type":"raw","value":{"contributor":"OpenPAI","description":"# Serving a TensorFlow MNIST Digit Recognition Model\nThis example shows you how to use TensorFlow Serving components to export a trained TensorFlow model\nand use the standard tensorflow_model_server to serve it on OpenPAI.\nThis example uses the simple Softmax Regression model introduced in the TensorFlow tutorial for handwritten image (MNIST data) classification.\nReference https://www.tensorflow.org/tfx/serving/serving_basic.\n","name":"sdk_test_job63860926","parameters":{"modelPath":"/tmp/mnist_model"},"prerequisites":[{"contributor":"OpenPAI","description":"This is an [example TensorFlow Serving Docker image on OpenPAI](https://github.com/Microsoft/pai/tree/master/examples/serving).\n","name":"tf_serving_example","protocolVersion":2,"type":"dockerimage","uri":"openpai/pai.example.tensorflow-serving","version":"1.0-r1.4"}],"protocolVersion":2,"taskRoles":{"worker":{"commands":["bazel-bin/tensorflow_serving/example/mnist_saved_model <% $parameters.modelPath %>","tensorflow_model_server --port=$PAI_CONTAINER_HOST_model_server_PORT_LIST --model_name=mnist --model_base_path=<% $parameters.modelPath %>"],"dockerImage":"tf_serving_example","instances":1,"resourcePerInstance":{"cpu":4,"gpu":1,"memoryMB":8192,"ports":{"model_server":1}}}},"type":"job","version":"1.0"}}]}],"tests":[{"operation":{"parameters":[{"type":"raw","value":"sdk_test"},{"type":"raw","value":"sdk_test_job63860926"}],"tag":"job history","operationId":"getJobAttempts","response":{"statusCode":200,"schema":{"type":"array","items":{"type":"object","description":"job attempt","properties":{"jobName":{"type":"string"},"frameworkName":{"type":"string"},"uid":{"type":"string"},"userName":{"type":"string"},"state":{"type":"string"},"originState":{"type":"string"},"maxAttemptCount":{"type":"integer"},"attemptIndex":{"type":"integer"},"jobStartedTime":{"type":"integer"},"attemptStartedTime":{"type":"integer"},"attemptCompletedTime":{"type":"integer","nullable":true},"exitCode":{"type":"integer","nullable":true},"exitPhrase":{"type":"string","nullable":true},"exitType":{"type":"string","nullable":true},"exitDiagnostics":{"type":"object","nullable":true,"properties":{"diagnosticsSummary":{"type":"string"},"runtime":{"type":"object","nullable":true,"properties":{"exitCode":{"type":"integer","nullable":true},"originUserExitCode":{"type":"integer","nullable":true},"errorLogs":{"type":"object","nullable":true,"properties":{"user":{"type":"string"},"platform":{"type":"string"}}},"name":{"type":"string"}}},"launcher":{"type":"string"}}},"appExitTriggerMessage":{"type":"string","nullable":true},"appExitTriggerTaskRoleName":{"type":"string","nullable":true},"appExitTriggerTaskIndex":{"type":"integer","nullable":true},"appExitSpec":{"type":"object","nullable":true,"properties":{"code":{"type":"integer"},"phrase":{"type":"string"},"issuer":{"type":"string"},"causer":{"type":"string"},"type":{"type":"string"},"stage":{"type":"string"},"behavior":{"type":"string"},"reaction":{"type":"string"},"reason":{"type":"string"},"repro":{"type":"array","items":{"type":"string"}},"solution":{"type":"array","items":{"type":"string"}}}},"appExitDiagnostics":{"type":"string","nullable":true},"appExitMessages":{"type":"object","nullable":true,"properties":{"container":{"type":"string","nullable":true},"runtime":{"type":"object","nullable":true,"properties":{"exitCode":{"type":"integer","nullable":true},"originUserExitCode":{"type":"integer","nullable":true},"errorLogs":{"type":"object","nullable":true,"properties":{"user":{"type":"string"},"platform":{"type":"string"}}},"name":{"type":"string"}}},"launcher":{"type":"string","nullable":true}}},"totalGpuNumber":{"type":"integer"},"totalTasknumber":{"type":"integer"},"totalTaskRoleNumber":{"type":"integer"},"taskRoles":{"type":"object","properties":{"taskrole":{"type":"object","properties":{"taskRoleStatus":{"type":"object","properties":{"name":{"type":"string"}},"required":["name"]},"taskStatuses":{"type":"array","items":{"type":"object","properties":{"taskIndex":{"type":"integer"},"taskState":{"type":"string","enum":["WAITING","RUNNING","STOPPING","STOPPED","SUCCEEDED","FAILED","UNKNOWN"]},"containerId":{"type":"string"},"containerIp":{"type":"string"},"containerGpus":{"type":"string","nullable":true},"containerLog":{"type":"string"},"containerExitCode":{"type":"integer","nullable":true}}}}},"required":["taskRoleStatus","taskStatuses"]}}},"isLatest":{"type":"boolean"}}},"description":"job attempts"},"contentType":"application/json"}}}],"after":[{"tag":"job","operationId":"updateJobExecutionType","parameters":[{"type":"raw","value":"sdk_test"},{"type":"raw","value":"sdk_test_job63860926"},{"type":"raw","value":"STOP"}]}],"schemas":{"200":{"description":"Succeeded","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","description":"job attempt","properties":{"jobName":{"type":"string"},"frameworkName":{"type":"string"},"uid":{"type":"string"},"userName":{"type":"string"},"state":{"type":"string"},"originState":{"type":"string"},"maxAttemptCount":{"type":"integer"},"attemptIndex":{"type":"integer"},"jobStartedTime":{"type":"integer"},"attemptStartedTime":{"type":"integer"},"attemptCompletedTime":{"type":"integer","nullable":true},"exitCode":{"type":"integer","nullable":true},"exitPhrase":{"type":"string","nullable":true},"exitType":{"type":"string","nullable":true},"exitDiagnostics":{"type":"object","nullable":true,"properties":{"diagnosticsSummary":{"type":"string"},"runtime":{"type":"object","nullable":true,"properties":{"exitCode":{"type":"integer","nullable":true},"originUserExitCode":{"type":"integer","nullable":true},"errorLogs":{"type":"object","nullable":true,"properties":{"user":{"type":"string"},"platform":{"type":"string"}}},"name":{"type":"string"}}},"launcher":{"type":"string"}}},"appExitTriggerMessage":{"type":"string","nullable":true},"appExitTriggerTaskRoleName":{"type":"string","nullable":true},"appExitTriggerTaskIndex":{"type":"integer","nullable":true},"appExitSpec":{"type":"object","nullable":true,"properties":{"code":{"type":"integer"},"phrase":{"type":"string"},"issuer":{"type":"string"},"causer":{"type":"string"},"type":{"type":"string"},"stage":{"type":"string"},"behavior":{"type":"string"},"reaction":{"type":"string"},"reason":{"type":"string"},"repro":{"type":"array","items":{"type":"string"}},"solution":{"type":"array","items":{"type":"string"}}}},"appExitDiagnostics":{"type":"string","nullable":true},"appExitMessages":{"type":"object","nullable":true,"properties":{"container":{"type":"string","nullable":true},"runtime":{"type":"object","nullable":true,"properties":{"exitCode":{"type":"integer","nullable":true},"originUserExitCode":{"type":"integer","nullable":true},"errorLogs":{"type":"object","nullable":true,"properties":{"user":{"type":"string"},"platform":{"type":"string"}}},"name":{"type":"string"}}},"launcher":{"type":"string","nullable":true}}},"totalGpuNumber":{"type":"integer"},"totalTasknumber":{"type":"integer"},"totalTaskRoleNumber":{"type":"integer"},"taskRoles":{"type":"object","properties":{"taskrole":{"type":"object","properties":{"taskRoleStatus":{"type":"object","properties":{"name":{"type":"string"}},"required":["name"]},"taskStatuses":{"type":"array","items":{"type":"object","properties":{"taskIndex":{"type":"integer"},"taskState":{"type":"string","enum":["WAITING","RUNNING","STOPPING","STOPPED","SUCCEEDED","FAILED","UNKNOWN"]},"containerId":{"type":"string"},"containerIp":{"type":"string"},"containerGpus":{"type":"string","nullable":true},"containerLog":{"type":"string"},"containerExitCode":{"type":"integer","nullable":true}}}}},"required":["taskRoleStatus","taskStatuses"]}}},"isLatest":{"type":"boolean"}}},"description":"job attempts"}}}},"404":{"description":"NoJobError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"NoJobError":{"value":{"code":"NoJobError","message":"Job {job} is not found."}}}}}},"501":{"description":"UnknownError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"UnknownError":{"value":{"code":"UnknownError","message":"Internal error message."}}}}}}},"description":"get /api/v2/jobs/{user}~{job}/job-attempts"},{"before":[{"tag":"job","operationId":"createJob","parameters":[{"type":"raw","value":{"contributor":"OpenPAI","description":"# Serving a TensorFlow MNIST Digit Recognition Model\nThis example shows you how to use TensorFlow Serving components to export a trained TensorFlow model\nand use the standard tensorflow_model_server to serve it on OpenPAI.\nThis example uses the simple Softmax Regression model introduced in the TensorFlow tutorial for handwritten image (MNIST data) classification.\nReference https://www.tensorflow.org/tfx/serving/serving_basic.\n","name":"sdk_test_job6f60ffd7","parameters":{"modelPath":"/tmp/mnist_model"},"prerequisites":[{"contributor":"OpenPAI","description":"This is an [example TensorFlow Serving Docker image on OpenPAI](https://github.com/Microsoft/pai/tree/master/examples/serving).\n","name":"tf_serving_example","protocolVersion":2,"type":"dockerimage","uri":"openpai/pai.example.tensorflow-serving","version":"1.0-r1.4"}],"protocolVersion":2,"taskRoles":{"worker":{"commands":["bazel-bin/tensorflow_serving/example/mnist_saved_model <% $parameters.modelPath %>","tensorflow_model_server --port=$PAI_CONTAINER_HOST_model_server_PORT_LIST --model_name=mnist --model_base_path=<% $parameters.modelPath %>"],"dockerImage":"tf_serving_example","instances":1,"resourcePerInstance":{"cpu":4,"gpu":1,"memoryMB":8192,"ports":{"model_server":1}}}},"type":"job","version":"1.0"}}]}],"tests":[{"operation":{"parameters":[{"type":"raw","value":"sdk_test"},{"type":"raw","value":"sdk_test_job6f60ffd7"},{"type":"raw","value":0}],"tag":"job history","operationId":"getJobAttempt","response":{"statusCode":200,"schema":{"type":"object","description":"job attempt","properties":{"jobName":{"type":"string"},"frameworkName":{"type":"string"},"uid":{"type":"string"},"userName":{"type":"string"},"state":{"type":"string"},"originState":{"type":"string"},"maxAttemptCount":{"type":"integer"},"attemptIndex":{"type":"integer"},"jobStartedTime":{"type":"integer"},"attemptStartedTime":{"type":"integer"},"attemptCompletedTime":{"type":"integer","nullable":true},"exitCode":{"type":"integer","nullable":true},"exitPhrase":{"type":"string","nullable":true},"exitType":{"type":"string","nullable":true},"exitDiagnostics":{"type":"object","nullable":true,"properties":{"diagnosticsSummary":{"type":"string"},"runtime":{"type":"object","nullable":true,"properties":{"exitCode":{"type":"integer","nullable":true},"originUserExitCode":{"type":"integer","nullable":true},"errorLogs":{"type":"object","nullable":true,"properties":{"user":{"type":"string"},"platform":{"type":"string"}}},"name":{"type":"string"}}},"launcher":{"type":"string"}}},"appExitTriggerMessage":{"type":"string","nullable":true},"appExitTriggerTaskRoleName":{"type":"string","nullable":true},"appExitTriggerTaskIndex":{"type":"integer","nullable":true},"appExitSpec":{"type":"object","nullable":true,"properties":{"code":{"type":"integer"},"phrase":{"type":"string"},"issuer":{"type":"string"},"causer":{"type":"string"},"type":{"type":"string"},"stage":{"type":"string"},"behavior":{"type":"string"},"reaction":{"type":"string"},"reason":{"type":"string"},"repro":{"type":"array","items":{"type":"string"}},"solution":{"type":"array","items":{"type":"string"}}}},"appExitDiagnostics":{"type":"string","nullable":true},"appExitMessages":{"type":"object","nullable":true,"properties":{"container":{"type":"string","nullable":true},"runtime":{"type":"object","nullable":true,"properties":{"exitCode":{"type":"integer","nullable":true},"originUserExitCode":{"type":"integer","nullable":true},"errorLogs":{"type":"object","nullable":true,"properties":{"user":{"type":"string"},"platform":{"type":"string"}}},"name":{"type":"string"}}},"launcher":{"type":"string","nullable":true}}},"totalGpuNumber":{"type":"integer"},"totalTasknumber":{"type":"integer"},"totalTaskRoleNumber":{"type":"integer"},"taskRoles":{"type":"object","properties":{"taskrole":{"type":"object","properties":{"taskRoleStatus":{"type":"object","properties":{"name":{"type":"string"}},"required":["name"]},"taskStatuses":{"type":"array","items":{"type":"object","properties":{"taskIndex":{"type":"integer"},"taskState":{"type":"string","enum":["WAITING","RUNNING","STOPPING","STOPPED","SUCCEEDED","FAILED","UNKNOWN"]},"containerId":{"type":"string"},"containerIp":{"type":"string"},"containerGpus":{"type":"string","nullable":true},"containerLog":{"type":"string"},"containerExitCode":{"type":"integer","nullable":true}}}}},"required":["taskRoleStatus","taskStatuses"]}}},"isLatest":{"type":"boolean"}}},"contentType":"application/json"}}}],"after":[{"tag":"job","operationId":"updateJobExecutionType","parameters":[{"type":"raw","value":"sdk_test"},{"type":"raw","value":"sdk_test_job6f60ffd7"},{"type":"raw","value":"STOP"}]}],"schemas":{"200":{"description":"Succeeded","content":{"application/json":{"schema":{"type":"object","description":"job attempt","properties":{"jobName":{"type":"string"},"frameworkName":{"type":"string"},"uid":{"type":"string"},"userName":{"type":"string"},"state":{"type":"string"},"originState":{"type":"string"},"maxAttemptCount":{"type":"integer"},"attemptIndex":{"type":"integer"},"jobStartedTime":{"type":"integer"},"attemptStartedTime":{"type":"integer"},"attemptCompletedTime":{"type":"integer","nullable":true},"exitCode":{"type":"integer","nullable":true},"exitPhrase":{"type":"string","nullable":true},"exitType":{"type":"string","nullable":true},"exitDiagnostics":{"type":"object","nullable":true,"properties":{"diagnosticsSummary":{"type":"string"},"runtime":{"type":"object","nullable":true,"properties":{"exitCode":{"type":"integer","nullable":true},"originUserExitCode":{"type":"integer","nullable":true},"errorLogs":{"type":"object","nullable":true,"properties":{"user":{"type":"string"},"platform":{"type":"string"}}},"name":{"type":"string"}}},"launcher":{"type":"string"}}},"appExitTriggerMessage":{"type":"string","nullable":true},"appExitTriggerTaskRoleName":{"type":"string","nullable":true},"appExitTriggerTaskIndex":{"type":"integer","nullable":true},"appExitSpec":{"type":"object","nullable":true,"properties":{"code":{"type":"integer"},"phrase":{"type":"string"},"issuer":{"type":"string"},"causer":{"type":"string"},"type":{"type":"string"},"stage":{"type":"string"},"behavior":{"type":"string"},"reaction":{"type":"string"},"reason":{"type":"string"},"repro":{"type":"array","items":{"type":"string"}},"solution":{"type":"array","items":{"type":"string"}}}},"appExitDiagnostics":{"type":"string","nullable":true},"appExitMessages":{"type":"object","nullable":true,"properties":{"container":{"type":"string","nullable":true},"runtime":{"type":"object","nullable":true,"properties":{"exitCode":{"type":"integer","nullable":true},"originUserExitCode":{"type":"integer","nullable":true},"errorLogs":{"type":"object","nullable":true,"properties":{"user":{"type":"string"},"platform":{"type":"string"}}},"name":{"type":"string"}}},"launcher":{"type":"string","nullable":true}}},"totalGpuNumber":{"type":"integer"},"totalTasknumber":{"type":"integer"},"totalTaskRoleNumber":{"type":"integer"},"taskRoles":{"type":"object","properties":{"taskrole":{"type":"object","properties":{"taskRoleStatus":{"type":"object","properties":{"name":{"type":"string"}},"required":["name"]},"taskStatuses":{"type":"array","items":{"type":"object","properties":{"taskIndex":{"type":"integer"},"taskState":{"type":"string","enum":["WAITING","RUNNING","STOPPING","STOPPED","SUCCEEDED","FAILED","UNKNOWN"]},"containerId":{"type":"string"},"containerIp":{"type":"string"},"containerGpus":{"type":"string","nullable":true},"containerLog":{"type":"string"},"containerExitCode":{"type":"integer","nullable":true}}}}},"required":["taskRoleStatus","taskStatuses"]}}},"isLatest":{"type":"boolean"}}}}}},"404":{"description":"NoJobError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"NoJobError":{"value":{"code":"NoJobError","message":"Job {job} is not found."}}}}}},"501":{"description":"UnknownError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"UnknownError":{"value":{"code":"UnknownError","message":"Internal error message."}}}}}}},"description":"get /api/v2/jobs/{user}~{job}/job-attempts/{attemptIndex}"},{"description":"get /api/v2/kubernetes/nodes","tests":[{"operation":{"tag":"kubernetes","operationId":"getK8sNodes","parameters":[],"response":{"statusCode":200}}}],"schemas":{"200":{"description":"Succeeded","content":{"application/json":{"example":["Please refer to Kubernetes API doc","https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.17/#list-node-v1-core"]}}},"401":{"description":"UnauthorizedUserError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"UnauthorizedUserError":{"value":{"code":"UnauthorizedUserError","message":"Guest is not allowed to do this operation."}}}}}},"403":{"description":"ForbiddenUserError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"ForbiddenUserError":{"value":{"code":"ForbiddenUserError","message":"Non-admin is not allow to do this operation."}},"ForbiddenTokenError":{"value":{"code":"ForbiddenUserError","message":"Applications are not allowed to do this operation."}}}}}}}},{"description":"get /api/v2/kubernetes/pods","tests":[{"operation":{"tag":"kubernetes","operationId":"getK8sPods","parameters":[],"response":{"statusCode":200}}}],"schemas":{"200":{"description":"Succeeded","content":{"application/json":{"example":["Please refer to Kubernetes API doc","https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.17/#list-all-namespaces-pod-v1-core"]}}},"401":{"description":"UnauthorizedUserError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"UnauthorizedUserError":{"value":{"code":"UnauthorizedUserError","message":"Guest is not allowed to do this operation."}}}}}},"403":{"description":"ForbiddenUserError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"ForbiddenUserError":{"value":{"code":"ForbiddenUserError","message":"Non-admin is not allow to do this operation."}},"ForbiddenTokenError":{"value":{"code":"ForbiddenUserError","message":"Applications are not allowed to do this operation."}}}}}}}}],"map":{"getClusterInfo":{"path":"/api/v2/info","method":"get","examples":{"200":{"name":"PAI RESTful API","version":"v1.0.1","launcherType":"k8s","authnMethod":"basic"}}},"getTokens":{"path":"/api/v2/tokens","method":"get","examples":{"200":{"tokens":["JWT Token Example"]},"401":{"value":{"code":"UnauthorizedUserError","message":"Guest is not allowed to do this operation."}}}},"deleteToken":{"path":"/api/v2/tokens/{token}","method":"delete","examples":{"200":{"message":"revoke successfully"},"401":{"value":{"code":"UnauthorizedUserError","message":"Guest is not allowed to do this operation."}},"403":{"value":{"code":"ForbiddenUserError","message":"Non-admin is not allow to do this operation."}}}},"createApplicationToken":{"path":"/api/v2/tokens/application","method":"post","examples":{"200":{"token":"JWT Token Example","application":true},"401":{"value":{"code":"UnauthorizedUserError","message":"Guest is not allowed to do this operation."}}}},"oidcLogin":{"path":"/api/v2/authn/oidc/login","method":"get","examples":{}},"oidcLogout":{"path":"/api/v2/authn/oidc/logout","method":"get","examples":{}},"basicLogin":{"path":"/api/v2/authn/basic/login","method":"post","examples":{"200":{"token":"JWT Token Example","user":"user","admin":true},"404":{"value":{"code":"NoUserError","message":"User {user} is not found."}}}},"basicLogout":{"path":"/api/v2/authn/basic/logout","method":"delete","examples":{"200":{"message":"Logout successfully"},"401":{"value":{"code":"UnauthorizedUserError","message":"Guest is not allowed to do this operation."}},"403":{"value":{"code":"ForbiddenUserError","message":"Non-admin is not allow to do this operation."}}}},"createUser":{"path":"/api/v2/users","method":"post","examples":{"201":{"message":"User is created successfully"},"401":{"value":{"code":"UnauthorizedUserError","message":"Guest is not allowed to do this operation."}},"403":{"value":{"code":"ForbiddenUserError","message":"Non-admin is not allow to do this operation."}},"409":{"value":{"code":"ConflictUserError","message":"User name {user} already exists."}},"500":{"value":{"code":"UnknownError","message":"Internal error message."}}}},"getAllUser":{"path":"/api/v2/users","method":"get","examples":{"200":[{"username":"username","admin":true,"virtualCluster":[],"storageConfig":[],"email":"email@test.com","extension":{}}],"500":{"value":{"code":"UnknownError","message":"Internal error message."}}}},"updateUser":{"path":"/api/v2/users","method":"put","examples":{"201":{"message":"update group {username} successfully."},"401":{"value":{"code":"UnauthorizedUserError","message":"Guest is not allowed to do this operation."}},"403":{"value":{"code":"ForbiddenUserError","message":"Non-admin is not allow to do this operation."}},"404":{"value":{"code":"NoUserError","message":"User {user} is not found."}},"500":{"value":{"code":"UnknownError","message":"Internal error message."}}}},"updateUserSelf":{"path":"/api/v2/users/me","method":"put","examples":{"201":{"message":"update group {username} successfully."},"401":{"value":{"code":"UnauthorizedUserError","message":"Guest is not allowed to do this operation."}},"403":{"value":{"code":"ForbiddenUserError","message":"Non-admin is not allow to do this operation."}},"404":{"value":{"code":"NoUserError","message":"User {user} is not found."}},"500":{"value":{"code":"UnknownError","message":"Internal error message."}}}},"getUser":{"path":"/api/v2/users/{user}","method":"get","examples":{"200":{"username":"username","admin":true,"virtualCluster":[],"storageConfig":[],"email":"email@test.com","extension":{}},"401":{"value":{"code":"UnauthorizedUserError","message":"Guest is not allowed to do this operation."}},"404":{"value":{"code":"NoUserError","message":"User {user} is not found."}},"500":{"value":{"code":"UnknownError","message":"Internal error message."}}}},"deleteUser":{"path":"/api/v2/users/{user}","method":"delete","examples":{"200":{"message":"user is removed successfully"},"401":{"value":{"code":"UnauthorizedUserError","message":"Guest is not allowed to do this operation."}},"403":{"value":{"code":"ForbiddenUserError","message":"Non-admin is not allow to do this operation."}},"404":{"value":{"code":"NoUserError","message":"User {user} is not found."}},"500":{"value":{"code":"UnknownError","message":"Internal error message."}}}},"updateUserGroup":{"path":"/api/v2/users/{user}/group/","method":"put","examples":{"201":{"message":"User {username} is added into group {groupname}"},"401":{"value":{"code":"UnauthorizedUserError","message":"Guest is not allowed to do this operation."}},"403":{"value":{"code":"ForbiddenUserError","message":"Non-admin is not allow to do this operation."}},"404":{"value":{"code":"NoUserError","message":"User {user} is not found."}},"500":{"value":{"code":"UnknownError","message":"Internal error message."}}}},"deleteUserGroup":{"path":"/api/v2/users/{user}/group/","method":"delete","examples":{"201":{"message":"User {username} is removed from group {groupname}"},"401":{"value":{"code":"UnauthorizedUserError","message":"Guest is not allowed to do this operation."}},"403":{"value":{"code":"ForbiddenUserError","message":"Non-admin is not allow to do this operation."}},"404":{"value":{"code":"NoUserError","message":"User {user} is not found."}},"500":{"value":{"code":"UnknownError","message":"Internal error message."}}}},"updateUserGrouplist":{"path":"/api/v2/users/{user}/grouplist/","method":"put","examples":{"201":{"message":"update user grouplist successfully."},"401":{"value":{"code":"UnauthorizedUserError","message":"Guest is not allowed to do this operation."}},"403":{"value":{"code":"ForbiddenUserError","message":"Non-admin is not allow to do this operation."}},"404":{"value":{"code":"NoUserError","message":"User {user} is not found."}},"500":{"value":{"code":"UnknownError","message":"Internal error message."}}}},"getAllGroup":{"path":"/api/v2/groups","method":"get","examples":{"200":[{"groupname":"groupName","description":"description","externalName":"externalName","extension":{}}],"500":{"value":{"code":"UnknownError","message":"Internal error message."}}}},"createGroup":{"path":"/api/v2/groups","method":"post","examples":{"201":{"message":"group is created successfully"},"401":{"value":{"code":"UnauthorizedUserError","message":"Guest is not allowed to do this operation."}},"403":{"value":{"code":"ForbiddenUserError","message":"Non-admin is not allow to do this operation."}},"500":{"value":{"code":"UnknownError","message":"Internal error message."}}}},"updateGroup":{"path":"/api/v2/groups","method":"put","examples":{"201":{"message":"update group {groupname} successfully."},"401":{"value":{"code":"UnauthorizedUserError","message":"Guest is not allowed to do this operation."}},"403":{"value":{"code":"ForbiddenUserError","message":"Non-admin is not allow to do this operation."}},"404":{"value":{"code":"NoGroupError","message":"Group {groupname} is not found."}},"500":{"value":{"code":"UnknownError","message":"Internal error message."}}}},"getGroup":{"path":"/api/v2/groups/{group}","method":"get","examples":{"200":{"groupname":"groupName","description":"description","externalName":"externalName","extension":{}},"401":{"value":{"code":"UnauthorizedUserError","message":"Guest is not allowed to do this operation."}},"404":{"value":{"code":"NoGroupError","message":"Group {groupname} is not found."}},"500":{"value":{"code":"UnknownError","message":"Internal error message."}}}},"deleteGroup":{"path":"/api/v2/groups/{group}","method":"delete","examples":{"201":{"message":"group is removed successfully"},"401":{"value":{"code":"UnauthorizedUserError","message":"Guest is not allowed to do this operation."}},"403":{"value":{"code":"ForbiddenUserError","message":"Non-admin is not allow to do this operation."}},"500":{"value":{"code":"UnknownError","message":"Internal error message."}}}},"getGroupMembers":{"path":"/api/v2/groups/{group}/userlist","method":"get","examples":{"200":[{"username":"username","clusterAdmin":false}],"401":{"value":{"code":"UnauthorizedUserError","message":"Guest is not allowed to do this operation."}},"500":{"value":{"code":"UnknownError","message":"Internal error message."}}}},"listVirtualClusters":{"path":"/api/v2/virtual-clusters","method":"get","examples":{"500":{"value":{"code":"UnknownError","message":"Internal error message."}}}},"getVirtualCluster":{"path":"/api/v2/virtual-clusters/{vc}","method":"get","examples":{"200":{"capacity":70,"usedCapacity":30,"dedicated":false,"resourcesUsed":{"cpu":1,"memory":1024,"gpu":1,"vCores":1,"GPUs":1},"resourcesGuaranteed":{"cpu":2,"memory":2048,"gpu":2,"vCores":2,"GPUs":2},"resourcesTotal":{"cpu":2,"memory":2048,"gpu":2,"vCores":2,"GPUs":2},"maxCapacity":70},"404":{"value":{"code":"NoVirtualClusterError","message":"Virtual cluster {vc} is not found."}},"500":{"value":{"code":"UnknownError","message":"Internal error message."}}}},"getStorages":{"path":"/api/v2/storages","method":"get","examples":{"200":{"storages":[{"name":"name","share":true,"volumeName":"volumeName"}]},"500":{"value":{"code":"UnknownError","message":"Internal error message."}}}},"getStorage":{"path":"/api/v2/storages/{storage}","method":"get","examples":{"200":{"name":"nfs-storage-name","share":true,"volumeName":"nfs-volume-name","type":"nfs","data":{"server":"","path":"/data"}},"403":{"value":{"code":"ForbiddenUserError","message":"User {user} is not allowed to access {storage}."}},"404":{"value":{"code":"NoStorageError","message":"Storage {storage} is not found."}},"500":{"value":{"code":"UnknownError","message":"Internal error message."}}}},"createJob":{"path":"/api/v2/jobs","method":"post","examples":{"202":{"message":"update job {job} successfully"},"400":{"value":{"code":"NoVirtualClusterError","message":"Virtual cluster {vc} is not found."}},"403":{"value":{"code":"ForbiddenUserError","message":"Non-admin is not allow to do this operation."}},"409":{"value":{"code":"ConflictJobError","message":"Job name {job} already exists."}},"500":{"value":{"code":"UnknownError","message":"Internal error message."}}}},"listJobs":{"path":"/api/v2/jobs","method":"get","examples":{"200":[{"name":"job name","username":"user name","state":"SUCCEEDED","subState":"Completed","executionType":"STOP","retries":0,"createdTime":0,"completedTime":0,"appExitCode":0,"virtualCluster":"unknown"}],"500":{"value":{"code":"UnknownError","message":"Internal error message."}}}},"getJob":{"path":"/api/v2/jobs/{user}~{job}","method":"get","examples":{"200":{"name":"job name","jobStatus":{"username":"user name","state":"SUCCEEDED","subState":"Completed","executionType":"STOP","retries":0,"createdTime":0,"completedTime":0,"appId":"id","appLaunchedTime":0,"appCompletedTime":0,"appExitCode":0,"virtualCluster":"unknown"},"taskRoles":{"taskrole":{"taskRoleStatus":{"name":"task role name"},"taskStatuses":[{"taskIndex":0,"taskState":"SUCCEEDED"}]}}},"404":{"value":{"code":"NoJobError","message":"Job {job} is not found."}},"500":{"value":{"code":"UnknownError","message":"Internal error message."}}}},"getJobConfig":{"path":"/api/v2/jobs/{user}~{job}/config","method":"get","examples":{"404":{"value":{"code":"NoJobError","message":"Job {job} is not found."}},"500":{"value":{"code":"UnknownError","message":"Internal error message."}}}},"updateJobExecutionType":{"path":"/api/v2/jobs/{user}~{job}/exectionType","method":"put","examples":{"202":{"message":"execute job {job} successfully"},"404":{"value":{"code":"NoJobError","message":"Job {job} is not found."}},"500":{"value":{"code":"UnknownError","message":"Internal error message."}}}},"getJobAttemptsHealthz":{"path":"/api/v2/jobs/{user}~{job}/job-attempts/healthz","method":"get","examples":{}},"getJobAttempts":{"path":"/api/v2/jobs/{user}~{job}/job-attempts","method":"get","examples":{"404":{"value":{"code":"NoJobError","message":"Job {job} is not found."}},"501":{"value":{"code":"UnknownError","message":"Internal error message."}}}},"getJobAttempt":{"path":"/api/v2/jobs/{user}~{job}/job-attempts/{attemptIndex}","method":"get","examples":{"404":{"value":{"code":"NoJobError","message":"Job {job} is not found."}},"501":{"value":{"code":"UnknownError","message":"Internal error message."}}}},"getK8sNodes":{"path":"/api/v2/kubernetes/nodes","method":"get","examples":{"200":["Please refer to Kubernetes API doc","https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.17/#list-node-v1-core"],"401":{"value":{"code":"UnauthorizedUserError","message":"Guest is not allowed to do this operation."}},"403":{"value":{"code":"ForbiddenUserError","message":"Non-admin is not allow to do this operation."}}}},"getK8sPods":{"path":"/api/v2/kubernetes/pods","method":"get","examples":{"200":["Please refer to Kubernetes API doc","https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.17/#list-all-namespaces-pod-v1-core"],"401":{"value":{"code":"UnauthorizedUserError","message":"Guest is not allowed to do this operation."}},"403":{"value":{"code":"ForbiddenUserError","message":"Non-admin is not allow to do this operation."}}}}}} \ No newline at end of file diff --git a/.tests/clusters.json b/.tests/clusters.json index 5c4d7fc..ae614b1 100644 --- a/.tests/clusters.json +++ b/.tests/clusters.json @@ -1,9 +1,9 @@ [ { - "alias": "", - "rest_server_uri": "hostname/rest-server", - "username": "", - "password": "", + "alias": "int", + "rest_server_uri": "openpai.test/rest-server", + "username": "sdk_test", + "password": "pwd", "token": "", "https": true } diff --git a/package.json b/package.json index b9c732d..c4242ed 100644 --- a/package.json +++ b/package.json @@ -15,6 +15,7 @@ "test": "mocha -r ts-node/register -r tsconfig-paths/register tests/unit_tests/**/*.spec.ts", "preapi-test": "ts-node -r tsconfig-paths/register tests/common/apiTestCaseGenerator.ts -- \"src/api/v2/swagger.yaml\" \".tests/apiTestCase.json\"", "api-test": "mocha -r ts-node/register -r tsconfig-paths/register tests/api_tests/**/*.spec.ts -t 20000", + "api-test:mock": "npm run preapi-test && mocha -r ts-node/register -r tsconfig-paths/register tests/unit_tests/v2/v2.specdraft.ts", "prebuild": "tslint --config tslint.json --project tsconfig.build.json", "build": "ttsc -p tsconfig.json" }, @@ -74,4 +75,4 @@ "bin": { "pai": "lib/src/cli.js" } -} \ No newline at end of file +} diff --git a/src/api/v2/swagger.yaml b/src/api/v2/swagger.yaml index 58c6e0b..6dcbc96 100644 --- a/src/api/v2/swagger.yaml +++ b/src/api/v2/swagger.yaml @@ -67,6 +67,11 @@ paths: - version - launcherType - authnMethod + example: + name: 'PAI RESTful API' + version: 'v1.0.1' + launcherType: 'k8s' + authnMethod: 'basic' /api/v2/tokens: get: tags: @@ -91,6 +96,9 @@ paths: description: JWT string list required: - tokens + example: + tokens: + - 'JWT Token Example' '401': $ref: '#/components/responses/UnauthorizedUserError' '/api/v2/tokens/{token}': @@ -143,6 +151,9 @@ paths: application: type: boolean description: 'true' + example: + token: 'JWT Token Example' + application: true '401': $ref: '#/components/responses/UnauthorizedUserError' /api/v2/authn/oidc/login: @@ -215,6 +226,10 @@ paths: - token - user - admin + example: + token: 'JWT Token Example' + user: 'user' + admin: true '400': description: NoUserError or IncorrectPassworkError content: @@ -318,6 +333,13 @@ paths: type: array items: $ref: '#/components/schemas/UserInfo' + example: + - username: username + admin: true + virtualCluster: [] + storageConfig: [] + email: 'email@test.com' + extension: {} '500': $ref: '#/components/responses/UnknownError' put: @@ -487,6 +509,13 @@ paths: application/json: schema: $ref: '#/components/schemas/UserInfo' + example: + username: username + admin: true + virtualCluster: [] + storageConfig: [] + email: 'email@test.com' + extension: {} '401': $ref: '#/components/responses/UnauthorizedUserError' '404': @@ -674,6 +703,11 @@ paths: description: the external group name binding with the group in OpenPAI extension: type: object + example: + - groupname: groupName + description: description + externalName: externalName + extension: {} '500': $ref: '#/components/responses/UnknownError' post: @@ -812,6 +846,11 @@ paths: - description - externalName - extension + example: + groupname: groupName + description: description + externalName: externalName + extension: {} '401': $ref: '#/components/responses/UnauthorizedUserError' '404': @@ -869,6 +908,9 @@ paths: clusterAdmin: type: boolean description: Cluster admin or not. + example: + - username: username + clusterAdmin: false '401': $ref: '#/components/responses/UnauthorizedUserError' '500': @@ -911,6 +953,29 @@ paths: application/json: schema: $ref: '#/components/schemas/VirtualCluster' + example: + capacity: 70 + usedCapacity: 30 + dedicated: false + resourcesUsed: + cpu: 1 + memory: 1024 + gpu: 1 + vCores: 1 + GPUs: 1 + resourcesGuaranteed: + cpu: 2 + memory: 2048 + gpu: 2 + vCores: 2 + GPUs: 2 + resourcesTotal: + cpu: 2 + memory: 2048 + gpu: 2 + vCores: 2 + GPUs: 2 + maxCapacity: 70 '404': $ref: '#/components/responses/NoVirtualClusterError' '500': @@ -937,6 +1002,11 @@ paths: application/json: schema: $ref: '#/components/schemas/StorageSummary' + example: + storages: + - name: name + share: true + volumeName: volumeName '500': $ref: '#/components/responses/UnknownError' '/api/v2/storages/{storage}': @@ -957,6 +1027,14 @@ paths: application/json: schema: $ref: '#/components/schemas/StorageDetail' + example: + name: nfs-storage-name + share: true + volumeName: nfs-volume-name + type: nfs + data: + server: + path: "/data" '403': description: ForbiddenUserError content: @@ -1026,6 +1104,17 @@ paths: application/json: schema: $ref: '#/components/schemas/JobSummary' + example: + - name: job name + username: user name + state: SUCCEEDED + subState: Completed + executionType: STOP + retries: 0 + createdTime: 0 + completedTime: 0 + appExitCode: 0 + virtualCluster: unknown '500': $ref: '#/components/responses/UnknownError' '/api/v2/jobs/{user}~{job}': @@ -1047,6 +1136,28 @@ paths: application/json: schema: $ref: '#/components/schemas/JobDetail' + example: + name: job name + jobStatus: + username: user name + state: SUCCEEDED + subState: Completed + executionType: STOP + retries: 0 + createdTime: 0 + completedTime: 0 + appId: id + appLaunchedTime: 0 + appCompletedTime: 0 + appExitCode: 0 + virtualCluster: unknown + taskRoles: + taskrole: + taskRoleStatus: + name: task role name + taskStatuses: + - taskIndex: 0 + taskState: SUCCEEDED '404': $ref: '#/components/responses/NoJobError' '500': diff --git a/tests/api_tests/v2/api.v2.spec.ts b/tests/api_tests/v2/api.v2.spec.ts index ce418ab..8907b26 100644 --- a/tests/api_tests/v2/api.v2.spec.ts +++ b/tests/api_tests/v2/api.v2.spec.ts @@ -4,13 +4,12 @@ import { IPAIClusterInfo, OpenPAIClient } from '@api/v2'; import ajv, { Ajv } from 'ajv'; import * as chai from 'chai'; -import { expect } from 'chai'; import dirtyChai from 'dirty-chai'; -import nock from 'nock'; import apiTestCaseJson from '../../../.tests/apiTestCase.json'; import { IApiOperation, IApiTestCase } from '../../common/apiTestCaseGenerator'; import { CustomizedTests } from '../../common/apiTestCases'; +import { ApiTestRunner } from '../../common/apiTestRunner.js'; import { TestCluster } from '../../common/testCluster'; /** @@ -19,28 +18,24 @@ import { TestCluster } from '../../common/testCluster'; let ajvInstance: Ajv; let openPAIClient: any; let clusterInfo: IPAIClusterInfo; - -export interface IOperationResults { - beforeEachResults: any[]; - beforeResults: any[]; - testResults: any[]; -} +let runner: ApiTestRunner; chai.use(dirtyChai); before(async () => { ajvInstance = new ajv({ nullable: true }); openPAIClient = new OpenPAIClient(TestCluster.cluster); clusterInfo = await openPAIClient.api.getClusterInfo(); + runner = new ApiTestRunner(openPAIClient, ajvInstance, apiTestCaseJson.map); }); -for (const test of apiTestCaseJson as IApiTestCase[]) { +for (const test of apiTestCaseJson.tests as IApiTestCase[]) { let beforeEachResults: any[]; let beforeResults: any[]; const testResults: any[] = []; describe(test.description!, () => { - beforeEach(async () => beforeEachResults = await runOperations(test.beforeEach)); - before(async () => beforeResults = await runOperations(test.before)); + beforeEach(async () => beforeEachResults = await runner.runOperations(test.beforeEach)); + before(async () => beforeResults = await runner.runOperations(test.before)); for (const testItem of test.tests) { it (testItem.description || test.description || 'unknown test', async () => { @@ -58,7 +53,7 @@ for (const test of apiTestCaseJson as IApiTestCase[]) { } ); } else { - const res: any = await runOperation( + const res: any = await runner.runOperation( testItem.operation!, { beforeEachResults, @@ -73,14 +68,14 @@ for (const test of apiTestCaseJson as IApiTestCase[]) { }); } - after(async () => await runOperations( + after(async () => await runner.runOperations( test.after, { beforeEachResults, beforeResults, testResults })); - afterEach(async () => await runOperations( + afterEach(async () => await runner.runOperations( test.afterEach, { beforeEachResults, @@ -114,83 +109,3 @@ function skipTest(operation: IApiOperation): boolean { return false; } - -export function getClientName(tag: string): string { - const words: string[] = tag.split(' '); - if (words.length === 1) { - return tag; - } - - return words[0] + words[1].charAt(0).toUpperCase() + words[1].slice(1); -} - -export async function runOperation( - operation: IApiOperation, operationResults?: IOperationResults, mock?: any -): Promise { - if (mock) { - nock() - } - - const client: any = operation.cluster ? - (new OpenPAIClient(operation.cluster) as any)[operation.tag!] : - openPAIClient[getClientName(operation.tag!)]; - const parameters: any[] = []; - if (operation.parameters) { - for (const para of operation.parameters) { - if (para.type === 'raw') { - parameters.push(para.value); - } else if (operationResults) { - let parameter: any = operationResults[para.resultType!][para.resultIndex!]; - if (para.resultPath) { - for (const item of para.resultPath) { - parameter = parameter[item]; - } - } - parameters.push(parameter); - } - } - } - - let res: any; - try { - res = await client[operation.operationId!](...parameters); - } catch (err) { - if (err !== undefined && operation.response!.statusCode !== err.status) { - throw err; - } else { - res = err.data; - } - } - - if (operation.response) { - if (operation.response.schema) { - const valid: boolean = ajvInstance.validate(operation.response.schema, res) as boolean; - if (!valid) { - console.log(ajvInstance.errors); - } - expect(valid, 'response should be valid.').to.be.true(); - } - if (operation.response.expectResult) { - for (const key of Object.keys(operation.response.expectResult)) { - expect(res[key]).to.be.eq(operation.response.expectResult[key]); - } - } - } - - return res; -} - -export async function runOperations( - operations?: IApiOperation[], operationResults?: IOperationResults, mock?: any -): Promise { - const result: any[] = []; - if (operations) { - for (const operation of operations) { - const res: any = await runOperation(operation, operationResults, mock); - if (res) { - result.push(res); - } - } - } - return result; -} diff --git a/tests/common/apiTestCaseGenerator.ts b/tests/common/apiTestCaseGenerator.ts index d34e9c2..664d034 100644 --- a/tests/common/apiTestCaseGenerator.ts +++ b/tests/common/apiTestCaseGenerator.ts @@ -16,15 +16,11 @@ export class ApiTestCaseGenerator { swaggerPath: string = 'src/api/v2/swagger.yaml', outputPath?: string ): Promise<{ tests: IApiTestCase[], - map: { - [key: string]: string - } + map: any }> { const api: any = await swaggerParser.dereference(swaggerPath); const tests: IApiTestCase[] = []; - const map: { - [key: string]: string - } = {}; + const map: any = {}; for (const path of Object.keys(api.paths)) { const ops: any = api.paths[path]; @@ -33,7 +29,11 @@ export class ApiTestCaseGenerator { continue; } - map[ops[type].operationId] = type; + map[ops[type].operationId] = { + path: path, + method: type, + examples: {} + }; const responseCodes: string[] = Object.keys(ops[type].responses); const correctCode: string | undefined = @@ -41,7 +41,7 @@ export class ApiTestCaseGenerator { let testResponse: any; if (correctCode !== undefined) { testResponse = { - statusCode: correctCode + statusCode: Number(correctCode) }; const correctResponse: any = ops[type].responses[correctCode]; if (correctResponse.content) { @@ -61,10 +61,8 @@ export class ApiTestCaseGenerator { description: testName, tests: [{}] }; - - if (!test.schemas) { - test.schemas = {}; - } + this.fillMap(responseCodes, ops[type], map); + test.schemas = {}; responseCodes.forEach(code => { if (!test.schemas![code]) { test.schemas![code] = ops[type].responses[code]; @@ -104,11 +102,28 @@ export class ApiTestCaseGenerator { } if (outputPath) { - fs.writeFileSync(outputPath, JSON.stringify(tests)); + fs.writeFileSync(outputPath, JSON.stringify({ tests, map })); } return { tests, map }; } + + private fillMap(responseCodes: string[], opsType: any, map: any): void { + responseCodes.forEach(code => { + if (opsType.responses[code].content) { + for (const contentType of Object.keys(opsType.responses[code].content)) { + const content: any = opsType.responses[code].content[contentType]; + if (content.example) { + map[opsType.operationId].examples[code] = + opsType.responses[code].content[contentType].example; + } else if (content.examples) { + map[opsType.operationId].examples[code] = + Object.values(opsType.responses[code].content[contentType].examples)[0]; + } + } + } + }); + } } export interface IApiOperationParameter { diff --git a/tests/common/apiTestCases.ts b/tests/common/apiTestCases.ts index b7b9c71..8326d80 100644 --- a/tests/common/apiTestCases.ts +++ b/tests/common/apiTestCases.ts @@ -9,9 +9,9 @@ import { expect } from 'chai'; import crypto from 'crypto'; import clustersJson from '../../.tests/clusters.json'; -import { IOperationResults } from '../api_tests/v2/api.v2.spec'; import { IApiOperation, IApiTestCase, IApiTestItem } from './apiTestCaseGenerator'; +import { IOperationResults } from './apiTestRunner'; import { testJobConfig } from './test_data/testJobConfig'; /** diff --git a/tests/common/apiTestRunner.ts b/tests/common/apiTestRunner.ts new file mode 100644 index 0000000..8843739 --- /dev/null +++ b/tests/common/apiTestRunner.ts @@ -0,0 +1,158 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { IPAIClusterInfo, OpenPAIClient } from '@api/v2'; +import ajv, { Ajv } from 'ajv'; +import * as chai from 'chai'; +import { expect } from 'chai'; +import dirtyChai from 'dirty-chai'; +import nock from 'nock'; + +import apiTestCaseJson from '../../.tests/apiTestCase.json'; + +import { IApiOperation, IApiTestCase } from './apiTestCaseGenerator'; +import { CustomizedTests } from './apiTestCases'; +import { TestCluster } from './testCluster'; + +export interface IOperationResults { + beforeEachResults: any[]; + beforeResults: any[]; + testResults: any[]; +} + +/** + * Api test runner. + */ +export class ApiTestRunner { + private openPAIClient: any; + private map: { + [key: string]: any; + } = {}; + private ajvInstance: Ajv; + private mock: any; + + constructor( + openPAIClient: OpenPAIClient, ajvInstance: Ajv, map?: any, mock?: any + ) { + this.openPAIClient = openPAIClient; + this.ajvInstance = ajvInstance; + this.map = map; + this.mock = mock; + } + + public getClientName(tag: string): string { + const words: string[] = tag.split(' '); + if (words.length === 1) { + return tag; + } + + return words[0] + words[1].charAt(0).toUpperCase() + words[1].slice(1); + } + + public async runOperation( + operation: IApiOperation, operationResults?: IOperationResults + ): Promise { + if (this.mock) { + this.mockExample(operation); + } + + const client: any = operation.cluster ? + (new OpenPAIClient(operation.cluster) as any)[operation.tag!] : + this.openPAIClient[this.getClientName(operation.tag!)]; + const parameters: any[] = []; + if (operation.parameters) { + for (const para of operation.parameters) { + if (para.type === 'raw') { + parameters.push(para.value); + } else if (operationResults) { + let parameter: any = operationResults[para.resultType!][para.resultIndex!]; + if (para.resultPath) { + for (const item of para.resultPath) { + parameter = parameter[item]; + } + } + parameters.push(parameter); + } + } + } + + let res: any; + try { + res = await client[operation.operationId!](...parameters); + } catch (err) { + if (err !== undefined && operation.response!.statusCode !== err.status) { + throw err; + } else { + res = err.data; + } + } + + if (operation.response) { + if (operation.response.schema) { + const valid: boolean = this.ajvInstance.validate(operation.response.schema, res) as boolean; + if (!valid) { + console.log(this.ajvInstance.errors); + } + expect(valid, 'response should be valid.').to.be.true(); + } + if (operation.response.expectResult) { + for (const key of Object.keys(operation.response.expectResult)) { + expect(res[key]).to.be.eq(operation.response.expectResult[key]); + } + } + } + + return res; + } + + public async runOperations( + operations?: IApiOperation[], operationResults?: IOperationResults + ): Promise { + const result: any[] = []; + if (operations) { + for (const operation of operations) { + const res: any = await this.runOperation(operation, operationResults); + if (res) { + result.push(res); + } + } + } + return result; + } + + private mockExample(operation: IApiOperation): void { + const op: any = this.map[operation.operationId!]; + let example: any = {}; + if (this.mock.operations && + this.mock.operations[operation.operationId!] && + this.mock.operations[operation.operationId!].example + ) { + example = this.mock.operations[operation.operationId!].example; + } else { + if (operation.response) { + example = { + code: operation.response!.statusCode!, + data: operation.response.expectResult || + op.examples[operation.response!.statusCode!] || {} + }; + } else { + for (const code of Object.keys(op.examples)) { + if (code.startsWith('20')) { + example = { + code: Number(code), + data: op.examples[code] + }; + } + } + } + } + let pathString: string = op.path.replace(new RegExp('{(.*)}', 'gi'), '(.*)'); + if (pathString.endsWith('/')) { + pathString = pathString.substring(0, pathString.lastIndexOf('/')); + } + const mockPath: RegExp = new RegExp(pathString); + (nock(this.mock.rest_server_uri) as any)[op.method](mockPath).reply( + example.code, example.data + ); + } +} diff --git a/tests/unit_tests/v2/v2.specdraft.ts b/tests/unit_tests/v2/v2.specdraft.ts index 772aae8..be4b49e 100644 --- a/tests/unit_tests/v2/v2.specdraft.ts +++ b/tests/unit_tests/v2/v2.specdraft.ts @@ -9,9 +9,9 @@ import dirtyChai from 'dirty-chai'; import nock from 'nock'; import apiTestCaseJson from '../../../.tests/apiTestCase.json'; -import { runOperation, runOperations } from '../../api_tests/v2/api.v2.spec.js'; import { IApiOperation, IApiTestCase } from '../../common/apiTestCaseGenerator'; import { CustomizedTests } from '../../common/apiTestCases'; +import { ApiTestRunner } from '../../common/apiTestRunner'; import { TestCluster } from '../../common/testCluster'; /** @@ -20,6 +20,7 @@ import { TestCluster } from '../../common/testCluster'; let ajvInstance: Ajv; let openPAIClient: any; let clusterInfo: IPAIClusterInfo; +let runner: ApiTestRunner; // A revoked jwt token, from user: sdk_test const testToken: string = @@ -29,6 +30,14 @@ const testToken: string = const testUrl: string = 'https://openpai.test/rest-server'; const apiGetClusterInfo: string = '/api/v2/info'; +const basicLogin: string = '/api/v2/authn/basic/login'; + +const testClusterInfo: IPAIClusterInfo = { + name: 'PAI RESTful API', + version: 'v1.0.1', + launcherType: 'k8s', + authnMethod: 'basic' +}; const testCluster: IPAICluster = { rest_server_uri: testUrl, @@ -39,19 +48,24 @@ const testCluster: IPAICluster = { chai.use(dirtyChai); before(async () => { + nock(testUrl).get(apiGetClusterInfo).reply(200, testClusterInfo); + ajvInstance = new ajv({ nullable: true }); - openPAIClient = new OpenPAIClient(TestCluster.cluster); + openPAIClient = new OpenPAIClient(testCluster); clusterInfo = await openPAIClient.api.getClusterInfo(); + runner = new ApiTestRunner(openPAIClient, ajvInstance, apiTestCaseJson.map, { + rest_server_uri: testUrl + }); }); -for (const test of apiTestCaseJson as IApiTestCase[]) { +for (const test of apiTestCaseJson.tests as IApiTestCase[]) { let beforeEachResults: any[]; let beforeResults: any[]; const testResults: any[] = []; describe(test.description!, () => { - beforeEach(async () => beforeEachResults = await runOperations(test.beforeEach)); - before(async () => beforeResults = await runOperations(test.before)); + beforeEach(async () => beforeEachResults = await runner.runOperations(test.beforeEach)); + before(async () => beforeResults = await runner.runOperations(test.before)); for (const testItem of test.tests) { it (testItem.description || test.description || 'unknown test', async () => { @@ -66,7 +80,7 @@ for (const test of apiTestCaseJson as IApiTestCase[]) { } );*/ } else { - const res: any = await runOperation( + const res: any = await runner.runOperation( testItem.operation!, { beforeEachResults, @@ -81,14 +95,14 @@ for (const test of apiTestCaseJson as IApiTestCase[]) { }); } - after(async () => await runOperations( + after(async () => await runner.runOperations( test.after, { beforeEachResults, beforeResults, testResults })); - afterEach(async () => await runOperations( + afterEach(async () => await runner.runOperations( test.afterEach, { beforeEachResults, From a7cf2824c3e97c1f54ca80fcb1a4ad89224195f0 Mon Sep 17 00:00:00 2001 From: Yi Yi Date: Mon, 15 Jun 2020 01:13:44 +0800 Subject: [PATCH 04/24] mock all api tests and add to unittests --- .tests/apiTestCase.json | 2 +- package.json | 2 +- src/api/v2/swagger.yaml | 127 +++++++++++++++++- .../v2/{v2.specdraft.ts => v2.spec.ts} | 0 4 files changed, 127 insertions(+), 4 deletions(-) rename tests/unit_tests/v2/{v2.specdraft.ts => v2.spec.ts} (100%) diff --git a/.tests/apiTestCase.json b/.tests/apiTestCase.json index 562285d..bdbc6fe 100644 --- a/.tests/apiTestCase.json +++ b/.tests/apiTestCase.json @@ -1 +1 @@ -{"tests":[{"description":"get /api/v2/info","tests":[{"operation":{"tag":"api","operationId":"getClusterInfo","parameters":[],"response":{"statusCode":200,"schema":{"type":"object","properties":{"name":{"type":"string","description":"PAI RESTfulAPI"},"version":{"type":"string","description":"cluster version in v0.X.0 format"},"launcherType":{"type":"string","enum":["yarn","k8s"]},"authnMethod":{"type":"string","enum":["basic","OIDC"]}},"required":["name","version","launcherType","authnMethod"]},"contentType":"application/json"}}}],"schemas":{"200":{"description":"Succeeded","content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","description":"PAI RESTfulAPI"},"version":{"type":"string","description":"cluster version in v0.X.0 format"},"launcherType":{"type":"string","enum":["yarn","k8s"]},"authnMethod":{"type":"string","enum":["basic","OIDC"]}},"required":["name","version","launcherType","authnMethod"]},"example":{"name":"PAI RESTful API","version":"v1.0.1","launcherType":"k8s","authnMethod":"basic"}}}}}},{"before":[{"tag":"token","operationId":"createApplicationToken"}],"tests":[{"description":"Get tokens with user token","operation":{"tag":"token","operationId":"getTokens","parameters":[],"response":{"statusCode":200,"schema":{"type":"object","properties":{"tokens":{"type":"array","items":{"type":"string"},"description":"JWT string list"}},"required":["tokens"]},"contentType":"application/json"}}},{"description":"Get tokens with unauthorized token","customizedTest":"getTokensWithUnauthorizedUser","operation":{"tag":"token","operationId":"getTokens","parameters":[],"response":{"statusCode":200,"schema":{"type":"object","properties":{"tokens":{"type":"array","items":{"type":"string"},"description":"JWT string list"}},"required":["tokens"]},"contentType":"application/json"}}}],"after":[{"tag":"token","operationId":"deleteToken","parameters":[{"type":"fromResult","resultType":"beforeResults","resultPath":["token"],"resultIndex":0}]}],"schemas":{"200":{"description":"Succeeded","content":{"application/json":{"schema":{"type":"object","properties":{"tokens":{"type":"array","items":{"type":"string"},"description":"JWT string list"}},"required":["tokens"]},"example":{"tokens":["JWT Token Example"]}}}},"401":{"description":"UnauthorizedUserError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"UnauthorizedUserError":{"value":{"code":"UnauthorizedUserError","message":"Guest is not allowed to do this operation."}}}}}}},"description":"get /api/v2/tokens"},{"before":[{"tag":"token","operationId":"createApplicationToken"}],"tests":[{"operation":{"parameters":[{"type":"fromResult","resultType":"beforeResults","resultPath":["token"],"resultIndex":0}],"tag":"token","operationId":"deleteToken","response":{"statusCode":200,"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"contentType":"application/json"}}}],"schemas":{"200":{"description":"Succeeded","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"example":{"message":"revoke successfully"}}}},"401":{"description":"UnauthorizedUserError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"UnauthorizedUserError":{"value":{"code":"UnauthorizedUserError","message":"Guest is not allowed to do this operation."}}}}}},"403":{"description":"ForbiddenUserError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"ForbiddenUserError":{"value":{"code":"ForbiddenUserError","message":"Non-admin is not allow to do this operation."}},"ForbiddenTokenError":{"value":{"code":"ForbiddenUserError","message":"Applications are not allowed to do this operation."}}}}}}},"description":"delete /api/v2/tokens/{token}"},{"tests":[{"operation":{"tag":"token","operationId":"createApplicationToken","parameters":[],"response":{"statusCode":200,"schema":{"type":"object","properties":{"token":{"type":"string","description":"your access token"},"application":{"type":"boolean","description":"true"}}},"contentType":"application/json"}}}],"after":[{"tag":"token","operationId":"deleteToken","parameters":[{"type":"fromResult","resultType":"testResults","resultPath":["token"],"resultIndex":0}]}],"schemas":{"200":{"description":"Succeeded","content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string","description":"your access token"},"application":{"type":"boolean","description":"true"}}},"example":{"token":"JWT Token Example","application":true}}}},"401":{"description":"UnauthorizedUserError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"UnauthorizedUserError":{"value":{"code":"UnauthorizedUserError","message":"Guest is not allowed to do this operation."}}}}}}},"description":"post /api/v2/tokens/application"},{"description":"get /api/v2/authn/oidc/login","tests":[{"operation":{"tag":"authn","operationId":"oidcLogin","parameters":[]}}],"schemas":{"302":{"description":"Redirect"}}},{"description":"get /api/v2/authn/oidc/logout","tests":[{"operation":{"tag":"authn","operationId":"oidcLogout","parameters":[]}}],"schemas":{"302":{"description":"Redirect"}}},{"tests":[{"description":"login with correct username and password","operation":{"parameters":[{"type":"raw","value":"sdk_test"},{"type":"raw","value":"pwd"}],"tag":"authn","operationId":"basicLogin","response":{"statusCode":200,"schema":{"type":"object","properties":{"token":{"type":"string","description":"your access token"},"user":{"type":"string","description":"username"},"admin":{"type":"boolean","description":"true if user is admin"}},"required":["token","user","admin"]},"contentType":"application/json"}}},{"description":"login with non-existent username","operation":{"parameters":[{"type":"raw","value":"nonexistentuser"},{"type":"raw","value":"password"}],"response":{"statusCode":400,"expectResult":{"code":"NoUserError","message":"User nonexistentuser is not found."},"schema":{"description":"NoUserError or IncorrectPassworkError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]}}}}},"tag":"authn","operationId":"basicLogin"}},{"description":"login with incorrect password","operation":{"parameters":[{"type":"raw","value":"sdk_test"},{"type":"raw","value":"incorrectpassword"}],"response":{"statusCode":400,"expectResult":{"code":"IncorrectPasswordError","message":"Password is incorrect."},"schema":{"description":"NoUserError or IncorrectPassworkError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]}}}}},"tag":"authn","operationId":"basicLogin"}}],"after":[{"tag":"token","operationId":"deleteToken","parameters":[{"type":"fromResult","resultType":"testResults","resultPath":["token"],"resultIndex":0}]}],"schemas":{"200":{"description":"Succeeded","content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string","description":"your access token"},"user":{"type":"string","description":"username"},"admin":{"type":"boolean","description":"true if user is admin"}},"required":["token","user","admin"]},"example":{"token":"JWT Token Example","user":"user","admin":true}}}},"400":{"description":"NoUserError or IncorrectPassworkError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]}}}},"404":{"description":"NoUserError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"NoUserError":{"value":{"code":"NoUserError","message":"User {user} is not found."}}}}}}},"description":"post /api/v2/authn/basic/login"},{"before":[{"tag":"authn","operationId":"basicLogin","parameters":[{"type":"raw","value":"sdk_test"},{"type":"raw","value":"pwd"}]}],"tests":[{"description":"Logout with correct token","customizedTest":"logoutWithCorrectToken","operation":{"tag":"authn","operationId":"basicLogout","parameters":[],"response":{"statusCode":200,"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"contentType":"application/json"}}},{"description":"Logout with incorrect token","customizedTest":"logoutWithIncorrectToken","operation":{"tag":"authn","operationId":"basicLogout","parameters":[],"response":{"statusCode":200,"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"contentType":"application/json"}}}],"schemas":{"200":{"description":"Succeeded","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"example":{"message":"Logout successfully"}}}},"401":{"description":"UnauthorizedUserError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"UnauthorizedUserError":{"value":{"code":"UnauthorizedUserError","message":"Guest is not allowed to do this operation."}}}}}},"403":{"description":"ForbiddenUserError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"ForbiddenUserError":{"value":{"code":"ForbiddenUserError","message":"Non-admin is not allow to do this operation."}},"ForbiddenTokenError":{"value":{"code":"ForbiddenUserError","message":"Applications are not allowed to do this operation."}}}}}}},"description":"delete /api/v2/authn/basic/logout"},{"before":[{"tag":"token","operationId":"createApplicationToken"}],"tests":[{"description":"Create a user","operation":{"tag":"user","operationId":"createUser","parameters":[{"type":"raw","value":{"username":"sdk_test_user","password":"test_password"}}],"response":{"statusCode":201,"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"contentType":"application/json"}}},{"description":"Create a conflict user","operation":{"tag":"user","operationId":"createUser","parameters":[{"type":"raw","value":{"username":"sdk_test_user","password":"test_password"}}],"response":{"statusCode":409,"schema":{"description":"ConflictUserError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"ConflictUserError":{"value":{"code":"ConflictUserError","message":"User name {user} already exists."}}}}}}}}},{"description":"Create a user by application token","customizedTest":"createUserByApplicationToken","operation":{"tag":"user","operationId":"createUser","parameters":[],"response":{"statusCode":201,"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"contentType":"application/json"}}},{"description":"Create a user by non-admin user token","customizedTest":"createUserByNonadminToken","operation":{"tag":"user","operationId":"createUser","parameters":[],"response":{"statusCode":201,"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"contentType":"application/json"}}}],"after":[{"tag":"user","operationId":"deleteUser","parameters":[{"type":"raw","value":"sdk_test_user"}],"response":{"statusCode":200,"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"contentType":"application/json"}},{"tag":"token","operationId":"deleteToken","parameters":[{"type":"fromResult","resultType":"beforeResults","resultPath":["token"],"resultIndex":0}]}],"schemas":{"201":{"description":"Succeeded","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"example":{"message":"User is created successfully"}}}},"401":{"description":"UnauthorizedUserError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"UnauthorizedUserError":{"value":{"code":"UnauthorizedUserError","message":"Guest is not allowed to do this operation."}}}}}},"403":{"description":"ForbiddenUserError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"ForbiddenUserError":{"value":{"code":"ForbiddenUserError","message":"Non-admin is not allow to do this operation."}},"ForbiddenTokenError":{"value":{"code":"ForbiddenUserError","message":"Applications are not allowed to do this operation."}}}}}},"409":{"description":"ConflictUserError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"ConflictUserError":{"value":{"code":"ConflictUserError","message":"User name {user} already exists."}}}}}},"500":{"description":"UnknownError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"UnknownError":{"value":{"code":"UnknownError","message":"Internal error message."}}}}}}},"description":"post /api/v2/users"},{"description":"get /api/v2/users","tests":[{"operation":{"tag":"user","operationId":"getAllUser","parameters":[],"response":{"statusCode":200,"schema":{"description":"Array with all users in the system.","type":"array","items":{"type":"object","properties":{"username":{"type":"string","description":"user name"},"admin":{"type":"boolean","description":"Admin or not."},"virtualCluster":{"type":"array","description":"The list of virtualCluster which the user can access.","items":{"type":"string","description":"virtual cluster name."}},"storageConfig":{"type":"array","description":"storageconfig string arry","items":{"type":"string"}},"email":{"type":"string","description":"email address"},"extension":{"type":"object","description":"extension field."}},"required":["username","admin","virtualCluster","storageConfig","email","extension"]}},"contentType":"application/json"}}}],"schemas":{"200":{"description":"Succeeded","content":{"application/json":{"schema":{"description":"Array with all users in the system.","type":"array","items":{"type":"object","properties":{"username":{"type":"string","description":"user name"},"admin":{"type":"boolean","description":"Admin or not."},"virtualCluster":{"type":"array","description":"The list of virtualCluster which the user can access.","items":{"type":"string","description":"virtual cluster name."}},"storageConfig":{"type":"array","description":"storageconfig string arry","items":{"type":"string"}},"email":{"type":"string","description":"email address"},"extension":{"type":"object","description":"extension field."}},"required":["username","admin","virtualCluster","storageConfig","email","extension"]}},"example":[{"username":"username","admin":true,"virtualCluster":[],"storageConfig":[],"email":"email@test.com","extension":{}}]}}},"500":{"description":"UnknownError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"UnknownError":{"value":{"code":"UnknownError","message":"Internal error message."}}}}}}}},{"before":[{"tag":"user","operationId":"createUser","parameters":[{"type":"raw","value":{"username":"sdk_test_user","password":"test_password"}}],"response":{"statusCode":201,"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"contentType":"application/json"}},{"tag":"token","operationId":"createApplicationToken"}],"tests":[{"description":"Update a user, patch: true","operation":{"parameters":[{"type":"raw","value":{"username":"sdk_test_user","email":"new_email@test1.com"}}],"tag":"user","operationId":"updateUser","response":{"statusCode":201,"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"contentType":"application/json"}}},{"description":"Update a user, patch: false","operation":{"parameters":[{"type":"raw","value":{"username":"sdk_test_user","email":"new_email@test2.com","virtualCluster":["default"],"admin":false,"password":"new_test_password","extension":{}}},{"type":"raw","value":false}],"tag":"user","operationId":"updateUser","response":{"statusCode":201,"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"contentType":"application/json"}}},{"description":"Update a non-existent user","operation":{"parameters":[{"type":"raw","value":{"username":"non_exist_user","email":"new_email@test1.com"}}],"response":{"statusCode":404,"schema":{"description":"NoUserError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"NoUserError":{"value":{"code":"NoUserError","message":"User {user} is not found."}}}}}}},"tag":"user","operationId":"updateUser"}},{"description":"Update a user by application token","customizedTest":"updateUserByApplicationToken","operation":{"tag":"user","operationId":"updateUser","parameters":[],"response":{"statusCode":201,"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"contentType":"application/json"}}},{"description":"Update a user by non-admin user token","customizedTest":"updateUserByNonadminToken","operation":{"tag":"user","operationId":"updateUser","parameters":[],"response":{"statusCode":201,"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"contentType":"application/json"}}}],"after":[{"tag":"user","operationId":"deleteUser","parameters":[{"type":"raw","value":"sdk_test_user"}],"response":{"statusCode":200,"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"contentType":"application/json"}},{"tag":"token","operationId":"deleteToken","parameters":[{"type":"fromResult","resultType":"beforeResults","resultPath":["token"],"resultIndex":1}]}],"schemas":{"201":{"description":"Succeeded","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"example":{"message":"update group {username} successfully."}}}},"401":{"description":"UnauthorizedUserError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"UnauthorizedUserError":{"value":{"code":"UnauthorizedUserError","message":"Guest is not allowed to do this operation."}}}}}},"403":{"description":"ForbiddenUserError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"ForbiddenUserError":{"value":{"code":"ForbiddenUserError","message":"Non-admin is not allow to do this operation."}},"ForbiddenTokenError":{"value":{"code":"ForbiddenUserError","message":"Applications are not allowed to do this operation."}}}}}},"404":{"description":"NoUserError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"NoUserError":{"value":{"code":"NoUserError","message":"User {user} is not found."}}}}}},"500":{"description":"UnknownError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"UnknownError":{"value":{"code":"UnknownError","message":"Internal error message."}}}}}}},"description":"put /api/v2/users"},{"tests":[{"description":"Update user self, patch: true","operation":{"parameters":[{"type":"raw","value":{"username":"sdk_test","email":"new_email@test1.com"}}],"tag":"user","operationId":"updateUserSelf","response":{"statusCode":201,"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"contentType":"application/json"}}},{"description":"Update user self, patch: false","operation":{"parameters":[{"type":"raw","value":{"username":"sdk_test","email":"new_email@test2.com","oldPassword":"pwd","newPassword":"pwd"}},{"type":"raw","value":false}],"tag":"user","operationId":"updateUserSelf","response":{"statusCode":201,"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"contentType":"application/json"}}},{"description":"Update user self with incorrect username","operation":{"parameters":[{"type":"raw","value":{"username":"incorrect_username","email":"new_email@test1.com"}}],"response":{"statusCode":403,"schema":{"description":"ForbiddenUserError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"ForbiddenUserError":{"value":{"code":"ForbiddenUserError","message":"Non-admin is not allow to do this operation."}},"ForbiddenTokenError":{"value":{"code":"ForbiddenUserError","message":"Applications are not allowed to do this operation."}}}}}}},"tag":"user","operationId":"updateUserSelf"}}],"schemas":{"201":{"description":"Succeeded","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"example":{"message":"update group {username} successfully."}}}},"401":{"description":"UnauthorizedUserError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"UnauthorizedUserError":{"value":{"code":"UnauthorizedUserError","message":"Guest is not allowed to do this operation."}}}}}},"403":{"description":"ForbiddenUserError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"ForbiddenUserError":{"value":{"code":"ForbiddenUserError","message":"Non-admin is not allow to do this operation."}},"ForbiddenTokenError":{"value":{"code":"ForbiddenUserError","message":"Applications are not allowed to do this operation."}}}}}},"404":{"description":"NoUserError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"NoUserError":{"value":{"code":"NoUserError","message":"User {user} is not found."}}}}}},"500":{"description":"UnknownError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"UnknownError":{"value":{"code":"UnknownError","message":"Internal error message."}}}}}}},"description":"put /api/v2/users/me"},{"tests":[{"operation":{"parameters":[{"type":"raw","value":"sdk_test"}],"tag":"user","operationId":"getUser","response":{"statusCode":200,"schema":{"type":"object","properties":{"username":{"type":"string","description":"user name"},"admin":{"type":"boolean","description":"Admin or not."},"virtualCluster":{"type":"array","description":"The list of virtualCluster which the user can access.","items":{"type":"string","description":"virtual cluster name."}},"storageConfig":{"type":"array","description":"storageconfig string arry","items":{"type":"string"}},"email":{"type":"string","description":"email address"},"extension":{"type":"object","description":"extension field."}},"required":["username","admin","virtualCluster","storageConfig","email","extension"]},"contentType":"application/json"}}}],"schemas":{"200":{"description":"Succeeded","content":{"application/json":{"schema":{"type":"object","properties":{"username":{"type":"string","description":"user name"},"admin":{"type":"boolean","description":"Admin or not."},"virtualCluster":{"type":"array","description":"The list of virtualCluster which the user can access.","items":{"type":"string","description":"virtual cluster name."}},"storageConfig":{"type":"array","description":"storageconfig string arry","items":{"type":"string"}},"email":{"type":"string","description":"email address"},"extension":{"type":"object","description":"extension field."}},"required":["username","admin","virtualCluster","storageConfig","email","extension"]},"example":{"username":"username","admin":true,"virtualCluster":[],"storageConfig":[],"email":"email@test.com","extension":{}}}}},"401":{"description":"UnauthorizedUserError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"UnauthorizedUserError":{"value":{"code":"UnauthorizedUserError","message":"Guest is not allowed to do this operation."}}}}}},"404":{"description":"NoUserError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"NoUserError":{"value":{"code":"NoUserError","message":"User {user} is not found."}}}}}},"500":{"description":"UnknownError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"UnknownError":{"value":{"code":"UnknownError","message":"Internal error message."}}}}}}},"description":"get /api/v2/users/{user}"},{"before":[{"tag":"user","operationId":"createUser","parameters":[{"type":"raw","value":{"username":"sdk_test_user","password":"test_password"}}],"response":{"statusCode":201,"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"contentType":"application/json"}},{"tag":"token","operationId":"createApplicationToken"}],"tests":[{"description":"Delete a user","operation":{"tag":"user","operationId":"deleteUser","parameters":[{"type":"raw","value":"sdk_test_user"}],"response":{"statusCode":200,"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"contentType":"application/json"}}},{"description":"Delete a non-existent user","operation":{"parameters":[{"type":"raw","value":"non_exist_user"}],"response":{"statusCode":404,"schema":{"description":"NoUserError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"NoUserError":{"value":{"code":"NoUserError","message":"User {user} is not found."}}}}}}},"tag":"user","operationId":"deleteUser"}},{"description":"Delete a user by application token","customizedTest":"deleteUserByApplicationToken","operation":{"tag":"user","operationId":"deleteUser","parameters":[],"response":{"statusCode":200,"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"contentType":"application/json"}}},{"description":"Delete a user by non-admin user token","customizedTest":"deleteUserByNonadminToken","operation":{"tag":"user","operationId":"deleteUser","parameters":[],"response":{"statusCode":200,"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"contentType":"application/json"}}}],"after":[{"tag":"token","operationId":"deleteToken","parameters":[{"type":"fromResult","resultType":"beforeResults","resultPath":["token"],"resultIndex":1}]}],"schemas":{"200":{"description":"Succeeded","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"example":{"message":"user is removed successfully"}}}},"401":{"description":"UnauthorizedUserError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"UnauthorizedUserError":{"value":{"code":"UnauthorizedUserError","message":"Guest is not allowed to do this operation."}}}}}},"403":{"description":"ForbiddenUserError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"ForbiddenUserError":{"value":{"code":"ForbiddenUserError","message":"Non-admin is not allow to do this operation."}},"ForbiddenTokenError":{"value":{"code":"ForbiddenUserError","message":"Applications are not allowed to do this operation."}}}}}},"404":{"description":"NoUserError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"NoUserError":{"value":{"code":"NoUserError","message":"User {user} is not found."}}}}}},"500":{"description":"UnknownError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"UnknownError":{"value":{"code":"UnknownError","message":"Internal error message."}}}}}}},"description":"delete /api/v2/users/{user}"},{"before":[{"tag":"token","operationId":"createApplicationToken"},{"tag":"user","operationId":"createUser","parameters":[{"type":"raw","value":{"username":"sdk_test_user","password":"test_password"}}],"response":{"statusCode":201,"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"contentType":"application/json"}},{"tag":"group","operationId":"createGroup","parameters":[{"type":"raw","value":{"groupname":"sdktestgroup"}}],"response":{"statusCode":201,"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"contentType":"application/json"}}],"tests":[{"description":"Add a group to a user's grouplist","operation":{"parameters":[{"type":"raw","value":"sdk_test_user"},{"type":"raw","value":"sdktestgroup"}],"tag":"user","operationId":"updateUserGroup","response":{"statusCode":201,"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"contentType":"application/json"}}},{"description":"Add a group to a non-existent user's grouplist","operation":{"parameters":[{"type":"raw","value":"non_exist_user"},{"type":"raw","value":"sdktestgroup"}],"response":{"statusCode":404,"schema":{"description":"NoUserError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"NoUserError":{"value":{"code":"NoUserError","message":"User {user} is not found."}}}}}}},"tag":"user","operationId":"updateUserGroup"}},{"description":"Add a group to a user's grouplist by application token","customizedTest":"updateUserGroupByApplicationToken","operation":{"tag":"user","operationId":"updateUserGroup","parameters":[],"response":{"statusCode":201,"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"contentType":"application/json"}}},{"description":"Add a group to a user's grouplist by non-admin user token","customizedTest":"updateUserGroupByNonadminToken","operation":{"tag":"user","operationId":"updateUserGroup","parameters":[],"response":{"statusCode":201,"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"contentType":"application/json"}}}],"after":[{"tag":"token","operationId":"deleteToken","parameters":[{"type":"fromResult","resultType":"beforeResults","resultPath":["token"],"resultIndex":0}]},{"tag":"user","operationId":"deleteUser","parameters":[{"type":"raw","value":"sdk_test_user"}],"response":{"statusCode":200,"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"contentType":"application/json"}},{"tag":"group","operationId":"deleteGroup","parameters":[{"type":"raw","value":"sdktestgroup"}],"response":{"statusCode":201,"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"contentType":"application/json"}}],"schemas":{"201":{"description":"Succeeded","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"example":{"message":"User {username} is added into group {groupname}"}}}},"401":{"description":"UnauthorizedUserError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"UnauthorizedUserError":{"value":{"code":"UnauthorizedUserError","message":"Guest is not allowed to do this operation."}}}}}},"403":{"description":"ForbiddenUserError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"ForbiddenUserError":{"value":{"code":"ForbiddenUserError","message":"Non-admin is not allow to do this operation."}},"ForbiddenTokenError":{"value":{"code":"ForbiddenUserError","message":"Applications are not allowed to do this operation."}}}}}},"404":{"description":"NoUserError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"NoUserError":{"value":{"code":"NoUserError","message":"User {user} is not found."}}}}}},"500":{"description":"UnknownError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"UnknownError":{"value":{"code":"UnknownError","message":"Internal error message."}}}}}}},"description":"put /api/v2/users/{user}/group/"},{"before":[{"tag":"token","operationId":"createApplicationToken"},{"tag":"user","operationId":"createUser","parameters":[{"type":"raw","value":{"username":"sdk_test_user","password":"test_password"}}],"response":{"statusCode":201,"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"contentType":"application/json"}},{"tag":"group","operationId":"createGroup","parameters":[{"type":"raw","value":{"groupname":"sdktestgroup"}}],"response":{"statusCode":201,"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"contentType":"application/json"}},{"tag":"user","operationId":"updateUserGroup","parameters":[{"type":"raw","value":"sdk_test_user"},{"type":"raw","value":"sdktestgroup"}]}],"tests":[{"description":"Remove a group to a user's grouplist","operation":{"parameters":[{"type":"raw","value":"sdk_test_user"},{"type":"raw","value":"sdktestgroup"}],"tag":"user","operationId":"deleteUserGroup","response":{"statusCode":201,"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"contentType":"application/json"}}},{"description":"Remove a group to a non-existent user's grouplist","operation":{"parameters":[{"type":"raw","value":"non_exist_user"},{"type":"raw","value":"sdktestgroup"}],"response":{"statusCode":404,"schema":{"description":"NoUserError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"NoUserError":{"value":{"code":"NoUserError","message":"User {user} is not found."}}}}}}},"tag":"user","operationId":"deleteUserGroup"}},{"description":"Remove a group to a user's grouplist by application token","customizedTest":"deleteUserGroupByApplicationToken","operation":{"tag":"user","operationId":"deleteUserGroup","parameters":[],"response":{"statusCode":201,"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"contentType":"application/json"}}},{"description":"Remove a group to a user's grouplist by non-admin user token","customizedTest":"deleteUserGroupByNonadminToken","operation":{"tag":"user","operationId":"deleteUserGroup","parameters":[],"response":{"statusCode":201,"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"contentType":"application/json"}}}],"after":[{"tag":"token","operationId":"deleteToken","parameters":[{"type":"fromResult","resultType":"beforeResults","resultPath":["token"],"resultIndex":0}]},{"tag":"user","operationId":"deleteUser","parameters":[{"type":"raw","value":"sdk_test_user"}],"response":{"statusCode":200,"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"contentType":"application/json"}},{"tag":"group","operationId":"deleteGroup","parameters":[{"type":"raw","value":"sdktestgroup"}],"response":{"statusCode":201,"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"contentType":"application/json"}}],"schemas":{"201":{"description":"Succeeded","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"example":{"message":"User {username} is removed from group {groupname}"}}}},"401":{"description":"UnauthorizedUserError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"UnauthorizedUserError":{"value":{"code":"UnauthorizedUserError","message":"Guest is not allowed to do this operation."}}}}}},"403":{"description":"ForbiddenUserError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"ForbiddenUserError":{"value":{"code":"ForbiddenUserError","message":"Non-admin is not allow to do this operation."}},"ForbiddenTokenError":{"value":{"code":"ForbiddenUserError","message":"Applications are not allowed to do this operation."}}}}}},"404":{"description":"NoUserError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"NoUserError":{"value":{"code":"NoUserError","message":"User {user} is not found."}}}}}},"500":{"description":"UnknownError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"UnknownError":{"value":{"code":"UnknownError","message":"Internal error message."}}}}}}},"description":"delete /api/v2/users/{user}/group/"},{"before":[{"tag":"token","operationId":"createApplicationToken"},{"tag":"user","operationId":"createUser","parameters":[{"type":"raw","value":{"username":"sdk_test_user","password":"test_password"}}],"response":{"statusCode":201,"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"contentType":"application/json"}}],"tests":[{"description":"Replace a user's grouplist","operation":{"parameters":[{"type":"raw","value":"sdk_test_user"},{"type":"raw","value":["default"]}],"tag":"user","operationId":"updateUserGrouplist","response":{"statusCode":201,"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"contentType":"application/json"}}},{"description":"Replace a non-existent user's grouplist","operation":{"parameters":[{"type":"raw","value":"non_exist_user"},{"type":"raw","value":["default"]}],"response":{"statusCode":404,"schema":{"description":"NoUserError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"NoUserError":{"value":{"code":"NoUserError","message":"User {user} is not found."}}}}}}},"tag":"user","operationId":"updateUserGrouplist"}},{"description":"Replace a user's grouplist by application token","customizedTest":"updateUserGrouplistByApplicationToken","operation":{"tag":"user","operationId":"updateUserGrouplist","parameters":[],"response":{"statusCode":201,"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"contentType":"application/json"}}},{"description":"Replace a user's grouplist by non-admin user token","customizedTest":"updateUserGrouplistByNonadminToken","operation":{"tag":"user","operationId":"updateUserGrouplist","parameters":[],"response":{"statusCode":201,"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"contentType":"application/json"}}}],"after":[{"tag":"token","operationId":"deleteToken","parameters":[{"type":"fromResult","resultType":"beforeResults","resultPath":["token"],"resultIndex":0}]},{"tag":"user","operationId":"deleteUser","parameters":[{"type":"raw","value":"sdk_test_user"}],"response":{"statusCode":200,"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"contentType":"application/json"}}],"schemas":{"201":{"description":"Succeeded","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"example":{"message":"update user grouplist successfully."}}}},"401":{"description":"UnauthorizedUserError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"UnauthorizedUserError":{"value":{"code":"UnauthorizedUserError","message":"Guest is not allowed to do this operation."}}}}}},"403":{"description":"ForbiddenUserError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"ForbiddenUserError":{"value":{"code":"ForbiddenUserError","message":"Non-admin is not allow to do this operation."}},"ForbiddenTokenError":{"value":{"code":"ForbiddenUserError","message":"Applications are not allowed to do this operation."}}}}}},"404":{"description":"NoUserError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"NoUserError":{"value":{"code":"NoUserError","message":"User {user} is not found."}}}}}},"500":{"description":"UnknownError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"UnknownError":{"value":{"code":"UnknownError","message":"Internal error message."}}}}}}},"description":"put /api/v2/users/{user}/grouplist/"},{"description":"get /api/v2/groups","tests":[{"operation":{"tag":"group","operationId":"getAllGroup","parameters":[],"response":{"statusCode":200,"schema":{"description":"Array with all groups in the system.","type":"array","items":{"type":"object","properties":{"groupname":{"type":"string","description":"group name"},"description":{"type":"string","description":"description for the group"},"externalName":{"type":"string","description":"the external group name binding with the group in OpenPAI"},"extension":{"type":"object"}}}},"contentType":"application/json"}}}],"schemas":{"200":{"description":"Succeeded","content":{"application/json":{"schema":{"description":"Array with all groups in the system.","type":"array","items":{"type":"object","properties":{"groupname":{"type":"string","description":"group name"},"description":{"type":"string","description":"description for the group"},"externalName":{"type":"string","description":"the external group name binding with the group in OpenPAI"},"extension":{"type":"object"}}}},"example":[{"groupname":"groupName","description":"description","externalName":"externalName","extension":{}}]}}},"500":{"description":"UnknownError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"UnknownError":{"value":{"code":"UnknownError","message":"Internal error message."}}}}}}}},{"tests":[{"operation":{"tag":"group","operationId":"createGroup","parameters":[{"type":"raw","value":{"groupname":"sdktestgroup"}}],"response":{"statusCode":201,"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"contentType":"application/json"}}}],"after":[{"tag":"group","operationId":"deleteGroup","parameters":[{"type":"raw","value":"sdktestgroup"}],"response":{"statusCode":201,"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"contentType":"application/json"}}],"schemas":{"201":{"description":"Succeeded","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"example":{"message":"group is created successfully"}}}},"401":{"description":"UnauthorizedUserError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"UnauthorizedUserError":{"value":{"code":"UnauthorizedUserError","message":"Guest is not allowed to do this operation."}}}}}},"403":{"description":"ForbiddenUserError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"ForbiddenUserError":{"value":{"code":"ForbiddenUserError","message":"Non-admin is not allow to do this operation."}},"ForbiddenTokenError":{"value":{"code":"ForbiddenUserError","message":"Applications are not allowed to do this operation."}}}}}},"500":{"description":"UnknownError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"UnknownError":{"value":{"code":"UnknownError","message":"Internal error message."}}}}}}},"description":"post /api/v2/groups"},{"before":[{"tag":"group","operationId":"createGroup","parameters":[{"type":"raw","value":{"groupname":"sdktestgroup"}}],"response":{"statusCode":201,"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"contentType":"application/json"}}],"tests":[{"operation":{"parameters":[{"type":"raw","value":{"data":{"groupname":"sdktestgroup","description":"test update group"},"patch":true}}],"tag":"group","operationId":"updateGroup","response":{"statusCode":201,"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"contentType":"application/json"}}}],"after":[{"tag":"group","operationId":"deleteGroup","parameters":[{"type":"raw","value":"sdktestgroup"}],"response":{"statusCode":201,"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"contentType":"application/json"}}],"schemas":{"201":{"description":"Succeeded","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"example":{"message":"update group {groupname} successfully."}}}},"401":{"description":"UnauthorizedUserError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"UnauthorizedUserError":{"value":{"code":"UnauthorizedUserError","message":"Guest is not allowed to do this operation."}}}}}},"403":{"description":"ForbiddenUserError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"ForbiddenUserError":{"value":{"code":"ForbiddenUserError","message":"Non-admin is not allow to do this operation."}},"ForbiddenTokenError":{"value":{"code":"ForbiddenUserError","message":"Applications are not allowed to do this operation."}}}}}},"404":{"description":"NoGroupError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"NoGroupError":{"value":{"code":"NoGroupError","message":"Group {groupname} is not found."}}}}}},"500":{"description":"UnknownError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"UnknownError":{"value":{"code":"UnknownError","message":"Internal error message."}}}}}}},"description":"put /api/v2/groups"},{"before":[{"tag":"group","operationId":"createGroup","parameters":[{"type":"raw","value":{"groupname":"sdktestgroup"}}],"response":{"statusCode":201,"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"contentType":"application/json"}}],"tests":[{"operation":{"parameters":[{"type":"raw","value":"sdktestgroup"}],"tag":"group","operationId":"getGroup","response":{"statusCode":200,"schema":{"type":"object","properties":{"groupname":{"type":"string","description":"group name"},"description":{"type":"string","description":"description for the group"},"externalName":{"type":"string","description":"the external group name binding with the group in OpenPAI"},"extension":{"type":"object"}},"required":["groupname","description","externalName","extension"]},"contentType":"application/json"}}}],"after":[{"tag":"group","operationId":"deleteGroup","parameters":[{"type":"raw","value":"sdktestgroup"}],"response":{"statusCode":201,"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"contentType":"application/json"}}],"schemas":{"200":{"description":"Succeeded","content":{"application/json":{"schema":{"type":"object","properties":{"groupname":{"type":"string","description":"group name"},"description":{"type":"string","description":"description for the group"},"externalName":{"type":"string","description":"the external group name binding with the group in OpenPAI"},"extension":{"type":"object"}},"required":["groupname","description","externalName","extension"]},"example":{"groupname":"groupName","description":"description","externalName":"externalName","extension":{}}}}},"401":{"description":"UnauthorizedUserError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"UnauthorizedUserError":{"value":{"code":"UnauthorizedUserError","message":"Guest is not allowed to do this operation."}}}}}},"404":{"description":"NoGroupError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"NoGroupError":{"value":{"code":"NoGroupError","message":"Group {groupname} is not found."}}}}}},"500":{"description":"UnknownError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"UnknownError":{"value":{"code":"UnknownError","message":"Internal error message."}}}}}}},"description":"get /api/v2/groups/{group}"},{"before":[{"tag":"group","operationId":"createGroup","parameters":[{"type":"raw","value":{"groupname":"sdktestgroup"}}],"response":{"statusCode":201,"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"contentType":"application/json"}}],"tests":[{"operation":{"tag":"group","operationId":"deleteGroup","parameters":[{"type":"raw","value":"sdktestgroup"}],"response":{"statusCode":201,"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"contentType":"application/json"}}}],"schemas":{"201":{"description":"Succeeded","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"example":{"message":"group is removed successfully"}}}},"401":{"description":"UnauthorizedUserError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"UnauthorizedUserError":{"value":{"code":"UnauthorizedUserError","message":"Guest is not allowed to do this operation."}}}}}},"403":{"description":"ForbiddenUserError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"ForbiddenUserError":{"value":{"code":"ForbiddenUserError","message":"Non-admin is not allow to do this operation."}},"ForbiddenTokenError":{"value":{"code":"ForbiddenUserError","message":"Applications are not allowed to do this operation."}}}}}},"500":{"description":"UnknownError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"UnknownError":{"value":{"code":"UnknownError","message":"Internal error message."}}}}}}},"description":"delete /api/v2/groups/{group}"},{"description":"get /api/v2/groups/{group}/userlist","tests":[{"operation":{"tag":"group","operationId":"getGroupMembers","parameters":[],"response":{"statusCode":200,"schema":{"description":"Array with all users in the group.","type":"array","items":{"type":"object","properties":{"username":{"type":"string","description":"user name"},"clusterAdmin":{"type":"boolean","description":"Cluster admin or not."}}}},"contentType":"application/json"}}}],"schemas":{"200":{"description":"Succeeded","content":{"application/json":{"schema":{"description":"Array with all users in the group.","type":"array","items":{"type":"object","properties":{"username":{"type":"string","description":"user name"},"clusterAdmin":{"type":"boolean","description":"Cluster admin or not."}}}},"example":[{"username":"username","clusterAdmin":false}]}}},"401":{"description":"UnauthorizedUserError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"UnauthorizedUserError":{"value":{"code":"UnauthorizedUserError","message":"Guest is not allowed to do this operation."}}}}}},"500":{"description":"UnknownError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"UnknownError":{"value":{"code":"UnknownError","message":"Internal error message."}}}}}}}},{"description":"get /api/v2/virtual-clusters","tests":[{"operation":{"tag":"virtual cluster","operationId":"listVirtualClusters","parameters":[],"response":{"statusCode":200,"schema":{"type":"object","additionalProperties":{"type":"object","properties":{"capacity":{"type":"number","description":"capacity percentage this virtual cluster can use of entire cluster"},"usedCapacity":{"type":"number","description":"used capacity percentage this virtual cluster can use of entire cluster"},"maxCapacity":{"type":"number","description":"max capacity percentage this virtual cluster can use of entire cluster"},"dedicated":{"type":"boolean","description":"dedicated virtual cluster or not"},"resourcesUsed":{"type":"object","description":"used resources","properties":{"cpu":{"type":"integer","description":"used cpu number"},"vCores":{"type":"integer","description":"same as cpu"},"memory":{"type":"integer","description":"used memory in MB"},"gpu":{"type":"integer","description":"used gpu number"},"GPUs":{"type":"integer","description":"same as gpu"}}},"resourcesGuaranteed":{"type":"object","description":"guaranteed resources, including used and free","properties":{"cpu":{"type":"integer","description":"guaranteed cpu number"},"vCores":{"type":"integer","description":"same as cpu"},"memory":{"type":"integer","description":"guaranteed memory in MB"},"gpu":{"type":"integer","description":"guaranteed gpu number"},"GPUs":{"type":"integer","description":"same as gpu"}}},"resourcesTotal":{"type":"object","description":"total resources, including guaranteed and bad","properties":{"cpu":{"type":"integer","description":"total cpu number"},"vCores":{"type":"integer","description":"same as cpu"},"memory":{"type":"integer","description":"total memory in MB"},"gpu":{"type":"integer","description":"total gpu number"},"GPUs":{"type":"integer","description":"same as gpu"}}}},"required":["capacity","usedCapacity","maxCapacity","resourcesUsed","resourcesGuaranteed","resourcesTotal"]}},"contentType":"application/json"}}}],"schemas":{"200":{"description":"Succeeded","content":{"application/json":{"schema":{"type":"object","additionalProperties":{"type":"object","properties":{"capacity":{"type":"number","description":"capacity percentage this virtual cluster can use of entire cluster"},"usedCapacity":{"type":"number","description":"used capacity percentage this virtual cluster can use of entire cluster"},"maxCapacity":{"type":"number","description":"max capacity percentage this virtual cluster can use of entire cluster"},"dedicated":{"type":"boolean","description":"dedicated virtual cluster or not"},"resourcesUsed":{"type":"object","description":"used resources","properties":{"cpu":{"type":"integer","description":"used cpu number"},"vCores":{"type":"integer","description":"same as cpu"},"memory":{"type":"integer","description":"used memory in MB"},"gpu":{"type":"integer","description":"used gpu number"},"GPUs":{"type":"integer","description":"same as gpu"}}},"resourcesGuaranteed":{"type":"object","description":"guaranteed resources, including used and free","properties":{"cpu":{"type":"integer","description":"guaranteed cpu number"},"vCores":{"type":"integer","description":"same as cpu"},"memory":{"type":"integer","description":"guaranteed memory in MB"},"gpu":{"type":"integer","description":"guaranteed gpu number"},"GPUs":{"type":"integer","description":"same as gpu"}}},"resourcesTotal":{"type":"object","description":"total resources, including guaranteed and bad","properties":{"cpu":{"type":"integer","description":"total cpu number"},"vCores":{"type":"integer","description":"same as cpu"},"memory":{"type":"integer","description":"total memory in MB"},"gpu":{"type":"integer","description":"total gpu number"},"GPUs":{"type":"integer","description":"same as gpu"}}}},"required":["capacity","usedCapacity","maxCapacity","resourcesUsed","resourcesGuaranteed","resourcesTotal"]}}}}},"500":{"description":"UnknownError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"UnknownError":{"value":{"code":"UnknownError","message":"Internal error message."}}}}}}}},{"tests":[{"operation":{"parameters":[{"type":"raw","value":"default"}],"tag":"virtual cluster","operationId":"getVirtualCluster","response":{"statusCode":200,"schema":{"type":"object","properties":{"capacity":{"type":"number","description":"capacity percentage this virtual cluster can use of entire cluster"},"usedCapacity":{"type":"number","description":"used capacity percentage this virtual cluster can use of entire cluster"},"maxCapacity":{"type":"number","description":"max capacity percentage this virtual cluster can use of entire cluster"},"dedicated":{"type":"boolean","description":"dedicated virtual cluster or not"},"resourcesUsed":{"type":"object","description":"used resources","properties":{"cpu":{"type":"integer","description":"used cpu number"},"vCores":{"type":"integer","description":"same as cpu"},"memory":{"type":"integer","description":"used memory in MB"},"gpu":{"type":"integer","description":"used gpu number"},"GPUs":{"type":"integer","description":"same as gpu"}}},"resourcesGuaranteed":{"type":"object","description":"guaranteed resources, including used and free","properties":{"cpu":{"type":"integer","description":"guaranteed cpu number"},"vCores":{"type":"integer","description":"same as cpu"},"memory":{"type":"integer","description":"guaranteed memory in MB"},"gpu":{"type":"integer","description":"guaranteed gpu number"},"GPUs":{"type":"integer","description":"same as gpu"}}},"resourcesTotal":{"type":"object","description":"total resources, including guaranteed and bad","properties":{"cpu":{"type":"integer","description":"total cpu number"},"vCores":{"type":"integer","description":"same as cpu"},"memory":{"type":"integer","description":"total memory in MB"},"gpu":{"type":"integer","description":"total gpu number"},"GPUs":{"type":"integer","description":"same as gpu"}}}},"required":["capacity","usedCapacity","maxCapacity","resourcesUsed","resourcesGuaranteed","resourcesTotal"]},"contentType":"application/json"}}}],"schemas":{"200":{"description":"Succeeded","content":{"application/json":{"schema":{"type":"object","properties":{"capacity":{"type":"number","description":"capacity percentage this virtual cluster can use of entire cluster"},"usedCapacity":{"type":"number","description":"used capacity percentage this virtual cluster can use of entire cluster"},"maxCapacity":{"type":"number","description":"max capacity percentage this virtual cluster can use of entire cluster"},"dedicated":{"type":"boolean","description":"dedicated virtual cluster or not"},"resourcesUsed":{"type":"object","description":"used resources","properties":{"cpu":{"type":"integer","description":"used cpu number"},"vCores":{"type":"integer","description":"same as cpu"},"memory":{"type":"integer","description":"used memory in MB"},"gpu":{"type":"integer","description":"used gpu number"},"GPUs":{"type":"integer","description":"same as gpu"}}},"resourcesGuaranteed":{"type":"object","description":"guaranteed resources, including used and free","properties":{"cpu":{"type":"integer","description":"guaranteed cpu number"},"vCores":{"type":"integer","description":"same as cpu"},"memory":{"type":"integer","description":"guaranteed memory in MB"},"gpu":{"type":"integer","description":"guaranteed gpu number"},"GPUs":{"type":"integer","description":"same as gpu"}}},"resourcesTotal":{"type":"object","description":"total resources, including guaranteed and bad","properties":{"cpu":{"type":"integer","description":"total cpu number"},"vCores":{"type":"integer","description":"same as cpu"},"memory":{"type":"integer","description":"total memory in MB"},"gpu":{"type":"integer","description":"total gpu number"},"GPUs":{"type":"integer","description":"same as gpu"}}}},"required":["capacity","usedCapacity","maxCapacity","resourcesUsed","resourcesGuaranteed","resourcesTotal"]},"example":{"capacity":70,"usedCapacity":30,"dedicated":false,"resourcesUsed":{"cpu":1,"memory":1024,"gpu":1,"vCores":1,"GPUs":1},"resourcesGuaranteed":{"cpu":2,"memory":2048,"gpu":2,"vCores":2,"GPUs":2},"resourcesTotal":{"cpu":2,"memory":2048,"gpu":2,"vCores":2,"GPUs":2},"maxCapacity":70}}}},"404":{"description":"NoVirtualClusterError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"NoVirtualClusterError":{"value":{"code":"NoVirtualClusterError","message":"Virtual cluster {vc} is not found."}}}}}},"500":{"description":"UnknownError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"UnknownError":{"value":{"code":"UnknownError","message":"Internal error message."}}}}}}},"description":"get /api/v2/virtual-clusters/{vc}"},{"description":"get /api/v2/storages","tests":[{"operation":{"tag":"storage","operationId":"getStorages","parameters":[],"response":{"statusCode":200,"schema":{"type":"object","description":"summary of configured PV storage","properties":{"storages":{"type":"array","items":{"type":"object","description":"summary of each storage","properties":{"name":{"type":"string"},"share":{"type":"boolean"},"volumeName":{"type":"string"}},"required":["name","share","volumeName"]}}},"required":["storages"]},"contentType":"application/json"}}}],"schemas":{"200":{"description":"Succeeded","content":{"application/json":{"schema":{"type":"object","description":"summary of configured PV storage","properties":{"storages":{"type":"array","items":{"type":"object","description":"summary of each storage","properties":{"name":{"type":"string"},"share":{"type":"boolean"},"volumeName":{"type":"string"}},"required":["name","share","volumeName"]}}},"required":["storages"]},"example":{"storages":[{"name":"name","share":true,"volumeName":"volumeName"}]}}}},"500":{"description":"UnknownError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"UnknownError":{"value":{"code":"UnknownError","message":"Internal error message."}}}}}}}},{"before":[{"tag":"storage","operationId":"getStorages"}],"tests":[{"operation":{"parameters":[{"type":"fromResult","resultType":"beforeResults","resultPath":["storages",0,"name"],"resultIndex":0}],"tag":"storage","operationId":"getStorage","response":{"statusCode":200,"schema":{"type":"object","description":"detail of configured PV storage","properties":{"name":{"type":"string"},"share":{"type":"boolean"},"volumeName":{"type":"string"},"type":{"type":"string","enum":["nfs","samba","azureFile","azureBlob","other","unknown"]},"data":{"anyOf":[{"type":"object","description":"nfs type","properties":{"server":{"type":"string"},"path":{"type":"string"}},"required":["server","path"]},{"type":"object","description":"samba type","properties":{"address":{"type":"string"},"username":{"type":"string"},"password":{"type":"string"}},"required":["address"]},{"type":"object","description":"azureFile type","properties":{"shareName":{"type":"string"},"accountName":{"type":"string"},"accountKey":{"type":"string"}},"required":["shareName"]},{"type":"object","description":"azureBlob type","properties":{"containerName":{"type":"string"},"accountName":{"type":"string"},"accountKey":{"type":"string"},"accountSASToken":{"type":"string"}},"required":["containerName"]},{"type":"object","description":"other/unknown type","properties":{}}]},"secretName":{"type":"string"},"mountOptions":{"type":"array","items":{"type":"string"}}},"required":["name","share","volumeName","type","data"]},"contentType":"application/json"}}}],"schemas":{"200":{"description":"Succeeded","content":{"application/json":{"schema":{"type":"object","description":"detail of configured PV storage","properties":{"name":{"type":"string"},"share":{"type":"boolean"},"volumeName":{"type":"string"},"type":{"type":"string","enum":["nfs","samba","azureFile","azureBlob","other","unknown"]},"data":{"anyOf":[{"type":"object","description":"nfs type","properties":{"server":{"type":"string"},"path":{"type":"string"}},"required":["server","path"]},{"type":"object","description":"samba type","properties":{"address":{"type":"string"},"username":{"type":"string"},"password":{"type":"string"}},"required":["address"]},{"type":"object","description":"azureFile type","properties":{"shareName":{"type":"string"},"accountName":{"type":"string"},"accountKey":{"type":"string"}},"required":["shareName"]},{"type":"object","description":"azureBlob type","properties":{"containerName":{"type":"string"},"accountName":{"type":"string"},"accountKey":{"type":"string"},"accountSASToken":{"type":"string"}},"required":["containerName"]},{"type":"object","description":"other/unknown type","properties":{}}]},"secretName":{"type":"string"},"mountOptions":{"type":"array","items":{"type":"string"}}},"required":["name","share","volumeName","type","data"]},"example":{"name":"nfs-storage-name","share":true,"volumeName":"nfs-volume-name","type":"nfs","data":{"server":"","path":"/data"}}}}},"403":{"description":"ForbiddenUserError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"ForbiddenUserError":{"value":{"code":"ForbiddenUserError","message":"User {user} is not allowed to access {storage}."}}}}}},"404":{"description":"NoStorageError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"NoVirtualClusterError":{"value":{"code":"NoStorageError","message":"Storage {storage} is not found."}}}}}},"500":{"description":"UnknownError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"UnknownError":{"value":{"code":"UnknownError","message":"Internal error message."}}}}}}},"description":"get /api/v2/storages/{storage}"},{"tests":[{"operation":{"tag":"job","operationId":"createJob","parameters":[{"type":"raw","value":{"contributor":"OpenPAI","description":"# Serving a TensorFlow MNIST Digit Recognition Model\nThis example shows you how to use TensorFlow Serving components to export a trained TensorFlow model\nand use the standard tensorflow_model_server to serve it on OpenPAI.\nThis example uses the simple Softmax Regression model introduced in the TensorFlow tutorial for handwritten image (MNIST data) classification.\nReference https://www.tensorflow.org/tfx/serving/serving_basic.\n","name":"sdk_test_jobb0968e37","parameters":{"modelPath":"/tmp/mnist_model"},"prerequisites":[{"contributor":"OpenPAI","description":"This is an [example TensorFlow Serving Docker image on OpenPAI](https://github.com/Microsoft/pai/tree/master/examples/serving).\n","name":"tf_serving_example","protocolVersion":2,"type":"dockerimage","uri":"openpai/pai.example.tensorflow-serving","version":"1.0-r1.4"}],"protocolVersion":2,"taskRoles":{"worker":{"commands":["bazel-bin/tensorflow_serving/example/mnist_saved_model <% $parameters.modelPath %>","tensorflow_model_server --port=$PAI_CONTAINER_HOST_model_server_PORT_LIST --model_name=mnist --model_base_path=<% $parameters.modelPath %>"],"dockerImage":"tf_serving_example","instances":1,"resourcePerInstance":{"cpu":4,"gpu":1,"memoryMB":8192,"ports":{"model_server":1}}}},"type":"job","version":"1.0"}}],"response":{"statusCode":202,"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"contentType":"application/json"}}}],"after":[{"tag":"job","operationId":"updateJobExecutionType","parameters":[{"type":"raw","value":"sdk_test"},{"type":"raw","value":"sdk_test_jobb0968e37"},{"type":"raw","value":"STOP"}]}],"schemas":{"202":{"description":"Succeeded","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"example":{"message":"update job {job} successfully"}}}},"400":{"description":"NoVirtualClusterError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"NoVirtualClusterError":{"value":{"code":"NoVirtualClusterError","message":"Virtual cluster {vc} is not found."}}}}}},"403":{"description":"ForbiddenUserError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"ForbiddenUserError":{"value":{"code":"ForbiddenUserError","message":"Non-admin is not allow to do this operation."}},"ForbiddenTokenError":{"value":{"code":"ForbiddenUserError","message":"Applications are not allowed to do this operation."}}}}}},"409":{"description":"ConflictJobError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"ConflictJobError":{"value":{"code":"ConflictJobError","message":"Job name {job} already exists."}}}}}},"500":{"description":"UnknownError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"UnknownError":{"value":{"code":"UnknownError","message":"Internal error message."}}}}}}},"description":"post /api/v2/jobs"},{"description":"get /api/v2/jobs","tests":[{"operation":{"tag":"job","operationId":"listJobs","parameters":[],"response":{"statusCode":200,"schema":{"type":"array","description":"job summary list","items":{"type":"object","properties":{"name":{"type":"string","description":"job name"},"username":{"type":"string","description":"user name or \"unknown\""},"state":{"type":"string","description":"general job state","enum":["WAITING","RUNNING","STOPPING","STOPPED","SUCCEEDED","FAILED","UNKNOWN"]},"subState":{"type":"string","description":"job state in framework controller","enum":["AttemptCreationPending","AttemptCreationRequested","AttemptPreparing","AttemptRunning","AttemptDeletionPending","AttemptDeletionRequested","AttemptDeleting","AttemptCompleted","Completed"]},"executionType":{"type":"string","description":"start or stop","enum":["START","STOP"]},"retries":{"type":"integer","description":"job retried times"},"retryDetails":{"type":"object","properties":{"user":{"type":"integer"},"platform":{"type":"integer"},"resource":{"type":"integer"}}},"retryDelayTime":{"type":"integer","nullable":true,"description":"retry delay time"},"createdTime":{"type":"integer","description":"job created time, in number of milliseconds since the Unix Epoch."},"completedTime":{"type":"integer","nullable":true,"description":"job completed time, in number of milliseconds since the Unix Epoch."},"appExitCode":{"type":"integer","nullable":true,"description":"job exit code"},"virtualCluster":{"type":"string","description":"virtual cluster to which the job submitted, or \"unknown\""},"totalGpuNumber":{"type":"integer","description":"total gpu number used in the job"},"totalTaskNumber":{"type":"integer","description":"total task number used in the job"},"totalTaskRoleNumber":{"type":"integer","description":"total task role number used in the job"},"debugId":{"type":"string","description":"md5 hash name for the job in framework controller, used for debug purpose"}},"required":["name","username","virtualCluster","state","subState","executionType","retries","createdTime","completedTime","appExitCode"]}},"contentType":"application/json"}}}],"schemas":{"200":{"description":"Succeeded","content":{"application/json":{"schema":{"type":"array","description":"job summary list","items":{"type":"object","properties":{"name":{"type":"string","description":"job name"},"username":{"type":"string","description":"user name or \"unknown\""},"state":{"type":"string","description":"general job state","enum":["WAITING","RUNNING","STOPPING","STOPPED","SUCCEEDED","FAILED","UNKNOWN"]},"subState":{"type":"string","description":"job state in framework controller","enum":["AttemptCreationPending","AttemptCreationRequested","AttemptPreparing","AttemptRunning","AttemptDeletionPending","AttemptDeletionRequested","AttemptDeleting","AttemptCompleted","Completed"]},"executionType":{"type":"string","description":"start or stop","enum":["START","STOP"]},"retries":{"type":"integer","description":"job retried times"},"retryDetails":{"type":"object","properties":{"user":{"type":"integer"},"platform":{"type":"integer"},"resource":{"type":"integer"}}},"retryDelayTime":{"type":"integer","nullable":true,"description":"retry delay time"},"createdTime":{"type":"integer","description":"job created time, in number of milliseconds since the Unix Epoch."},"completedTime":{"type":"integer","nullable":true,"description":"job completed time, in number of milliseconds since the Unix Epoch."},"appExitCode":{"type":"integer","nullable":true,"description":"job exit code"},"virtualCluster":{"type":"string","description":"virtual cluster to which the job submitted, or \"unknown\""},"totalGpuNumber":{"type":"integer","description":"total gpu number used in the job"},"totalTaskNumber":{"type":"integer","description":"total task number used in the job"},"totalTaskRoleNumber":{"type":"integer","description":"total task role number used in the job"},"debugId":{"type":"string","description":"md5 hash name for the job in framework controller, used for debug purpose"}},"required":["name","username","virtualCluster","state","subState","executionType","retries","createdTime","completedTime","appExitCode"]}},"example":[{"name":"job name","username":"user name","state":"SUCCEEDED","subState":"Completed","executionType":"STOP","retries":0,"createdTime":0,"completedTime":0,"appExitCode":0,"virtualCluster":"unknown"}]}}},"500":{"description":"UnknownError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"UnknownError":{"value":{"code":"UnknownError","message":"Internal error message."}}}}}}}},{"before":[{"tag":"job","operationId":"createJob","parameters":[{"type":"raw","value":{"contributor":"OpenPAI","description":"# Serving a TensorFlow MNIST Digit Recognition Model\nThis example shows you how to use TensorFlow Serving components to export a trained TensorFlow model\nand use the standard tensorflow_model_server to serve it on OpenPAI.\nThis example uses the simple Softmax Regression model introduced in the TensorFlow tutorial for handwritten image (MNIST data) classification.\nReference https://www.tensorflow.org/tfx/serving/serving_basic.\n","name":"sdk_test_jobbe30565d","parameters":{"modelPath":"/tmp/mnist_model"},"prerequisites":[{"contributor":"OpenPAI","description":"This is an [example TensorFlow Serving Docker image on OpenPAI](https://github.com/Microsoft/pai/tree/master/examples/serving).\n","name":"tf_serving_example","protocolVersion":2,"type":"dockerimage","uri":"openpai/pai.example.tensorflow-serving","version":"1.0-r1.4"}],"protocolVersion":2,"taskRoles":{"worker":{"commands":["bazel-bin/tensorflow_serving/example/mnist_saved_model <% $parameters.modelPath %>","tensorflow_model_server --port=$PAI_CONTAINER_HOST_model_server_PORT_LIST --model_name=mnist --model_base_path=<% $parameters.modelPath %>"],"dockerImage":"tf_serving_example","instances":1,"resourcePerInstance":{"cpu":4,"gpu":1,"memoryMB":8192,"ports":{"model_server":1}}}},"type":"job","version":"1.0"}}]}],"tests":[{"description":"Get a job detail","operation":{"parameters":[{"type":"raw","value":"sdk_test"},{"type":"raw","value":"sdk_test_jobbe30565d"}],"tag":"job","operationId":"getJob","response":{"statusCode":200,"schema":{"type":"object","description":"job details","properties":{"name":{"type":"string","description":"job name"},"jobStatus":{"type":"object","description":"job status","properties":{"username":{"type":"string","description":"user name or \"unknown\""},"state":{"type":"string","description":"general job state","enum":["WAITING","RUNNING","STOPPING","STOPPED","SUCCEEDED","FAILED","UNKNOWN"]},"subState":{"type":"string","description":"job state in framework controller","enum":["AttemptCreationPending","AttemptCreationRequested","AttemptPreparing","AttemptRunning","AttemptDeletionPending","AttemptDeletionRequested","AttemptDeleting","AttemptCompleted","Completed"]},"executionType":{"type":"string","description":"start or stop","enum":["START","STOP"]},"retries":{"type":"integer","description":"job retried times"},"retryDetails":{"type":"object","properties":{"user":{"type":"integer"},"platform":{"type":"integer"},"resource":{"type":"integer"}}},"retryDelayTime":{"type":"integer","nullable":true,"description":"retry delay time"},"createdTime":{"type":"integer","description":"job created time, in number of milliseconds since the Unix Epoch."},"completedTime":{"type":"integer","nullable":true,"description":"job completed time, in number of milliseconds since the Unix Epoch."},"appId":{"type":"string","description":"unique id for the job"},"appLaunchedTime":{"type":"integer","nullable":true,"description":"job launched time for last attempt, in number of milliseconds since the Unix Epoch."},"appCompletedTime":{"type":"integer","nullable":true,"description":"job completed time for last attempt, in number of milliseconds since the Unix Epoch. to get durations for last attempt:\n wholeDuration = completedTime - createdTime;\n runningDuration = appCompletedTime - appLaunchedTime;\n waitingDuration = wholeDuration - runningDuration.\nto get durations for all attempts:\n runningDuration = sum(appCompletedTime - appLaunchedTime) for all attempts.\n"},"appExitCode":{"type":"integer","nullable":true,"description":"job exit code"},"appExitSpec":{"type":"object","nullable":true,"description":"job exit spec","properties":{"code":{"type":"integer"},"phrase":{"type":"string"},"issuer":{"type":"string"},"causer":{"type":"string"},"type":{"type":"string"},"stage":{"type":"string"},"behavior":{"type":"string"},"reaction":{"type":"string"},"repro":{"type":"array","items":{"type":"string"}}}},"appExitDiagnostics":{"type":"string","nullable":true,"description":"job exit diagnostics"},"appExitMessages":{"type":"object","nullable":true,"properties":{"container":{"type":"string","nullable":true},"runtime":{"type":"string","nullable":true},"launcher":{"type":"string","nullable":true}}},"appExitTriggerMessage":{"type":"string","nullable":true,"description":"job completion message"},"appExitTriggerTaskRoleName":{"type":"string","nullable":true,"description":"task role name which triggered job completion"},"appExitTriggerTaskIndex":{"type":"integer","nullable":true,"description":"task index which triggered job completion"},"appExitType":{"type":"string","nullable":true,"description":"job completion type"},"virtualCluster":{"type":"string","description":"virtual cluster to which the job submitted, or \"unknown\""}},"required":["username","virtualCluster","state","subState","executionType","retries","createdTime","completedTime","appId","appLaunchedTime","appCompletedTime","appExitCode"]},"taskRoles":{"type":"object","additionalProperties":{"type":"object","description":"task role status","properties":{"taskRoleStatus":{"type":"object","properties":{"name":{"type":"string","description":"task role name"}},"required":["name"]},"taskStatuses":{"type":"array","description":"task statuses in the task role","items":{"type":"object","properties":{"taskIndex":{"type":"integer","description":"task index"},"taskState":{"type":"string","description":"task state","enum":["WAITING","RUNNING","STOPPING","STOPPED","SUCCEEDED","FAILED","UNKNOWN"]},"containerId":{"type":"string","description":"uid of the task container"},"containerIp":{"type":"string","description":"ip of the task container"},"containerPorts":{"type":"object","description":"ports of the task container"},"containerGpus":{"type":"string","nullable":true,"description":"gpu of the task container"},"containerLog":{"type":"string","description":"log url of the task container"},"containerExitCode":{"type":"integer","nullable":true,"description":"exit code the task container"}}}}},"required":["taskRoleStatus","taskStatuses"]}},"debugId":{"type":"string","description":"md5 hash name for the job in framework controller, used for debug purpose"}},"required":["name","jobStatus","taskRoles"]},"contentType":"application/json"}}},{"description":"Get nonexist job detail","operation":{"parameters":[{"type":"raw","value":"sdk_test"},{"type":"raw","value":"sdk_test_nonexist_job"}],"response":{"statusCode":404,"schema":{"description":"NoJobError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"NoJobError":{"value":{"code":"NoJobError","message":"Job {job} is not found."}}}}}}},"tag":"job","operationId":"getJob"}}],"after":[{"tag":"job","operationId":"updateJobExecutionType","parameters":[{"type":"raw","value":"sdk_test"},{"type":"raw","value":"sdk_test_jobbe30565d"},{"type":"raw","value":"STOP"}]}],"schemas":{"200":{"description":"Succeeded","content":{"application/json":{"schema":{"type":"object","description":"job details","properties":{"name":{"type":"string","description":"job name"},"jobStatus":{"type":"object","description":"job status","properties":{"username":{"type":"string","description":"user name or \"unknown\""},"state":{"type":"string","description":"general job state","enum":["WAITING","RUNNING","STOPPING","STOPPED","SUCCEEDED","FAILED","UNKNOWN"]},"subState":{"type":"string","description":"job state in framework controller","enum":["AttemptCreationPending","AttemptCreationRequested","AttemptPreparing","AttemptRunning","AttemptDeletionPending","AttemptDeletionRequested","AttemptDeleting","AttemptCompleted","Completed"]},"executionType":{"type":"string","description":"start or stop","enum":["START","STOP"]},"retries":{"type":"integer","description":"job retried times"},"retryDetails":{"type":"object","properties":{"user":{"type":"integer"},"platform":{"type":"integer"},"resource":{"type":"integer"}}},"retryDelayTime":{"type":"integer","nullable":true,"description":"retry delay time"},"createdTime":{"type":"integer","description":"job created time, in number of milliseconds since the Unix Epoch."},"completedTime":{"type":"integer","nullable":true,"description":"job completed time, in number of milliseconds since the Unix Epoch."},"appId":{"type":"string","description":"unique id for the job"},"appLaunchedTime":{"type":"integer","nullable":true,"description":"job launched time for last attempt, in number of milliseconds since the Unix Epoch."},"appCompletedTime":{"type":"integer","nullable":true,"description":"job completed time for last attempt, in number of milliseconds since the Unix Epoch. to get durations for last attempt:\n wholeDuration = completedTime - createdTime;\n runningDuration = appCompletedTime - appLaunchedTime;\n waitingDuration = wholeDuration - runningDuration.\nto get durations for all attempts:\n runningDuration = sum(appCompletedTime - appLaunchedTime) for all attempts.\n"},"appExitCode":{"type":"integer","nullable":true,"description":"job exit code"},"appExitSpec":{"type":"object","nullable":true,"description":"job exit spec","properties":{"code":{"type":"integer"},"phrase":{"type":"string"},"issuer":{"type":"string"},"causer":{"type":"string"},"type":{"type":"string"},"stage":{"type":"string"},"behavior":{"type":"string"},"reaction":{"type":"string"},"repro":{"type":"array","items":{"type":"string"}}}},"appExitDiagnostics":{"type":"string","nullable":true,"description":"job exit diagnostics"},"appExitMessages":{"type":"object","nullable":true,"properties":{"container":{"type":"string","nullable":true},"runtime":{"type":"string","nullable":true},"launcher":{"type":"string","nullable":true}}},"appExitTriggerMessage":{"type":"string","nullable":true,"description":"job completion message"},"appExitTriggerTaskRoleName":{"type":"string","nullable":true,"description":"task role name which triggered job completion"},"appExitTriggerTaskIndex":{"type":"integer","nullable":true,"description":"task index which triggered job completion"},"appExitType":{"type":"string","nullable":true,"description":"job completion type"},"virtualCluster":{"type":"string","description":"virtual cluster to which the job submitted, or \"unknown\""}},"required":["username","virtualCluster","state","subState","executionType","retries","createdTime","completedTime","appId","appLaunchedTime","appCompletedTime","appExitCode"]},"taskRoles":{"type":"object","additionalProperties":{"type":"object","description":"task role status","properties":{"taskRoleStatus":{"type":"object","properties":{"name":{"type":"string","description":"task role name"}},"required":["name"]},"taskStatuses":{"type":"array","description":"task statuses in the task role","items":{"type":"object","properties":{"taskIndex":{"type":"integer","description":"task index"},"taskState":{"type":"string","description":"task state","enum":["WAITING","RUNNING","STOPPING","STOPPED","SUCCEEDED","FAILED","UNKNOWN"]},"containerId":{"type":"string","description":"uid of the task container"},"containerIp":{"type":"string","description":"ip of the task container"},"containerPorts":{"type":"object","description":"ports of the task container"},"containerGpus":{"type":"string","nullable":true,"description":"gpu of the task container"},"containerLog":{"type":"string","description":"log url of the task container"},"containerExitCode":{"type":"integer","nullable":true,"description":"exit code the task container"}}}}},"required":["taskRoleStatus","taskStatuses"]}},"debugId":{"type":"string","description":"md5 hash name for the job in framework controller, used for debug purpose"}},"required":["name","jobStatus","taskRoles"]},"example":{"name":"job name","jobStatus":{"username":"user name","state":"SUCCEEDED","subState":"Completed","executionType":"STOP","retries":0,"createdTime":0,"completedTime":0,"appId":"id","appLaunchedTime":0,"appCompletedTime":0,"appExitCode":0,"virtualCluster":"unknown"},"taskRoles":{"taskrole":{"taskRoleStatus":{"name":"task role name"},"taskStatuses":[{"taskIndex":0,"taskState":"SUCCEEDED"}]}}}}}},"404":{"description":"NoJobError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"NoJobError":{"value":{"code":"NoJobError","message":"Job {job} is not found."}}}}}},"500":{"description":"UnknownError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"UnknownError":{"value":{"code":"UnknownError","message":"Internal error message."}}}}}}},"description":"get /api/v2/jobs/{user}~{job}"},{"before":[{"tag":"job","operationId":"createJob","parameters":[{"type":"raw","value":{"contributor":"OpenPAI","description":"# Serving a TensorFlow MNIST Digit Recognition Model\nThis example shows you how to use TensorFlow Serving components to export a trained TensorFlow model\nand use the standard tensorflow_model_server to serve it on OpenPAI.\nThis example uses the simple Softmax Regression model introduced in the TensorFlow tutorial for handwritten image (MNIST data) classification.\nReference https://www.tensorflow.org/tfx/serving/serving_basic.\n","name":"sdk_test_job1ff7f5d3","parameters":{"modelPath":"/tmp/mnist_model"},"prerequisites":[{"contributor":"OpenPAI","description":"This is an [example TensorFlow Serving Docker image on OpenPAI](https://github.com/Microsoft/pai/tree/master/examples/serving).\n","name":"tf_serving_example","protocolVersion":2,"type":"dockerimage","uri":"openpai/pai.example.tensorflow-serving","version":"1.0-r1.4"}],"protocolVersion":2,"taskRoles":{"worker":{"commands":["bazel-bin/tensorflow_serving/example/mnist_saved_model <% $parameters.modelPath %>","tensorflow_model_server --port=$PAI_CONTAINER_HOST_model_server_PORT_LIST --model_name=mnist --model_base_path=<% $parameters.modelPath %>"],"dockerImage":"tf_serving_example","instances":1,"resourcePerInstance":{"cpu":4,"gpu":1,"memoryMB":8192,"ports":{"model_server":1}}}},"type":"job","version":"1.0"}}]}],"tests":[{"description":"Get a job config","operation":{"parameters":[{"type":"raw","value":"sdk_test"},{"type":"raw","value":"sdk_test_job1ff7f5d3"}],"tag":"job","operationId":"getJobConfig","response":{"statusCode":200,"schema":{"type":"object","description":"openpai job protocol","properties":{"protocolVersion":{"oneOf":[{"type":"number"},{"type":"string"}],"description":"Protocol version, current version is 2."},"name":{"type":"string","maxLength":255,"description":"String in ^[a-zA-Z0-9_-]+$ format, no longer than 255 characters."},"type":{"type":"string","description":"Component type, should be \"job\" here."},"version":{"type":"string","description":"Component version, default is latest."},"contributor":{"type":"string"},"description":{"type":"string"},"prerequisites":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"type":{"type":"string","enum":["data","script","dockerimage","output"]},"version":{"type":"string"},"contributor":{"type":"string"},"description":{"type":"string"},"auth":{"type":"object","properties":{"username":{"type":"string"},"password":{"type":"string"},"registryuri":{"type":"string"}}},"uri":{"oneOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}]}}}},"parameters":{"type":"object","additionalProperties":true},"secrets":{"type":"object","additionalProperties":true},"jobRetryCount":{"type":"integer","description":"Default is 0."},"taskRoles":{"type":"object","additionalProperties":{"type":"object","properties":{"instances":{"type":"integer","description":"Default is 1, instances of a taskRole, no less than 1."},"completion":{"type":"object","description":"Completion poclicy for the job.","properties":{"minFailedInstances":{"type":"integer"},"minSucceededInstances":{"type":"integer"}}},"taskRetryCount":{"type":"integer","description":"Default is 0."},"dockerImage":{"type":"string","description":"Should reference to a dockerimage defined in prerequisites."},"data":{"type":"string"},"output":{"type":"string"},"script":{"type":"string"},"extraContainerOptions":{"type":"object","properties":{"shmMB":{"type":"integer","description":"Config the /dev/shm in a docker container."},"infiniband":{"type":"boolean","description":"Use InfiniBand devices or not in a docker container."}}},"resourcePerInstance":{"type":"object","properties":{"cpu":{"type":"integer","description":"CPU number, unit is CPU vcore."},"memoryMB":{"type":"integer","description":"Memory number, unit is MB."},"gpu":{"type":"integer","description":"GPU number, unit is GPU card."},"ports":{"type":"object","additionalProperties":{"type":"integer","description":"Port number for the port label."}}}},"commands":{"type":"array","items":{"type":"string"}}},"required":["dockerImage","resourcePerInstance","commands"]}},"deployments":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"taskRoles":{"type":"object","additionalProperties":{"type":"object","properties":{"preCommands":{"type":"array","items":{"type":"string"}},"postCommands":{"type":"array","items":{"type":"string"}}}}}}}},"defaults":{"type":"object","description":"Default cluster specific settings.","properties":{"virtualCluster":{"type":"string"},"deployment":{"type":"string"}}},"extras":{"type":"object","description":"Extra field, save any information that plugin may use.","properties":{"submitFrom":{"type":"string"},"hivedScheduler":{"type":"object","properties":{"jobPriorityClass":{"type":"string"},"taskRoles":{"type":"object","additionalProperties":{"type":"object","properties":{"skuType":{"type":"string"},"affinityGroupName":{"type":"string"}}}}}}}}},"required":["protocolVersion","name","type","taskRoles"]},"contentType":"text/yaml"}}},{"description":"Get nonexist job config","operation":{"parameters":[{"type":"raw","value":"sdk_test"},{"type":"raw","value":"sdk_test_nonexist_job"}],"response":{"statusCode":404,"schema":{"description":"NoJobError or NoJobConfigError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"NoJobError":{"value":{"code":"NoJobError","message":"Job {job} is not found."}},"NoJobConfigError":{"value":{"code":"NoJobConfigError","message":"Config of job {job} is not found."}}}}}}},"tag":"job","operationId":"getJobConfig"}}],"after":[{"tag":"job","operationId":"updateJobExecutionType","parameters":[{"type":"raw","value":"sdk_test"},{"type":"raw","value":"sdk_test_job1ff7f5d3"},{"type":"raw","value":"STOP"}]}],"schemas":{"200":{"description":"Succeeded","content":{"text/yaml":{"schema":{"type":"object","description":"openpai job protocol","properties":{"protocolVersion":{"oneOf":[{"type":"number"},{"type":"string"}],"description":"Protocol version, current version is 2."},"name":{"type":"string","maxLength":255,"description":"String in ^[a-zA-Z0-9_-]+$ format, no longer than 255 characters."},"type":{"type":"string","description":"Component type, should be \"job\" here."},"version":{"type":"string","description":"Component version, default is latest."},"contributor":{"type":"string"},"description":{"type":"string"},"prerequisites":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"type":{"type":"string","enum":["data","script","dockerimage","output"]},"version":{"type":"string"},"contributor":{"type":"string"},"description":{"type":"string"},"auth":{"type":"object","properties":{"username":{"type":"string"},"password":{"type":"string"},"registryuri":{"type":"string"}}},"uri":{"oneOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}]}}}},"parameters":{"type":"object","additionalProperties":true},"secrets":{"type":"object","additionalProperties":true},"jobRetryCount":{"type":"integer","description":"Default is 0."},"taskRoles":{"type":"object","additionalProperties":{"type":"object","properties":{"instances":{"type":"integer","description":"Default is 1, instances of a taskRole, no less than 1."},"completion":{"type":"object","description":"Completion poclicy for the job.","properties":{"minFailedInstances":{"type":"integer"},"minSucceededInstances":{"type":"integer"}}},"taskRetryCount":{"type":"integer","description":"Default is 0."},"dockerImage":{"type":"string","description":"Should reference to a dockerimage defined in prerequisites."},"data":{"type":"string"},"output":{"type":"string"},"script":{"type":"string"},"extraContainerOptions":{"type":"object","properties":{"shmMB":{"type":"integer","description":"Config the /dev/shm in a docker container."},"infiniband":{"type":"boolean","description":"Use InfiniBand devices or not in a docker container."}}},"resourcePerInstance":{"type":"object","properties":{"cpu":{"type":"integer","description":"CPU number, unit is CPU vcore."},"memoryMB":{"type":"integer","description":"Memory number, unit is MB."},"gpu":{"type":"integer","description":"GPU number, unit is GPU card."},"ports":{"type":"object","additionalProperties":{"type":"integer","description":"Port number for the port label."}}}},"commands":{"type":"array","items":{"type":"string"}}},"required":["dockerImage","resourcePerInstance","commands"]}},"deployments":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"taskRoles":{"type":"object","additionalProperties":{"type":"object","properties":{"preCommands":{"type":"array","items":{"type":"string"}},"postCommands":{"type":"array","items":{"type":"string"}}}}}}}},"defaults":{"type":"object","description":"Default cluster specific settings.","properties":{"virtualCluster":{"type":"string"},"deployment":{"type":"string"}}},"extras":{"type":"object","description":"Extra field, save any information that plugin may use.","properties":{"submitFrom":{"type":"string"},"hivedScheduler":{"type":"object","properties":{"jobPriorityClass":{"type":"string"},"taskRoles":{"type":"object","additionalProperties":{"type":"object","properties":{"skuType":{"type":"string"},"affinityGroupName":{"type":"string"}}}}}}}}},"required":["protocolVersion","name","type","taskRoles"]}}}},"404":{"description":"NoJobError or NoJobConfigError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"NoJobError":{"value":{"code":"NoJobError","message":"Job {job} is not found."}},"NoJobConfigError":{"value":{"code":"NoJobConfigError","message":"Config of job {job} is not found."}}}}}},"500":{"description":"UnknownError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"UnknownError":{"value":{"code":"UnknownError","message":"Internal error message."}}}}}}},"description":"get /api/v2/jobs/{user}~{job}/config"},{"before":[{"tag":"job","operationId":"createJob","parameters":[{"type":"raw","value":{"contributor":"OpenPAI","description":"# Serving a TensorFlow MNIST Digit Recognition Model\nThis example shows you how to use TensorFlow Serving components to export a trained TensorFlow model\nand use the standard tensorflow_model_server to serve it on OpenPAI.\nThis example uses the simple Softmax Regression model introduced in the TensorFlow tutorial for handwritten image (MNIST data) classification.\nReference https://www.tensorflow.org/tfx/serving/serving_basic.\n","name":"sdk_test_jobe5b9a31a","parameters":{"modelPath":"/tmp/mnist_model"},"prerequisites":[{"contributor":"OpenPAI","description":"This is an [example TensorFlow Serving Docker image on OpenPAI](https://github.com/Microsoft/pai/tree/master/examples/serving).\n","name":"tf_serving_example","protocolVersion":2,"type":"dockerimage","uri":"openpai/pai.example.tensorflow-serving","version":"1.0-r1.4"}],"protocolVersion":2,"taskRoles":{"worker":{"commands":["bazel-bin/tensorflow_serving/example/mnist_saved_model <% $parameters.modelPath %>","tensorflow_model_server --port=$PAI_CONTAINER_HOST_model_server_PORT_LIST --model_name=mnist --model_base_path=<% $parameters.modelPath %>"],"dockerImage":"tf_serving_example","instances":1,"resourcePerInstance":{"cpu":4,"gpu":1,"memoryMB":8192,"ports":{"model_server":1}}}},"type":"job","version":"1.0"}}]}],"tests":[{"description":"update job execution type to STOP","operation":{"tag":"job","operationId":"updateJobExecutionType","parameters":[{"type":"raw","value":"sdk_test"},{"type":"raw","value":"sdk_test_jobe5b9a31a"},{"type":"raw","value":"STOP"}],"response":{"statusCode":202,"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"contentType":"application/json"}}},{"description":"update job execution type to START","operation":{"tag":"job","operationId":"updateJobExecutionType","parameters":[{"type":"raw","value":"sdk_test"},{"type":"raw","value":"sdk_test_jobe5b9a31a"},{"type":"raw","value":"START"}],"response":{"statusCode":202,"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"contentType":"application/json"}}}],"after":[{"tag":"job","operationId":"updateJobExecutionType","parameters":[{"type":"raw","value":"sdk_test"},{"type":"raw","value":"sdk_test_jobe5b9a31a"},{"type":"raw","value":"STOP"}]}],"schemas":{"202":{"description":"Succeeded","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"example":{"message":"execute job {job} successfully"}}}},"404":{"description":"NoJobError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"NoJobError":{"value":{"code":"NoJobError","message":"Job {job} is not found."}}}}}},"500":{"description":"UnknownError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"UnknownError":{"value":{"code":"UnknownError","message":"Internal error message."}}}}}}},"description":"put /api/v2/jobs/{user}~{job}/exectionType"},{"description":"get /api/v2/jobs/{user}~{job}/job-attempts/healthz","tests":[{"operation":{"tag":"job history","operationId":"getJobAttemptsHealthz","parameters":[],"response":{"statusCode":200}}}],"schemas":{"200":{"description":"OK"},"501":{"description":"Not healthy"}}},{"before":[{"tag":"job","operationId":"createJob","parameters":[{"type":"raw","value":{"contributor":"OpenPAI","description":"# Serving a TensorFlow MNIST Digit Recognition Model\nThis example shows you how to use TensorFlow Serving components to export a trained TensorFlow model\nand use the standard tensorflow_model_server to serve it on OpenPAI.\nThis example uses the simple Softmax Regression model introduced in the TensorFlow tutorial for handwritten image (MNIST data) classification.\nReference https://www.tensorflow.org/tfx/serving/serving_basic.\n","name":"sdk_test_job63860926","parameters":{"modelPath":"/tmp/mnist_model"},"prerequisites":[{"contributor":"OpenPAI","description":"This is an [example TensorFlow Serving Docker image on OpenPAI](https://github.com/Microsoft/pai/tree/master/examples/serving).\n","name":"tf_serving_example","protocolVersion":2,"type":"dockerimage","uri":"openpai/pai.example.tensorflow-serving","version":"1.0-r1.4"}],"protocolVersion":2,"taskRoles":{"worker":{"commands":["bazel-bin/tensorflow_serving/example/mnist_saved_model <% $parameters.modelPath %>","tensorflow_model_server --port=$PAI_CONTAINER_HOST_model_server_PORT_LIST --model_name=mnist --model_base_path=<% $parameters.modelPath %>"],"dockerImage":"tf_serving_example","instances":1,"resourcePerInstance":{"cpu":4,"gpu":1,"memoryMB":8192,"ports":{"model_server":1}}}},"type":"job","version":"1.0"}}]}],"tests":[{"operation":{"parameters":[{"type":"raw","value":"sdk_test"},{"type":"raw","value":"sdk_test_job63860926"}],"tag":"job history","operationId":"getJobAttempts","response":{"statusCode":200,"schema":{"type":"array","items":{"type":"object","description":"job attempt","properties":{"jobName":{"type":"string"},"frameworkName":{"type":"string"},"uid":{"type":"string"},"userName":{"type":"string"},"state":{"type":"string"},"originState":{"type":"string"},"maxAttemptCount":{"type":"integer"},"attemptIndex":{"type":"integer"},"jobStartedTime":{"type":"integer"},"attemptStartedTime":{"type":"integer"},"attemptCompletedTime":{"type":"integer","nullable":true},"exitCode":{"type":"integer","nullable":true},"exitPhrase":{"type":"string","nullable":true},"exitType":{"type":"string","nullable":true},"exitDiagnostics":{"type":"object","nullable":true,"properties":{"diagnosticsSummary":{"type":"string"},"runtime":{"type":"object","nullable":true,"properties":{"exitCode":{"type":"integer","nullable":true},"originUserExitCode":{"type":"integer","nullable":true},"errorLogs":{"type":"object","nullable":true,"properties":{"user":{"type":"string"},"platform":{"type":"string"}}},"name":{"type":"string"}}},"launcher":{"type":"string"}}},"appExitTriggerMessage":{"type":"string","nullable":true},"appExitTriggerTaskRoleName":{"type":"string","nullable":true},"appExitTriggerTaskIndex":{"type":"integer","nullable":true},"appExitSpec":{"type":"object","nullable":true,"properties":{"code":{"type":"integer"},"phrase":{"type":"string"},"issuer":{"type":"string"},"causer":{"type":"string"},"type":{"type":"string"},"stage":{"type":"string"},"behavior":{"type":"string"},"reaction":{"type":"string"},"reason":{"type":"string"},"repro":{"type":"array","items":{"type":"string"}},"solution":{"type":"array","items":{"type":"string"}}}},"appExitDiagnostics":{"type":"string","nullable":true},"appExitMessages":{"type":"object","nullable":true,"properties":{"container":{"type":"string","nullable":true},"runtime":{"type":"object","nullable":true,"properties":{"exitCode":{"type":"integer","nullable":true},"originUserExitCode":{"type":"integer","nullable":true},"errorLogs":{"type":"object","nullable":true,"properties":{"user":{"type":"string"},"platform":{"type":"string"}}},"name":{"type":"string"}}},"launcher":{"type":"string","nullable":true}}},"totalGpuNumber":{"type":"integer"},"totalTasknumber":{"type":"integer"},"totalTaskRoleNumber":{"type":"integer"},"taskRoles":{"type":"object","properties":{"taskrole":{"type":"object","properties":{"taskRoleStatus":{"type":"object","properties":{"name":{"type":"string"}},"required":["name"]},"taskStatuses":{"type":"array","items":{"type":"object","properties":{"taskIndex":{"type":"integer"},"taskState":{"type":"string","enum":["WAITING","RUNNING","STOPPING","STOPPED","SUCCEEDED","FAILED","UNKNOWN"]},"containerId":{"type":"string"},"containerIp":{"type":"string"},"containerGpus":{"type":"string","nullable":true},"containerLog":{"type":"string"},"containerExitCode":{"type":"integer","nullable":true}}}}},"required":["taskRoleStatus","taskStatuses"]}}},"isLatest":{"type":"boolean"}}},"description":"job attempts"},"contentType":"application/json"}}}],"after":[{"tag":"job","operationId":"updateJobExecutionType","parameters":[{"type":"raw","value":"sdk_test"},{"type":"raw","value":"sdk_test_job63860926"},{"type":"raw","value":"STOP"}]}],"schemas":{"200":{"description":"Succeeded","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","description":"job attempt","properties":{"jobName":{"type":"string"},"frameworkName":{"type":"string"},"uid":{"type":"string"},"userName":{"type":"string"},"state":{"type":"string"},"originState":{"type":"string"},"maxAttemptCount":{"type":"integer"},"attemptIndex":{"type":"integer"},"jobStartedTime":{"type":"integer"},"attemptStartedTime":{"type":"integer"},"attemptCompletedTime":{"type":"integer","nullable":true},"exitCode":{"type":"integer","nullable":true},"exitPhrase":{"type":"string","nullable":true},"exitType":{"type":"string","nullable":true},"exitDiagnostics":{"type":"object","nullable":true,"properties":{"diagnosticsSummary":{"type":"string"},"runtime":{"type":"object","nullable":true,"properties":{"exitCode":{"type":"integer","nullable":true},"originUserExitCode":{"type":"integer","nullable":true},"errorLogs":{"type":"object","nullable":true,"properties":{"user":{"type":"string"},"platform":{"type":"string"}}},"name":{"type":"string"}}},"launcher":{"type":"string"}}},"appExitTriggerMessage":{"type":"string","nullable":true},"appExitTriggerTaskRoleName":{"type":"string","nullable":true},"appExitTriggerTaskIndex":{"type":"integer","nullable":true},"appExitSpec":{"type":"object","nullable":true,"properties":{"code":{"type":"integer"},"phrase":{"type":"string"},"issuer":{"type":"string"},"causer":{"type":"string"},"type":{"type":"string"},"stage":{"type":"string"},"behavior":{"type":"string"},"reaction":{"type":"string"},"reason":{"type":"string"},"repro":{"type":"array","items":{"type":"string"}},"solution":{"type":"array","items":{"type":"string"}}}},"appExitDiagnostics":{"type":"string","nullable":true},"appExitMessages":{"type":"object","nullable":true,"properties":{"container":{"type":"string","nullable":true},"runtime":{"type":"object","nullable":true,"properties":{"exitCode":{"type":"integer","nullable":true},"originUserExitCode":{"type":"integer","nullable":true},"errorLogs":{"type":"object","nullable":true,"properties":{"user":{"type":"string"},"platform":{"type":"string"}}},"name":{"type":"string"}}},"launcher":{"type":"string","nullable":true}}},"totalGpuNumber":{"type":"integer"},"totalTasknumber":{"type":"integer"},"totalTaskRoleNumber":{"type":"integer"},"taskRoles":{"type":"object","properties":{"taskrole":{"type":"object","properties":{"taskRoleStatus":{"type":"object","properties":{"name":{"type":"string"}},"required":["name"]},"taskStatuses":{"type":"array","items":{"type":"object","properties":{"taskIndex":{"type":"integer"},"taskState":{"type":"string","enum":["WAITING","RUNNING","STOPPING","STOPPED","SUCCEEDED","FAILED","UNKNOWN"]},"containerId":{"type":"string"},"containerIp":{"type":"string"},"containerGpus":{"type":"string","nullable":true},"containerLog":{"type":"string"},"containerExitCode":{"type":"integer","nullable":true}}}}},"required":["taskRoleStatus","taskStatuses"]}}},"isLatest":{"type":"boolean"}}},"description":"job attempts"}}}},"404":{"description":"NoJobError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"NoJobError":{"value":{"code":"NoJobError","message":"Job {job} is not found."}}}}}},"501":{"description":"UnknownError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"UnknownError":{"value":{"code":"UnknownError","message":"Internal error message."}}}}}}},"description":"get /api/v2/jobs/{user}~{job}/job-attempts"},{"before":[{"tag":"job","operationId":"createJob","parameters":[{"type":"raw","value":{"contributor":"OpenPAI","description":"# Serving a TensorFlow MNIST Digit Recognition Model\nThis example shows you how to use TensorFlow Serving components to export a trained TensorFlow model\nand use the standard tensorflow_model_server to serve it on OpenPAI.\nThis example uses the simple Softmax Regression model introduced in the TensorFlow tutorial for handwritten image (MNIST data) classification.\nReference https://www.tensorflow.org/tfx/serving/serving_basic.\n","name":"sdk_test_job6f60ffd7","parameters":{"modelPath":"/tmp/mnist_model"},"prerequisites":[{"contributor":"OpenPAI","description":"This is an [example TensorFlow Serving Docker image on OpenPAI](https://github.com/Microsoft/pai/tree/master/examples/serving).\n","name":"tf_serving_example","protocolVersion":2,"type":"dockerimage","uri":"openpai/pai.example.tensorflow-serving","version":"1.0-r1.4"}],"protocolVersion":2,"taskRoles":{"worker":{"commands":["bazel-bin/tensorflow_serving/example/mnist_saved_model <% $parameters.modelPath %>","tensorflow_model_server --port=$PAI_CONTAINER_HOST_model_server_PORT_LIST --model_name=mnist --model_base_path=<% $parameters.modelPath %>"],"dockerImage":"tf_serving_example","instances":1,"resourcePerInstance":{"cpu":4,"gpu":1,"memoryMB":8192,"ports":{"model_server":1}}}},"type":"job","version":"1.0"}}]}],"tests":[{"operation":{"parameters":[{"type":"raw","value":"sdk_test"},{"type":"raw","value":"sdk_test_job6f60ffd7"},{"type":"raw","value":0}],"tag":"job history","operationId":"getJobAttempt","response":{"statusCode":200,"schema":{"type":"object","description":"job attempt","properties":{"jobName":{"type":"string"},"frameworkName":{"type":"string"},"uid":{"type":"string"},"userName":{"type":"string"},"state":{"type":"string"},"originState":{"type":"string"},"maxAttemptCount":{"type":"integer"},"attemptIndex":{"type":"integer"},"jobStartedTime":{"type":"integer"},"attemptStartedTime":{"type":"integer"},"attemptCompletedTime":{"type":"integer","nullable":true},"exitCode":{"type":"integer","nullable":true},"exitPhrase":{"type":"string","nullable":true},"exitType":{"type":"string","nullable":true},"exitDiagnostics":{"type":"object","nullable":true,"properties":{"diagnosticsSummary":{"type":"string"},"runtime":{"type":"object","nullable":true,"properties":{"exitCode":{"type":"integer","nullable":true},"originUserExitCode":{"type":"integer","nullable":true},"errorLogs":{"type":"object","nullable":true,"properties":{"user":{"type":"string"},"platform":{"type":"string"}}},"name":{"type":"string"}}},"launcher":{"type":"string"}}},"appExitTriggerMessage":{"type":"string","nullable":true},"appExitTriggerTaskRoleName":{"type":"string","nullable":true},"appExitTriggerTaskIndex":{"type":"integer","nullable":true},"appExitSpec":{"type":"object","nullable":true,"properties":{"code":{"type":"integer"},"phrase":{"type":"string"},"issuer":{"type":"string"},"causer":{"type":"string"},"type":{"type":"string"},"stage":{"type":"string"},"behavior":{"type":"string"},"reaction":{"type":"string"},"reason":{"type":"string"},"repro":{"type":"array","items":{"type":"string"}},"solution":{"type":"array","items":{"type":"string"}}}},"appExitDiagnostics":{"type":"string","nullable":true},"appExitMessages":{"type":"object","nullable":true,"properties":{"container":{"type":"string","nullable":true},"runtime":{"type":"object","nullable":true,"properties":{"exitCode":{"type":"integer","nullable":true},"originUserExitCode":{"type":"integer","nullable":true},"errorLogs":{"type":"object","nullable":true,"properties":{"user":{"type":"string"},"platform":{"type":"string"}}},"name":{"type":"string"}}},"launcher":{"type":"string","nullable":true}}},"totalGpuNumber":{"type":"integer"},"totalTasknumber":{"type":"integer"},"totalTaskRoleNumber":{"type":"integer"},"taskRoles":{"type":"object","properties":{"taskrole":{"type":"object","properties":{"taskRoleStatus":{"type":"object","properties":{"name":{"type":"string"}},"required":["name"]},"taskStatuses":{"type":"array","items":{"type":"object","properties":{"taskIndex":{"type":"integer"},"taskState":{"type":"string","enum":["WAITING","RUNNING","STOPPING","STOPPED","SUCCEEDED","FAILED","UNKNOWN"]},"containerId":{"type":"string"},"containerIp":{"type":"string"},"containerGpus":{"type":"string","nullable":true},"containerLog":{"type":"string"},"containerExitCode":{"type":"integer","nullable":true}}}}},"required":["taskRoleStatus","taskStatuses"]}}},"isLatest":{"type":"boolean"}}},"contentType":"application/json"}}}],"after":[{"tag":"job","operationId":"updateJobExecutionType","parameters":[{"type":"raw","value":"sdk_test"},{"type":"raw","value":"sdk_test_job6f60ffd7"},{"type":"raw","value":"STOP"}]}],"schemas":{"200":{"description":"Succeeded","content":{"application/json":{"schema":{"type":"object","description":"job attempt","properties":{"jobName":{"type":"string"},"frameworkName":{"type":"string"},"uid":{"type":"string"},"userName":{"type":"string"},"state":{"type":"string"},"originState":{"type":"string"},"maxAttemptCount":{"type":"integer"},"attemptIndex":{"type":"integer"},"jobStartedTime":{"type":"integer"},"attemptStartedTime":{"type":"integer"},"attemptCompletedTime":{"type":"integer","nullable":true},"exitCode":{"type":"integer","nullable":true},"exitPhrase":{"type":"string","nullable":true},"exitType":{"type":"string","nullable":true},"exitDiagnostics":{"type":"object","nullable":true,"properties":{"diagnosticsSummary":{"type":"string"},"runtime":{"type":"object","nullable":true,"properties":{"exitCode":{"type":"integer","nullable":true},"originUserExitCode":{"type":"integer","nullable":true},"errorLogs":{"type":"object","nullable":true,"properties":{"user":{"type":"string"},"platform":{"type":"string"}}},"name":{"type":"string"}}},"launcher":{"type":"string"}}},"appExitTriggerMessage":{"type":"string","nullable":true},"appExitTriggerTaskRoleName":{"type":"string","nullable":true},"appExitTriggerTaskIndex":{"type":"integer","nullable":true},"appExitSpec":{"type":"object","nullable":true,"properties":{"code":{"type":"integer"},"phrase":{"type":"string"},"issuer":{"type":"string"},"causer":{"type":"string"},"type":{"type":"string"},"stage":{"type":"string"},"behavior":{"type":"string"},"reaction":{"type":"string"},"reason":{"type":"string"},"repro":{"type":"array","items":{"type":"string"}},"solution":{"type":"array","items":{"type":"string"}}}},"appExitDiagnostics":{"type":"string","nullable":true},"appExitMessages":{"type":"object","nullable":true,"properties":{"container":{"type":"string","nullable":true},"runtime":{"type":"object","nullable":true,"properties":{"exitCode":{"type":"integer","nullable":true},"originUserExitCode":{"type":"integer","nullable":true},"errorLogs":{"type":"object","nullable":true,"properties":{"user":{"type":"string"},"platform":{"type":"string"}}},"name":{"type":"string"}}},"launcher":{"type":"string","nullable":true}}},"totalGpuNumber":{"type":"integer"},"totalTasknumber":{"type":"integer"},"totalTaskRoleNumber":{"type":"integer"},"taskRoles":{"type":"object","properties":{"taskrole":{"type":"object","properties":{"taskRoleStatus":{"type":"object","properties":{"name":{"type":"string"}},"required":["name"]},"taskStatuses":{"type":"array","items":{"type":"object","properties":{"taskIndex":{"type":"integer"},"taskState":{"type":"string","enum":["WAITING","RUNNING","STOPPING","STOPPED","SUCCEEDED","FAILED","UNKNOWN"]},"containerId":{"type":"string"},"containerIp":{"type":"string"},"containerGpus":{"type":"string","nullable":true},"containerLog":{"type":"string"},"containerExitCode":{"type":"integer","nullable":true}}}}},"required":["taskRoleStatus","taskStatuses"]}}},"isLatest":{"type":"boolean"}}}}}},"404":{"description":"NoJobError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"NoJobError":{"value":{"code":"NoJobError","message":"Job {job} is not found."}}}}}},"501":{"description":"UnknownError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"UnknownError":{"value":{"code":"UnknownError","message":"Internal error message."}}}}}}},"description":"get /api/v2/jobs/{user}~{job}/job-attempts/{attemptIndex}"},{"description":"get /api/v2/kubernetes/nodes","tests":[{"operation":{"tag":"kubernetes","operationId":"getK8sNodes","parameters":[],"response":{"statusCode":200}}}],"schemas":{"200":{"description":"Succeeded","content":{"application/json":{"example":["Please refer to Kubernetes API doc","https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.17/#list-node-v1-core"]}}},"401":{"description":"UnauthorizedUserError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"UnauthorizedUserError":{"value":{"code":"UnauthorizedUserError","message":"Guest is not allowed to do this operation."}}}}}},"403":{"description":"ForbiddenUserError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"ForbiddenUserError":{"value":{"code":"ForbiddenUserError","message":"Non-admin is not allow to do this operation."}},"ForbiddenTokenError":{"value":{"code":"ForbiddenUserError","message":"Applications are not allowed to do this operation."}}}}}}}},{"description":"get /api/v2/kubernetes/pods","tests":[{"operation":{"tag":"kubernetes","operationId":"getK8sPods","parameters":[],"response":{"statusCode":200}}}],"schemas":{"200":{"description":"Succeeded","content":{"application/json":{"example":["Please refer to Kubernetes API doc","https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.17/#list-all-namespaces-pod-v1-core"]}}},"401":{"description":"UnauthorizedUserError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"UnauthorizedUserError":{"value":{"code":"UnauthorizedUserError","message":"Guest is not allowed to do this operation."}}}}}},"403":{"description":"ForbiddenUserError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"ForbiddenUserError":{"value":{"code":"ForbiddenUserError","message":"Non-admin is not allow to do this operation."}},"ForbiddenTokenError":{"value":{"code":"ForbiddenUserError","message":"Applications are not allowed to do this operation."}}}}}}}}],"map":{"getClusterInfo":{"path":"/api/v2/info","method":"get","examples":{"200":{"name":"PAI RESTful API","version":"v1.0.1","launcherType":"k8s","authnMethod":"basic"}}},"getTokens":{"path":"/api/v2/tokens","method":"get","examples":{"200":{"tokens":["JWT Token Example"]},"401":{"value":{"code":"UnauthorizedUserError","message":"Guest is not allowed to do this operation."}}}},"deleteToken":{"path":"/api/v2/tokens/{token}","method":"delete","examples":{"200":{"message":"revoke successfully"},"401":{"value":{"code":"UnauthorizedUserError","message":"Guest is not allowed to do this operation."}},"403":{"value":{"code":"ForbiddenUserError","message":"Non-admin is not allow to do this operation."}}}},"createApplicationToken":{"path":"/api/v2/tokens/application","method":"post","examples":{"200":{"token":"JWT Token Example","application":true},"401":{"value":{"code":"UnauthorizedUserError","message":"Guest is not allowed to do this operation."}}}},"oidcLogin":{"path":"/api/v2/authn/oidc/login","method":"get","examples":{}},"oidcLogout":{"path":"/api/v2/authn/oidc/logout","method":"get","examples":{}},"basicLogin":{"path":"/api/v2/authn/basic/login","method":"post","examples":{"200":{"token":"JWT Token Example","user":"user","admin":true},"404":{"value":{"code":"NoUserError","message":"User {user} is not found."}}}},"basicLogout":{"path":"/api/v2/authn/basic/logout","method":"delete","examples":{"200":{"message":"Logout successfully"},"401":{"value":{"code":"UnauthorizedUserError","message":"Guest is not allowed to do this operation."}},"403":{"value":{"code":"ForbiddenUserError","message":"Non-admin is not allow to do this operation."}}}},"createUser":{"path":"/api/v2/users","method":"post","examples":{"201":{"message":"User is created successfully"},"401":{"value":{"code":"UnauthorizedUserError","message":"Guest is not allowed to do this operation."}},"403":{"value":{"code":"ForbiddenUserError","message":"Non-admin is not allow to do this operation."}},"409":{"value":{"code":"ConflictUserError","message":"User name {user} already exists."}},"500":{"value":{"code":"UnknownError","message":"Internal error message."}}}},"getAllUser":{"path":"/api/v2/users","method":"get","examples":{"200":[{"username":"username","admin":true,"virtualCluster":[],"storageConfig":[],"email":"email@test.com","extension":{}}],"500":{"value":{"code":"UnknownError","message":"Internal error message."}}}},"updateUser":{"path":"/api/v2/users","method":"put","examples":{"201":{"message":"update group {username} successfully."},"401":{"value":{"code":"UnauthorizedUserError","message":"Guest is not allowed to do this operation."}},"403":{"value":{"code":"ForbiddenUserError","message":"Non-admin is not allow to do this operation."}},"404":{"value":{"code":"NoUserError","message":"User {user} is not found."}},"500":{"value":{"code":"UnknownError","message":"Internal error message."}}}},"updateUserSelf":{"path":"/api/v2/users/me","method":"put","examples":{"201":{"message":"update group {username} successfully."},"401":{"value":{"code":"UnauthorizedUserError","message":"Guest is not allowed to do this operation."}},"403":{"value":{"code":"ForbiddenUserError","message":"Non-admin is not allow to do this operation."}},"404":{"value":{"code":"NoUserError","message":"User {user} is not found."}},"500":{"value":{"code":"UnknownError","message":"Internal error message."}}}},"getUser":{"path":"/api/v2/users/{user}","method":"get","examples":{"200":{"username":"username","admin":true,"virtualCluster":[],"storageConfig":[],"email":"email@test.com","extension":{}},"401":{"value":{"code":"UnauthorizedUserError","message":"Guest is not allowed to do this operation."}},"404":{"value":{"code":"NoUserError","message":"User {user} is not found."}},"500":{"value":{"code":"UnknownError","message":"Internal error message."}}}},"deleteUser":{"path":"/api/v2/users/{user}","method":"delete","examples":{"200":{"message":"user is removed successfully"},"401":{"value":{"code":"UnauthorizedUserError","message":"Guest is not allowed to do this operation."}},"403":{"value":{"code":"ForbiddenUserError","message":"Non-admin is not allow to do this operation."}},"404":{"value":{"code":"NoUserError","message":"User {user} is not found."}},"500":{"value":{"code":"UnknownError","message":"Internal error message."}}}},"updateUserGroup":{"path":"/api/v2/users/{user}/group/","method":"put","examples":{"201":{"message":"User {username} is added into group {groupname}"},"401":{"value":{"code":"UnauthorizedUserError","message":"Guest is not allowed to do this operation."}},"403":{"value":{"code":"ForbiddenUserError","message":"Non-admin is not allow to do this operation."}},"404":{"value":{"code":"NoUserError","message":"User {user} is not found."}},"500":{"value":{"code":"UnknownError","message":"Internal error message."}}}},"deleteUserGroup":{"path":"/api/v2/users/{user}/group/","method":"delete","examples":{"201":{"message":"User {username} is removed from group {groupname}"},"401":{"value":{"code":"UnauthorizedUserError","message":"Guest is not allowed to do this operation."}},"403":{"value":{"code":"ForbiddenUserError","message":"Non-admin is not allow to do this operation."}},"404":{"value":{"code":"NoUserError","message":"User {user} is not found."}},"500":{"value":{"code":"UnknownError","message":"Internal error message."}}}},"updateUserGrouplist":{"path":"/api/v2/users/{user}/grouplist/","method":"put","examples":{"201":{"message":"update user grouplist successfully."},"401":{"value":{"code":"UnauthorizedUserError","message":"Guest is not allowed to do this operation."}},"403":{"value":{"code":"ForbiddenUserError","message":"Non-admin is not allow to do this operation."}},"404":{"value":{"code":"NoUserError","message":"User {user} is not found."}},"500":{"value":{"code":"UnknownError","message":"Internal error message."}}}},"getAllGroup":{"path":"/api/v2/groups","method":"get","examples":{"200":[{"groupname":"groupName","description":"description","externalName":"externalName","extension":{}}],"500":{"value":{"code":"UnknownError","message":"Internal error message."}}}},"createGroup":{"path":"/api/v2/groups","method":"post","examples":{"201":{"message":"group is created successfully"},"401":{"value":{"code":"UnauthorizedUserError","message":"Guest is not allowed to do this operation."}},"403":{"value":{"code":"ForbiddenUserError","message":"Non-admin is not allow to do this operation."}},"500":{"value":{"code":"UnknownError","message":"Internal error message."}}}},"updateGroup":{"path":"/api/v2/groups","method":"put","examples":{"201":{"message":"update group {groupname} successfully."},"401":{"value":{"code":"UnauthorizedUserError","message":"Guest is not allowed to do this operation."}},"403":{"value":{"code":"ForbiddenUserError","message":"Non-admin is not allow to do this operation."}},"404":{"value":{"code":"NoGroupError","message":"Group {groupname} is not found."}},"500":{"value":{"code":"UnknownError","message":"Internal error message."}}}},"getGroup":{"path":"/api/v2/groups/{group}","method":"get","examples":{"200":{"groupname":"groupName","description":"description","externalName":"externalName","extension":{}},"401":{"value":{"code":"UnauthorizedUserError","message":"Guest is not allowed to do this operation."}},"404":{"value":{"code":"NoGroupError","message":"Group {groupname} is not found."}},"500":{"value":{"code":"UnknownError","message":"Internal error message."}}}},"deleteGroup":{"path":"/api/v2/groups/{group}","method":"delete","examples":{"201":{"message":"group is removed successfully"},"401":{"value":{"code":"UnauthorizedUserError","message":"Guest is not allowed to do this operation."}},"403":{"value":{"code":"ForbiddenUserError","message":"Non-admin is not allow to do this operation."}},"500":{"value":{"code":"UnknownError","message":"Internal error message."}}}},"getGroupMembers":{"path":"/api/v2/groups/{group}/userlist","method":"get","examples":{"200":[{"username":"username","clusterAdmin":false}],"401":{"value":{"code":"UnauthorizedUserError","message":"Guest is not allowed to do this operation."}},"500":{"value":{"code":"UnknownError","message":"Internal error message."}}}},"listVirtualClusters":{"path":"/api/v2/virtual-clusters","method":"get","examples":{"500":{"value":{"code":"UnknownError","message":"Internal error message."}}}},"getVirtualCluster":{"path":"/api/v2/virtual-clusters/{vc}","method":"get","examples":{"200":{"capacity":70,"usedCapacity":30,"dedicated":false,"resourcesUsed":{"cpu":1,"memory":1024,"gpu":1,"vCores":1,"GPUs":1},"resourcesGuaranteed":{"cpu":2,"memory":2048,"gpu":2,"vCores":2,"GPUs":2},"resourcesTotal":{"cpu":2,"memory":2048,"gpu":2,"vCores":2,"GPUs":2},"maxCapacity":70},"404":{"value":{"code":"NoVirtualClusterError","message":"Virtual cluster {vc} is not found."}},"500":{"value":{"code":"UnknownError","message":"Internal error message."}}}},"getStorages":{"path":"/api/v2/storages","method":"get","examples":{"200":{"storages":[{"name":"name","share":true,"volumeName":"volumeName"}]},"500":{"value":{"code":"UnknownError","message":"Internal error message."}}}},"getStorage":{"path":"/api/v2/storages/{storage}","method":"get","examples":{"200":{"name":"nfs-storage-name","share":true,"volumeName":"nfs-volume-name","type":"nfs","data":{"server":"","path":"/data"}},"403":{"value":{"code":"ForbiddenUserError","message":"User {user} is not allowed to access {storage}."}},"404":{"value":{"code":"NoStorageError","message":"Storage {storage} is not found."}},"500":{"value":{"code":"UnknownError","message":"Internal error message."}}}},"createJob":{"path":"/api/v2/jobs","method":"post","examples":{"202":{"message":"update job {job} successfully"},"400":{"value":{"code":"NoVirtualClusterError","message":"Virtual cluster {vc} is not found."}},"403":{"value":{"code":"ForbiddenUserError","message":"Non-admin is not allow to do this operation."}},"409":{"value":{"code":"ConflictJobError","message":"Job name {job} already exists."}},"500":{"value":{"code":"UnknownError","message":"Internal error message."}}}},"listJobs":{"path":"/api/v2/jobs","method":"get","examples":{"200":[{"name":"job name","username":"user name","state":"SUCCEEDED","subState":"Completed","executionType":"STOP","retries":0,"createdTime":0,"completedTime":0,"appExitCode":0,"virtualCluster":"unknown"}],"500":{"value":{"code":"UnknownError","message":"Internal error message."}}}},"getJob":{"path":"/api/v2/jobs/{user}~{job}","method":"get","examples":{"200":{"name":"job name","jobStatus":{"username":"user name","state":"SUCCEEDED","subState":"Completed","executionType":"STOP","retries":0,"createdTime":0,"completedTime":0,"appId":"id","appLaunchedTime":0,"appCompletedTime":0,"appExitCode":0,"virtualCluster":"unknown"},"taskRoles":{"taskrole":{"taskRoleStatus":{"name":"task role name"},"taskStatuses":[{"taskIndex":0,"taskState":"SUCCEEDED"}]}}},"404":{"value":{"code":"NoJobError","message":"Job {job} is not found."}},"500":{"value":{"code":"UnknownError","message":"Internal error message."}}}},"getJobConfig":{"path":"/api/v2/jobs/{user}~{job}/config","method":"get","examples":{"404":{"value":{"code":"NoJobError","message":"Job {job} is not found."}},"500":{"value":{"code":"UnknownError","message":"Internal error message."}}}},"updateJobExecutionType":{"path":"/api/v2/jobs/{user}~{job}/exectionType","method":"put","examples":{"202":{"message":"execute job {job} successfully"},"404":{"value":{"code":"NoJobError","message":"Job {job} is not found."}},"500":{"value":{"code":"UnknownError","message":"Internal error message."}}}},"getJobAttemptsHealthz":{"path":"/api/v2/jobs/{user}~{job}/job-attempts/healthz","method":"get","examples":{}},"getJobAttempts":{"path":"/api/v2/jobs/{user}~{job}/job-attempts","method":"get","examples":{"404":{"value":{"code":"NoJobError","message":"Job {job} is not found."}},"501":{"value":{"code":"UnknownError","message":"Internal error message."}}}},"getJobAttempt":{"path":"/api/v2/jobs/{user}~{job}/job-attempts/{attemptIndex}","method":"get","examples":{"404":{"value":{"code":"NoJobError","message":"Job {job} is not found."}},"501":{"value":{"code":"UnknownError","message":"Internal error message."}}}},"getK8sNodes":{"path":"/api/v2/kubernetes/nodes","method":"get","examples":{"200":["Please refer to Kubernetes API doc","https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.17/#list-node-v1-core"],"401":{"value":{"code":"UnauthorizedUserError","message":"Guest is not allowed to do this operation."}},"403":{"value":{"code":"ForbiddenUserError","message":"Non-admin is not allow to do this operation."}}}},"getK8sPods":{"path":"/api/v2/kubernetes/pods","method":"get","examples":{"200":["Please refer to Kubernetes API doc","https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.17/#list-all-namespaces-pod-v1-core"],"401":{"value":{"code":"UnauthorizedUserError","message":"Guest is not allowed to do this operation."}},"403":{"value":{"code":"ForbiddenUserError","message":"Non-admin is not allow to do this operation."}}}}}} \ No newline at end of file +{"tests":[{"description":"get /api/v2/info","tests":[{"operation":{"tag":"api","operationId":"getClusterInfo","parameters":[],"response":{"statusCode":200,"schema":{"type":"object","properties":{"name":{"type":"string","description":"PAI RESTfulAPI"},"version":{"type":"string","description":"cluster version in v0.X.0 format"},"launcherType":{"type":"string","enum":["yarn","k8s"]},"authnMethod":{"type":"string","enum":["basic","OIDC"]}},"required":["name","version","launcherType","authnMethod"]},"contentType":"application/json"}}}],"schemas":{"200":{"description":"Succeeded","content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","description":"PAI RESTfulAPI"},"version":{"type":"string","description":"cluster version in v0.X.0 format"},"launcherType":{"type":"string","enum":["yarn","k8s"]},"authnMethod":{"type":"string","enum":["basic","OIDC"]}},"required":["name","version","launcherType","authnMethod"]},"example":{"name":"PAI RESTful API","version":"v1.0.1","launcherType":"k8s","authnMethod":"basic"}}}}}},{"before":[{"tag":"token","operationId":"createApplicationToken"}],"tests":[{"description":"Get tokens with user token","operation":{"tag":"token","operationId":"getTokens","parameters":[],"response":{"statusCode":200,"schema":{"type":"object","properties":{"tokens":{"type":"array","items":{"type":"string"},"description":"JWT string list"}},"required":["tokens"]},"contentType":"application/json"}}},{"description":"Get tokens with unauthorized token","customizedTest":"getTokensWithUnauthorizedUser","operation":{"tag":"token","operationId":"getTokens","parameters":[],"response":{"statusCode":200,"schema":{"type":"object","properties":{"tokens":{"type":"array","items":{"type":"string"},"description":"JWT string list"}},"required":["tokens"]},"contentType":"application/json"}}}],"after":[{"tag":"token","operationId":"deleteToken","parameters":[{"type":"fromResult","resultType":"beforeResults","resultPath":["token"],"resultIndex":0}]}],"schemas":{"200":{"description":"Succeeded","content":{"application/json":{"schema":{"type":"object","properties":{"tokens":{"type":"array","items":{"type":"string"},"description":"JWT string list"}},"required":["tokens"]},"example":{"tokens":["JWT Token Example"]}}}},"401":{"description":"UnauthorizedUserError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"UnauthorizedUserError":{"value":{"code":"UnauthorizedUserError","message":"Guest is not allowed to do this operation."}}}}}}},"description":"get /api/v2/tokens"},{"before":[{"tag":"token","operationId":"createApplicationToken"}],"tests":[{"operation":{"parameters":[{"type":"fromResult","resultType":"beforeResults","resultPath":["token"],"resultIndex":0}],"tag":"token","operationId":"deleteToken","response":{"statusCode":200,"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"contentType":"application/json"}}}],"schemas":{"200":{"description":"Succeeded","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"example":{"message":"revoke successfully"}}}},"401":{"description":"UnauthorizedUserError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"UnauthorizedUserError":{"value":{"code":"UnauthorizedUserError","message":"Guest is not allowed to do this operation."}}}}}},"403":{"description":"ForbiddenUserError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"ForbiddenUserError":{"value":{"code":"ForbiddenUserError","message":"Non-admin is not allow to do this operation."}},"ForbiddenTokenError":{"value":{"code":"ForbiddenUserError","message":"Applications are not allowed to do this operation."}}}}}}},"description":"delete /api/v2/tokens/{token}"},{"tests":[{"operation":{"tag":"token","operationId":"createApplicationToken","parameters":[],"response":{"statusCode":200,"schema":{"type":"object","properties":{"token":{"type":"string","description":"your access token"},"application":{"type":"boolean","description":"true"}}},"contentType":"application/json"}}}],"after":[{"tag":"token","operationId":"deleteToken","parameters":[{"type":"fromResult","resultType":"testResults","resultPath":["token"],"resultIndex":0}]}],"schemas":{"200":{"description":"Succeeded","content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string","description":"your access token"},"application":{"type":"boolean","description":"true"}}},"example":{"token":"JWT Token Example","application":true}}}},"401":{"description":"UnauthorizedUserError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"UnauthorizedUserError":{"value":{"code":"UnauthorizedUserError","message":"Guest is not allowed to do this operation."}}}}}}},"description":"post /api/v2/tokens/application"},{"description":"get /api/v2/authn/oidc/login","tests":[{"operation":{"tag":"authn","operationId":"oidcLogin","parameters":[]}}],"schemas":{"302":{"description":"Redirect"}}},{"description":"get /api/v2/authn/oidc/logout","tests":[{"operation":{"tag":"authn","operationId":"oidcLogout","parameters":[]}}],"schemas":{"302":{"description":"Redirect"}}},{"tests":[{"description":"login with correct username and password","operation":{"parameters":[{"type":"raw","value":"sdk_test"},{"type":"raw","value":"pwd"}],"tag":"authn","operationId":"basicLogin","response":{"statusCode":200,"schema":{"type":"object","properties":{"token":{"type":"string","description":"your access token"},"user":{"type":"string","description":"username"},"admin":{"type":"boolean","description":"true if user is admin"}},"required":["token","user","admin"]},"contentType":"application/json"}}},{"description":"login with non-existent username","operation":{"parameters":[{"type":"raw","value":"nonexistentuser"},{"type":"raw","value":"password"}],"response":{"statusCode":400,"expectResult":{"code":"NoUserError","message":"User nonexistentuser is not found."},"schema":{"description":"NoUserError or IncorrectPassworkError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]}}}}},"tag":"authn","operationId":"basicLogin"}},{"description":"login with incorrect password","operation":{"parameters":[{"type":"raw","value":"sdk_test"},{"type":"raw","value":"incorrectpassword"}],"response":{"statusCode":400,"expectResult":{"code":"IncorrectPasswordError","message":"Password is incorrect."},"schema":{"description":"NoUserError or IncorrectPassworkError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]}}}}},"tag":"authn","operationId":"basicLogin"}}],"after":[{"tag":"token","operationId":"deleteToken","parameters":[{"type":"fromResult","resultType":"testResults","resultPath":["token"],"resultIndex":0}]}],"schemas":{"200":{"description":"Succeeded","content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string","description":"your access token"},"user":{"type":"string","description":"username"},"admin":{"type":"boolean","description":"true if user is admin"}},"required":["token","user","admin"]},"example":{"token":"JWT Token Example","user":"user","admin":true}}}},"400":{"description":"NoUserError or IncorrectPassworkError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]}}}},"404":{"description":"NoUserError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"NoUserError":{"value":{"code":"NoUserError","message":"User {user} is not found."}}}}}}},"description":"post /api/v2/authn/basic/login"},{"before":[{"tag":"authn","operationId":"basicLogin","parameters":[{"type":"raw","value":"sdk_test"},{"type":"raw","value":"pwd"}]}],"tests":[{"description":"Logout with correct token","customizedTest":"logoutWithCorrectToken","operation":{"tag":"authn","operationId":"basicLogout","parameters":[],"response":{"statusCode":200,"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"contentType":"application/json"}}},{"description":"Logout with incorrect token","customizedTest":"logoutWithIncorrectToken","operation":{"tag":"authn","operationId":"basicLogout","parameters":[],"response":{"statusCode":200,"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"contentType":"application/json"}}}],"schemas":{"200":{"description":"Succeeded","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"example":{"message":"Logout successfully"}}}},"401":{"description":"UnauthorizedUserError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"UnauthorizedUserError":{"value":{"code":"UnauthorizedUserError","message":"Guest is not allowed to do this operation."}}}}}},"403":{"description":"ForbiddenUserError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"ForbiddenUserError":{"value":{"code":"ForbiddenUserError","message":"Non-admin is not allow to do this operation."}},"ForbiddenTokenError":{"value":{"code":"ForbiddenUserError","message":"Applications are not allowed to do this operation."}}}}}}},"description":"delete /api/v2/authn/basic/logout"},{"before":[{"tag":"token","operationId":"createApplicationToken"}],"tests":[{"description":"Create a user","operation":{"tag":"user","operationId":"createUser","parameters":[{"type":"raw","value":{"username":"sdk_test_user","password":"test_password"}}],"response":{"statusCode":201,"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"contentType":"application/json"}}},{"description":"Create a conflict user","operation":{"tag":"user","operationId":"createUser","parameters":[{"type":"raw","value":{"username":"sdk_test_user","password":"test_password"}}],"response":{"statusCode":409,"schema":{"description":"ConflictUserError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"ConflictUserError":{"value":{"code":"ConflictUserError","message":"User name {user} already exists."}}}}}}}}},{"description":"Create a user by application token","customizedTest":"createUserByApplicationToken","operation":{"tag":"user","operationId":"createUser","parameters":[],"response":{"statusCode":201,"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"contentType":"application/json"}}},{"description":"Create a user by non-admin user token","customizedTest":"createUserByNonadminToken","operation":{"tag":"user","operationId":"createUser","parameters":[],"response":{"statusCode":201,"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"contentType":"application/json"}}}],"after":[{"tag":"user","operationId":"deleteUser","parameters":[{"type":"raw","value":"sdk_test_user"}],"response":{"statusCode":200,"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"contentType":"application/json"}},{"tag":"token","operationId":"deleteToken","parameters":[{"type":"fromResult","resultType":"beforeResults","resultPath":["token"],"resultIndex":0}]}],"schemas":{"201":{"description":"Succeeded","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"example":{"message":"User is created successfully"}}}},"401":{"description":"UnauthorizedUserError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"UnauthorizedUserError":{"value":{"code":"UnauthorizedUserError","message":"Guest is not allowed to do this operation."}}}}}},"403":{"description":"ForbiddenUserError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"ForbiddenUserError":{"value":{"code":"ForbiddenUserError","message":"Non-admin is not allow to do this operation."}},"ForbiddenTokenError":{"value":{"code":"ForbiddenUserError","message":"Applications are not allowed to do this operation."}}}}}},"409":{"description":"ConflictUserError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"ConflictUserError":{"value":{"code":"ConflictUserError","message":"User name {user} already exists."}}}}}},"500":{"description":"UnknownError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"UnknownError":{"value":{"code":"UnknownError","message":"Internal error message."}}}}}}},"description":"post /api/v2/users"},{"description":"get /api/v2/users","tests":[{"operation":{"tag":"user","operationId":"getAllUser","parameters":[],"response":{"statusCode":200,"schema":{"description":"Array with all users in the system.","type":"array","items":{"type":"object","properties":{"username":{"type":"string","description":"user name"},"admin":{"type":"boolean","description":"Admin or not."},"virtualCluster":{"type":"array","description":"The list of virtualCluster which the user can access.","items":{"type":"string","description":"virtual cluster name."}},"storageConfig":{"type":"array","description":"storageconfig string arry","items":{"type":"string"}},"email":{"type":"string","description":"email address"},"extension":{"type":"object","description":"extension field."}},"required":["username","admin","virtualCluster","storageConfig","email","extension"]}},"contentType":"application/json"}}}],"schemas":{"200":{"description":"Succeeded","content":{"application/json":{"schema":{"description":"Array with all users in the system.","type":"array","items":{"type":"object","properties":{"username":{"type":"string","description":"user name"},"admin":{"type":"boolean","description":"Admin or not."},"virtualCluster":{"type":"array","description":"The list of virtualCluster which the user can access.","items":{"type":"string","description":"virtual cluster name."}},"storageConfig":{"type":"array","description":"storageconfig string arry","items":{"type":"string"}},"email":{"type":"string","description":"email address"},"extension":{"type":"object","description":"extension field."}},"required":["username","admin","virtualCluster","storageConfig","email","extension"]}},"example":[{"username":"username","admin":true,"virtualCluster":[],"storageConfig":[],"email":"email@test.com","extension":{}}]}}},"500":{"description":"UnknownError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"UnknownError":{"value":{"code":"UnknownError","message":"Internal error message."}}}}}}}},{"before":[{"tag":"user","operationId":"createUser","parameters":[{"type":"raw","value":{"username":"sdk_test_user","password":"test_password"}}],"response":{"statusCode":201,"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"contentType":"application/json"}},{"tag":"token","operationId":"createApplicationToken"}],"tests":[{"description":"Update a user, patch: true","operation":{"parameters":[{"type":"raw","value":{"username":"sdk_test_user","email":"new_email@test1.com"}}],"tag":"user","operationId":"updateUser","response":{"statusCode":201,"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"contentType":"application/json"}}},{"description":"Update a user, patch: false","operation":{"parameters":[{"type":"raw","value":{"username":"sdk_test_user","email":"new_email@test2.com","virtualCluster":["default"],"admin":false,"password":"new_test_password","extension":{}}},{"type":"raw","value":false}],"tag":"user","operationId":"updateUser","response":{"statusCode":201,"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"contentType":"application/json"}}},{"description":"Update a non-existent user","operation":{"parameters":[{"type":"raw","value":{"username":"non_exist_user","email":"new_email@test1.com"}}],"response":{"statusCode":404,"schema":{"description":"NoUserError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"NoUserError":{"value":{"code":"NoUserError","message":"User {user} is not found."}}}}}}},"tag":"user","operationId":"updateUser"}},{"description":"Update a user by application token","customizedTest":"updateUserByApplicationToken","operation":{"tag":"user","operationId":"updateUser","parameters":[],"response":{"statusCode":201,"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"contentType":"application/json"}}},{"description":"Update a user by non-admin user token","customizedTest":"updateUserByNonadminToken","operation":{"tag":"user","operationId":"updateUser","parameters":[],"response":{"statusCode":201,"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"contentType":"application/json"}}}],"after":[{"tag":"user","operationId":"deleteUser","parameters":[{"type":"raw","value":"sdk_test_user"}],"response":{"statusCode":200,"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"contentType":"application/json"}},{"tag":"token","operationId":"deleteToken","parameters":[{"type":"fromResult","resultType":"beforeResults","resultPath":["token"],"resultIndex":1}]}],"schemas":{"201":{"description":"Succeeded","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"example":{"message":"update group {username} successfully."}}}},"401":{"description":"UnauthorizedUserError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"UnauthorizedUserError":{"value":{"code":"UnauthorizedUserError","message":"Guest is not allowed to do this operation."}}}}}},"403":{"description":"ForbiddenUserError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"ForbiddenUserError":{"value":{"code":"ForbiddenUserError","message":"Non-admin is not allow to do this operation."}},"ForbiddenTokenError":{"value":{"code":"ForbiddenUserError","message":"Applications are not allowed to do this operation."}}}}}},"404":{"description":"NoUserError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"NoUserError":{"value":{"code":"NoUserError","message":"User {user} is not found."}}}}}},"500":{"description":"UnknownError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"UnknownError":{"value":{"code":"UnknownError","message":"Internal error message."}}}}}}},"description":"put /api/v2/users"},{"tests":[{"description":"Update user self, patch: true","operation":{"parameters":[{"type":"raw","value":{"username":"sdk_test","email":"new_email@test1.com"}}],"tag":"user","operationId":"updateUserSelf","response":{"statusCode":201,"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"contentType":"application/json"}}},{"description":"Update user self, patch: false","operation":{"parameters":[{"type":"raw","value":{"username":"sdk_test","email":"new_email@test2.com","oldPassword":"pwd","newPassword":"pwd"}},{"type":"raw","value":false}],"tag":"user","operationId":"updateUserSelf","response":{"statusCode":201,"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"contentType":"application/json"}}},{"description":"Update user self with incorrect username","operation":{"parameters":[{"type":"raw","value":{"username":"incorrect_username","email":"new_email@test1.com"}}],"response":{"statusCode":403,"schema":{"description":"ForbiddenUserError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"ForbiddenUserError":{"value":{"code":"ForbiddenUserError","message":"Non-admin is not allow to do this operation."}},"ForbiddenTokenError":{"value":{"code":"ForbiddenUserError","message":"Applications are not allowed to do this operation."}}}}}}},"tag":"user","operationId":"updateUserSelf"}}],"schemas":{"201":{"description":"Succeeded","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"example":{"message":"update group {username} successfully."}}}},"401":{"description":"UnauthorizedUserError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"UnauthorizedUserError":{"value":{"code":"UnauthorizedUserError","message":"Guest is not allowed to do this operation."}}}}}},"403":{"description":"ForbiddenUserError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"ForbiddenUserError":{"value":{"code":"ForbiddenUserError","message":"Non-admin is not allow to do this operation."}},"ForbiddenTokenError":{"value":{"code":"ForbiddenUserError","message":"Applications are not allowed to do this operation."}}}}}},"404":{"description":"NoUserError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"NoUserError":{"value":{"code":"NoUserError","message":"User {user} is not found."}}}}}},"500":{"description":"UnknownError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"UnknownError":{"value":{"code":"UnknownError","message":"Internal error message."}}}}}}},"description":"put /api/v2/users/me"},{"tests":[{"operation":{"parameters":[{"type":"raw","value":"sdk_test"}],"tag":"user","operationId":"getUser","response":{"statusCode":200,"schema":{"type":"object","properties":{"username":{"type":"string","description":"user name"},"admin":{"type":"boolean","description":"Admin or not."},"virtualCluster":{"type":"array","description":"The list of virtualCluster which the user can access.","items":{"type":"string","description":"virtual cluster name."}},"storageConfig":{"type":"array","description":"storageconfig string arry","items":{"type":"string"}},"email":{"type":"string","description":"email address"},"extension":{"type":"object","description":"extension field."}},"required":["username","admin","virtualCluster","storageConfig","email","extension"]},"contentType":"application/json"}}}],"schemas":{"200":{"description":"Succeeded","content":{"application/json":{"schema":{"type":"object","properties":{"username":{"type":"string","description":"user name"},"admin":{"type":"boolean","description":"Admin or not."},"virtualCluster":{"type":"array","description":"The list of virtualCluster which the user can access.","items":{"type":"string","description":"virtual cluster name."}},"storageConfig":{"type":"array","description":"storageconfig string arry","items":{"type":"string"}},"email":{"type":"string","description":"email address"},"extension":{"type":"object","description":"extension field."}},"required":["username","admin","virtualCluster","storageConfig","email","extension"]},"example":{"username":"username","admin":true,"virtualCluster":[],"storageConfig":[],"email":"email@test.com","extension":{}}}}},"401":{"description":"UnauthorizedUserError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"UnauthorizedUserError":{"value":{"code":"UnauthorizedUserError","message":"Guest is not allowed to do this operation."}}}}}},"404":{"description":"NoUserError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"NoUserError":{"value":{"code":"NoUserError","message":"User {user} is not found."}}}}}},"500":{"description":"UnknownError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"UnknownError":{"value":{"code":"UnknownError","message":"Internal error message."}}}}}}},"description":"get /api/v2/users/{user}"},{"before":[{"tag":"user","operationId":"createUser","parameters":[{"type":"raw","value":{"username":"sdk_test_user","password":"test_password"}}],"response":{"statusCode":201,"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"contentType":"application/json"}},{"tag":"token","operationId":"createApplicationToken"}],"tests":[{"description":"Delete a user","operation":{"tag":"user","operationId":"deleteUser","parameters":[{"type":"raw","value":"sdk_test_user"}],"response":{"statusCode":200,"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"contentType":"application/json"}}},{"description":"Delete a non-existent user","operation":{"parameters":[{"type":"raw","value":"non_exist_user"}],"response":{"statusCode":404,"schema":{"description":"NoUserError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"NoUserError":{"value":{"code":"NoUserError","message":"User {user} is not found."}}}}}}},"tag":"user","operationId":"deleteUser"}},{"description":"Delete a user by application token","customizedTest":"deleteUserByApplicationToken","operation":{"tag":"user","operationId":"deleteUser","parameters":[],"response":{"statusCode":200,"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"contentType":"application/json"}}},{"description":"Delete a user by non-admin user token","customizedTest":"deleteUserByNonadminToken","operation":{"tag":"user","operationId":"deleteUser","parameters":[],"response":{"statusCode":200,"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"contentType":"application/json"}}}],"after":[{"tag":"token","operationId":"deleteToken","parameters":[{"type":"fromResult","resultType":"beforeResults","resultPath":["token"],"resultIndex":1}]}],"schemas":{"200":{"description":"Succeeded","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"example":{"message":"user is removed successfully"}}}},"401":{"description":"UnauthorizedUserError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"UnauthorizedUserError":{"value":{"code":"UnauthorizedUserError","message":"Guest is not allowed to do this operation."}}}}}},"403":{"description":"ForbiddenUserError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"ForbiddenUserError":{"value":{"code":"ForbiddenUserError","message":"Non-admin is not allow to do this operation."}},"ForbiddenTokenError":{"value":{"code":"ForbiddenUserError","message":"Applications are not allowed to do this operation."}}}}}},"404":{"description":"NoUserError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"NoUserError":{"value":{"code":"NoUserError","message":"User {user} is not found."}}}}}},"500":{"description":"UnknownError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"UnknownError":{"value":{"code":"UnknownError","message":"Internal error message."}}}}}}},"description":"delete /api/v2/users/{user}"},{"before":[{"tag":"token","operationId":"createApplicationToken"},{"tag":"user","operationId":"createUser","parameters":[{"type":"raw","value":{"username":"sdk_test_user","password":"test_password"}}],"response":{"statusCode":201,"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"contentType":"application/json"}},{"tag":"group","operationId":"createGroup","parameters":[{"type":"raw","value":{"groupname":"sdktestgroup"}}],"response":{"statusCode":201,"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"contentType":"application/json"}}],"tests":[{"description":"Add a group to a user's grouplist","operation":{"parameters":[{"type":"raw","value":"sdk_test_user"},{"type":"raw","value":"sdktestgroup"}],"tag":"user","operationId":"updateUserGroup","response":{"statusCode":201,"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"contentType":"application/json"}}},{"description":"Add a group to a non-existent user's grouplist","operation":{"parameters":[{"type":"raw","value":"non_exist_user"},{"type":"raw","value":"sdktestgroup"}],"response":{"statusCode":404,"schema":{"description":"NoUserError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"NoUserError":{"value":{"code":"NoUserError","message":"User {user} is not found."}}}}}}},"tag":"user","operationId":"updateUserGroup"}},{"description":"Add a group to a user's grouplist by application token","customizedTest":"updateUserGroupByApplicationToken","operation":{"tag":"user","operationId":"updateUserGroup","parameters":[],"response":{"statusCode":201,"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"contentType":"application/json"}}},{"description":"Add a group to a user's grouplist by non-admin user token","customizedTest":"updateUserGroupByNonadminToken","operation":{"tag":"user","operationId":"updateUserGroup","parameters":[],"response":{"statusCode":201,"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"contentType":"application/json"}}}],"after":[{"tag":"token","operationId":"deleteToken","parameters":[{"type":"fromResult","resultType":"beforeResults","resultPath":["token"],"resultIndex":0}]},{"tag":"user","operationId":"deleteUser","parameters":[{"type":"raw","value":"sdk_test_user"}],"response":{"statusCode":200,"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"contentType":"application/json"}},{"tag":"group","operationId":"deleteGroup","parameters":[{"type":"raw","value":"sdktestgroup"}],"response":{"statusCode":201,"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"contentType":"application/json"}}],"schemas":{"201":{"description":"Succeeded","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"example":{"message":"User {username} is added into group {groupname}"}}}},"401":{"description":"UnauthorizedUserError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"UnauthorizedUserError":{"value":{"code":"UnauthorizedUserError","message":"Guest is not allowed to do this operation."}}}}}},"403":{"description":"ForbiddenUserError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"ForbiddenUserError":{"value":{"code":"ForbiddenUserError","message":"Non-admin is not allow to do this operation."}},"ForbiddenTokenError":{"value":{"code":"ForbiddenUserError","message":"Applications are not allowed to do this operation."}}}}}},"404":{"description":"NoUserError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"NoUserError":{"value":{"code":"NoUserError","message":"User {user} is not found."}}}}}},"500":{"description":"UnknownError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"UnknownError":{"value":{"code":"UnknownError","message":"Internal error message."}}}}}}},"description":"put /api/v2/users/{user}/group/"},{"before":[{"tag":"token","operationId":"createApplicationToken"},{"tag":"user","operationId":"createUser","parameters":[{"type":"raw","value":{"username":"sdk_test_user","password":"test_password"}}],"response":{"statusCode":201,"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"contentType":"application/json"}},{"tag":"group","operationId":"createGroup","parameters":[{"type":"raw","value":{"groupname":"sdktestgroup"}}],"response":{"statusCode":201,"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"contentType":"application/json"}},{"tag":"user","operationId":"updateUserGroup","parameters":[{"type":"raw","value":"sdk_test_user"},{"type":"raw","value":"sdktestgroup"}]}],"tests":[{"description":"Remove a group to a user's grouplist","operation":{"parameters":[{"type":"raw","value":"sdk_test_user"},{"type":"raw","value":"sdktestgroup"}],"tag":"user","operationId":"deleteUserGroup","response":{"statusCode":201,"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"contentType":"application/json"}}},{"description":"Remove a group to a non-existent user's grouplist","operation":{"parameters":[{"type":"raw","value":"non_exist_user"},{"type":"raw","value":"sdktestgroup"}],"response":{"statusCode":404,"schema":{"description":"NoUserError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"NoUserError":{"value":{"code":"NoUserError","message":"User {user} is not found."}}}}}}},"tag":"user","operationId":"deleteUserGroup"}},{"description":"Remove a group to a user's grouplist by application token","customizedTest":"deleteUserGroupByApplicationToken","operation":{"tag":"user","operationId":"deleteUserGroup","parameters":[],"response":{"statusCode":201,"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"contentType":"application/json"}}},{"description":"Remove a group to a user's grouplist by non-admin user token","customizedTest":"deleteUserGroupByNonadminToken","operation":{"tag":"user","operationId":"deleteUserGroup","parameters":[],"response":{"statusCode":201,"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"contentType":"application/json"}}}],"after":[{"tag":"token","operationId":"deleteToken","parameters":[{"type":"fromResult","resultType":"beforeResults","resultPath":["token"],"resultIndex":0}]},{"tag":"user","operationId":"deleteUser","parameters":[{"type":"raw","value":"sdk_test_user"}],"response":{"statusCode":200,"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"contentType":"application/json"}},{"tag":"group","operationId":"deleteGroup","parameters":[{"type":"raw","value":"sdktestgroup"}],"response":{"statusCode":201,"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"contentType":"application/json"}}],"schemas":{"201":{"description":"Succeeded","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"example":{"message":"User {username} is removed from group {groupname}"}}}},"401":{"description":"UnauthorizedUserError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"UnauthorizedUserError":{"value":{"code":"UnauthorizedUserError","message":"Guest is not allowed to do this operation."}}}}}},"403":{"description":"ForbiddenUserError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"ForbiddenUserError":{"value":{"code":"ForbiddenUserError","message":"Non-admin is not allow to do this operation."}},"ForbiddenTokenError":{"value":{"code":"ForbiddenUserError","message":"Applications are not allowed to do this operation."}}}}}},"404":{"description":"NoUserError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"NoUserError":{"value":{"code":"NoUserError","message":"User {user} is not found."}}}}}},"500":{"description":"UnknownError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"UnknownError":{"value":{"code":"UnknownError","message":"Internal error message."}}}}}}},"description":"delete /api/v2/users/{user}/group/"},{"before":[{"tag":"token","operationId":"createApplicationToken"},{"tag":"user","operationId":"createUser","parameters":[{"type":"raw","value":{"username":"sdk_test_user","password":"test_password"}}],"response":{"statusCode":201,"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"contentType":"application/json"}}],"tests":[{"description":"Replace a user's grouplist","operation":{"parameters":[{"type":"raw","value":"sdk_test_user"},{"type":"raw","value":["default"]}],"tag":"user","operationId":"updateUserGrouplist","response":{"statusCode":201,"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"contentType":"application/json"}}},{"description":"Replace a non-existent user's grouplist","operation":{"parameters":[{"type":"raw","value":"non_exist_user"},{"type":"raw","value":["default"]}],"response":{"statusCode":404,"schema":{"description":"NoUserError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"NoUserError":{"value":{"code":"NoUserError","message":"User {user} is not found."}}}}}}},"tag":"user","operationId":"updateUserGrouplist"}},{"description":"Replace a user's grouplist by application token","customizedTest":"updateUserGrouplistByApplicationToken","operation":{"tag":"user","operationId":"updateUserGrouplist","parameters":[],"response":{"statusCode":201,"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"contentType":"application/json"}}},{"description":"Replace a user's grouplist by non-admin user token","customizedTest":"updateUserGrouplistByNonadminToken","operation":{"tag":"user","operationId":"updateUserGrouplist","parameters":[],"response":{"statusCode":201,"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"contentType":"application/json"}}}],"after":[{"tag":"token","operationId":"deleteToken","parameters":[{"type":"fromResult","resultType":"beforeResults","resultPath":["token"],"resultIndex":0}]},{"tag":"user","operationId":"deleteUser","parameters":[{"type":"raw","value":"sdk_test_user"}],"response":{"statusCode":200,"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"contentType":"application/json"}}],"schemas":{"201":{"description":"Succeeded","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"example":{"message":"update user grouplist successfully."}}}},"401":{"description":"UnauthorizedUserError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"UnauthorizedUserError":{"value":{"code":"UnauthorizedUserError","message":"Guest is not allowed to do this operation."}}}}}},"403":{"description":"ForbiddenUserError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"ForbiddenUserError":{"value":{"code":"ForbiddenUserError","message":"Non-admin is not allow to do this operation."}},"ForbiddenTokenError":{"value":{"code":"ForbiddenUserError","message":"Applications are not allowed to do this operation."}}}}}},"404":{"description":"NoUserError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"NoUserError":{"value":{"code":"NoUserError","message":"User {user} is not found."}}}}}},"500":{"description":"UnknownError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"UnknownError":{"value":{"code":"UnknownError","message":"Internal error message."}}}}}}},"description":"put /api/v2/users/{user}/grouplist/"},{"description":"get /api/v2/groups","tests":[{"operation":{"tag":"group","operationId":"getAllGroup","parameters":[],"response":{"statusCode":200,"schema":{"description":"Array with all groups in the system.","type":"array","items":{"type":"object","properties":{"groupname":{"type":"string","description":"group name"},"description":{"type":"string","description":"description for the group"},"externalName":{"type":"string","description":"the external group name binding with the group in OpenPAI"},"extension":{"type":"object"}}}},"contentType":"application/json"}}}],"schemas":{"200":{"description":"Succeeded","content":{"application/json":{"schema":{"description":"Array with all groups in the system.","type":"array","items":{"type":"object","properties":{"groupname":{"type":"string","description":"group name"},"description":{"type":"string","description":"description for the group"},"externalName":{"type":"string","description":"the external group name binding with the group in OpenPAI"},"extension":{"type":"object"}}}},"example":[{"groupname":"groupName","description":"description","externalName":"externalName","extension":{}}]}}},"500":{"description":"UnknownError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"UnknownError":{"value":{"code":"UnknownError","message":"Internal error message."}}}}}}}},{"tests":[{"operation":{"tag":"group","operationId":"createGroup","parameters":[{"type":"raw","value":{"groupname":"sdktestgroup"}}],"response":{"statusCode":201,"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"contentType":"application/json"}}}],"after":[{"tag":"group","operationId":"deleteGroup","parameters":[{"type":"raw","value":"sdktestgroup"}],"response":{"statusCode":201,"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"contentType":"application/json"}}],"schemas":{"201":{"description":"Succeeded","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"example":{"message":"group is created successfully"}}}},"401":{"description":"UnauthorizedUserError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"UnauthorizedUserError":{"value":{"code":"UnauthorizedUserError","message":"Guest is not allowed to do this operation."}}}}}},"403":{"description":"ForbiddenUserError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"ForbiddenUserError":{"value":{"code":"ForbiddenUserError","message":"Non-admin is not allow to do this operation."}},"ForbiddenTokenError":{"value":{"code":"ForbiddenUserError","message":"Applications are not allowed to do this operation."}}}}}},"500":{"description":"UnknownError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"UnknownError":{"value":{"code":"UnknownError","message":"Internal error message."}}}}}}},"description":"post /api/v2/groups"},{"before":[{"tag":"group","operationId":"createGroup","parameters":[{"type":"raw","value":{"groupname":"sdktestgroup"}}],"response":{"statusCode":201,"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"contentType":"application/json"}}],"tests":[{"operation":{"parameters":[{"type":"raw","value":{"data":{"groupname":"sdktestgroup","description":"test update group"},"patch":true}}],"tag":"group","operationId":"updateGroup","response":{"statusCode":201,"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"contentType":"application/json"}}}],"after":[{"tag":"group","operationId":"deleteGroup","parameters":[{"type":"raw","value":"sdktestgroup"}],"response":{"statusCode":201,"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"contentType":"application/json"}}],"schemas":{"201":{"description":"Succeeded","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"example":{"message":"update group {groupname} successfully."}}}},"401":{"description":"UnauthorizedUserError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"UnauthorizedUserError":{"value":{"code":"UnauthorizedUserError","message":"Guest is not allowed to do this operation."}}}}}},"403":{"description":"ForbiddenUserError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"ForbiddenUserError":{"value":{"code":"ForbiddenUserError","message":"Non-admin is not allow to do this operation."}},"ForbiddenTokenError":{"value":{"code":"ForbiddenUserError","message":"Applications are not allowed to do this operation."}}}}}},"404":{"description":"NoGroupError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"NoGroupError":{"value":{"code":"NoGroupError","message":"Group {groupname} is not found."}}}}}},"500":{"description":"UnknownError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"UnknownError":{"value":{"code":"UnknownError","message":"Internal error message."}}}}}}},"description":"put /api/v2/groups"},{"before":[{"tag":"group","operationId":"createGroup","parameters":[{"type":"raw","value":{"groupname":"sdktestgroup"}}],"response":{"statusCode":201,"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"contentType":"application/json"}}],"tests":[{"operation":{"parameters":[{"type":"raw","value":"sdktestgroup"}],"tag":"group","operationId":"getGroup","response":{"statusCode":200,"schema":{"type":"object","properties":{"groupname":{"type":"string","description":"group name"},"description":{"type":"string","description":"description for the group"},"externalName":{"type":"string","description":"the external group name binding with the group in OpenPAI"},"extension":{"type":"object"}},"required":["groupname","description","externalName","extension"]},"contentType":"application/json"}}}],"after":[{"tag":"group","operationId":"deleteGroup","parameters":[{"type":"raw","value":"sdktestgroup"}],"response":{"statusCode":201,"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"contentType":"application/json"}}],"schemas":{"200":{"description":"Succeeded","content":{"application/json":{"schema":{"type":"object","properties":{"groupname":{"type":"string","description":"group name"},"description":{"type":"string","description":"description for the group"},"externalName":{"type":"string","description":"the external group name binding with the group in OpenPAI"},"extension":{"type":"object"}},"required":["groupname","description","externalName","extension"]},"example":{"groupname":"groupName","description":"description","externalName":"externalName","extension":{}}}}},"401":{"description":"UnauthorizedUserError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"UnauthorizedUserError":{"value":{"code":"UnauthorizedUserError","message":"Guest is not allowed to do this operation."}}}}}},"404":{"description":"NoGroupError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"NoGroupError":{"value":{"code":"NoGroupError","message":"Group {groupname} is not found."}}}}}},"500":{"description":"UnknownError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"UnknownError":{"value":{"code":"UnknownError","message":"Internal error message."}}}}}}},"description":"get /api/v2/groups/{group}"},{"before":[{"tag":"group","operationId":"createGroup","parameters":[{"type":"raw","value":{"groupname":"sdktestgroup"}}],"response":{"statusCode":201,"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"contentType":"application/json"}}],"tests":[{"operation":{"tag":"group","operationId":"deleteGroup","parameters":[{"type":"raw","value":"sdktestgroup"}],"response":{"statusCode":201,"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"contentType":"application/json"}}}],"schemas":{"201":{"description":"Succeeded","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"example":{"message":"group is removed successfully"}}}},"401":{"description":"UnauthorizedUserError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"UnauthorizedUserError":{"value":{"code":"UnauthorizedUserError","message":"Guest is not allowed to do this operation."}}}}}},"403":{"description":"ForbiddenUserError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"ForbiddenUserError":{"value":{"code":"ForbiddenUserError","message":"Non-admin is not allow to do this operation."}},"ForbiddenTokenError":{"value":{"code":"ForbiddenUserError","message":"Applications are not allowed to do this operation."}}}}}},"500":{"description":"UnknownError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"UnknownError":{"value":{"code":"UnknownError","message":"Internal error message."}}}}}}},"description":"delete /api/v2/groups/{group}"},{"description":"get /api/v2/groups/{group}/userlist","tests":[{"operation":{"tag":"group","operationId":"getGroupMembers","parameters":[],"response":{"statusCode":200,"schema":{"description":"Array with all users in the group.","type":"array","items":{"type":"object","properties":{"username":{"type":"string","description":"user name"},"clusterAdmin":{"type":"boolean","description":"Cluster admin or not."}}}},"contentType":"application/json"}}}],"schemas":{"200":{"description":"Succeeded","content":{"application/json":{"schema":{"description":"Array with all users in the group.","type":"array","items":{"type":"object","properties":{"username":{"type":"string","description":"user name"},"clusterAdmin":{"type":"boolean","description":"Cluster admin or not."}}}},"example":[{"username":"username","clusterAdmin":false}]}}},"401":{"description":"UnauthorizedUserError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"UnauthorizedUserError":{"value":{"code":"UnauthorizedUserError","message":"Guest is not allowed to do this operation."}}}}}},"500":{"description":"UnknownError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"UnknownError":{"value":{"code":"UnknownError","message":"Internal error message."}}}}}}}},{"description":"get /api/v2/virtual-clusters","tests":[{"operation":{"tag":"virtual cluster","operationId":"listVirtualClusters","parameters":[],"response":{"statusCode":200,"schema":{"type":"object","additionalProperties":{"type":"object","properties":{"capacity":{"type":"number","description":"capacity percentage this virtual cluster can use of entire cluster"},"usedCapacity":{"type":"number","description":"used capacity percentage this virtual cluster can use of entire cluster"},"maxCapacity":{"type":"number","description":"max capacity percentage this virtual cluster can use of entire cluster"},"dedicated":{"type":"boolean","description":"dedicated virtual cluster or not"},"resourcesUsed":{"type":"object","description":"used resources","properties":{"cpu":{"type":"integer","description":"used cpu number"},"vCores":{"type":"integer","description":"same as cpu"},"memory":{"type":"integer","description":"used memory in MB"},"gpu":{"type":"integer","description":"used gpu number"},"GPUs":{"type":"integer","description":"same as gpu"}}},"resourcesGuaranteed":{"type":"object","description":"guaranteed resources, including used and free","properties":{"cpu":{"type":"integer","description":"guaranteed cpu number"},"vCores":{"type":"integer","description":"same as cpu"},"memory":{"type":"integer","description":"guaranteed memory in MB"},"gpu":{"type":"integer","description":"guaranteed gpu number"},"GPUs":{"type":"integer","description":"same as gpu"}}},"resourcesTotal":{"type":"object","description":"total resources, including guaranteed and bad","properties":{"cpu":{"type":"integer","description":"total cpu number"},"vCores":{"type":"integer","description":"same as cpu"},"memory":{"type":"integer","description":"total memory in MB"},"gpu":{"type":"integer","description":"total gpu number"},"GPUs":{"type":"integer","description":"same as gpu"}}}},"required":["capacity","usedCapacity","maxCapacity","resourcesUsed","resourcesGuaranteed","resourcesTotal"]}},"contentType":"application/json"}}}],"schemas":{"200":{"description":"Succeeded","content":{"application/json":{"schema":{"type":"object","additionalProperties":{"type":"object","properties":{"capacity":{"type":"number","description":"capacity percentage this virtual cluster can use of entire cluster"},"usedCapacity":{"type":"number","description":"used capacity percentage this virtual cluster can use of entire cluster"},"maxCapacity":{"type":"number","description":"max capacity percentage this virtual cluster can use of entire cluster"},"dedicated":{"type":"boolean","description":"dedicated virtual cluster or not"},"resourcesUsed":{"type":"object","description":"used resources","properties":{"cpu":{"type":"integer","description":"used cpu number"},"vCores":{"type":"integer","description":"same as cpu"},"memory":{"type":"integer","description":"used memory in MB"},"gpu":{"type":"integer","description":"used gpu number"},"GPUs":{"type":"integer","description":"same as gpu"}}},"resourcesGuaranteed":{"type":"object","description":"guaranteed resources, including used and free","properties":{"cpu":{"type":"integer","description":"guaranteed cpu number"},"vCores":{"type":"integer","description":"same as cpu"},"memory":{"type":"integer","description":"guaranteed memory in MB"},"gpu":{"type":"integer","description":"guaranteed gpu number"},"GPUs":{"type":"integer","description":"same as gpu"}}},"resourcesTotal":{"type":"object","description":"total resources, including guaranteed and bad","properties":{"cpu":{"type":"integer","description":"total cpu number"},"vCores":{"type":"integer","description":"same as cpu"},"memory":{"type":"integer","description":"total memory in MB"},"gpu":{"type":"integer","description":"total gpu number"},"GPUs":{"type":"integer","description":"same as gpu"}}}},"required":["capacity","usedCapacity","maxCapacity","resourcesUsed","resourcesGuaranteed","resourcesTotal"]}}}}},"500":{"description":"UnknownError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"UnknownError":{"value":{"code":"UnknownError","message":"Internal error message."}}}}}}}},{"tests":[{"operation":{"parameters":[{"type":"raw","value":"default"}],"tag":"virtual cluster","operationId":"getVirtualCluster","response":{"statusCode":200,"schema":{"type":"object","properties":{"capacity":{"type":"number","description":"capacity percentage this virtual cluster can use of entire cluster"},"usedCapacity":{"type":"number","description":"used capacity percentage this virtual cluster can use of entire cluster"},"maxCapacity":{"type":"number","description":"max capacity percentage this virtual cluster can use of entire cluster"},"dedicated":{"type":"boolean","description":"dedicated virtual cluster or not"},"resourcesUsed":{"type":"object","description":"used resources","properties":{"cpu":{"type":"integer","description":"used cpu number"},"vCores":{"type":"integer","description":"same as cpu"},"memory":{"type":"integer","description":"used memory in MB"},"gpu":{"type":"integer","description":"used gpu number"},"GPUs":{"type":"integer","description":"same as gpu"}}},"resourcesGuaranteed":{"type":"object","description":"guaranteed resources, including used and free","properties":{"cpu":{"type":"integer","description":"guaranteed cpu number"},"vCores":{"type":"integer","description":"same as cpu"},"memory":{"type":"integer","description":"guaranteed memory in MB"},"gpu":{"type":"integer","description":"guaranteed gpu number"},"GPUs":{"type":"integer","description":"same as gpu"}}},"resourcesTotal":{"type":"object","description":"total resources, including guaranteed and bad","properties":{"cpu":{"type":"integer","description":"total cpu number"},"vCores":{"type":"integer","description":"same as cpu"},"memory":{"type":"integer","description":"total memory in MB"},"gpu":{"type":"integer","description":"total gpu number"},"GPUs":{"type":"integer","description":"same as gpu"}}}},"required":["capacity","usedCapacity","maxCapacity","resourcesUsed","resourcesGuaranteed","resourcesTotal"]},"contentType":"application/json"}}}],"schemas":{"200":{"description":"Succeeded","content":{"application/json":{"schema":{"type":"object","properties":{"capacity":{"type":"number","description":"capacity percentage this virtual cluster can use of entire cluster"},"usedCapacity":{"type":"number","description":"used capacity percentage this virtual cluster can use of entire cluster"},"maxCapacity":{"type":"number","description":"max capacity percentage this virtual cluster can use of entire cluster"},"dedicated":{"type":"boolean","description":"dedicated virtual cluster or not"},"resourcesUsed":{"type":"object","description":"used resources","properties":{"cpu":{"type":"integer","description":"used cpu number"},"vCores":{"type":"integer","description":"same as cpu"},"memory":{"type":"integer","description":"used memory in MB"},"gpu":{"type":"integer","description":"used gpu number"},"GPUs":{"type":"integer","description":"same as gpu"}}},"resourcesGuaranteed":{"type":"object","description":"guaranteed resources, including used and free","properties":{"cpu":{"type":"integer","description":"guaranteed cpu number"},"vCores":{"type":"integer","description":"same as cpu"},"memory":{"type":"integer","description":"guaranteed memory in MB"},"gpu":{"type":"integer","description":"guaranteed gpu number"},"GPUs":{"type":"integer","description":"same as gpu"}}},"resourcesTotal":{"type":"object","description":"total resources, including guaranteed and bad","properties":{"cpu":{"type":"integer","description":"total cpu number"},"vCores":{"type":"integer","description":"same as cpu"},"memory":{"type":"integer","description":"total memory in MB"},"gpu":{"type":"integer","description":"total gpu number"},"GPUs":{"type":"integer","description":"same as gpu"}}}},"required":["capacity","usedCapacity","maxCapacity","resourcesUsed","resourcesGuaranteed","resourcesTotal"]},"example":{"capacity":70,"usedCapacity":30,"dedicated":false,"resourcesUsed":{"cpu":1,"memory":1024,"gpu":1,"vCores":1,"GPUs":1},"resourcesGuaranteed":{"cpu":2,"memory":2048,"gpu":2,"vCores":2,"GPUs":2},"resourcesTotal":{"cpu":2,"memory":2048,"gpu":2,"vCores":2,"GPUs":2},"maxCapacity":70}}}},"404":{"description":"NoVirtualClusterError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"NoVirtualClusterError":{"value":{"code":"NoVirtualClusterError","message":"Virtual cluster {vc} is not found."}}}}}},"500":{"description":"UnknownError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"UnknownError":{"value":{"code":"UnknownError","message":"Internal error message."}}}}}}},"description":"get /api/v2/virtual-clusters/{vc}"},{"description":"get /api/v2/storages","tests":[{"operation":{"tag":"storage","operationId":"getStorages","parameters":[],"response":{"statusCode":200,"schema":{"type":"object","description":"summary of configured PV storage","properties":{"storages":{"type":"array","items":{"type":"object","description":"summary of each storage","properties":{"name":{"type":"string"},"share":{"type":"boolean"},"volumeName":{"type":"string"}},"required":["name","share","volumeName"]}}},"required":["storages"]},"contentType":"application/json"}}}],"schemas":{"200":{"description":"Succeeded","content":{"application/json":{"schema":{"type":"object","description":"summary of configured PV storage","properties":{"storages":{"type":"array","items":{"type":"object","description":"summary of each storage","properties":{"name":{"type":"string"},"share":{"type":"boolean"},"volumeName":{"type":"string"}},"required":["name","share","volumeName"]}}},"required":["storages"]},"example":{"storages":[{"name":"name","share":true,"volumeName":"volumeName"}]}}}},"500":{"description":"UnknownError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"UnknownError":{"value":{"code":"UnknownError","message":"Internal error message."}}}}}}}},{"before":[{"tag":"storage","operationId":"getStorages"}],"tests":[{"operation":{"parameters":[{"type":"fromResult","resultType":"beforeResults","resultPath":["storages",0,"name"],"resultIndex":0}],"tag":"storage","operationId":"getStorage","response":{"statusCode":200,"schema":{"type":"object","description":"detail of configured PV storage","properties":{"name":{"type":"string"},"share":{"type":"boolean"},"volumeName":{"type":"string"},"type":{"type":"string","enum":["nfs","samba","azureFile","azureBlob","other","unknown"]},"data":{"anyOf":[{"type":"object","description":"nfs type","properties":{"server":{"type":"string"},"path":{"type":"string"}},"required":["server","path"]},{"type":"object","description":"samba type","properties":{"address":{"type":"string"},"username":{"type":"string"},"password":{"type":"string"}},"required":["address"]},{"type":"object","description":"azureFile type","properties":{"shareName":{"type":"string"},"accountName":{"type":"string"},"accountKey":{"type":"string"}},"required":["shareName"]},{"type":"object","description":"azureBlob type","properties":{"containerName":{"type":"string"},"accountName":{"type":"string"},"accountKey":{"type":"string"},"accountSASToken":{"type":"string"}},"required":["containerName"]},{"type":"object","description":"other/unknown type","properties":{}}]},"secretName":{"type":"string"},"mountOptions":{"type":"array","items":{"type":"string"}}},"required":["name","share","volumeName","type","data"]},"contentType":"application/json"}}}],"schemas":{"200":{"description":"Succeeded","content":{"application/json":{"schema":{"type":"object","description":"detail of configured PV storage","properties":{"name":{"type":"string"},"share":{"type":"boolean"},"volumeName":{"type":"string"},"type":{"type":"string","enum":["nfs","samba","azureFile","azureBlob","other","unknown"]},"data":{"anyOf":[{"type":"object","description":"nfs type","properties":{"server":{"type":"string"},"path":{"type":"string"}},"required":["server","path"]},{"type":"object","description":"samba type","properties":{"address":{"type":"string"},"username":{"type":"string"},"password":{"type":"string"}},"required":["address"]},{"type":"object","description":"azureFile type","properties":{"shareName":{"type":"string"},"accountName":{"type":"string"},"accountKey":{"type":"string"}},"required":["shareName"]},{"type":"object","description":"azureBlob type","properties":{"containerName":{"type":"string"},"accountName":{"type":"string"},"accountKey":{"type":"string"},"accountSASToken":{"type":"string"}},"required":["containerName"]},{"type":"object","description":"other/unknown type","properties":{}}]},"secretName":{"type":"string"},"mountOptions":{"type":"array","items":{"type":"string"}}},"required":["name","share","volumeName","type","data"]},"example":{"name":"nfs-storage-name","share":true,"volumeName":"nfs-volume-name","type":"nfs","data":{"server":"","path":"/data"}}}}},"403":{"description":"ForbiddenUserError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"ForbiddenUserError":{"value":{"code":"ForbiddenUserError","message":"User {user} is not allowed to access {storage}."}}}}}},"404":{"description":"NoStorageError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"NoVirtualClusterError":{"value":{"code":"NoStorageError","message":"Storage {storage} is not found."}}}}}},"500":{"description":"UnknownError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"UnknownError":{"value":{"code":"UnknownError","message":"Internal error message."}}}}}}},"description":"get /api/v2/storages/{storage}"},{"tests":[{"operation":{"tag":"job","operationId":"createJob","parameters":[{"type":"raw","value":{"contributor":"OpenPAI","description":"# Serving a TensorFlow MNIST Digit Recognition Model\nThis example shows you how to use TensorFlow Serving components to export a trained TensorFlow model\nand use the standard tensorflow_model_server to serve it on OpenPAI.\nThis example uses the simple Softmax Regression model introduced in the TensorFlow tutorial for handwritten image (MNIST data) classification.\nReference https://www.tensorflow.org/tfx/serving/serving_basic.\n","name":"sdk_test_job19f61623","parameters":{"modelPath":"/tmp/mnist_model"},"prerequisites":[{"contributor":"OpenPAI","description":"This is an [example TensorFlow Serving Docker image on OpenPAI](https://github.com/Microsoft/pai/tree/master/examples/serving).\n","name":"tf_serving_example","protocolVersion":2,"type":"dockerimage","uri":"openpai/pai.example.tensorflow-serving","version":"1.0-r1.4"}],"protocolVersion":2,"taskRoles":{"worker":{"commands":["bazel-bin/tensorflow_serving/example/mnist_saved_model <% $parameters.modelPath %>","tensorflow_model_server --port=$PAI_CONTAINER_HOST_model_server_PORT_LIST --model_name=mnist --model_base_path=<% $parameters.modelPath %>"],"dockerImage":"tf_serving_example","instances":1,"resourcePerInstance":{"cpu":4,"gpu":1,"memoryMB":8192,"ports":{"model_server":1}}}},"type":"job","version":"1.0"}}],"response":{"statusCode":202,"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"contentType":"application/json"}}}],"after":[{"tag":"job","operationId":"updateJobExecutionType","parameters":[{"type":"raw","value":"sdk_test"},{"type":"raw","value":"sdk_test_job19f61623"},{"type":"raw","value":"STOP"}]}],"schemas":{"202":{"description":"Succeeded","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"example":{"message":"update job {job} successfully"}}}},"400":{"description":"NoVirtualClusterError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"NoVirtualClusterError":{"value":{"code":"NoVirtualClusterError","message":"Virtual cluster {vc} is not found."}}}}}},"403":{"description":"ForbiddenUserError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"ForbiddenUserError":{"value":{"code":"ForbiddenUserError","message":"Non-admin is not allow to do this operation."}},"ForbiddenTokenError":{"value":{"code":"ForbiddenUserError","message":"Applications are not allowed to do this operation."}}}}}},"409":{"description":"ConflictJobError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"ConflictJobError":{"value":{"code":"ConflictJobError","message":"Job name {job} already exists."}}}}}},"500":{"description":"UnknownError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"UnknownError":{"value":{"code":"UnknownError","message":"Internal error message."}}}}}}},"description":"post /api/v2/jobs"},{"description":"get /api/v2/jobs","tests":[{"operation":{"tag":"job","operationId":"listJobs","parameters":[],"response":{"statusCode":200,"schema":{"type":"array","description":"job summary list","items":{"type":"object","properties":{"name":{"type":"string","description":"job name"},"username":{"type":"string","description":"user name or \"unknown\""},"state":{"type":"string","description":"general job state","enum":["WAITING","RUNNING","STOPPING","STOPPED","SUCCEEDED","FAILED","UNKNOWN"]},"subState":{"type":"string","description":"job state in framework controller","enum":["AttemptCreationPending","AttemptCreationRequested","AttemptPreparing","AttemptRunning","AttemptDeletionPending","AttemptDeletionRequested","AttemptDeleting","AttemptCompleted","Completed"]},"executionType":{"type":"string","description":"start or stop","enum":["START","STOP"]},"retries":{"type":"integer","description":"job retried times"},"retryDetails":{"type":"object","properties":{"user":{"type":"integer"},"platform":{"type":"integer"},"resource":{"type":"integer"}}},"retryDelayTime":{"type":"integer","nullable":true,"description":"retry delay time"},"createdTime":{"type":"integer","description":"job created time, in number of milliseconds since the Unix Epoch."},"completedTime":{"type":"integer","nullable":true,"description":"job completed time, in number of milliseconds since the Unix Epoch."},"appExitCode":{"type":"integer","nullable":true,"description":"job exit code"},"virtualCluster":{"type":"string","description":"virtual cluster to which the job submitted, or \"unknown\""},"totalGpuNumber":{"type":"integer","description":"total gpu number used in the job"},"totalTaskNumber":{"type":"integer","description":"total task number used in the job"},"totalTaskRoleNumber":{"type":"integer","description":"total task role number used in the job"},"debugId":{"type":"string","description":"md5 hash name for the job in framework controller, used for debug purpose"}},"required":["name","username","virtualCluster","state","subState","executionType","retries","createdTime","completedTime","appExitCode"]}},"contentType":"application/json"}}}],"schemas":{"200":{"description":"Succeeded","content":{"application/json":{"schema":{"type":"array","description":"job summary list","items":{"type":"object","properties":{"name":{"type":"string","description":"job name"},"username":{"type":"string","description":"user name or \"unknown\""},"state":{"type":"string","description":"general job state","enum":["WAITING","RUNNING","STOPPING","STOPPED","SUCCEEDED","FAILED","UNKNOWN"]},"subState":{"type":"string","description":"job state in framework controller","enum":["AttemptCreationPending","AttemptCreationRequested","AttemptPreparing","AttemptRunning","AttemptDeletionPending","AttemptDeletionRequested","AttemptDeleting","AttemptCompleted","Completed"]},"executionType":{"type":"string","description":"start or stop","enum":["START","STOP"]},"retries":{"type":"integer","description":"job retried times"},"retryDetails":{"type":"object","properties":{"user":{"type":"integer"},"platform":{"type":"integer"},"resource":{"type":"integer"}}},"retryDelayTime":{"type":"integer","nullable":true,"description":"retry delay time"},"createdTime":{"type":"integer","description":"job created time, in number of milliseconds since the Unix Epoch."},"completedTime":{"type":"integer","nullable":true,"description":"job completed time, in number of milliseconds since the Unix Epoch."},"appExitCode":{"type":"integer","nullable":true,"description":"job exit code"},"virtualCluster":{"type":"string","description":"virtual cluster to which the job submitted, or \"unknown\""},"totalGpuNumber":{"type":"integer","description":"total gpu number used in the job"},"totalTaskNumber":{"type":"integer","description":"total task number used in the job"},"totalTaskRoleNumber":{"type":"integer","description":"total task role number used in the job"},"debugId":{"type":"string","description":"md5 hash name for the job in framework controller, used for debug purpose"}},"required":["name","username","virtualCluster","state","subState","executionType","retries","createdTime","completedTime","appExitCode"]}},"example":[{"protocolVersion":"2","name":"job name","username":"user name","state":"SUCCEEDED","subState":"Completed","executionType":"STOP","retries":0,"createdTime":0,"completedTime":0,"appExitCode":0,"virtualCluster":"unknown"}]}}},"500":{"description":"UnknownError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"UnknownError":{"value":{"code":"UnknownError","message":"Internal error message."}}}}}}}},{"before":[{"tag":"job","operationId":"createJob","parameters":[{"type":"raw","value":{"contributor":"OpenPAI","description":"# Serving a TensorFlow MNIST Digit Recognition Model\nThis example shows you how to use TensorFlow Serving components to export a trained TensorFlow model\nand use the standard tensorflow_model_server to serve it on OpenPAI.\nThis example uses the simple Softmax Regression model introduced in the TensorFlow tutorial for handwritten image (MNIST data) classification.\nReference https://www.tensorflow.org/tfx/serving/serving_basic.\n","name":"sdk_test_jobdfa1db44","parameters":{"modelPath":"/tmp/mnist_model"},"prerequisites":[{"contributor":"OpenPAI","description":"This is an [example TensorFlow Serving Docker image on OpenPAI](https://github.com/Microsoft/pai/tree/master/examples/serving).\n","name":"tf_serving_example","protocolVersion":2,"type":"dockerimage","uri":"openpai/pai.example.tensorflow-serving","version":"1.0-r1.4"}],"protocolVersion":2,"taskRoles":{"worker":{"commands":["bazel-bin/tensorflow_serving/example/mnist_saved_model <% $parameters.modelPath %>","tensorflow_model_server --port=$PAI_CONTAINER_HOST_model_server_PORT_LIST --model_name=mnist --model_base_path=<% $parameters.modelPath %>"],"dockerImage":"tf_serving_example","instances":1,"resourcePerInstance":{"cpu":4,"gpu":1,"memoryMB":8192,"ports":{"model_server":1}}}},"type":"job","version":"1.0"}}]}],"tests":[{"description":"Get a job detail","operation":{"parameters":[{"type":"raw","value":"sdk_test"},{"type":"raw","value":"sdk_test_jobdfa1db44"}],"tag":"job","operationId":"getJob","response":{"statusCode":200,"schema":{"type":"object","description":"job details","properties":{"name":{"type":"string","description":"job name"},"jobStatus":{"type":"object","description":"job status","properties":{"username":{"type":"string","description":"user name or \"unknown\""},"state":{"type":"string","description":"general job state","enum":["WAITING","RUNNING","STOPPING","STOPPED","SUCCEEDED","FAILED","UNKNOWN"]},"subState":{"type":"string","description":"job state in framework controller","enum":["AttemptCreationPending","AttemptCreationRequested","AttemptPreparing","AttemptRunning","AttemptDeletionPending","AttemptDeletionRequested","AttemptDeleting","AttemptCompleted","Completed"]},"executionType":{"type":"string","description":"start or stop","enum":["START","STOP"]},"retries":{"type":"integer","description":"job retried times"},"retryDetails":{"type":"object","properties":{"user":{"type":"integer"},"platform":{"type":"integer"},"resource":{"type":"integer"}}},"retryDelayTime":{"type":"integer","nullable":true,"description":"retry delay time"},"createdTime":{"type":"integer","description":"job created time, in number of milliseconds since the Unix Epoch."},"completedTime":{"type":"integer","nullable":true,"description":"job completed time, in number of milliseconds since the Unix Epoch."},"appId":{"type":"string","description":"unique id for the job"},"appLaunchedTime":{"type":"integer","nullable":true,"description":"job launched time for last attempt, in number of milliseconds since the Unix Epoch."},"appCompletedTime":{"type":"integer","nullable":true,"description":"job completed time for last attempt, in number of milliseconds since the Unix Epoch. to get durations for last attempt:\n wholeDuration = completedTime - createdTime;\n runningDuration = appCompletedTime - appLaunchedTime;\n waitingDuration = wholeDuration - runningDuration.\nto get durations for all attempts:\n runningDuration = sum(appCompletedTime - appLaunchedTime) for all attempts.\n"},"appExitCode":{"type":"integer","nullable":true,"description":"job exit code"},"appExitSpec":{"type":"object","nullable":true,"description":"job exit spec","properties":{"code":{"type":"integer"},"phrase":{"type":"string"},"issuer":{"type":"string"},"causer":{"type":"string"},"type":{"type":"string"},"stage":{"type":"string"},"behavior":{"type":"string"},"reaction":{"type":"string"},"repro":{"type":"array","items":{"type":"string"}}}},"appExitDiagnostics":{"type":"string","nullable":true,"description":"job exit diagnostics"},"appExitMessages":{"type":"object","nullable":true,"properties":{"container":{"type":"string","nullable":true},"runtime":{"type":"string","nullable":true},"launcher":{"type":"string","nullable":true}}},"appExitTriggerMessage":{"type":"string","nullable":true,"description":"job completion message"},"appExitTriggerTaskRoleName":{"type":"string","nullable":true,"description":"task role name which triggered job completion"},"appExitTriggerTaskIndex":{"type":"integer","nullable":true,"description":"task index which triggered job completion"},"appExitType":{"type":"string","nullable":true,"description":"job completion type"},"virtualCluster":{"type":"string","description":"virtual cluster to which the job submitted, or \"unknown\""}},"required":["username","virtualCluster","state","subState","executionType","retries","createdTime","completedTime","appId","appLaunchedTime","appCompletedTime","appExitCode"]},"taskRoles":{"type":"object","additionalProperties":{"type":"object","description":"task role status","properties":{"taskRoleStatus":{"type":"object","properties":{"name":{"type":"string","description":"task role name"}},"required":["name"]},"taskStatuses":{"type":"array","description":"task statuses in the task role","items":{"type":"object","properties":{"taskIndex":{"type":"integer","description":"task index"},"taskState":{"type":"string","description":"task state","enum":["WAITING","RUNNING","STOPPING","STOPPED","SUCCEEDED","FAILED","UNKNOWN"]},"containerId":{"type":"string","description":"uid of the task container"},"containerIp":{"type":"string","description":"ip of the task container"},"containerPorts":{"type":"object","description":"ports of the task container"},"containerGpus":{"type":"string","nullable":true,"description":"gpu of the task container"},"containerLog":{"type":"string","description":"log url of the task container"},"containerExitCode":{"type":"integer","nullable":true,"description":"exit code the task container"}}}}},"required":["taskRoleStatus","taskStatuses"]}},"debugId":{"type":"string","description":"md5 hash name for the job in framework controller, used for debug purpose"}},"required":["name","jobStatus","taskRoles"]},"contentType":"application/json"}}},{"description":"Get nonexist job detail","operation":{"parameters":[{"type":"raw","value":"sdk_test"},{"type":"raw","value":"sdk_test_nonexist_job"}],"response":{"statusCode":404,"schema":{"description":"NoJobError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"NoJobError":{"value":{"code":"NoJobError","message":"Job {job} is not found."}}}}}}},"tag":"job","operationId":"getJob"}}],"after":[{"tag":"job","operationId":"updateJobExecutionType","parameters":[{"type":"raw","value":"sdk_test"},{"type":"raw","value":"sdk_test_jobdfa1db44"},{"type":"raw","value":"STOP"}]}],"schemas":{"200":{"description":"Succeeded","content":{"application/json":{"schema":{"type":"object","description":"job details","properties":{"name":{"type":"string","description":"job name"},"jobStatus":{"type":"object","description":"job status","properties":{"username":{"type":"string","description":"user name or \"unknown\""},"state":{"type":"string","description":"general job state","enum":["WAITING","RUNNING","STOPPING","STOPPED","SUCCEEDED","FAILED","UNKNOWN"]},"subState":{"type":"string","description":"job state in framework controller","enum":["AttemptCreationPending","AttemptCreationRequested","AttemptPreparing","AttemptRunning","AttemptDeletionPending","AttemptDeletionRequested","AttemptDeleting","AttemptCompleted","Completed"]},"executionType":{"type":"string","description":"start or stop","enum":["START","STOP"]},"retries":{"type":"integer","description":"job retried times"},"retryDetails":{"type":"object","properties":{"user":{"type":"integer"},"platform":{"type":"integer"},"resource":{"type":"integer"}}},"retryDelayTime":{"type":"integer","nullable":true,"description":"retry delay time"},"createdTime":{"type":"integer","description":"job created time, in number of milliseconds since the Unix Epoch."},"completedTime":{"type":"integer","nullable":true,"description":"job completed time, in number of milliseconds since the Unix Epoch."},"appId":{"type":"string","description":"unique id for the job"},"appLaunchedTime":{"type":"integer","nullable":true,"description":"job launched time for last attempt, in number of milliseconds since the Unix Epoch."},"appCompletedTime":{"type":"integer","nullable":true,"description":"job completed time for last attempt, in number of milliseconds since the Unix Epoch. to get durations for last attempt:\n wholeDuration = completedTime - createdTime;\n runningDuration = appCompletedTime - appLaunchedTime;\n waitingDuration = wholeDuration - runningDuration.\nto get durations for all attempts:\n runningDuration = sum(appCompletedTime - appLaunchedTime) for all attempts.\n"},"appExitCode":{"type":"integer","nullable":true,"description":"job exit code"},"appExitSpec":{"type":"object","nullable":true,"description":"job exit spec","properties":{"code":{"type":"integer"},"phrase":{"type":"string"},"issuer":{"type":"string"},"causer":{"type":"string"},"type":{"type":"string"},"stage":{"type":"string"},"behavior":{"type":"string"},"reaction":{"type":"string"},"repro":{"type":"array","items":{"type":"string"}}}},"appExitDiagnostics":{"type":"string","nullable":true,"description":"job exit diagnostics"},"appExitMessages":{"type":"object","nullable":true,"properties":{"container":{"type":"string","nullable":true},"runtime":{"type":"string","nullable":true},"launcher":{"type":"string","nullable":true}}},"appExitTriggerMessage":{"type":"string","nullable":true,"description":"job completion message"},"appExitTriggerTaskRoleName":{"type":"string","nullable":true,"description":"task role name which triggered job completion"},"appExitTriggerTaskIndex":{"type":"integer","nullable":true,"description":"task index which triggered job completion"},"appExitType":{"type":"string","nullable":true,"description":"job completion type"},"virtualCluster":{"type":"string","description":"virtual cluster to which the job submitted, or \"unknown\""}},"required":["username","virtualCluster","state","subState","executionType","retries","createdTime","completedTime","appId","appLaunchedTime","appCompletedTime","appExitCode"]},"taskRoles":{"type":"object","additionalProperties":{"type":"object","description":"task role status","properties":{"taskRoleStatus":{"type":"object","properties":{"name":{"type":"string","description":"task role name"}},"required":["name"]},"taskStatuses":{"type":"array","description":"task statuses in the task role","items":{"type":"object","properties":{"taskIndex":{"type":"integer","description":"task index"},"taskState":{"type":"string","description":"task state","enum":["WAITING","RUNNING","STOPPING","STOPPED","SUCCEEDED","FAILED","UNKNOWN"]},"containerId":{"type":"string","description":"uid of the task container"},"containerIp":{"type":"string","description":"ip of the task container"},"containerPorts":{"type":"object","description":"ports of the task container"},"containerGpus":{"type":"string","nullable":true,"description":"gpu of the task container"},"containerLog":{"type":"string","description":"log url of the task container"},"containerExitCode":{"type":"integer","nullable":true,"description":"exit code the task container"}}}}},"required":["taskRoleStatus","taskStatuses"]}},"debugId":{"type":"string","description":"md5 hash name for the job in framework controller, used for debug purpose"}},"required":["name","jobStatus","taskRoles"]},"example":{"name":"job name","jobStatus":{"username":"user name","state":"SUCCEEDED","subState":"Completed","executionType":"STOP","retries":0,"createdTime":0,"completedTime":0,"appId":"id","appLaunchedTime":0,"appCompletedTime":0,"appExitCode":0,"virtualCluster":"unknown"},"taskRoles":{"taskrole":{"taskRoleStatus":{"name":"task role name"},"taskStatuses":[{"taskIndex":0,"taskState":"SUCCEEDED"}]}}}}}},"404":{"description":"NoJobError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"NoJobError":{"value":{"code":"NoJobError","message":"Job {job} is not found."}}}}}},"500":{"description":"UnknownError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"UnknownError":{"value":{"code":"UnknownError","message":"Internal error message."}}}}}}},"description":"get /api/v2/jobs/{user}~{job}"},{"before":[{"tag":"job","operationId":"createJob","parameters":[{"type":"raw","value":{"contributor":"OpenPAI","description":"# Serving a TensorFlow MNIST Digit Recognition Model\nThis example shows you how to use TensorFlow Serving components to export a trained TensorFlow model\nand use the standard tensorflow_model_server to serve it on OpenPAI.\nThis example uses the simple Softmax Regression model introduced in the TensorFlow tutorial for handwritten image (MNIST data) classification.\nReference https://www.tensorflow.org/tfx/serving/serving_basic.\n","name":"sdk_test_joba43a5b4c","parameters":{"modelPath":"/tmp/mnist_model"},"prerequisites":[{"contributor":"OpenPAI","description":"This is an [example TensorFlow Serving Docker image on OpenPAI](https://github.com/Microsoft/pai/tree/master/examples/serving).\n","name":"tf_serving_example","protocolVersion":2,"type":"dockerimage","uri":"openpai/pai.example.tensorflow-serving","version":"1.0-r1.4"}],"protocolVersion":2,"taskRoles":{"worker":{"commands":["bazel-bin/tensorflow_serving/example/mnist_saved_model <% $parameters.modelPath %>","tensorflow_model_server --port=$PAI_CONTAINER_HOST_model_server_PORT_LIST --model_name=mnist --model_base_path=<% $parameters.modelPath %>"],"dockerImage":"tf_serving_example","instances":1,"resourcePerInstance":{"cpu":4,"gpu":1,"memoryMB":8192,"ports":{"model_server":1}}}},"type":"job","version":"1.0"}}]}],"tests":[{"description":"Get a job config","operation":{"parameters":[{"type":"raw","value":"sdk_test"},{"type":"raw","value":"sdk_test_joba43a5b4c"}],"tag":"job","operationId":"getJobConfig","response":{"statusCode":200,"schema":{"type":"object","description":"openpai job protocol","properties":{"protocolVersion":{"oneOf":[{"type":"number"},{"type":"string"}],"description":"Protocol version, current version is 2."},"name":{"type":"string","maxLength":255,"description":"String in ^[a-zA-Z0-9_-]+$ format, no longer than 255 characters."},"type":{"type":"string","description":"Component type, should be \"job\" here."},"version":{"type":"string","description":"Component version, default is latest."},"contributor":{"type":"string"},"description":{"type":"string"},"prerequisites":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"type":{"type":"string","enum":["data","script","dockerimage","output"]},"version":{"type":"string"},"contributor":{"type":"string"},"description":{"type":"string"},"auth":{"type":"object","properties":{"username":{"type":"string"},"password":{"type":"string"},"registryuri":{"type":"string"}}},"uri":{"oneOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}]}}}},"parameters":{"type":"object","additionalProperties":true},"secrets":{"type":"object","additionalProperties":true},"jobRetryCount":{"type":"integer","description":"Default is 0."},"taskRoles":{"type":"object","additionalProperties":{"type":"object","properties":{"instances":{"type":"integer","description":"Default is 1, instances of a taskRole, no less than 1."},"completion":{"type":"object","description":"Completion poclicy for the job.","properties":{"minFailedInstances":{"type":"integer"},"minSucceededInstances":{"type":"integer"}}},"taskRetryCount":{"type":"integer","description":"Default is 0."},"dockerImage":{"type":"string","description":"Should reference to a dockerimage defined in prerequisites."},"data":{"type":"string"},"output":{"type":"string"},"script":{"type":"string"},"extraContainerOptions":{"type":"object","properties":{"shmMB":{"type":"integer","description":"Config the /dev/shm in a docker container."},"infiniband":{"type":"boolean","description":"Use InfiniBand devices or not in a docker container."}}},"resourcePerInstance":{"type":"object","properties":{"cpu":{"type":"integer","description":"CPU number, unit is CPU vcore."},"memoryMB":{"type":"integer","description":"Memory number, unit is MB."},"gpu":{"type":"integer","description":"GPU number, unit is GPU card."},"ports":{"type":"object","additionalProperties":{"type":"integer","description":"Port number for the port label."}}}},"commands":{"type":"array","items":{"type":"string"}}},"required":["dockerImage","resourcePerInstance","commands"]}},"deployments":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"taskRoles":{"type":"object","additionalProperties":{"type":"object","properties":{"preCommands":{"type":"array","items":{"type":"string"}},"postCommands":{"type":"array","items":{"type":"string"}}}}}}}},"defaults":{"type":"object","description":"Default cluster specific settings.","properties":{"virtualCluster":{"type":"string"},"deployment":{"type":"string"}}},"extras":{"type":"object","description":"Extra field, save any information that plugin may use.","properties":{"submitFrom":{"type":"string"},"hivedScheduler":{"type":"object","properties":{"jobPriorityClass":{"type":"string"},"taskRoles":{"type":"object","additionalProperties":{"type":"object","properties":{"skuType":{"type":"string"},"affinityGroupName":{"type":"string"}}}}}}}}},"required":["protocolVersion","name","type","taskRoles"]},"contentType":"text/yaml"}}},{"description":"Get nonexist job config","operation":{"parameters":[{"type":"raw","value":"sdk_test"},{"type":"raw","value":"sdk_test_nonexist_job"}],"response":{"statusCode":404,"schema":{"description":"NoJobError or NoJobConfigError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"NoJobError":{"value":{"code":"NoJobError","message":"Job {job} is not found."}},"NoJobConfigError":{"value":{"code":"NoJobConfigError","message":"Config of job {job} is not found."}}}}}}},"tag":"job","operationId":"getJobConfig"}}],"after":[{"tag":"job","operationId":"updateJobExecutionType","parameters":[{"type":"raw","value":"sdk_test"},{"type":"raw","value":"sdk_test_joba43a5b4c"},{"type":"raw","value":"STOP"}]}],"schemas":{"200":{"description":"Succeeded","content":{"text/yaml":{"schema":{"type":"object","description":"openpai job protocol","properties":{"protocolVersion":{"oneOf":[{"type":"number"},{"type":"string"}],"description":"Protocol version, current version is 2."},"name":{"type":"string","maxLength":255,"description":"String in ^[a-zA-Z0-9_-]+$ format, no longer than 255 characters."},"type":{"type":"string","description":"Component type, should be \"job\" here."},"version":{"type":"string","description":"Component version, default is latest."},"contributor":{"type":"string"},"description":{"type":"string"},"prerequisites":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"type":{"type":"string","enum":["data","script","dockerimage","output"]},"version":{"type":"string"},"contributor":{"type":"string"},"description":{"type":"string"},"auth":{"type":"object","properties":{"username":{"type":"string"},"password":{"type":"string"},"registryuri":{"type":"string"}}},"uri":{"oneOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}]}}}},"parameters":{"type":"object","additionalProperties":true},"secrets":{"type":"object","additionalProperties":true},"jobRetryCount":{"type":"integer","description":"Default is 0."},"taskRoles":{"type":"object","additionalProperties":{"type":"object","properties":{"instances":{"type":"integer","description":"Default is 1, instances of a taskRole, no less than 1."},"completion":{"type":"object","description":"Completion poclicy for the job.","properties":{"minFailedInstances":{"type":"integer"},"minSucceededInstances":{"type":"integer"}}},"taskRetryCount":{"type":"integer","description":"Default is 0."},"dockerImage":{"type":"string","description":"Should reference to a dockerimage defined in prerequisites."},"data":{"type":"string"},"output":{"type":"string"},"script":{"type":"string"},"extraContainerOptions":{"type":"object","properties":{"shmMB":{"type":"integer","description":"Config the /dev/shm in a docker container."},"infiniband":{"type":"boolean","description":"Use InfiniBand devices or not in a docker container."}}},"resourcePerInstance":{"type":"object","properties":{"cpu":{"type":"integer","description":"CPU number, unit is CPU vcore."},"memoryMB":{"type":"integer","description":"Memory number, unit is MB."},"gpu":{"type":"integer","description":"GPU number, unit is GPU card."},"ports":{"type":"object","additionalProperties":{"type":"integer","description":"Port number for the port label."}}}},"commands":{"type":"array","items":{"type":"string"}}},"required":["dockerImage","resourcePerInstance","commands"]}},"deployments":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"taskRoles":{"type":"object","additionalProperties":{"type":"object","properties":{"preCommands":{"type":"array","items":{"type":"string"}},"postCommands":{"type":"array","items":{"type":"string"}}}}}}}},"defaults":{"type":"object","description":"Default cluster specific settings.","properties":{"virtualCluster":{"type":"string"},"deployment":{"type":"string"}}},"extras":{"type":"object","description":"Extra field, save any information that plugin may use.","properties":{"submitFrom":{"type":"string"},"hivedScheduler":{"type":"object","properties":{"jobPriorityClass":{"type":"string"},"taskRoles":{"type":"object","additionalProperties":{"type":"object","properties":{"skuType":{"type":"string"},"affinityGroupName":{"type":"string"}}}}}}}}},"required":["protocolVersion","name","type","taskRoles"]},"example":{"protocolVersion":"2","name":"","type":"job","prerequisites":[{"name":"","type":"dockerimage","uri":"image_url"}],"taskRoles":{"train":{"instances":1,"dockerImage":"","resourcePerInstance":{"cpu":1,"memoryMB":16384,"gpu":1},"commands":["python "]}}}}}},"404":{"description":"NoJobError or NoJobConfigError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"NoJobError":{"value":{"code":"NoJobError","message":"Job {job} is not found."}},"NoJobConfigError":{"value":{"code":"NoJobConfigError","message":"Config of job {job} is not found."}}}}}},"500":{"description":"UnknownError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"UnknownError":{"value":{"code":"UnknownError","message":"Internal error message."}}}}}}},"description":"get /api/v2/jobs/{user}~{job}/config"},{"description":"put /api/v2/jobs/{user}~{job}/executionType","tests":[{"operation":{"tag":"job","operationId":"updateJobExecutionType","parameters":[],"response":{"statusCode":202,"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"contentType":"application/json"}}}],"schemas":{"202":{"description":"Succeeded","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"example":{"message":"execute job {job} successfully"}}}},"404":{"description":"NoJobError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"NoJobError":{"value":{"code":"NoJobError","message":"Job {job} is not found."}}}}}},"500":{"description":"UnknownError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"UnknownError":{"value":{"code":"UnknownError","message":"Internal error message."}}}}}}}},{"description":"get /api/v2/jobs/{user}~{job}/job-attempts/healthz","tests":[{"operation":{"tag":"job history","operationId":"getJobAttemptsHealthz","parameters":[],"response":{"statusCode":200}}}],"schemas":{"200":{"description":"OK"},"501":{"description":"Not healthy"}}},{"before":[{"tag":"job","operationId":"createJob","parameters":[{"type":"raw","value":{"contributor":"OpenPAI","description":"# Serving a TensorFlow MNIST Digit Recognition Model\nThis example shows you how to use TensorFlow Serving components to export a trained TensorFlow model\nand use the standard tensorflow_model_server to serve it on OpenPAI.\nThis example uses the simple Softmax Regression model introduced in the TensorFlow tutorial for handwritten image (MNIST data) classification.\nReference https://www.tensorflow.org/tfx/serving/serving_basic.\n","name":"sdk_test_job9b070682","parameters":{"modelPath":"/tmp/mnist_model"},"prerequisites":[{"contributor":"OpenPAI","description":"This is an [example TensorFlow Serving Docker image on OpenPAI](https://github.com/Microsoft/pai/tree/master/examples/serving).\n","name":"tf_serving_example","protocolVersion":2,"type":"dockerimage","uri":"openpai/pai.example.tensorflow-serving","version":"1.0-r1.4"}],"protocolVersion":2,"taskRoles":{"worker":{"commands":["bazel-bin/tensorflow_serving/example/mnist_saved_model <% $parameters.modelPath %>","tensorflow_model_server --port=$PAI_CONTAINER_HOST_model_server_PORT_LIST --model_name=mnist --model_base_path=<% $parameters.modelPath %>"],"dockerImage":"tf_serving_example","instances":1,"resourcePerInstance":{"cpu":4,"gpu":1,"memoryMB":8192,"ports":{"model_server":1}}}},"type":"job","version":"1.0"}}]}],"tests":[{"operation":{"parameters":[{"type":"raw","value":"sdk_test"},{"type":"raw","value":"sdk_test_job9b070682"}],"tag":"job history","operationId":"getJobAttempts","response":{"statusCode":200,"schema":{"type":"array","items":{"type":"object","description":"job attempt","properties":{"jobName":{"type":"string"},"frameworkName":{"type":"string"},"uid":{"type":"string"},"userName":{"type":"string"},"state":{"type":"string"},"originState":{"type":"string"},"maxAttemptCount":{"type":"integer"},"attemptIndex":{"type":"integer"},"jobStartedTime":{"type":"integer"},"attemptStartedTime":{"type":"integer"},"attemptCompletedTime":{"type":"integer","nullable":true},"exitCode":{"type":"integer","nullable":true},"exitPhrase":{"type":"string","nullable":true},"exitType":{"type":"string","nullable":true},"exitDiagnostics":{"type":"object","nullable":true,"properties":{"diagnosticsSummary":{"type":"string"},"runtime":{"type":"object","nullable":true,"properties":{"exitCode":{"type":"integer","nullable":true},"originUserExitCode":{"type":"integer","nullable":true},"errorLogs":{"type":"object","nullable":true,"properties":{"user":{"type":"string"},"platform":{"type":"string"}}},"name":{"type":"string"}}},"launcher":{"type":"string"}}},"appExitTriggerMessage":{"type":"string","nullable":true},"appExitTriggerTaskRoleName":{"type":"string","nullable":true},"appExitTriggerTaskIndex":{"type":"integer","nullable":true},"appExitSpec":{"type":"object","nullable":true,"properties":{"code":{"type":"integer"},"phrase":{"type":"string"},"issuer":{"type":"string"},"causer":{"type":"string"},"type":{"type":"string"},"stage":{"type":"string"},"behavior":{"type":"string"},"reaction":{"type":"string"},"reason":{"type":"string"},"repro":{"type":"array","items":{"type":"string"}},"solution":{"type":"array","items":{"type":"string"}}}},"appExitDiagnostics":{"type":"string","nullable":true},"appExitMessages":{"type":"object","nullable":true,"properties":{"container":{"type":"string","nullable":true},"runtime":{"type":"object","nullable":true,"properties":{"exitCode":{"type":"integer","nullable":true},"originUserExitCode":{"type":"integer","nullable":true},"errorLogs":{"type":"object","nullable":true,"properties":{"user":{"type":"string"},"platform":{"type":"string"}}},"name":{"type":"string"}}},"launcher":{"type":"string","nullable":true}}},"totalGpuNumber":{"type":"integer"},"totalTasknumber":{"type":"integer"},"totalTaskRoleNumber":{"type":"integer"},"taskRoles":{"type":"object","properties":{"taskrole":{"type":"object","properties":{"taskRoleStatus":{"type":"object","properties":{"name":{"type":"string"}},"required":["name"]},"taskStatuses":{"type":"array","items":{"type":"object","properties":{"taskIndex":{"type":"integer"},"taskState":{"type":"string","enum":["WAITING","RUNNING","STOPPING","STOPPED","SUCCEEDED","FAILED","UNKNOWN"]},"containerId":{"type":"string"},"containerIp":{"type":"string"},"containerGpus":{"type":"string","nullable":true},"containerLog":{"type":"string"},"containerExitCode":{"type":"integer","nullable":true}}}}},"required":["taskRoleStatus","taskStatuses"]}}},"isLatest":{"type":"boolean"}}},"description":"job attempts"},"contentType":"application/json"}}}],"after":[{"tag":"job","operationId":"updateJobExecutionType","parameters":[{"type":"raw","value":"sdk_test"},{"type":"raw","value":"sdk_test_job9b070682"},{"type":"raw","value":"STOP"}]}],"schemas":{"200":{"description":"Succeeded","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","description":"job attempt","properties":{"jobName":{"type":"string"},"frameworkName":{"type":"string"},"uid":{"type":"string"},"userName":{"type":"string"},"state":{"type":"string"},"originState":{"type":"string"},"maxAttemptCount":{"type":"integer"},"attemptIndex":{"type":"integer"},"jobStartedTime":{"type":"integer"},"attemptStartedTime":{"type":"integer"},"attemptCompletedTime":{"type":"integer","nullable":true},"exitCode":{"type":"integer","nullable":true},"exitPhrase":{"type":"string","nullable":true},"exitType":{"type":"string","nullable":true},"exitDiagnostics":{"type":"object","nullable":true,"properties":{"diagnosticsSummary":{"type":"string"},"runtime":{"type":"object","nullable":true,"properties":{"exitCode":{"type":"integer","nullable":true},"originUserExitCode":{"type":"integer","nullable":true},"errorLogs":{"type":"object","nullable":true,"properties":{"user":{"type":"string"},"platform":{"type":"string"}}},"name":{"type":"string"}}},"launcher":{"type":"string"}}},"appExitTriggerMessage":{"type":"string","nullable":true},"appExitTriggerTaskRoleName":{"type":"string","nullable":true},"appExitTriggerTaskIndex":{"type":"integer","nullable":true},"appExitSpec":{"type":"object","nullable":true,"properties":{"code":{"type":"integer"},"phrase":{"type":"string"},"issuer":{"type":"string"},"causer":{"type":"string"},"type":{"type":"string"},"stage":{"type":"string"},"behavior":{"type":"string"},"reaction":{"type":"string"},"reason":{"type":"string"},"repro":{"type":"array","items":{"type":"string"}},"solution":{"type":"array","items":{"type":"string"}}}},"appExitDiagnostics":{"type":"string","nullable":true},"appExitMessages":{"type":"object","nullable":true,"properties":{"container":{"type":"string","nullable":true},"runtime":{"type":"object","nullable":true,"properties":{"exitCode":{"type":"integer","nullable":true},"originUserExitCode":{"type":"integer","nullable":true},"errorLogs":{"type":"object","nullable":true,"properties":{"user":{"type":"string"},"platform":{"type":"string"}}},"name":{"type":"string"}}},"launcher":{"type":"string","nullable":true}}},"totalGpuNumber":{"type":"integer"},"totalTasknumber":{"type":"integer"},"totalTaskRoleNumber":{"type":"integer"},"taskRoles":{"type":"object","properties":{"taskrole":{"type":"object","properties":{"taskRoleStatus":{"type":"object","properties":{"name":{"type":"string"}},"required":["name"]},"taskStatuses":{"type":"array","items":{"type":"object","properties":{"taskIndex":{"type":"integer"},"taskState":{"type":"string","enum":["WAITING","RUNNING","STOPPING","STOPPED","SUCCEEDED","FAILED","UNKNOWN"]},"containerId":{"type":"string"},"containerIp":{"type":"string"},"containerGpus":{"type":"string","nullable":true},"containerLog":{"type":"string"},"containerExitCode":{"type":"integer","nullable":true}}}}},"required":["taskRoleStatus","taskStatuses"]}}},"isLatest":{"type":"boolean"}}},"description":"job attempts"},"example":[{"jobName":"jobName","frameworkName":"frameworkName","uid":"uid","userName":"userName","state":"SUCCEEDED","originState":"Completed","maxAttemptCount":1,"attemptIndex":0,"jobStartedTime":0,"attemptStartedTime":0,"attemptCompletedTime":0,"exitCode":0,"exitPhrase":"Succeeded","exitType":"Succeeded","exitDiagnostics":{"diagnosticsSummary":"Pod succeeded","runtime":null,"launcher":"Pod succeeded"},"appExitTriggerMessage":"All Tasks are completed","appExitTriggerTaskRoleName":"taskrole","appExitTriggerTaskIndex":0,"appExitSpec":{"code":0,"phrase":"Succeeded","issuer":"USER_CONTAINER","causer":"USER_CONTAINER","type":"USER_SUCCESS","stage":"COMPLETING","behavior":"UNKNOWN","reaction":"NEVER_RETRY","repro":["User program exits with exitcode 0"]},"appExitDiagnostics":"Pod succeeded","appExitMessages":{"container":null,"runtime":null,"launcher":"Pod succeeded"},"totalGpuNumber":1,"totalTaskNumber":1,"totalTaskRoleNumber":1,"taskRoles":{"taskrole":{"taskRoleStatus":{"name":"taskrole"},"taskStatuses":[{"taskIndex":0,"taskState":"SUCCEEDED","containerId":"","containerIp":"","containerExitCode":0}]}},"isLatest":true}]}}},"404":{"description":"NoJobError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"NoJobError":{"value":{"code":"NoJobError","message":"Job {job} is not found."}}}}}},"501":{"description":"UnknownError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"UnknownError":{"value":{"code":"UnknownError","message":"Internal error message."}}}}}}},"description":"get /api/v2/jobs/{user}~{job}/job-attempts"},{"before":[{"tag":"job","operationId":"createJob","parameters":[{"type":"raw","value":{"contributor":"OpenPAI","description":"# Serving a TensorFlow MNIST Digit Recognition Model\nThis example shows you how to use TensorFlow Serving components to export a trained TensorFlow model\nand use the standard tensorflow_model_server to serve it on OpenPAI.\nThis example uses the simple Softmax Regression model introduced in the TensorFlow tutorial for handwritten image (MNIST data) classification.\nReference https://www.tensorflow.org/tfx/serving/serving_basic.\n","name":"sdk_test_job6961cae2","parameters":{"modelPath":"/tmp/mnist_model"},"prerequisites":[{"contributor":"OpenPAI","description":"This is an [example TensorFlow Serving Docker image on OpenPAI](https://github.com/Microsoft/pai/tree/master/examples/serving).\n","name":"tf_serving_example","protocolVersion":2,"type":"dockerimage","uri":"openpai/pai.example.tensorflow-serving","version":"1.0-r1.4"}],"protocolVersion":2,"taskRoles":{"worker":{"commands":["bazel-bin/tensorflow_serving/example/mnist_saved_model <% $parameters.modelPath %>","tensorflow_model_server --port=$PAI_CONTAINER_HOST_model_server_PORT_LIST --model_name=mnist --model_base_path=<% $parameters.modelPath %>"],"dockerImage":"tf_serving_example","instances":1,"resourcePerInstance":{"cpu":4,"gpu":1,"memoryMB":8192,"ports":{"model_server":1}}}},"type":"job","version":"1.0"}}]}],"tests":[{"operation":{"parameters":[{"type":"raw","value":"sdk_test"},{"type":"raw","value":"sdk_test_job6961cae2"},{"type":"raw","value":0}],"tag":"job history","operationId":"getJobAttempt","response":{"statusCode":200,"schema":{"type":"object","description":"job attempt","properties":{"jobName":{"type":"string"},"frameworkName":{"type":"string"},"uid":{"type":"string"},"userName":{"type":"string"},"state":{"type":"string"},"originState":{"type":"string"},"maxAttemptCount":{"type":"integer"},"attemptIndex":{"type":"integer"},"jobStartedTime":{"type":"integer"},"attemptStartedTime":{"type":"integer"},"attemptCompletedTime":{"type":"integer","nullable":true},"exitCode":{"type":"integer","nullable":true},"exitPhrase":{"type":"string","nullable":true},"exitType":{"type":"string","nullable":true},"exitDiagnostics":{"type":"object","nullable":true,"properties":{"diagnosticsSummary":{"type":"string"},"runtime":{"type":"object","nullable":true,"properties":{"exitCode":{"type":"integer","nullable":true},"originUserExitCode":{"type":"integer","nullable":true},"errorLogs":{"type":"object","nullable":true,"properties":{"user":{"type":"string"},"platform":{"type":"string"}}},"name":{"type":"string"}}},"launcher":{"type":"string"}}},"appExitTriggerMessage":{"type":"string","nullable":true},"appExitTriggerTaskRoleName":{"type":"string","nullable":true},"appExitTriggerTaskIndex":{"type":"integer","nullable":true},"appExitSpec":{"type":"object","nullable":true,"properties":{"code":{"type":"integer"},"phrase":{"type":"string"},"issuer":{"type":"string"},"causer":{"type":"string"},"type":{"type":"string"},"stage":{"type":"string"},"behavior":{"type":"string"},"reaction":{"type":"string"},"reason":{"type":"string"},"repro":{"type":"array","items":{"type":"string"}},"solution":{"type":"array","items":{"type":"string"}}}},"appExitDiagnostics":{"type":"string","nullable":true},"appExitMessages":{"type":"object","nullable":true,"properties":{"container":{"type":"string","nullable":true},"runtime":{"type":"object","nullable":true,"properties":{"exitCode":{"type":"integer","nullable":true},"originUserExitCode":{"type":"integer","nullable":true},"errorLogs":{"type":"object","nullable":true,"properties":{"user":{"type":"string"},"platform":{"type":"string"}}},"name":{"type":"string"}}},"launcher":{"type":"string","nullable":true}}},"totalGpuNumber":{"type":"integer"},"totalTasknumber":{"type":"integer"},"totalTaskRoleNumber":{"type":"integer"},"taskRoles":{"type":"object","properties":{"taskrole":{"type":"object","properties":{"taskRoleStatus":{"type":"object","properties":{"name":{"type":"string"}},"required":["name"]},"taskStatuses":{"type":"array","items":{"type":"object","properties":{"taskIndex":{"type":"integer"},"taskState":{"type":"string","enum":["WAITING","RUNNING","STOPPING","STOPPED","SUCCEEDED","FAILED","UNKNOWN"]},"containerId":{"type":"string"},"containerIp":{"type":"string"},"containerGpus":{"type":"string","nullable":true},"containerLog":{"type":"string"},"containerExitCode":{"type":"integer","nullable":true}}}}},"required":["taskRoleStatus","taskStatuses"]}}},"isLatest":{"type":"boolean"}}},"contentType":"application/json"}}}],"after":[{"tag":"job","operationId":"updateJobExecutionType","parameters":[{"type":"raw","value":"sdk_test"},{"type":"raw","value":"sdk_test_job6961cae2"},{"type":"raw","value":"STOP"}]}],"schemas":{"200":{"description":"Succeeded","content":{"application/json":{"schema":{"type":"object","description":"job attempt","properties":{"jobName":{"type":"string"},"frameworkName":{"type":"string"},"uid":{"type":"string"},"userName":{"type":"string"},"state":{"type":"string"},"originState":{"type":"string"},"maxAttemptCount":{"type":"integer"},"attemptIndex":{"type":"integer"},"jobStartedTime":{"type":"integer"},"attemptStartedTime":{"type":"integer"},"attemptCompletedTime":{"type":"integer","nullable":true},"exitCode":{"type":"integer","nullable":true},"exitPhrase":{"type":"string","nullable":true},"exitType":{"type":"string","nullable":true},"exitDiagnostics":{"type":"object","nullable":true,"properties":{"diagnosticsSummary":{"type":"string"},"runtime":{"type":"object","nullable":true,"properties":{"exitCode":{"type":"integer","nullable":true},"originUserExitCode":{"type":"integer","nullable":true},"errorLogs":{"type":"object","nullable":true,"properties":{"user":{"type":"string"},"platform":{"type":"string"}}},"name":{"type":"string"}}},"launcher":{"type":"string"}}},"appExitTriggerMessage":{"type":"string","nullable":true},"appExitTriggerTaskRoleName":{"type":"string","nullable":true},"appExitTriggerTaskIndex":{"type":"integer","nullable":true},"appExitSpec":{"type":"object","nullable":true,"properties":{"code":{"type":"integer"},"phrase":{"type":"string"},"issuer":{"type":"string"},"causer":{"type":"string"},"type":{"type":"string"},"stage":{"type":"string"},"behavior":{"type":"string"},"reaction":{"type":"string"},"reason":{"type":"string"},"repro":{"type":"array","items":{"type":"string"}},"solution":{"type":"array","items":{"type":"string"}}}},"appExitDiagnostics":{"type":"string","nullable":true},"appExitMessages":{"type":"object","nullable":true,"properties":{"container":{"type":"string","nullable":true},"runtime":{"type":"object","nullable":true,"properties":{"exitCode":{"type":"integer","nullable":true},"originUserExitCode":{"type":"integer","nullable":true},"errorLogs":{"type":"object","nullable":true,"properties":{"user":{"type":"string"},"platform":{"type":"string"}}},"name":{"type":"string"}}},"launcher":{"type":"string","nullable":true}}},"totalGpuNumber":{"type":"integer"},"totalTasknumber":{"type":"integer"},"totalTaskRoleNumber":{"type":"integer"},"taskRoles":{"type":"object","properties":{"taskrole":{"type":"object","properties":{"taskRoleStatus":{"type":"object","properties":{"name":{"type":"string"}},"required":["name"]},"taskStatuses":{"type":"array","items":{"type":"object","properties":{"taskIndex":{"type":"integer"},"taskState":{"type":"string","enum":["WAITING","RUNNING","STOPPING","STOPPED","SUCCEEDED","FAILED","UNKNOWN"]},"containerId":{"type":"string"},"containerIp":{"type":"string"},"containerGpus":{"type":"string","nullable":true},"containerLog":{"type":"string"},"containerExitCode":{"type":"integer","nullable":true}}}}},"required":["taskRoleStatus","taskStatuses"]}}},"isLatest":{"type":"boolean"}}},"example":{"jobName":"jobName","frameworkName":"frameworkName","uid":"uid","userName":"userName","state":"SUCCEEDED","originState":"Completed","maxAttemptCount":1,"attemptIndex":0,"jobStartedTime":0,"attemptStartedTime":0,"attemptCompletedTime":0,"exitCode":0,"exitPhrase":"Succeeded","exitType":"Succeeded","exitDiagnostics":{"diagnosticsSummary":"Pod succeeded","runtime":null,"launcher":"Pod succeeded"},"appExitTriggerMessage":"All Tasks are completed","appExitTriggerTaskRoleName":"taskrole","appExitTriggerTaskIndex":0,"appExitSpec":{"code":0,"phrase":"Succeeded","issuer":"USER_CONTAINER","causer":"USER_CONTAINER","type":"USER_SUCCESS","stage":"COMPLETING","behavior":"UNKNOWN","reaction":"NEVER_RETRY","repro":["User program exits with exitcode 0"]},"appExitDiagnostics":"Pod succeeded","appExitMessages":{"container":null,"runtime":null,"launcher":"Pod succeeded"},"totalGpuNumber":1,"totalTaskNumber":1,"totalTaskRoleNumber":1,"taskRoles":{"taskrole":{"taskRoleStatus":{"name":"taskrole"},"taskStatuses":[{"taskIndex":0,"taskState":"SUCCEEDED","containerId":"","containerIp":"","containerExitCode":0}]}},"isLatest":true}}}},"404":{"description":"NoJobError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"NoJobError":{"value":{"code":"NoJobError","message":"Job {job} is not found."}}}}}},"501":{"description":"UnknownError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"UnknownError":{"value":{"code":"UnknownError","message":"Internal error message."}}}}}}},"description":"get /api/v2/jobs/{user}~{job}/job-attempts/{attemptIndex}"},{"description":"get /api/v2/kubernetes/nodes","tests":[{"operation":{"tag":"kubernetes","operationId":"getK8sNodes","parameters":[],"response":{"statusCode":200}}}],"schemas":{"200":{"description":"Succeeded","content":{"application/json":{"example":["Please refer to Kubernetes API doc","https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.17/#list-node-v1-core"]}}},"401":{"description":"UnauthorizedUserError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"UnauthorizedUserError":{"value":{"code":"UnauthorizedUserError","message":"Guest is not allowed to do this operation."}}}}}},"403":{"description":"ForbiddenUserError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"ForbiddenUserError":{"value":{"code":"ForbiddenUserError","message":"Non-admin is not allow to do this operation."}},"ForbiddenTokenError":{"value":{"code":"ForbiddenUserError","message":"Applications are not allowed to do this operation."}}}}}}}},{"description":"get /api/v2/kubernetes/pods","tests":[{"operation":{"tag":"kubernetes","operationId":"getK8sPods","parameters":[],"response":{"statusCode":200}}}],"schemas":{"200":{"description":"Succeeded","content":{"application/json":{"example":["Please refer to Kubernetes API doc","https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.17/#list-all-namespaces-pod-v1-core"]}}},"401":{"description":"UnauthorizedUserError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"UnauthorizedUserError":{"value":{"code":"UnauthorizedUserError","message":"Guest is not allowed to do this operation."}}}}}},"403":{"description":"ForbiddenUserError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"ForbiddenUserError":{"value":{"code":"ForbiddenUserError","message":"Non-admin is not allow to do this operation."}},"ForbiddenTokenError":{"value":{"code":"ForbiddenUserError","message":"Applications are not allowed to do this operation."}}}}}}}}],"map":{"getClusterInfo":{"path":"/api/v2/info","method":"get","examples":{"200":{"name":"PAI RESTful API","version":"v1.0.1","launcherType":"k8s","authnMethod":"basic"}}},"getTokens":{"path":"/api/v2/tokens","method":"get","examples":{"200":{"tokens":["JWT Token Example"]},"401":{"value":{"code":"UnauthorizedUserError","message":"Guest is not allowed to do this operation."}}}},"deleteToken":{"path":"/api/v2/tokens/{token}","method":"delete","examples":{"200":{"message":"revoke successfully"},"401":{"value":{"code":"UnauthorizedUserError","message":"Guest is not allowed to do this operation."}},"403":{"value":{"code":"ForbiddenUserError","message":"Non-admin is not allow to do this operation."}}}},"createApplicationToken":{"path":"/api/v2/tokens/application","method":"post","examples":{"200":{"token":"JWT Token Example","application":true},"401":{"value":{"code":"UnauthorizedUserError","message":"Guest is not allowed to do this operation."}}}},"oidcLogin":{"path":"/api/v2/authn/oidc/login","method":"get","examples":{}},"oidcLogout":{"path":"/api/v2/authn/oidc/logout","method":"get","examples":{}},"basicLogin":{"path":"/api/v2/authn/basic/login","method":"post","examples":{"200":{"token":"JWT Token Example","user":"user","admin":true},"404":{"value":{"code":"NoUserError","message":"User {user} is not found."}}}},"basicLogout":{"path":"/api/v2/authn/basic/logout","method":"delete","examples":{"200":{"message":"Logout successfully"},"401":{"value":{"code":"UnauthorizedUserError","message":"Guest is not allowed to do this operation."}},"403":{"value":{"code":"ForbiddenUserError","message":"Non-admin is not allow to do this operation."}}}},"createUser":{"path":"/api/v2/users","method":"post","examples":{"201":{"message":"User is created successfully"},"401":{"value":{"code":"UnauthorizedUserError","message":"Guest is not allowed to do this operation."}},"403":{"value":{"code":"ForbiddenUserError","message":"Non-admin is not allow to do this operation."}},"409":{"value":{"code":"ConflictUserError","message":"User name {user} already exists."}},"500":{"value":{"code":"UnknownError","message":"Internal error message."}}}},"getAllUser":{"path":"/api/v2/users","method":"get","examples":{"200":[{"username":"username","admin":true,"virtualCluster":[],"storageConfig":[],"email":"email@test.com","extension":{}}],"500":{"value":{"code":"UnknownError","message":"Internal error message."}}}},"updateUser":{"path":"/api/v2/users","method":"put","examples":{"201":{"message":"update group {username} successfully."},"401":{"value":{"code":"UnauthorizedUserError","message":"Guest is not allowed to do this operation."}},"403":{"value":{"code":"ForbiddenUserError","message":"Non-admin is not allow to do this operation."}},"404":{"value":{"code":"NoUserError","message":"User {user} is not found."}},"500":{"value":{"code":"UnknownError","message":"Internal error message."}}}},"updateUserSelf":{"path":"/api/v2/users/me","method":"put","examples":{"201":{"message":"update group {username} successfully."},"401":{"value":{"code":"UnauthorizedUserError","message":"Guest is not allowed to do this operation."}},"403":{"value":{"code":"ForbiddenUserError","message":"Non-admin is not allow to do this operation."}},"404":{"value":{"code":"NoUserError","message":"User {user} is not found."}},"500":{"value":{"code":"UnknownError","message":"Internal error message."}}}},"getUser":{"path":"/api/v2/users/{user}","method":"get","examples":{"200":{"username":"username","admin":true,"virtualCluster":[],"storageConfig":[],"email":"email@test.com","extension":{}},"401":{"value":{"code":"UnauthorizedUserError","message":"Guest is not allowed to do this operation."}},"404":{"value":{"code":"NoUserError","message":"User {user} is not found."}},"500":{"value":{"code":"UnknownError","message":"Internal error message."}}}},"deleteUser":{"path":"/api/v2/users/{user}","method":"delete","examples":{"200":{"message":"user is removed successfully"},"401":{"value":{"code":"UnauthorizedUserError","message":"Guest is not allowed to do this operation."}},"403":{"value":{"code":"ForbiddenUserError","message":"Non-admin is not allow to do this operation."}},"404":{"value":{"code":"NoUserError","message":"User {user} is not found."}},"500":{"value":{"code":"UnknownError","message":"Internal error message."}}}},"updateUserGroup":{"path":"/api/v2/users/{user}/group/","method":"put","examples":{"201":{"message":"User {username} is added into group {groupname}"},"401":{"value":{"code":"UnauthorizedUserError","message":"Guest is not allowed to do this operation."}},"403":{"value":{"code":"ForbiddenUserError","message":"Non-admin is not allow to do this operation."}},"404":{"value":{"code":"NoUserError","message":"User {user} is not found."}},"500":{"value":{"code":"UnknownError","message":"Internal error message."}}}},"deleteUserGroup":{"path":"/api/v2/users/{user}/group/","method":"delete","examples":{"201":{"message":"User {username} is removed from group {groupname}"},"401":{"value":{"code":"UnauthorizedUserError","message":"Guest is not allowed to do this operation."}},"403":{"value":{"code":"ForbiddenUserError","message":"Non-admin is not allow to do this operation."}},"404":{"value":{"code":"NoUserError","message":"User {user} is not found."}},"500":{"value":{"code":"UnknownError","message":"Internal error message."}}}},"updateUserGrouplist":{"path":"/api/v2/users/{user}/grouplist/","method":"put","examples":{"201":{"message":"update user grouplist successfully."},"401":{"value":{"code":"UnauthorizedUserError","message":"Guest is not allowed to do this operation."}},"403":{"value":{"code":"ForbiddenUserError","message":"Non-admin is not allow to do this operation."}},"404":{"value":{"code":"NoUserError","message":"User {user} is not found."}},"500":{"value":{"code":"UnknownError","message":"Internal error message."}}}},"getAllGroup":{"path":"/api/v2/groups","method":"get","examples":{"200":[{"groupname":"groupName","description":"description","externalName":"externalName","extension":{}}],"500":{"value":{"code":"UnknownError","message":"Internal error message."}}}},"createGroup":{"path":"/api/v2/groups","method":"post","examples":{"201":{"message":"group is created successfully"},"401":{"value":{"code":"UnauthorizedUserError","message":"Guest is not allowed to do this operation."}},"403":{"value":{"code":"ForbiddenUserError","message":"Non-admin is not allow to do this operation."}},"500":{"value":{"code":"UnknownError","message":"Internal error message."}}}},"updateGroup":{"path":"/api/v2/groups","method":"put","examples":{"201":{"message":"update group {groupname} successfully."},"401":{"value":{"code":"UnauthorizedUserError","message":"Guest is not allowed to do this operation."}},"403":{"value":{"code":"ForbiddenUserError","message":"Non-admin is not allow to do this operation."}},"404":{"value":{"code":"NoGroupError","message":"Group {groupname} is not found."}},"500":{"value":{"code":"UnknownError","message":"Internal error message."}}}},"getGroup":{"path":"/api/v2/groups/{group}","method":"get","examples":{"200":{"groupname":"groupName","description":"description","externalName":"externalName","extension":{}},"401":{"value":{"code":"UnauthorizedUserError","message":"Guest is not allowed to do this operation."}},"404":{"value":{"code":"NoGroupError","message":"Group {groupname} is not found."}},"500":{"value":{"code":"UnknownError","message":"Internal error message."}}}},"deleteGroup":{"path":"/api/v2/groups/{group}","method":"delete","examples":{"201":{"message":"group is removed successfully"},"401":{"value":{"code":"UnauthorizedUserError","message":"Guest is not allowed to do this operation."}},"403":{"value":{"code":"ForbiddenUserError","message":"Non-admin is not allow to do this operation."}},"500":{"value":{"code":"UnknownError","message":"Internal error message."}}}},"getGroupMembers":{"path":"/api/v2/groups/{group}/userlist","method":"get","examples":{"200":[{"username":"username","clusterAdmin":false}],"401":{"value":{"code":"UnauthorizedUserError","message":"Guest is not allowed to do this operation."}},"500":{"value":{"code":"UnknownError","message":"Internal error message."}}}},"listVirtualClusters":{"path":"/api/v2/virtual-clusters","method":"get","examples":{"500":{"value":{"code":"UnknownError","message":"Internal error message."}}}},"getVirtualCluster":{"path":"/api/v2/virtual-clusters/{vc}","method":"get","examples":{"200":{"capacity":70,"usedCapacity":30,"dedicated":false,"resourcesUsed":{"cpu":1,"memory":1024,"gpu":1,"vCores":1,"GPUs":1},"resourcesGuaranteed":{"cpu":2,"memory":2048,"gpu":2,"vCores":2,"GPUs":2},"resourcesTotal":{"cpu":2,"memory":2048,"gpu":2,"vCores":2,"GPUs":2},"maxCapacity":70},"404":{"value":{"code":"NoVirtualClusterError","message":"Virtual cluster {vc} is not found."}},"500":{"value":{"code":"UnknownError","message":"Internal error message."}}}},"getStorages":{"path":"/api/v2/storages","method":"get","examples":{"200":{"storages":[{"name":"name","share":true,"volumeName":"volumeName"}]},"500":{"value":{"code":"UnknownError","message":"Internal error message."}}}},"getStorage":{"path":"/api/v2/storages/{storage}","method":"get","examples":{"200":{"name":"nfs-storage-name","share":true,"volumeName":"nfs-volume-name","type":"nfs","data":{"server":"","path":"/data"}},"403":{"value":{"code":"ForbiddenUserError","message":"User {user} is not allowed to access {storage}."}},"404":{"value":{"code":"NoStorageError","message":"Storage {storage} is not found."}},"500":{"value":{"code":"UnknownError","message":"Internal error message."}}}},"createJob":{"path":"/api/v2/jobs","method":"post","examples":{"202":{"message":"update job {job} successfully"},"400":{"value":{"code":"NoVirtualClusterError","message":"Virtual cluster {vc} is not found."}},"403":{"value":{"code":"ForbiddenUserError","message":"Non-admin is not allow to do this operation."}},"409":{"value":{"code":"ConflictJobError","message":"Job name {job} already exists."}},"500":{"value":{"code":"UnknownError","message":"Internal error message."}}}},"listJobs":{"path":"/api/v2/jobs","method":"get","examples":{"200":[{"protocolVersion":"2","name":"job name","username":"user name","state":"SUCCEEDED","subState":"Completed","executionType":"STOP","retries":0,"createdTime":0,"completedTime":0,"appExitCode":0,"virtualCluster":"unknown"}],"500":{"value":{"code":"UnknownError","message":"Internal error message."}}}},"getJob":{"path":"/api/v2/jobs/{user}~{job}","method":"get","examples":{"200":{"name":"job name","jobStatus":{"username":"user name","state":"SUCCEEDED","subState":"Completed","executionType":"STOP","retries":0,"createdTime":0,"completedTime":0,"appId":"id","appLaunchedTime":0,"appCompletedTime":0,"appExitCode":0,"virtualCluster":"unknown"},"taskRoles":{"taskrole":{"taskRoleStatus":{"name":"task role name"},"taskStatuses":[{"taskIndex":0,"taskState":"SUCCEEDED"}]}}},"404":{"value":{"code":"NoJobError","message":"Job {job} is not found."}},"500":{"value":{"code":"UnknownError","message":"Internal error message."}}}},"getJobConfig":{"path":"/api/v2/jobs/{user}~{job}/config","method":"get","examples":{"200":{"protocolVersion":"2","name":"","type":"job","prerequisites":[{"name":"","type":"dockerimage","uri":"image_url"}],"taskRoles":{"train":{"instances":1,"dockerImage":"","resourcePerInstance":{"cpu":1,"memoryMB":16384,"gpu":1},"commands":["python "]}}},"404":{"value":{"code":"NoJobError","message":"Job {job} is not found."}},"500":{"value":{"code":"UnknownError","message":"Internal error message."}}}},"updateJobExecutionType":{"path":"/api/v2/jobs/{user}~{job}/executionType","method":"put","examples":{"202":{"message":"execute job {job} successfully"},"404":{"value":{"code":"NoJobError","message":"Job {job} is not found."}},"500":{"value":{"code":"UnknownError","message":"Internal error message."}}}},"getJobAttemptsHealthz":{"path":"/api/v2/jobs/{user}~{job}/job-attempts/healthz","method":"get","examples":{}},"getJobAttempts":{"path":"/api/v2/jobs/{user}~{job}/job-attempts","method":"get","examples":{"200":[{"jobName":"jobName","frameworkName":"frameworkName","uid":"uid","userName":"userName","state":"SUCCEEDED","originState":"Completed","maxAttemptCount":1,"attemptIndex":0,"jobStartedTime":0,"attemptStartedTime":0,"attemptCompletedTime":0,"exitCode":0,"exitPhrase":"Succeeded","exitType":"Succeeded","exitDiagnostics":{"diagnosticsSummary":"Pod succeeded","runtime":null,"launcher":"Pod succeeded"},"appExitTriggerMessage":"All Tasks are completed","appExitTriggerTaskRoleName":"taskrole","appExitTriggerTaskIndex":0,"appExitSpec":{"code":0,"phrase":"Succeeded","issuer":"USER_CONTAINER","causer":"USER_CONTAINER","type":"USER_SUCCESS","stage":"COMPLETING","behavior":"UNKNOWN","reaction":"NEVER_RETRY","repro":["User program exits with exitcode 0"]},"appExitDiagnostics":"Pod succeeded","appExitMessages":{"container":null,"runtime":null,"launcher":"Pod succeeded"},"totalGpuNumber":1,"totalTaskNumber":1,"totalTaskRoleNumber":1,"taskRoles":{"taskrole":{"taskRoleStatus":{"name":"taskrole"},"taskStatuses":[{"taskIndex":0,"taskState":"SUCCEEDED","containerId":"","containerIp":"","containerExitCode":0}]}},"isLatest":true}],"404":{"value":{"code":"NoJobError","message":"Job {job} is not found."}},"501":{"value":{"code":"UnknownError","message":"Internal error message."}}}},"getJobAttempt":{"path":"/api/v2/jobs/{user}~{job}/job-attempts/{attemptIndex}","method":"get","examples":{"200":{"jobName":"jobName","frameworkName":"frameworkName","uid":"uid","userName":"userName","state":"SUCCEEDED","originState":"Completed","maxAttemptCount":1,"attemptIndex":0,"jobStartedTime":0,"attemptStartedTime":0,"attemptCompletedTime":0,"exitCode":0,"exitPhrase":"Succeeded","exitType":"Succeeded","exitDiagnostics":{"diagnosticsSummary":"Pod succeeded","runtime":null,"launcher":"Pod succeeded"},"appExitTriggerMessage":"All Tasks are completed","appExitTriggerTaskRoleName":"taskrole","appExitTriggerTaskIndex":0,"appExitSpec":{"code":0,"phrase":"Succeeded","issuer":"USER_CONTAINER","causer":"USER_CONTAINER","type":"USER_SUCCESS","stage":"COMPLETING","behavior":"UNKNOWN","reaction":"NEVER_RETRY","repro":["User program exits with exitcode 0"]},"appExitDiagnostics":"Pod succeeded","appExitMessages":{"container":null,"runtime":null,"launcher":"Pod succeeded"},"totalGpuNumber":1,"totalTaskNumber":1,"totalTaskRoleNumber":1,"taskRoles":{"taskrole":{"taskRoleStatus":{"name":"taskrole"},"taskStatuses":[{"taskIndex":0,"taskState":"SUCCEEDED","containerId":"","containerIp":"","containerExitCode":0}]}},"isLatest":true},"404":{"value":{"code":"NoJobError","message":"Job {job} is not found."}},"501":{"value":{"code":"UnknownError","message":"Internal error message."}}}},"getK8sNodes":{"path":"/api/v2/kubernetes/nodes","method":"get","examples":{"200":["Please refer to Kubernetes API doc","https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.17/#list-node-v1-core"],"401":{"value":{"code":"UnauthorizedUserError","message":"Guest is not allowed to do this operation."}},"403":{"value":{"code":"ForbiddenUserError","message":"Non-admin is not allow to do this operation."}}}},"getK8sPods":{"path":"/api/v2/kubernetes/pods","method":"get","examples":{"200":["Please refer to Kubernetes API doc","https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.17/#list-all-namespaces-pod-v1-core"],"401":{"value":{"code":"UnauthorizedUserError","message":"Guest is not allowed to do this operation."}},"403":{"value":{"code":"ForbiddenUserError","message":"Non-admin is not allow to do this operation."}}}}}} \ No newline at end of file diff --git a/package.json b/package.json index c4242ed..c5aac89 100644 --- a/package.json +++ b/package.json @@ -15,7 +15,7 @@ "test": "mocha -r ts-node/register -r tsconfig-paths/register tests/unit_tests/**/*.spec.ts", "preapi-test": "ts-node -r tsconfig-paths/register tests/common/apiTestCaseGenerator.ts -- \"src/api/v2/swagger.yaml\" \".tests/apiTestCase.json\"", "api-test": "mocha -r ts-node/register -r tsconfig-paths/register tests/api_tests/**/*.spec.ts -t 20000", - "api-test:mock": "npm run preapi-test && mocha -r ts-node/register -r tsconfig-paths/register tests/unit_tests/v2/v2.specdraft.ts", + "mock-api-test": "npm run preapi-test && mocha -r ts-node/register -r tsconfig-paths/register tests/unit_tests/v2/v2.spec.ts", "prebuild": "tslint --config tslint.json --project tsconfig.build.json", "build": "ttsc -p tsconfig.json" }, diff --git a/src/api/v2/swagger.yaml b/src/api/v2/swagger.yaml index 6dcbc96..ef2b34b 100644 --- a/src/api/v2/swagger.yaml +++ b/src/api/v2/swagger.yaml @@ -1105,7 +1105,8 @@ paths: schema: $ref: '#/components/schemas/JobSummary' example: - - name: job name + - protocolVersion: '2' + name: job name username: user name state: SUCCEEDED subState: Completed @@ -1181,6 +1182,24 @@ paths: text/yaml: schema: $ref: '#/components/schemas/JobProtocol' + example: + protocolVersion: '2' + name: + type: job + prerequisites: + - name: + type: dockerimage + uri: image_url + taskRoles: + train: + instances: 1 + dockerImage: + resourcePerInstance: + cpu: 1 + memoryMB: 16384 + gpu: 1 + commands: + - python '404': description: NoJobError or NoJobConfigError content: @@ -1194,7 +1213,7 @@ paths: $ref: '#/components/responses/NoJobConfigError/content/application~1json/examples/NoJobConfigError' '500': $ref: '#/components/responses/UnknownError' - '/api/v2/jobs/{user}~{job}/exectionType': + '/api/v2/jobs/{user}~{job}/executionType': put: tags: - job @@ -1274,6 +1293,58 @@ paths: items: $ref: '#/components/schemas/JobAttempt' description: job attempts + example: + - jobName: jobName + frameworkName: frameworkName + uid: uid + userName: userName + state: SUCCEEDED + originState: Completed + maxAttemptCount: 1 + attemptIndex: 0 + jobStartedTime: 0 + attemptStartedTime: 0 + attemptCompletedTime: 0 + exitCode: 0 + exitPhrase: Succeeded + exitType: Succeeded + exitDiagnostics: + diagnosticsSummary: Pod succeeded + runtime: + launcher: Pod succeeded + appExitTriggerMessage: 'All Tasks are completed' + appExitTriggerTaskRoleName: taskrole + appExitTriggerTaskIndex: 0 + appExitSpec: + code: 0 + phrase: Succeeded + issuer: USER_CONTAINER + causer: USER_CONTAINER + type: USER_SUCCESS + stage: COMPLETING + behavior: UNKNOWN + reaction: NEVER_RETRY + repro: + - User program exits with exitcode 0 + appExitDiagnostics: Pod succeeded + appExitMessages: + container: + runtime: + launcher: Pod succeeded + totalGpuNumber: 1 + totalTaskNumber: 1 + totalTaskRoleNumber: 1 + taskRoles: + taskrole: + taskRoleStatus: + name: taskrole + taskStatuses: + - taskIndex: 0 + taskState: SUCCEEDED + containerId: + containerIp: + containerExitCode: 0 + isLatest: true '404': $ref: '#/components/responses/NoJobError' '501': @@ -1298,6 +1369,58 @@ paths: application/json: schema: $ref: '#/components/schemas/JobAttempt' + example: + jobName: jobName + frameworkName: frameworkName + uid: uid + userName: userName + state: SUCCEEDED + originState: Completed + maxAttemptCount: 1 + attemptIndex: 0 + jobStartedTime: 0 + attemptStartedTime: 0 + attemptCompletedTime: 0 + exitCode: 0 + exitPhrase: Succeeded + exitType: Succeeded + exitDiagnostics: + diagnosticsSummary: Pod succeeded + runtime: + launcher: Pod succeeded + appExitTriggerMessage: 'All Tasks are completed' + appExitTriggerTaskRoleName: taskrole + appExitTriggerTaskIndex: 0 + appExitSpec: + code: 0 + phrase: Succeeded + issuer: USER_CONTAINER + causer: USER_CONTAINER + type: USER_SUCCESS + stage: COMPLETING + behavior: UNKNOWN + reaction: NEVER_RETRY + repro: + - User program exits with exitcode 0 + appExitDiagnostics: Pod succeeded + appExitMessages: + container: + runtime: + launcher: Pod succeeded + totalGpuNumber: 1 + totalTaskNumber: 1 + totalTaskRoleNumber: 1 + taskRoles: + taskrole: + taskRoleStatus: + name: taskrole + taskStatuses: + - taskIndex: 0 + taskState: SUCCEEDED + containerId: + containerIp: + containerExitCode: 0 + isLatest: true '404': $ref: '#/components/responses/NoJobError' '501': diff --git a/tests/unit_tests/v2/v2.specdraft.ts b/tests/unit_tests/v2/v2.spec.ts similarity index 100% rename from tests/unit_tests/v2/v2.specdraft.ts rename to tests/unit_tests/v2/v2.spec.ts From 8cf955e4faad7368c7f06b10e5948b58ffd8557e Mon Sep 17 00:00:00 2001 From: Yi Yi Date: Mon, 15 Jun 2020 01:30:07 +0800 Subject: [PATCH 05/24] update --- .tests/apiTestCase.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.tests/apiTestCase.json b/.tests/apiTestCase.json index bdbc6fe..fe51488 100644 --- a/.tests/apiTestCase.json +++ b/.tests/apiTestCase.json @@ -1 +1 @@ -{"tests":[{"description":"get /api/v2/info","tests":[{"operation":{"tag":"api","operationId":"getClusterInfo","parameters":[],"response":{"statusCode":200,"schema":{"type":"object","properties":{"name":{"type":"string","description":"PAI RESTfulAPI"},"version":{"type":"string","description":"cluster version in v0.X.0 format"},"launcherType":{"type":"string","enum":["yarn","k8s"]},"authnMethod":{"type":"string","enum":["basic","OIDC"]}},"required":["name","version","launcherType","authnMethod"]},"contentType":"application/json"}}}],"schemas":{"200":{"description":"Succeeded","content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","description":"PAI RESTfulAPI"},"version":{"type":"string","description":"cluster version in v0.X.0 format"},"launcherType":{"type":"string","enum":["yarn","k8s"]},"authnMethod":{"type":"string","enum":["basic","OIDC"]}},"required":["name","version","launcherType","authnMethod"]},"example":{"name":"PAI RESTful API","version":"v1.0.1","launcherType":"k8s","authnMethod":"basic"}}}}}},{"before":[{"tag":"token","operationId":"createApplicationToken"}],"tests":[{"description":"Get tokens with user token","operation":{"tag":"token","operationId":"getTokens","parameters":[],"response":{"statusCode":200,"schema":{"type":"object","properties":{"tokens":{"type":"array","items":{"type":"string"},"description":"JWT string list"}},"required":["tokens"]},"contentType":"application/json"}}},{"description":"Get tokens with unauthorized token","customizedTest":"getTokensWithUnauthorizedUser","operation":{"tag":"token","operationId":"getTokens","parameters":[],"response":{"statusCode":200,"schema":{"type":"object","properties":{"tokens":{"type":"array","items":{"type":"string"},"description":"JWT string list"}},"required":["tokens"]},"contentType":"application/json"}}}],"after":[{"tag":"token","operationId":"deleteToken","parameters":[{"type":"fromResult","resultType":"beforeResults","resultPath":["token"],"resultIndex":0}]}],"schemas":{"200":{"description":"Succeeded","content":{"application/json":{"schema":{"type":"object","properties":{"tokens":{"type":"array","items":{"type":"string"},"description":"JWT string list"}},"required":["tokens"]},"example":{"tokens":["JWT Token Example"]}}}},"401":{"description":"UnauthorizedUserError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"UnauthorizedUserError":{"value":{"code":"UnauthorizedUserError","message":"Guest is not allowed to do this operation."}}}}}}},"description":"get /api/v2/tokens"},{"before":[{"tag":"token","operationId":"createApplicationToken"}],"tests":[{"operation":{"parameters":[{"type":"fromResult","resultType":"beforeResults","resultPath":["token"],"resultIndex":0}],"tag":"token","operationId":"deleteToken","response":{"statusCode":200,"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"contentType":"application/json"}}}],"schemas":{"200":{"description":"Succeeded","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"example":{"message":"revoke successfully"}}}},"401":{"description":"UnauthorizedUserError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"UnauthorizedUserError":{"value":{"code":"UnauthorizedUserError","message":"Guest is not allowed to do this operation."}}}}}},"403":{"description":"ForbiddenUserError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"ForbiddenUserError":{"value":{"code":"ForbiddenUserError","message":"Non-admin is not allow to do this operation."}},"ForbiddenTokenError":{"value":{"code":"ForbiddenUserError","message":"Applications are not allowed to do this operation."}}}}}}},"description":"delete /api/v2/tokens/{token}"},{"tests":[{"operation":{"tag":"token","operationId":"createApplicationToken","parameters":[],"response":{"statusCode":200,"schema":{"type":"object","properties":{"token":{"type":"string","description":"your access token"},"application":{"type":"boolean","description":"true"}}},"contentType":"application/json"}}}],"after":[{"tag":"token","operationId":"deleteToken","parameters":[{"type":"fromResult","resultType":"testResults","resultPath":["token"],"resultIndex":0}]}],"schemas":{"200":{"description":"Succeeded","content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string","description":"your access token"},"application":{"type":"boolean","description":"true"}}},"example":{"token":"JWT Token Example","application":true}}}},"401":{"description":"UnauthorizedUserError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"UnauthorizedUserError":{"value":{"code":"UnauthorizedUserError","message":"Guest is not allowed to do this operation."}}}}}}},"description":"post /api/v2/tokens/application"},{"description":"get /api/v2/authn/oidc/login","tests":[{"operation":{"tag":"authn","operationId":"oidcLogin","parameters":[]}}],"schemas":{"302":{"description":"Redirect"}}},{"description":"get /api/v2/authn/oidc/logout","tests":[{"operation":{"tag":"authn","operationId":"oidcLogout","parameters":[]}}],"schemas":{"302":{"description":"Redirect"}}},{"tests":[{"description":"login with correct username and password","operation":{"parameters":[{"type":"raw","value":"sdk_test"},{"type":"raw","value":"pwd"}],"tag":"authn","operationId":"basicLogin","response":{"statusCode":200,"schema":{"type":"object","properties":{"token":{"type":"string","description":"your access token"},"user":{"type":"string","description":"username"},"admin":{"type":"boolean","description":"true if user is admin"}},"required":["token","user","admin"]},"contentType":"application/json"}}},{"description":"login with non-existent username","operation":{"parameters":[{"type":"raw","value":"nonexistentuser"},{"type":"raw","value":"password"}],"response":{"statusCode":400,"expectResult":{"code":"NoUserError","message":"User nonexistentuser is not found."},"schema":{"description":"NoUserError or IncorrectPassworkError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]}}}}},"tag":"authn","operationId":"basicLogin"}},{"description":"login with incorrect password","operation":{"parameters":[{"type":"raw","value":"sdk_test"},{"type":"raw","value":"incorrectpassword"}],"response":{"statusCode":400,"expectResult":{"code":"IncorrectPasswordError","message":"Password is incorrect."},"schema":{"description":"NoUserError or IncorrectPassworkError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]}}}}},"tag":"authn","operationId":"basicLogin"}}],"after":[{"tag":"token","operationId":"deleteToken","parameters":[{"type":"fromResult","resultType":"testResults","resultPath":["token"],"resultIndex":0}]}],"schemas":{"200":{"description":"Succeeded","content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string","description":"your access token"},"user":{"type":"string","description":"username"},"admin":{"type":"boolean","description":"true if user is admin"}},"required":["token","user","admin"]},"example":{"token":"JWT Token Example","user":"user","admin":true}}}},"400":{"description":"NoUserError or IncorrectPassworkError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]}}}},"404":{"description":"NoUserError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"NoUserError":{"value":{"code":"NoUserError","message":"User {user} is not found."}}}}}}},"description":"post /api/v2/authn/basic/login"},{"before":[{"tag":"authn","operationId":"basicLogin","parameters":[{"type":"raw","value":"sdk_test"},{"type":"raw","value":"pwd"}]}],"tests":[{"description":"Logout with correct token","customizedTest":"logoutWithCorrectToken","operation":{"tag":"authn","operationId":"basicLogout","parameters":[],"response":{"statusCode":200,"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"contentType":"application/json"}}},{"description":"Logout with incorrect token","customizedTest":"logoutWithIncorrectToken","operation":{"tag":"authn","operationId":"basicLogout","parameters":[],"response":{"statusCode":200,"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"contentType":"application/json"}}}],"schemas":{"200":{"description":"Succeeded","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"example":{"message":"Logout successfully"}}}},"401":{"description":"UnauthorizedUserError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"UnauthorizedUserError":{"value":{"code":"UnauthorizedUserError","message":"Guest is not allowed to do this operation."}}}}}},"403":{"description":"ForbiddenUserError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"ForbiddenUserError":{"value":{"code":"ForbiddenUserError","message":"Non-admin is not allow to do this operation."}},"ForbiddenTokenError":{"value":{"code":"ForbiddenUserError","message":"Applications are not allowed to do this operation."}}}}}}},"description":"delete /api/v2/authn/basic/logout"},{"before":[{"tag":"token","operationId":"createApplicationToken"}],"tests":[{"description":"Create a user","operation":{"tag":"user","operationId":"createUser","parameters":[{"type":"raw","value":{"username":"sdk_test_user","password":"test_password"}}],"response":{"statusCode":201,"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"contentType":"application/json"}}},{"description":"Create a conflict user","operation":{"tag":"user","operationId":"createUser","parameters":[{"type":"raw","value":{"username":"sdk_test_user","password":"test_password"}}],"response":{"statusCode":409,"schema":{"description":"ConflictUserError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"ConflictUserError":{"value":{"code":"ConflictUserError","message":"User name {user} already exists."}}}}}}}}},{"description":"Create a user by application token","customizedTest":"createUserByApplicationToken","operation":{"tag":"user","operationId":"createUser","parameters":[],"response":{"statusCode":201,"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"contentType":"application/json"}}},{"description":"Create a user by non-admin user token","customizedTest":"createUserByNonadminToken","operation":{"tag":"user","operationId":"createUser","parameters":[],"response":{"statusCode":201,"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"contentType":"application/json"}}}],"after":[{"tag":"user","operationId":"deleteUser","parameters":[{"type":"raw","value":"sdk_test_user"}],"response":{"statusCode":200,"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"contentType":"application/json"}},{"tag":"token","operationId":"deleteToken","parameters":[{"type":"fromResult","resultType":"beforeResults","resultPath":["token"],"resultIndex":0}]}],"schemas":{"201":{"description":"Succeeded","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"example":{"message":"User is created successfully"}}}},"401":{"description":"UnauthorizedUserError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"UnauthorizedUserError":{"value":{"code":"UnauthorizedUserError","message":"Guest is not allowed to do this operation."}}}}}},"403":{"description":"ForbiddenUserError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"ForbiddenUserError":{"value":{"code":"ForbiddenUserError","message":"Non-admin is not allow to do this operation."}},"ForbiddenTokenError":{"value":{"code":"ForbiddenUserError","message":"Applications are not allowed to do this operation."}}}}}},"409":{"description":"ConflictUserError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"ConflictUserError":{"value":{"code":"ConflictUserError","message":"User name {user} already exists."}}}}}},"500":{"description":"UnknownError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"UnknownError":{"value":{"code":"UnknownError","message":"Internal error message."}}}}}}},"description":"post /api/v2/users"},{"description":"get /api/v2/users","tests":[{"operation":{"tag":"user","operationId":"getAllUser","parameters":[],"response":{"statusCode":200,"schema":{"description":"Array with all users in the system.","type":"array","items":{"type":"object","properties":{"username":{"type":"string","description":"user name"},"admin":{"type":"boolean","description":"Admin or not."},"virtualCluster":{"type":"array","description":"The list of virtualCluster which the user can access.","items":{"type":"string","description":"virtual cluster name."}},"storageConfig":{"type":"array","description":"storageconfig string arry","items":{"type":"string"}},"email":{"type":"string","description":"email address"},"extension":{"type":"object","description":"extension field."}},"required":["username","admin","virtualCluster","storageConfig","email","extension"]}},"contentType":"application/json"}}}],"schemas":{"200":{"description":"Succeeded","content":{"application/json":{"schema":{"description":"Array with all users in the system.","type":"array","items":{"type":"object","properties":{"username":{"type":"string","description":"user name"},"admin":{"type":"boolean","description":"Admin or not."},"virtualCluster":{"type":"array","description":"The list of virtualCluster which the user can access.","items":{"type":"string","description":"virtual cluster name."}},"storageConfig":{"type":"array","description":"storageconfig string arry","items":{"type":"string"}},"email":{"type":"string","description":"email address"},"extension":{"type":"object","description":"extension field."}},"required":["username","admin","virtualCluster","storageConfig","email","extension"]}},"example":[{"username":"username","admin":true,"virtualCluster":[],"storageConfig":[],"email":"email@test.com","extension":{}}]}}},"500":{"description":"UnknownError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"UnknownError":{"value":{"code":"UnknownError","message":"Internal error message."}}}}}}}},{"before":[{"tag":"user","operationId":"createUser","parameters":[{"type":"raw","value":{"username":"sdk_test_user","password":"test_password"}}],"response":{"statusCode":201,"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"contentType":"application/json"}},{"tag":"token","operationId":"createApplicationToken"}],"tests":[{"description":"Update a user, patch: true","operation":{"parameters":[{"type":"raw","value":{"username":"sdk_test_user","email":"new_email@test1.com"}}],"tag":"user","operationId":"updateUser","response":{"statusCode":201,"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"contentType":"application/json"}}},{"description":"Update a user, patch: false","operation":{"parameters":[{"type":"raw","value":{"username":"sdk_test_user","email":"new_email@test2.com","virtualCluster":["default"],"admin":false,"password":"new_test_password","extension":{}}},{"type":"raw","value":false}],"tag":"user","operationId":"updateUser","response":{"statusCode":201,"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"contentType":"application/json"}}},{"description":"Update a non-existent user","operation":{"parameters":[{"type":"raw","value":{"username":"non_exist_user","email":"new_email@test1.com"}}],"response":{"statusCode":404,"schema":{"description":"NoUserError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"NoUserError":{"value":{"code":"NoUserError","message":"User {user} is not found."}}}}}}},"tag":"user","operationId":"updateUser"}},{"description":"Update a user by application token","customizedTest":"updateUserByApplicationToken","operation":{"tag":"user","operationId":"updateUser","parameters":[],"response":{"statusCode":201,"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"contentType":"application/json"}}},{"description":"Update a user by non-admin user token","customizedTest":"updateUserByNonadminToken","operation":{"tag":"user","operationId":"updateUser","parameters":[],"response":{"statusCode":201,"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"contentType":"application/json"}}}],"after":[{"tag":"user","operationId":"deleteUser","parameters":[{"type":"raw","value":"sdk_test_user"}],"response":{"statusCode":200,"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"contentType":"application/json"}},{"tag":"token","operationId":"deleteToken","parameters":[{"type":"fromResult","resultType":"beforeResults","resultPath":["token"],"resultIndex":1}]}],"schemas":{"201":{"description":"Succeeded","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"example":{"message":"update group {username} successfully."}}}},"401":{"description":"UnauthorizedUserError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"UnauthorizedUserError":{"value":{"code":"UnauthorizedUserError","message":"Guest is not allowed to do this operation."}}}}}},"403":{"description":"ForbiddenUserError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"ForbiddenUserError":{"value":{"code":"ForbiddenUserError","message":"Non-admin is not allow to do this operation."}},"ForbiddenTokenError":{"value":{"code":"ForbiddenUserError","message":"Applications are not allowed to do this operation."}}}}}},"404":{"description":"NoUserError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"NoUserError":{"value":{"code":"NoUserError","message":"User {user} is not found."}}}}}},"500":{"description":"UnknownError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"UnknownError":{"value":{"code":"UnknownError","message":"Internal error message."}}}}}}},"description":"put /api/v2/users"},{"tests":[{"description":"Update user self, patch: true","operation":{"parameters":[{"type":"raw","value":{"username":"sdk_test","email":"new_email@test1.com"}}],"tag":"user","operationId":"updateUserSelf","response":{"statusCode":201,"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"contentType":"application/json"}}},{"description":"Update user self, patch: false","operation":{"parameters":[{"type":"raw","value":{"username":"sdk_test","email":"new_email@test2.com","oldPassword":"pwd","newPassword":"pwd"}},{"type":"raw","value":false}],"tag":"user","operationId":"updateUserSelf","response":{"statusCode":201,"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"contentType":"application/json"}}},{"description":"Update user self with incorrect username","operation":{"parameters":[{"type":"raw","value":{"username":"incorrect_username","email":"new_email@test1.com"}}],"response":{"statusCode":403,"schema":{"description":"ForbiddenUserError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"ForbiddenUserError":{"value":{"code":"ForbiddenUserError","message":"Non-admin is not allow to do this operation."}},"ForbiddenTokenError":{"value":{"code":"ForbiddenUserError","message":"Applications are not allowed to do this operation."}}}}}}},"tag":"user","operationId":"updateUserSelf"}}],"schemas":{"201":{"description":"Succeeded","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"example":{"message":"update group {username} successfully."}}}},"401":{"description":"UnauthorizedUserError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"UnauthorizedUserError":{"value":{"code":"UnauthorizedUserError","message":"Guest is not allowed to do this operation."}}}}}},"403":{"description":"ForbiddenUserError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"ForbiddenUserError":{"value":{"code":"ForbiddenUserError","message":"Non-admin is not allow to do this operation."}},"ForbiddenTokenError":{"value":{"code":"ForbiddenUserError","message":"Applications are not allowed to do this operation."}}}}}},"404":{"description":"NoUserError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"NoUserError":{"value":{"code":"NoUserError","message":"User {user} is not found."}}}}}},"500":{"description":"UnknownError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"UnknownError":{"value":{"code":"UnknownError","message":"Internal error message."}}}}}}},"description":"put /api/v2/users/me"},{"tests":[{"operation":{"parameters":[{"type":"raw","value":"sdk_test"}],"tag":"user","operationId":"getUser","response":{"statusCode":200,"schema":{"type":"object","properties":{"username":{"type":"string","description":"user name"},"admin":{"type":"boolean","description":"Admin or not."},"virtualCluster":{"type":"array","description":"The list of virtualCluster which the user can access.","items":{"type":"string","description":"virtual cluster name."}},"storageConfig":{"type":"array","description":"storageconfig string arry","items":{"type":"string"}},"email":{"type":"string","description":"email address"},"extension":{"type":"object","description":"extension field."}},"required":["username","admin","virtualCluster","storageConfig","email","extension"]},"contentType":"application/json"}}}],"schemas":{"200":{"description":"Succeeded","content":{"application/json":{"schema":{"type":"object","properties":{"username":{"type":"string","description":"user name"},"admin":{"type":"boolean","description":"Admin or not."},"virtualCluster":{"type":"array","description":"The list of virtualCluster which the user can access.","items":{"type":"string","description":"virtual cluster name."}},"storageConfig":{"type":"array","description":"storageconfig string arry","items":{"type":"string"}},"email":{"type":"string","description":"email address"},"extension":{"type":"object","description":"extension field."}},"required":["username","admin","virtualCluster","storageConfig","email","extension"]},"example":{"username":"username","admin":true,"virtualCluster":[],"storageConfig":[],"email":"email@test.com","extension":{}}}}},"401":{"description":"UnauthorizedUserError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"UnauthorizedUserError":{"value":{"code":"UnauthorizedUserError","message":"Guest is not allowed to do this operation."}}}}}},"404":{"description":"NoUserError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"NoUserError":{"value":{"code":"NoUserError","message":"User {user} is not found."}}}}}},"500":{"description":"UnknownError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"UnknownError":{"value":{"code":"UnknownError","message":"Internal error message."}}}}}}},"description":"get /api/v2/users/{user}"},{"before":[{"tag":"user","operationId":"createUser","parameters":[{"type":"raw","value":{"username":"sdk_test_user","password":"test_password"}}],"response":{"statusCode":201,"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"contentType":"application/json"}},{"tag":"token","operationId":"createApplicationToken"}],"tests":[{"description":"Delete a user","operation":{"tag":"user","operationId":"deleteUser","parameters":[{"type":"raw","value":"sdk_test_user"}],"response":{"statusCode":200,"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"contentType":"application/json"}}},{"description":"Delete a non-existent user","operation":{"parameters":[{"type":"raw","value":"non_exist_user"}],"response":{"statusCode":404,"schema":{"description":"NoUserError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"NoUserError":{"value":{"code":"NoUserError","message":"User {user} is not found."}}}}}}},"tag":"user","operationId":"deleteUser"}},{"description":"Delete a user by application token","customizedTest":"deleteUserByApplicationToken","operation":{"tag":"user","operationId":"deleteUser","parameters":[],"response":{"statusCode":200,"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"contentType":"application/json"}}},{"description":"Delete a user by non-admin user token","customizedTest":"deleteUserByNonadminToken","operation":{"tag":"user","operationId":"deleteUser","parameters":[],"response":{"statusCode":200,"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"contentType":"application/json"}}}],"after":[{"tag":"token","operationId":"deleteToken","parameters":[{"type":"fromResult","resultType":"beforeResults","resultPath":["token"],"resultIndex":1}]}],"schemas":{"200":{"description":"Succeeded","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"example":{"message":"user is removed successfully"}}}},"401":{"description":"UnauthorizedUserError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"UnauthorizedUserError":{"value":{"code":"UnauthorizedUserError","message":"Guest is not allowed to do this operation."}}}}}},"403":{"description":"ForbiddenUserError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"ForbiddenUserError":{"value":{"code":"ForbiddenUserError","message":"Non-admin is not allow to do this operation."}},"ForbiddenTokenError":{"value":{"code":"ForbiddenUserError","message":"Applications are not allowed to do this operation."}}}}}},"404":{"description":"NoUserError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"NoUserError":{"value":{"code":"NoUserError","message":"User {user} is not found."}}}}}},"500":{"description":"UnknownError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"UnknownError":{"value":{"code":"UnknownError","message":"Internal error message."}}}}}}},"description":"delete /api/v2/users/{user}"},{"before":[{"tag":"token","operationId":"createApplicationToken"},{"tag":"user","operationId":"createUser","parameters":[{"type":"raw","value":{"username":"sdk_test_user","password":"test_password"}}],"response":{"statusCode":201,"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"contentType":"application/json"}},{"tag":"group","operationId":"createGroup","parameters":[{"type":"raw","value":{"groupname":"sdktestgroup"}}],"response":{"statusCode":201,"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"contentType":"application/json"}}],"tests":[{"description":"Add a group to a user's grouplist","operation":{"parameters":[{"type":"raw","value":"sdk_test_user"},{"type":"raw","value":"sdktestgroup"}],"tag":"user","operationId":"updateUserGroup","response":{"statusCode":201,"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"contentType":"application/json"}}},{"description":"Add a group to a non-existent user's grouplist","operation":{"parameters":[{"type":"raw","value":"non_exist_user"},{"type":"raw","value":"sdktestgroup"}],"response":{"statusCode":404,"schema":{"description":"NoUserError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"NoUserError":{"value":{"code":"NoUserError","message":"User {user} is not found."}}}}}}},"tag":"user","operationId":"updateUserGroup"}},{"description":"Add a group to a user's grouplist by application token","customizedTest":"updateUserGroupByApplicationToken","operation":{"tag":"user","operationId":"updateUserGroup","parameters":[],"response":{"statusCode":201,"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"contentType":"application/json"}}},{"description":"Add a group to a user's grouplist by non-admin user token","customizedTest":"updateUserGroupByNonadminToken","operation":{"tag":"user","operationId":"updateUserGroup","parameters":[],"response":{"statusCode":201,"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"contentType":"application/json"}}}],"after":[{"tag":"token","operationId":"deleteToken","parameters":[{"type":"fromResult","resultType":"beforeResults","resultPath":["token"],"resultIndex":0}]},{"tag":"user","operationId":"deleteUser","parameters":[{"type":"raw","value":"sdk_test_user"}],"response":{"statusCode":200,"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"contentType":"application/json"}},{"tag":"group","operationId":"deleteGroup","parameters":[{"type":"raw","value":"sdktestgroup"}],"response":{"statusCode":201,"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"contentType":"application/json"}}],"schemas":{"201":{"description":"Succeeded","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"example":{"message":"User {username} is added into group {groupname}"}}}},"401":{"description":"UnauthorizedUserError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"UnauthorizedUserError":{"value":{"code":"UnauthorizedUserError","message":"Guest is not allowed to do this operation."}}}}}},"403":{"description":"ForbiddenUserError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"ForbiddenUserError":{"value":{"code":"ForbiddenUserError","message":"Non-admin is not allow to do this operation."}},"ForbiddenTokenError":{"value":{"code":"ForbiddenUserError","message":"Applications are not allowed to do this operation."}}}}}},"404":{"description":"NoUserError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"NoUserError":{"value":{"code":"NoUserError","message":"User {user} is not found."}}}}}},"500":{"description":"UnknownError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"UnknownError":{"value":{"code":"UnknownError","message":"Internal error message."}}}}}}},"description":"put /api/v2/users/{user}/group/"},{"before":[{"tag":"token","operationId":"createApplicationToken"},{"tag":"user","operationId":"createUser","parameters":[{"type":"raw","value":{"username":"sdk_test_user","password":"test_password"}}],"response":{"statusCode":201,"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"contentType":"application/json"}},{"tag":"group","operationId":"createGroup","parameters":[{"type":"raw","value":{"groupname":"sdktestgroup"}}],"response":{"statusCode":201,"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"contentType":"application/json"}},{"tag":"user","operationId":"updateUserGroup","parameters":[{"type":"raw","value":"sdk_test_user"},{"type":"raw","value":"sdktestgroup"}]}],"tests":[{"description":"Remove a group to a user's grouplist","operation":{"parameters":[{"type":"raw","value":"sdk_test_user"},{"type":"raw","value":"sdktestgroup"}],"tag":"user","operationId":"deleteUserGroup","response":{"statusCode":201,"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"contentType":"application/json"}}},{"description":"Remove a group to a non-existent user's grouplist","operation":{"parameters":[{"type":"raw","value":"non_exist_user"},{"type":"raw","value":"sdktestgroup"}],"response":{"statusCode":404,"schema":{"description":"NoUserError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"NoUserError":{"value":{"code":"NoUserError","message":"User {user} is not found."}}}}}}},"tag":"user","operationId":"deleteUserGroup"}},{"description":"Remove a group to a user's grouplist by application token","customizedTest":"deleteUserGroupByApplicationToken","operation":{"tag":"user","operationId":"deleteUserGroup","parameters":[],"response":{"statusCode":201,"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"contentType":"application/json"}}},{"description":"Remove a group to a user's grouplist by non-admin user token","customizedTest":"deleteUserGroupByNonadminToken","operation":{"tag":"user","operationId":"deleteUserGroup","parameters":[],"response":{"statusCode":201,"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"contentType":"application/json"}}}],"after":[{"tag":"token","operationId":"deleteToken","parameters":[{"type":"fromResult","resultType":"beforeResults","resultPath":["token"],"resultIndex":0}]},{"tag":"user","operationId":"deleteUser","parameters":[{"type":"raw","value":"sdk_test_user"}],"response":{"statusCode":200,"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"contentType":"application/json"}},{"tag":"group","operationId":"deleteGroup","parameters":[{"type":"raw","value":"sdktestgroup"}],"response":{"statusCode":201,"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"contentType":"application/json"}}],"schemas":{"201":{"description":"Succeeded","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"example":{"message":"User {username} is removed from group {groupname}"}}}},"401":{"description":"UnauthorizedUserError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"UnauthorizedUserError":{"value":{"code":"UnauthorizedUserError","message":"Guest is not allowed to do this operation."}}}}}},"403":{"description":"ForbiddenUserError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"ForbiddenUserError":{"value":{"code":"ForbiddenUserError","message":"Non-admin is not allow to do this operation."}},"ForbiddenTokenError":{"value":{"code":"ForbiddenUserError","message":"Applications are not allowed to do this operation."}}}}}},"404":{"description":"NoUserError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"NoUserError":{"value":{"code":"NoUserError","message":"User {user} is not found."}}}}}},"500":{"description":"UnknownError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"UnknownError":{"value":{"code":"UnknownError","message":"Internal error message."}}}}}}},"description":"delete /api/v2/users/{user}/group/"},{"before":[{"tag":"token","operationId":"createApplicationToken"},{"tag":"user","operationId":"createUser","parameters":[{"type":"raw","value":{"username":"sdk_test_user","password":"test_password"}}],"response":{"statusCode":201,"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"contentType":"application/json"}}],"tests":[{"description":"Replace a user's grouplist","operation":{"parameters":[{"type":"raw","value":"sdk_test_user"},{"type":"raw","value":["default"]}],"tag":"user","operationId":"updateUserGrouplist","response":{"statusCode":201,"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"contentType":"application/json"}}},{"description":"Replace a non-existent user's grouplist","operation":{"parameters":[{"type":"raw","value":"non_exist_user"},{"type":"raw","value":["default"]}],"response":{"statusCode":404,"schema":{"description":"NoUserError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"NoUserError":{"value":{"code":"NoUserError","message":"User {user} is not found."}}}}}}},"tag":"user","operationId":"updateUserGrouplist"}},{"description":"Replace a user's grouplist by application token","customizedTest":"updateUserGrouplistByApplicationToken","operation":{"tag":"user","operationId":"updateUserGrouplist","parameters":[],"response":{"statusCode":201,"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"contentType":"application/json"}}},{"description":"Replace a user's grouplist by non-admin user token","customizedTest":"updateUserGrouplistByNonadminToken","operation":{"tag":"user","operationId":"updateUserGrouplist","parameters":[],"response":{"statusCode":201,"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"contentType":"application/json"}}}],"after":[{"tag":"token","operationId":"deleteToken","parameters":[{"type":"fromResult","resultType":"beforeResults","resultPath":["token"],"resultIndex":0}]},{"tag":"user","operationId":"deleteUser","parameters":[{"type":"raw","value":"sdk_test_user"}],"response":{"statusCode":200,"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"contentType":"application/json"}}],"schemas":{"201":{"description":"Succeeded","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"example":{"message":"update user grouplist successfully."}}}},"401":{"description":"UnauthorizedUserError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"UnauthorizedUserError":{"value":{"code":"UnauthorizedUserError","message":"Guest is not allowed to do this operation."}}}}}},"403":{"description":"ForbiddenUserError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"ForbiddenUserError":{"value":{"code":"ForbiddenUserError","message":"Non-admin is not allow to do this operation."}},"ForbiddenTokenError":{"value":{"code":"ForbiddenUserError","message":"Applications are not allowed to do this operation."}}}}}},"404":{"description":"NoUserError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"NoUserError":{"value":{"code":"NoUserError","message":"User {user} is not found."}}}}}},"500":{"description":"UnknownError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"UnknownError":{"value":{"code":"UnknownError","message":"Internal error message."}}}}}}},"description":"put /api/v2/users/{user}/grouplist/"},{"description":"get /api/v2/groups","tests":[{"operation":{"tag":"group","operationId":"getAllGroup","parameters":[],"response":{"statusCode":200,"schema":{"description":"Array with all groups in the system.","type":"array","items":{"type":"object","properties":{"groupname":{"type":"string","description":"group name"},"description":{"type":"string","description":"description for the group"},"externalName":{"type":"string","description":"the external group name binding with the group in OpenPAI"},"extension":{"type":"object"}}}},"contentType":"application/json"}}}],"schemas":{"200":{"description":"Succeeded","content":{"application/json":{"schema":{"description":"Array with all groups in the system.","type":"array","items":{"type":"object","properties":{"groupname":{"type":"string","description":"group name"},"description":{"type":"string","description":"description for the group"},"externalName":{"type":"string","description":"the external group name binding with the group in OpenPAI"},"extension":{"type":"object"}}}},"example":[{"groupname":"groupName","description":"description","externalName":"externalName","extension":{}}]}}},"500":{"description":"UnknownError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"UnknownError":{"value":{"code":"UnknownError","message":"Internal error message."}}}}}}}},{"tests":[{"operation":{"tag":"group","operationId":"createGroup","parameters":[{"type":"raw","value":{"groupname":"sdktestgroup"}}],"response":{"statusCode":201,"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"contentType":"application/json"}}}],"after":[{"tag":"group","operationId":"deleteGroup","parameters":[{"type":"raw","value":"sdktestgroup"}],"response":{"statusCode":201,"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"contentType":"application/json"}}],"schemas":{"201":{"description":"Succeeded","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"example":{"message":"group is created successfully"}}}},"401":{"description":"UnauthorizedUserError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"UnauthorizedUserError":{"value":{"code":"UnauthorizedUserError","message":"Guest is not allowed to do this operation."}}}}}},"403":{"description":"ForbiddenUserError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"ForbiddenUserError":{"value":{"code":"ForbiddenUserError","message":"Non-admin is not allow to do this operation."}},"ForbiddenTokenError":{"value":{"code":"ForbiddenUserError","message":"Applications are not allowed to do this operation."}}}}}},"500":{"description":"UnknownError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"UnknownError":{"value":{"code":"UnknownError","message":"Internal error message."}}}}}}},"description":"post /api/v2/groups"},{"before":[{"tag":"group","operationId":"createGroup","parameters":[{"type":"raw","value":{"groupname":"sdktestgroup"}}],"response":{"statusCode":201,"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"contentType":"application/json"}}],"tests":[{"operation":{"parameters":[{"type":"raw","value":{"data":{"groupname":"sdktestgroup","description":"test update group"},"patch":true}}],"tag":"group","operationId":"updateGroup","response":{"statusCode":201,"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"contentType":"application/json"}}}],"after":[{"tag":"group","operationId":"deleteGroup","parameters":[{"type":"raw","value":"sdktestgroup"}],"response":{"statusCode":201,"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"contentType":"application/json"}}],"schemas":{"201":{"description":"Succeeded","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"example":{"message":"update group {groupname} successfully."}}}},"401":{"description":"UnauthorizedUserError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"UnauthorizedUserError":{"value":{"code":"UnauthorizedUserError","message":"Guest is not allowed to do this operation."}}}}}},"403":{"description":"ForbiddenUserError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"ForbiddenUserError":{"value":{"code":"ForbiddenUserError","message":"Non-admin is not allow to do this operation."}},"ForbiddenTokenError":{"value":{"code":"ForbiddenUserError","message":"Applications are not allowed to do this operation."}}}}}},"404":{"description":"NoGroupError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"NoGroupError":{"value":{"code":"NoGroupError","message":"Group {groupname} is not found."}}}}}},"500":{"description":"UnknownError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"UnknownError":{"value":{"code":"UnknownError","message":"Internal error message."}}}}}}},"description":"put /api/v2/groups"},{"before":[{"tag":"group","operationId":"createGroup","parameters":[{"type":"raw","value":{"groupname":"sdktestgroup"}}],"response":{"statusCode":201,"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"contentType":"application/json"}}],"tests":[{"operation":{"parameters":[{"type":"raw","value":"sdktestgroup"}],"tag":"group","operationId":"getGroup","response":{"statusCode":200,"schema":{"type":"object","properties":{"groupname":{"type":"string","description":"group name"},"description":{"type":"string","description":"description for the group"},"externalName":{"type":"string","description":"the external group name binding with the group in OpenPAI"},"extension":{"type":"object"}},"required":["groupname","description","externalName","extension"]},"contentType":"application/json"}}}],"after":[{"tag":"group","operationId":"deleteGroup","parameters":[{"type":"raw","value":"sdktestgroup"}],"response":{"statusCode":201,"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"contentType":"application/json"}}],"schemas":{"200":{"description":"Succeeded","content":{"application/json":{"schema":{"type":"object","properties":{"groupname":{"type":"string","description":"group name"},"description":{"type":"string","description":"description for the group"},"externalName":{"type":"string","description":"the external group name binding with the group in OpenPAI"},"extension":{"type":"object"}},"required":["groupname","description","externalName","extension"]},"example":{"groupname":"groupName","description":"description","externalName":"externalName","extension":{}}}}},"401":{"description":"UnauthorizedUserError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"UnauthorizedUserError":{"value":{"code":"UnauthorizedUserError","message":"Guest is not allowed to do this operation."}}}}}},"404":{"description":"NoGroupError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"NoGroupError":{"value":{"code":"NoGroupError","message":"Group {groupname} is not found."}}}}}},"500":{"description":"UnknownError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"UnknownError":{"value":{"code":"UnknownError","message":"Internal error message."}}}}}}},"description":"get /api/v2/groups/{group}"},{"before":[{"tag":"group","operationId":"createGroup","parameters":[{"type":"raw","value":{"groupname":"sdktestgroup"}}],"response":{"statusCode":201,"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"contentType":"application/json"}}],"tests":[{"operation":{"tag":"group","operationId":"deleteGroup","parameters":[{"type":"raw","value":"sdktestgroup"}],"response":{"statusCode":201,"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"contentType":"application/json"}}}],"schemas":{"201":{"description":"Succeeded","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"example":{"message":"group is removed successfully"}}}},"401":{"description":"UnauthorizedUserError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"UnauthorizedUserError":{"value":{"code":"UnauthorizedUserError","message":"Guest is not allowed to do this operation."}}}}}},"403":{"description":"ForbiddenUserError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"ForbiddenUserError":{"value":{"code":"ForbiddenUserError","message":"Non-admin is not allow to do this operation."}},"ForbiddenTokenError":{"value":{"code":"ForbiddenUserError","message":"Applications are not allowed to do this operation."}}}}}},"500":{"description":"UnknownError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"UnknownError":{"value":{"code":"UnknownError","message":"Internal error message."}}}}}}},"description":"delete /api/v2/groups/{group}"},{"description":"get /api/v2/groups/{group}/userlist","tests":[{"operation":{"tag":"group","operationId":"getGroupMembers","parameters":[],"response":{"statusCode":200,"schema":{"description":"Array with all users in the group.","type":"array","items":{"type":"object","properties":{"username":{"type":"string","description":"user name"},"clusterAdmin":{"type":"boolean","description":"Cluster admin or not."}}}},"contentType":"application/json"}}}],"schemas":{"200":{"description":"Succeeded","content":{"application/json":{"schema":{"description":"Array with all users in the group.","type":"array","items":{"type":"object","properties":{"username":{"type":"string","description":"user name"},"clusterAdmin":{"type":"boolean","description":"Cluster admin or not."}}}},"example":[{"username":"username","clusterAdmin":false}]}}},"401":{"description":"UnauthorizedUserError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"UnauthorizedUserError":{"value":{"code":"UnauthorizedUserError","message":"Guest is not allowed to do this operation."}}}}}},"500":{"description":"UnknownError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"UnknownError":{"value":{"code":"UnknownError","message":"Internal error message."}}}}}}}},{"description":"get /api/v2/virtual-clusters","tests":[{"operation":{"tag":"virtual cluster","operationId":"listVirtualClusters","parameters":[],"response":{"statusCode":200,"schema":{"type":"object","additionalProperties":{"type":"object","properties":{"capacity":{"type":"number","description":"capacity percentage this virtual cluster can use of entire cluster"},"usedCapacity":{"type":"number","description":"used capacity percentage this virtual cluster can use of entire cluster"},"maxCapacity":{"type":"number","description":"max capacity percentage this virtual cluster can use of entire cluster"},"dedicated":{"type":"boolean","description":"dedicated virtual cluster or not"},"resourcesUsed":{"type":"object","description":"used resources","properties":{"cpu":{"type":"integer","description":"used cpu number"},"vCores":{"type":"integer","description":"same as cpu"},"memory":{"type":"integer","description":"used memory in MB"},"gpu":{"type":"integer","description":"used gpu number"},"GPUs":{"type":"integer","description":"same as gpu"}}},"resourcesGuaranteed":{"type":"object","description":"guaranteed resources, including used and free","properties":{"cpu":{"type":"integer","description":"guaranteed cpu number"},"vCores":{"type":"integer","description":"same as cpu"},"memory":{"type":"integer","description":"guaranteed memory in MB"},"gpu":{"type":"integer","description":"guaranteed gpu number"},"GPUs":{"type":"integer","description":"same as gpu"}}},"resourcesTotal":{"type":"object","description":"total resources, including guaranteed and bad","properties":{"cpu":{"type":"integer","description":"total cpu number"},"vCores":{"type":"integer","description":"same as cpu"},"memory":{"type":"integer","description":"total memory in MB"},"gpu":{"type":"integer","description":"total gpu number"},"GPUs":{"type":"integer","description":"same as gpu"}}}},"required":["capacity","usedCapacity","maxCapacity","resourcesUsed","resourcesGuaranteed","resourcesTotal"]}},"contentType":"application/json"}}}],"schemas":{"200":{"description":"Succeeded","content":{"application/json":{"schema":{"type":"object","additionalProperties":{"type":"object","properties":{"capacity":{"type":"number","description":"capacity percentage this virtual cluster can use of entire cluster"},"usedCapacity":{"type":"number","description":"used capacity percentage this virtual cluster can use of entire cluster"},"maxCapacity":{"type":"number","description":"max capacity percentage this virtual cluster can use of entire cluster"},"dedicated":{"type":"boolean","description":"dedicated virtual cluster or not"},"resourcesUsed":{"type":"object","description":"used resources","properties":{"cpu":{"type":"integer","description":"used cpu number"},"vCores":{"type":"integer","description":"same as cpu"},"memory":{"type":"integer","description":"used memory in MB"},"gpu":{"type":"integer","description":"used gpu number"},"GPUs":{"type":"integer","description":"same as gpu"}}},"resourcesGuaranteed":{"type":"object","description":"guaranteed resources, including used and free","properties":{"cpu":{"type":"integer","description":"guaranteed cpu number"},"vCores":{"type":"integer","description":"same as cpu"},"memory":{"type":"integer","description":"guaranteed memory in MB"},"gpu":{"type":"integer","description":"guaranteed gpu number"},"GPUs":{"type":"integer","description":"same as gpu"}}},"resourcesTotal":{"type":"object","description":"total resources, including guaranteed and bad","properties":{"cpu":{"type":"integer","description":"total cpu number"},"vCores":{"type":"integer","description":"same as cpu"},"memory":{"type":"integer","description":"total memory in MB"},"gpu":{"type":"integer","description":"total gpu number"},"GPUs":{"type":"integer","description":"same as gpu"}}}},"required":["capacity","usedCapacity","maxCapacity","resourcesUsed","resourcesGuaranteed","resourcesTotal"]}}}}},"500":{"description":"UnknownError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"UnknownError":{"value":{"code":"UnknownError","message":"Internal error message."}}}}}}}},{"tests":[{"operation":{"parameters":[{"type":"raw","value":"default"}],"tag":"virtual cluster","operationId":"getVirtualCluster","response":{"statusCode":200,"schema":{"type":"object","properties":{"capacity":{"type":"number","description":"capacity percentage this virtual cluster can use of entire cluster"},"usedCapacity":{"type":"number","description":"used capacity percentage this virtual cluster can use of entire cluster"},"maxCapacity":{"type":"number","description":"max capacity percentage this virtual cluster can use of entire cluster"},"dedicated":{"type":"boolean","description":"dedicated virtual cluster or not"},"resourcesUsed":{"type":"object","description":"used resources","properties":{"cpu":{"type":"integer","description":"used cpu number"},"vCores":{"type":"integer","description":"same as cpu"},"memory":{"type":"integer","description":"used memory in MB"},"gpu":{"type":"integer","description":"used gpu number"},"GPUs":{"type":"integer","description":"same as gpu"}}},"resourcesGuaranteed":{"type":"object","description":"guaranteed resources, including used and free","properties":{"cpu":{"type":"integer","description":"guaranteed cpu number"},"vCores":{"type":"integer","description":"same as cpu"},"memory":{"type":"integer","description":"guaranteed memory in MB"},"gpu":{"type":"integer","description":"guaranteed gpu number"},"GPUs":{"type":"integer","description":"same as gpu"}}},"resourcesTotal":{"type":"object","description":"total resources, including guaranteed and bad","properties":{"cpu":{"type":"integer","description":"total cpu number"},"vCores":{"type":"integer","description":"same as cpu"},"memory":{"type":"integer","description":"total memory in MB"},"gpu":{"type":"integer","description":"total gpu number"},"GPUs":{"type":"integer","description":"same as gpu"}}}},"required":["capacity","usedCapacity","maxCapacity","resourcesUsed","resourcesGuaranteed","resourcesTotal"]},"contentType":"application/json"}}}],"schemas":{"200":{"description":"Succeeded","content":{"application/json":{"schema":{"type":"object","properties":{"capacity":{"type":"number","description":"capacity percentage this virtual cluster can use of entire cluster"},"usedCapacity":{"type":"number","description":"used capacity percentage this virtual cluster can use of entire cluster"},"maxCapacity":{"type":"number","description":"max capacity percentage this virtual cluster can use of entire cluster"},"dedicated":{"type":"boolean","description":"dedicated virtual cluster or not"},"resourcesUsed":{"type":"object","description":"used resources","properties":{"cpu":{"type":"integer","description":"used cpu number"},"vCores":{"type":"integer","description":"same as cpu"},"memory":{"type":"integer","description":"used memory in MB"},"gpu":{"type":"integer","description":"used gpu number"},"GPUs":{"type":"integer","description":"same as gpu"}}},"resourcesGuaranteed":{"type":"object","description":"guaranteed resources, including used and free","properties":{"cpu":{"type":"integer","description":"guaranteed cpu number"},"vCores":{"type":"integer","description":"same as cpu"},"memory":{"type":"integer","description":"guaranteed memory in MB"},"gpu":{"type":"integer","description":"guaranteed gpu number"},"GPUs":{"type":"integer","description":"same as gpu"}}},"resourcesTotal":{"type":"object","description":"total resources, including guaranteed and bad","properties":{"cpu":{"type":"integer","description":"total cpu number"},"vCores":{"type":"integer","description":"same as cpu"},"memory":{"type":"integer","description":"total memory in MB"},"gpu":{"type":"integer","description":"total gpu number"},"GPUs":{"type":"integer","description":"same as gpu"}}}},"required":["capacity","usedCapacity","maxCapacity","resourcesUsed","resourcesGuaranteed","resourcesTotal"]},"example":{"capacity":70,"usedCapacity":30,"dedicated":false,"resourcesUsed":{"cpu":1,"memory":1024,"gpu":1,"vCores":1,"GPUs":1},"resourcesGuaranteed":{"cpu":2,"memory":2048,"gpu":2,"vCores":2,"GPUs":2},"resourcesTotal":{"cpu":2,"memory":2048,"gpu":2,"vCores":2,"GPUs":2},"maxCapacity":70}}}},"404":{"description":"NoVirtualClusterError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"NoVirtualClusterError":{"value":{"code":"NoVirtualClusterError","message":"Virtual cluster {vc} is not found."}}}}}},"500":{"description":"UnknownError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"UnknownError":{"value":{"code":"UnknownError","message":"Internal error message."}}}}}}},"description":"get /api/v2/virtual-clusters/{vc}"},{"description":"get /api/v2/storages","tests":[{"operation":{"tag":"storage","operationId":"getStorages","parameters":[],"response":{"statusCode":200,"schema":{"type":"object","description":"summary of configured PV storage","properties":{"storages":{"type":"array","items":{"type":"object","description":"summary of each storage","properties":{"name":{"type":"string"},"share":{"type":"boolean"},"volumeName":{"type":"string"}},"required":["name","share","volumeName"]}}},"required":["storages"]},"contentType":"application/json"}}}],"schemas":{"200":{"description":"Succeeded","content":{"application/json":{"schema":{"type":"object","description":"summary of configured PV storage","properties":{"storages":{"type":"array","items":{"type":"object","description":"summary of each storage","properties":{"name":{"type":"string"},"share":{"type":"boolean"},"volumeName":{"type":"string"}},"required":["name","share","volumeName"]}}},"required":["storages"]},"example":{"storages":[{"name":"name","share":true,"volumeName":"volumeName"}]}}}},"500":{"description":"UnknownError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"UnknownError":{"value":{"code":"UnknownError","message":"Internal error message."}}}}}}}},{"before":[{"tag":"storage","operationId":"getStorages"}],"tests":[{"operation":{"parameters":[{"type":"fromResult","resultType":"beforeResults","resultPath":["storages",0,"name"],"resultIndex":0}],"tag":"storage","operationId":"getStorage","response":{"statusCode":200,"schema":{"type":"object","description":"detail of configured PV storage","properties":{"name":{"type":"string"},"share":{"type":"boolean"},"volumeName":{"type":"string"},"type":{"type":"string","enum":["nfs","samba","azureFile","azureBlob","other","unknown"]},"data":{"anyOf":[{"type":"object","description":"nfs type","properties":{"server":{"type":"string"},"path":{"type":"string"}},"required":["server","path"]},{"type":"object","description":"samba type","properties":{"address":{"type":"string"},"username":{"type":"string"},"password":{"type":"string"}},"required":["address"]},{"type":"object","description":"azureFile type","properties":{"shareName":{"type":"string"},"accountName":{"type":"string"},"accountKey":{"type":"string"}},"required":["shareName"]},{"type":"object","description":"azureBlob type","properties":{"containerName":{"type":"string"},"accountName":{"type":"string"},"accountKey":{"type":"string"},"accountSASToken":{"type":"string"}},"required":["containerName"]},{"type":"object","description":"other/unknown type","properties":{}}]},"secretName":{"type":"string"},"mountOptions":{"type":"array","items":{"type":"string"}}},"required":["name","share","volumeName","type","data"]},"contentType":"application/json"}}}],"schemas":{"200":{"description":"Succeeded","content":{"application/json":{"schema":{"type":"object","description":"detail of configured PV storage","properties":{"name":{"type":"string"},"share":{"type":"boolean"},"volumeName":{"type":"string"},"type":{"type":"string","enum":["nfs","samba","azureFile","azureBlob","other","unknown"]},"data":{"anyOf":[{"type":"object","description":"nfs type","properties":{"server":{"type":"string"},"path":{"type":"string"}},"required":["server","path"]},{"type":"object","description":"samba type","properties":{"address":{"type":"string"},"username":{"type":"string"},"password":{"type":"string"}},"required":["address"]},{"type":"object","description":"azureFile type","properties":{"shareName":{"type":"string"},"accountName":{"type":"string"},"accountKey":{"type":"string"}},"required":["shareName"]},{"type":"object","description":"azureBlob type","properties":{"containerName":{"type":"string"},"accountName":{"type":"string"},"accountKey":{"type":"string"},"accountSASToken":{"type":"string"}},"required":["containerName"]},{"type":"object","description":"other/unknown type","properties":{}}]},"secretName":{"type":"string"},"mountOptions":{"type":"array","items":{"type":"string"}}},"required":["name","share","volumeName","type","data"]},"example":{"name":"nfs-storage-name","share":true,"volumeName":"nfs-volume-name","type":"nfs","data":{"server":"","path":"/data"}}}}},"403":{"description":"ForbiddenUserError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"ForbiddenUserError":{"value":{"code":"ForbiddenUserError","message":"User {user} is not allowed to access {storage}."}}}}}},"404":{"description":"NoStorageError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"NoVirtualClusterError":{"value":{"code":"NoStorageError","message":"Storage {storage} is not found."}}}}}},"500":{"description":"UnknownError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"UnknownError":{"value":{"code":"UnknownError","message":"Internal error message."}}}}}}},"description":"get /api/v2/storages/{storage}"},{"tests":[{"operation":{"tag":"job","operationId":"createJob","parameters":[{"type":"raw","value":{"contributor":"OpenPAI","description":"# Serving a TensorFlow MNIST Digit Recognition Model\nThis example shows you how to use TensorFlow Serving components to export a trained TensorFlow model\nand use the standard tensorflow_model_server to serve it on OpenPAI.\nThis example uses the simple Softmax Regression model introduced in the TensorFlow tutorial for handwritten image (MNIST data) classification.\nReference https://www.tensorflow.org/tfx/serving/serving_basic.\n","name":"sdk_test_job19f61623","parameters":{"modelPath":"/tmp/mnist_model"},"prerequisites":[{"contributor":"OpenPAI","description":"This is an [example TensorFlow Serving Docker image on OpenPAI](https://github.com/Microsoft/pai/tree/master/examples/serving).\n","name":"tf_serving_example","protocolVersion":2,"type":"dockerimage","uri":"openpai/pai.example.tensorflow-serving","version":"1.0-r1.4"}],"protocolVersion":2,"taskRoles":{"worker":{"commands":["bazel-bin/tensorflow_serving/example/mnist_saved_model <% $parameters.modelPath %>","tensorflow_model_server --port=$PAI_CONTAINER_HOST_model_server_PORT_LIST --model_name=mnist --model_base_path=<% $parameters.modelPath %>"],"dockerImage":"tf_serving_example","instances":1,"resourcePerInstance":{"cpu":4,"gpu":1,"memoryMB":8192,"ports":{"model_server":1}}}},"type":"job","version":"1.0"}}],"response":{"statusCode":202,"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"contentType":"application/json"}}}],"after":[{"tag":"job","operationId":"updateJobExecutionType","parameters":[{"type":"raw","value":"sdk_test"},{"type":"raw","value":"sdk_test_job19f61623"},{"type":"raw","value":"STOP"}]}],"schemas":{"202":{"description":"Succeeded","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"example":{"message":"update job {job} successfully"}}}},"400":{"description":"NoVirtualClusterError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"NoVirtualClusterError":{"value":{"code":"NoVirtualClusterError","message":"Virtual cluster {vc} is not found."}}}}}},"403":{"description":"ForbiddenUserError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"ForbiddenUserError":{"value":{"code":"ForbiddenUserError","message":"Non-admin is not allow to do this operation."}},"ForbiddenTokenError":{"value":{"code":"ForbiddenUserError","message":"Applications are not allowed to do this operation."}}}}}},"409":{"description":"ConflictJobError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"ConflictJobError":{"value":{"code":"ConflictJobError","message":"Job name {job} already exists."}}}}}},"500":{"description":"UnknownError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"UnknownError":{"value":{"code":"UnknownError","message":"Internal error message."}}}}}}},"description":"post /api/v2/jobs"},{"description":"get /api/v2/jobs","tests":[{"operation":{"tag":"job","operationId":"listJobs","parameters":[],"response":{"statusCode":200,"schema":{"type":"array","description":"job summary list","items":{"type":"object","properties":{"name":{"type":"string","description":"job name"},"username":{"type":"string","description":"user name or \"unknown\""},"state":{"type":"string","description":"general job state","enum":["WAITING","RUNNING","STOPPING","STOPPED","SUCCEEDED","FAILED","UNKNOWN"]},"subState":{"type":"string","description":"job state in framework controller","enum":["AttemptCreationPending","AttemptCreationRequested","AttemptPreparing","AttemptRunning","AttemptDeletionPending","AttemptDeletionRequested","AttemptDeleting","AttemptCompleted","Completed"]},"executionType":{"type":"string","description":"start or stop","enum":["START","STOP"]},"retries":{"type":"integer","description":"job retried times"},"retryDetails":{"type":"object","properties":{"user":{"type":"integer"},"platform":{"type":"integer"},"resource":{"type":"integer"}}},"retryDelayTime":{"type":"integer","nullable":true,"description":"retry delay time"},"createdTime":{"type":"integer","description":"job created time, in number of milliseconds since the Unix Epoch."},"completedTime":{"type":"integer","nullable":true,"description":"job completed time, in number of milliseconds since the Unix Epoch."},"appExitCode":{"type":"integer","nullable":true,"description":"job exit code"},"virtualCluster":{"type":"string","description":"virtual cluster to which the job submitted, or \"unknown\""},"totalGpuNumber":{"type":"integer","description":"total gpu number used in the job"},"totalTaskNumber":{"type":"integer","description":"total task number used in the job"},"totalTaskRoleNumber":{"type":"integer","description":"total task role number used in the job"},"debugId":{"type":"string","description":"md5 hash name for the job in framework controller, used for debug purpose"}},"required":["name","username","virtualCluster","state","subState","executionType","retries","createdTime","completedTime","appExitCode"]}},"contentType":"application/json"}}}],"schemas":{"200":{"description":"Succeeded","content":{"application/json":{"schema":{"type":"array","description":"job summary list","items":{"type":"object","properties":{"name":{"type":"string","description":"job name"},"username":{"type":"string","description":"user name or \"unknown\""},"state":{"type":"string","description":"general job state","enum":["WAITING","RUNNING","STOPPING","STOPPED","SUCCEEDED","FAILED","UNKNOWN"]},"subState":{"type":"string","description":"job state in framework controller","enum":["AttemptCreationPending","AttemptCreationRequested","AttemptPreparing","AttemptRunning","AttemptDeletionPending","AttemptDeletionRequested","AttemptDeleting","AttemptCompleted","Completed"]},"executionType":{"type":"string","description":"start or stop","enum":["START","STOP"]},"retries":{"type":"integer","description":"job retried times"},"retryDetails":{"type":"object","properties":{"user":{"type":"integer"},"platform":{"type":"integer"},"resource":{"type":"integer"}}},"retryDelayTime":{"type":"integer","nullable":true,"description":"retry delay time"},"createdTime":{"type":"integer","description":"job created time, in number of milliseconds since the Unix Epoch."},"completedTime":{"type":"integer","nullable":true,"description":"job completed time, in number of milliseconds since the Unix Epoch."},"appExitCode":{"type":"integer","nullable":true,"description":"job exit code"},"virtualCluster":{"type":"string","description":"virtual cluster to which the job submitted, or \"unknown\""},"totalGpuNumber":{"type":"integer","description":"total gpu number used in the job"},"totalTaskNumber":{"type":"integer","description":"total task number used in the job"},"totalTaskRoleNumber":{"type":"integer","description":"total task role number used in the job"},"debugId":{"type":"string","description":"md5 hash name for the job in framework controller, used for debug purpose"}},"required":["name","username","virtualCluster","state","subState","executionType","retries","createdTime","completedTime","appExitCode"]}},"example":[{"protocolVersion":"2","name":"job name","username":"user name","state":"SUCCEEDED","subState":"Completed","executionType":"STOP","retries":0,"createdTime":0,"completedTime":0,"appExitCode":0,"virtualCluster":"unknown"}]}}},"500":{"description":"UnknownError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"UnknownError":{"value":{"code":"UnknownError","message":"Internal error message."}}}}}}}},{"before":[{"tag":"job","operationId":"createJob","parameters":[{"type":"raw","value":{"contributor":"OpenPAI","description":"# Serving a TensorFlow MNIST Digit Recognition Model\nThis example shows you how to use TensorFlow Serving components to export a trained TensorFlow model\nand use the standard tensorflow_model_server to serve it on OpenPAI.\nThis example uses the simple Softmax Regression model introduced in the TensorFlow tutorial for handwritten image (MNIST data) classification.\nReference https://www.tensorflow.org/tfx/serving/serving_basic.\n","name":"sdk_test_jobdfa1db44","parameters":{"modelPath":"/tmp/mnist_model"},"prerequisites":[{"contributor":"OpenPAI","description":"This is an [example TensorFlow Serving Docker image on OpenPAI](https://github.com/Microsoft/pai/tree/master/examples/serving).\n","name":"tf_serving_example","protocolVersion":2,"type":"dockerimage","uri":"openpai/pai.example.tensorflow-serving","version":"1.0-r1.4"}],"protocolVersion":2,"taskRoles":{"worker":{"commands":["bazel-bin/tensorflow_serving/example/mnist_saved_model <% $parameters.modelPath %>","tensorflow_model_server --port=$PAI_CONTAINER_HOST_model_server_PORT_LIST --model_name=mnist --model_base_path=<% $parameters.modelPath %>"],"dockerImage":"tf_serving_example","instances":1,"resourcePerInstance":{"cpu":4,"gpu":1,"memoryMB":8192,"ports":{"model_server":1}}}},"type":"job","version":"1.0"}}]}],"tests":[{"description":"Get a job detail","operation":{"parameters":[{"type":"raw","value":"sdk_test"},{"type":"raw","value":"sdk_test_jobdfa1db44"}],"tag":"job","operationId":"getJob","response":{"statusCode":200,"schema":{"type":"object","description":"job details","properties":{"name":{"type":"string","description":"job name"},"jobStatus":{"type":"object","description":"job status","properties":{"username":{"type":"string","description":"user name or \"unknown\""},"state":{"type":"string","description":"general job state","enum":["WAITING","RUNNING","STOPPING","STOPPED","SUCCEEDED","FAILED","UNKNOWN"]},"subState":{"type":"string","description":"job state in framework controller","enum":["AttemptCreationPending","AttemptCreationRequested","AttemptPreparing","AttemptRunning","AttemptDeletionPending","AttemptDeletionRequested","AttemptDeleting","AttemptCompleted","Completed"]},"executionType":{"type":"string","description":"start or stop","enum":["START","STOP"]},"retries":{"type":"integer","description":"job retried times"},"retryDetails":{"type":"object","properties":{"user":{"type":"integer"},"platform":{"type":"integer"},"resource":{"type":"integer"}}},"retryDelayTime":{"type":"integer","nullable":true,"description":"retry delay time"},"createdTime":{"type":"integer","description":"job created time, in number of milliseconds since the Unix Epoch."},"completedTime":{"type":"integer","nullable":true,"description":"job completed time, in number of milliseconds since the Unix Epoch."},"appId":{"type":"string","description":"unique id for the job"},"appLaunchedTime":{"type":"integer","nullable":true,"description":"job launched time for last attempt, in number of milliseconds since the Unix Epoch."},"appCompletedTime":{"type":"integer","nullable":true,"description":"job completed time for last attempt, in number of milliseconds since the Unix Epoch. to get durations for last attempt:\n wholeDuration = completedTime - createdTime;\n runningDuration = appCompletedTime - appLaunchedTime;\n waitingDuration = wholeDuration - runningDuration.\nto get durations for all attempts:\n runningDuration = sum(appCompletedTime - appLaunchedTime) for all attempts.\n"},"appExitCode":{"type":"integer","nullable":true,"description":"job exit code"},"appExitSpec":{"type":"object","nullable":true,"description":"job exit spec","properties":{"code":{"type":"integer"},"phrase":{"type":"string"},"issuer":{"type":"string"},"causer":{"type":"string"},"type":{"type":"string"},"stage":{"type":"string"},"behavior":{"type":"string"},"reaction":{"type":"string"},"repro":{"type":"array","items":{"type":"string"}}}},"appExitDiagnostics":{"type":"string","nullable":true,"description":"job exit diagnostics"},"appExitMessages":{"type":"object","nullable":true,"properties":{"container":{"type":"string","nullable":true},"runtime":{"type":"string","nullable":true},"launcher":{"type":"string","nullable":true}}},"appExitTriggerMessage":{"type":"string","nullable":true,"description":"job completion message"},"appExitTriggerTaskRoleName":{"type":"string","nullable":true,"description":"task role name which triggered job completion"},"appExitTriggerTaskIndex":{"type":"integer","nullable":true,"description":"task index which triggered job completion"},"appExitType":{"type":"string","nullable":true,"description":"job completion type"},"virtualCluster":{"type":"string","description":"virtual cluster to which the job submitted, or \"unknown\""}},"required":["username","virtualCluster","state","subState","executionType","retries","createdTime","completedTime","appId","appLaunchedTime","appCompletedTime","appExitCode"]},"taskRoles":{"type":"object","additionalProperties":{"type":"object","description":"task role status","properties":{"taskRoleStatus":{"type":"object","properties":{"name":{"type":"string","description":"task role name"}},"required":["name"]},"taskStatuses":{"type":"array","description":"task statuses in the task role","items":{"type":"object","properties":{"taskIndex":{"type":"integer","description":"task index"},"taskState":{"type":"string","description":"task state","enum":["WAITING","RUNNING","STOPPING","STOPPED","SUCCEEDED","FAILED","UNKNOWN"]},"containerId":{"type":"string","description":"uid of the task container"},"containerIp":{"type":"string","description":"ip of the task container"},"containerPorts":{"type":"object","description":"ports of the task container"},"containerGpus":{"type":"string","nullable":true,"description":"gpu of the task container"},"containerLog":{"type":"string","description":"log url of the task container"},"containerExitCode":{"type":"integer","nullable":true,"description":"exit code the task container"}}}}},"required":["taskRoleStatus","taskStatuses"]}},"debugId":{"type":"string","description":"md5 hash name for the job in framework controller, used for debug purpose"}},"required":["name","jobStatus","taskRoles"]},"contentType":"application/json"}}},{"description":"Get nonexist job detail","operation":{"parameters":[{"type":"raw","value":"sdk_test"},{"type":"raw","value":"sdk_test_nonexist_job"}],"response":{"statusCode":404,"schema":{"description":"NoJobError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"NoJobError":{"value":{"code":"NoJobError","message":"Job {job} is not found."}}}}}}},"tag":"job","operationId":"getJob"}}],"after":[{"tag":"job","operationId":"updateJobExecutionType","parameters":[{"type":"raw","value":"sdk_test"},{"type":"raw","value":"sdk_test_jobdfa1db44"},{"type":"raw","value":"STOP"}]}],"schemas":{"200":{"description":"Succeeded","content":{"application/json":{"schema":{"type":"object","description":"job details","properties":{"name":{"type":"string","description":"job name"},"jobStatus":{"type":"object","description":"job status","properties":{"username":{"type":"string","description":"user name or \"unknown\""},"state":{"type":"string","description":"general job state","enum":["WAITING","RUNNING","STOPPING","STOPPED","SUCCEEDED","FAILED","UNKNOWN"]},"subState":{"type":"string","description":"job state in framework controller","enum":["AttemptCreationPending","AttemptCreationRequested","AttemptPreparing","AttemptRunning","AttemptDeletionPending","AttemptDeletionRequested","AttemptDeleting","AttemptCompleted","Completed"]},"executionType":{"type":"string","description":"start or stop","enum":["START","STOP"]},"retries":{"type":"integer","description":"job retried times"},"retryDetails":{"type":"object","properties":{"user":{"type":"integer"},"platform":{"type":"integer"},"resource":{"type":"integer"}}},"retryDelayTime":{"type":"integer","nullable":true,"description":"retry delay time"},"createdTime":{"type":"integer","description":"job created time, in number of milliseconds since the Unix Epoch."},"completedTime":{"type":"integer","nullable":true,"description":"job completed time, in number of milliseconds since the Unix Epoch."},"appId":{"type":"string","description":"unique id for the job"},"appLaunchedTime":{"type":"integer","nullable":true,"description":"job launched time for last attempt, in number of milliseconds since the Unix Epoch."},"appCompletedTime":{"type":"integer","nullable":true,"description":"job completed time for last attempt, in number of milliseconds since the Unix Epoch. to get durations for last attempt:\n wholeDuration = completedTime - createdTime;\n runningDuration = appCompletedTime - appLaunchedTime;\n waitingDuration = wholeDuration - runningDuration.\nto get durations for all attempts:\n runningDuration = sum(appCompletedTime - appLaunchedTime) for all attempts.\n"},"appExitCode":{"type":"integer","nullable":true,"description":"job exit code"},"appExitSpec":{"type":"object","nullable":true,"description":"job exit spec","properties":{"code":{"type":"integer"},"phrase":{"type":"string"},"issuer":{"type":"string"},"causer":{"type":"string"},"type":{"type":"string"},"stage":{"type":"string"},"behavior":{"type":"string"},"reaction":{"type":"string"},"repro":{"type":"array","items":{"type":"string"}}}},"appExitDiagnostics":{"type":"string","nullable":true,"description":"job exit diagnostics"},"appExitMessages":{"type":"object","nullable":true,"properties":{"container":{"type":"string","nullable":true},"runtime":{"type":"string","nullable":true},"launcher":{"type":"string","nullable":true}}},"appExitTriggerMessage":{"type":"string","nullable":true,"description":"job completion message"},"appExitTriggerTaskRoleName":{"type":"string","nullable":true,"description":"task role name which triggered job completion"},"appExitTriggerTaskIndex":{"type":"integer","nullable":true,"description":"task index which triggered job completion"},"appExitType":{"type":"string","nullable":true,"description":"job completion type"},"virtualCluster":{"type":"string","description":"virtual cluster to which the job submitted, or \"unknown\""}},"required":["username","virtualCluster","state","subState","executionType","retries","createdTime","completedTime","appId","appLaunchedTime","appCompletedTime","appExitCode"]},"taskRoles":{"type":"object","additionalProperties":{"type":"object","description":"task role status","properties":{"taskRoleStatus":{"type":"object","properties":{"name":{"type":"string","description":"task role name"}},"required":["name"]},"taskStatuses":{"type":"array","description":"task statuses in the task role","items":{"type":"object","properties":{"taskIndex":{"type":"integer","description":"task index"},"taskState":{"type":"string","description":"task state","enum":["WAITING","RUNNING","STOPPING","STOPPED","SUCCEEDED","FAILED","UNKNOWN"]},"containerId":{"type":"string","description":"uid of the task container"},"containerIp":{"type":"string","description":"ip of the task container"},"containerPorts":{"type":"object","description":"ports of the task container"},"containerGpus":{"type":"string","nullable":true,"description":"gpu of the task container"},"containerLog":{"type":"string","description":"log url of the task container"},"containerExitCode":{"type":"integer","nullable":true,"description":"exit code the task container"}}}}},"required":["taskRoleStatus","taskStatuses"]}},"debugId":{"type":"string","description":"md5 hash name for the job in framework controller, used for debug purpose"}},"required":["name","jobStatus","taskRoles"]},"example":{"name":"job name","jobStatus":{"username":"user name","state":"SUCCEEDED","subState":"Completed","executionType":"STOP","retries":0,"createdTime":0,"completedTime":0,"appId":"id","appLaunchedTime":0,"appCompletedTime":0,"appExitCode":0,"virtualCluster":"unknown"},"taskRoles":{"taskrole":{"taskRoleStatus":{"name":"task role name"},"taskStatuses":[{"taskIndex":0,"taskState":"SUCCEEDED"}]}}}}}},"404":{"description":"NoJobError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"NoJobError":{"value":{"code":"NoJobError","message":"Job {job} is not found."}}}}}},"500":{"description":"UnknownError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"UnknownError":{"value":{"code":"UnknownError","message":"Internal error message."}}}}}}},"description":"get /api/v2/jobs/{user}~{job}"},{"before":[{"tag":"job","operationId":"createJob","parameters":[{"type":"raw","value":{"contributor":"OpenPAI","description":"# Serving a TensorFlow MNIST Digit Recognition Model\nThis example shows you how to use TensorFlow Serving components to export a trained TensorFlow model\nand use the standard tensorflow_model_server to serve it on OpenPAI.\nThis example uses the simple Softmax Regression model introduced in the TensorFlow tutorial for handwritten image (MNIST data) classification.\nReference https://www.tensorflow.org/tfx/serving/serving_basic.\n","name":"sdk_test_joba43a5b4c","parameters":{"modelPath":"/tmp/mnist_model"},"prerequisites":[{"contributor":"OpenPAI","description":"This is an [example TensorFlow Serving Docker image on OpenPAI](https://github.com/Microsoft/pai/tree/master/examples/serving).\n","name":"tf_serving_example","protocolVersion":2,"type":"dockerimage","uri":"openpai/pai.example.tensorflow-serving","version":"1.0-r1.4"}],"protocolVersion":2,"taskRoles":{"worker":{"commands":["bazel-bin/tensorflow_serving/example/mnist_saved_model <% $parameters.modelPath %>","tensorflow_model_server --port=$PAI_CONTAINER_HOST_model_server_PORT_LIST --model_name=mnist --model_base_path=<% $parameters.modelPath %>"],"dockerImage":"tf_serving_example","instances":1,"resourcePerInstance":{"cpu":4,"gpu":1,"memoryMB":8192,"ports":{"model_server":1}}}},"type":"job","version":"1.0"}}]}],"tests":[{"description":"Get a job config","operation":{"parameters":[{"type":"raw","value":"sdk_test"},{"type":"raw","value":"sdk_test_joba43a5b4c"}],"tag":"job","operationId":"getJobConfig","response":{"statusCode":200,"schema":{"type":"object","description":"openpai job protocol","properties":{"protocolVersion":{"oneOf":[{"type":"number"},{"type":"string"}],"description":"Protocol version, current version is 2."},"name":{"type":"string","maxLength":255,"description":"String in ^[a-zA-Z0-9_-]+$ format, no longer than 255 characters."},"type":{"type":"string","description":"Component type, should be \"job\" here."},"version":{"type":"string","description":"Component version, default is latest."},"contributor":{"type":"string"},"description":{"type":"string"},"prerequisites":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"type":{"type":"string","enum":["data","script","dockerimage","output"]},"version":{"type":"string"},"contributor":{"type":"string"},"description":{"type":"string"},"auth":{"type":"object","properties":{"username":{"type":"string"},"password":{"type":"string"},"registryuri":{"type":"string"}}},"uri":{"oneOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}]}}}},"parameters":{"type":"object","additionalProperties":true},"secrets":{"type":"object","additionalProperties":true},"jobRetryCount":{"type":"integer","description":"Default is 0."},"taskRoles":{"type":"object","additionalProperties":{"type":"object","properties":{"instances":{"type":"integer","description":"Default is 1, instances of a taskRole, no less than 1."},"completion":{"type":"object","description":"Completion poclicy for the job.","properties":{"minFailedInstances":{"type":"integer"},"minSucceededInstances":{"type":"integer"}}},"taskRetryCount":{"type":"integer","description":"Default is 0."},"dockerImage":{"type":"string","description":"Should reference to a dockerimage defined in prerequisites."},"data":{"type":"string"},"output":{"type":"string"},"script":{"type":"string"},"extraContainerOptions":{"type":"object","properties":{"shmMB":{"type":"integer","description":"Config the /dev/shm in a docker container."},"infiniband":{"type":"boolean","description":"Use InfiniBand devices or not in a docker container."}}},"resourcePerInstance":{"type":"object","properties":{"cpu":{"type":"integer","description":"CPU number, unit is CPU vcore."},"memoryMB":{"type":"integer","description":"Memory number, unit is MB."},"gpu":{"type":"integer","description":"GPU number, unit is GPU card."},"ports":{"type":"object","additionalProperties":{"type":"integer","description":"Port number for the port label."}}}},"commands":{"type":"array","items":{"type":"string"}}},"required":["dockerImage","resourcePerInstance","commands"]}},"deployments":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"taskRoles":{"type":"object","additionalProperties":{"type":"object","properties":{"preCommands":{"type":"array","items":{"type":"string"}},"postCommands":{"type":"array","items":{"type":"string"}}}}}}}},"defaults":{"type":"object","description":"Default cluster specific settings.","properties":{"virtualCluster":{"type":"string"},"deployment":{"type":"string"}}},"extras":{"type":"object","description":"Extra field, save any information that plugin may use.","properties":{"submitFrom":{"type":"string"},"hivedScheduler":{"type":"object","properties":{"jobPriorityClass":{"type":"string"},"taskRoles":{"type":"object","additionalProperties":{"type":"object","properties":{"skuType":{"type":"string"},"affinityGroupName":{"type":"string"}}}}}}}}},"required":["protocolVersion","name","type","taskRoles"]},"contentType":"text/yaml"}}},{"description":"Get nonexist job config","operation":{"parameters":[{"type":"raw","value":"sdk_test"},{"type":"raw","value":"sdk_test_nonexist_job"}],"response":{"statusCode":404,"schema":{"description":"NoJobError or NoJobConfigError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"NoJobError":{"value":{"code":"NoJobError","message":"Job {job} is not found."}},"NoJobConfigError":{"value":{"code":"NoJobConfigError","message":"Config of job {job} is not found."}}}}}}},"tag":"job","operationId":"getJobConfig"}}],"after":[{"tag":"job","operationId":"updateJobExecutionType","parameters":[{"type":"raw","value":"sdk_test"},{"type":"raw","value":"sdk_test_joba43a5b4c"},{"type":"raw","value":"STOP"}]}],"schemas":{"200":{"description":"Succeeded","content":{"text/yaml":{"schema":{"type":"object","description":"openpai job protocol","properties":{"protocolVersion":{"oneOf":[{"type":"number"},{"type":"string"}],"description":"Protocol version, current version is 2."},"name":{"type":"string","maxLength":255,"description":"String in ^[a-zA-Z0-9_-]+$ format, no longer than 255 characters."},"type":{"type":"string","description":"Component type, should be \"job\" here."},"version":{"type":"string","description":"Component version, default is latest."},"contributor":{"type":"string"},"description":{"type":"string"},"prerequisites":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"type":{"type":"string","enum":["data","script","dockerimage","output"]},"version":{"type":"string"},"contributor":{"type":"string"},"description":{"type":"string"},"auth":{"type":"object","properties":{"username":{"type":"string"},"password":{"type":"string"},"registryuri":{"type":"string"}}},"uri":{"oneOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}]}}}},"parameters":{"type":"object","additionalProperties":true},"secrets":{"type":"object","additionalProperties":true},"jobRetryCount":{"type":"integer","description":"Default is 0."},"taskRoles":{"type":"object","additionalProperties":{"type":"object","properties":{"instances":{"type":"integer","description":"Default is 1, instances of a taskRole, no less than 1."},"completion":{"type":"object","description":"Completion poclicy for the job.","properties":{"minFailedInstances":{"type":"integer"},"minSucceededInstances":{"type":"integer"}}},"taskRetryCount":{"type":"integer","description":"Default is 0."},"dockerImage":{"type":"string","description":"Should reference to a dockerimage defined in prerequisites."},"data":{"type":"string"},"output":{"type":"string"},"script":{"type":"string"},"extraContainerOptions":{"type":"object","properties":{"shmMB":{"type":"integer","description":"Config the /dev/shm in a docker container."},"infiniband":{"type":"boolean","description":"Use InfiniBand devices or not in a docker container."}}},"resourcePerInstance":{"type":"object","properties":{"cpu":{"type":"integer","description":"CPU number, unit is CPU vcore."},"memoryMB":{"type":"integer","description":"Memory number, unit is MB."},"gpu":{"type":"integer","description":"GPU number, unit is GPU card."},"ports":{"type":"object","additionalProperties":{"type":"integer","description":"Port number for the port label."}}}},"commands":{"type":"array","items":{"type":"string"}}},"required":["dockerImage","resourcePerInstance","commands"]}},"deployments":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"taskRoles":{"type":"object","additionalProperties":{"type":"object","properties":{"preCommands":{"type":"array","items":{"type":"string"}},"postCommands":{"type":"array","items":{"type":"string"}}}}}}}},"defaults":{"type":"object","description":"Default cluster specific settings.","properties":{"virtualCluster":{"type":"string"},"deployment":{"type":"string"}}},"extras":{"type":"object","description":"Extra field, save any information that plugin may use.","properties":{"submitFrom":{"type":"string"},"hivedScheduler":{"type":"object","properties":{"jobPriorityClass":{"type":"string"},"taskRoles":{"type":"object","additionalProperties":{"type":"object","properties":{"skuType":{"type":"string"},"affinityGroupName":{"type":"string"}}}}}}}}},"required":["protocolVersion","name","type","taskRoles"]},"example":{"protocolVersion":"2","name":"","type":"job","prerequisites":[{"name":"","type":"dockerimage","uri":"image_url"}],"taskRoles":{"train":{"instances":1,"dockerImage":"","resourcePerInstance":{"cpu":1,"memoryMB":16384,"gpu":1},"commands":["python "]}}}}}},"404":{"description":"NoJobError or NoJobConfigError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"NoJobError":{"value":{"code":"NoJobError","message":"Job {job} is not found."}},"NoJobConfigError":{"value":{"code":"NoJobConfigError","message":"Config of job {job} is not found."}}}}}},"500":{"description":"UnknownError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"UnknownError":{"value":{"code":"UnknownError","message":"Internal error message."}}}}}}},"description":"get /api/v2/jobs/{user}~{job}/config"},{"description":"put /api/v2/jobs/{user}~{job}/executionType","tests":[{"operation":{"tag":"job","operationId":"updateJobExecutionType","parameters":[],"response":{"statusCode":202,"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"contentType":"application/json"}}}],"schemas":{"202":{"description":"Succeeded","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"example":{"message":"execute job {job} successfully"}}}},"404":{"description":"NoJobError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"NoJobError":{"value":{"code":"NoJobError","message":"Job {job} is not found."}}}}}},"500":{"description":"UnknownError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"UnknownError":{"value":{"code":"UnknownError","message":"Internal error message."}}}}}}}},{"description":"get /api/v2/jobs/{user}~{job}/job-attempts/healthz","tests":[{"operation":{"tag":"job history","operationId":"getJobAttemptsHealthz","parameters":[],"response":{"statusCode":200}}}],"schemas":{"200":{"description":"OK"},"501":{"description":"Not healthy"}}},{"before":[{"tag":"job","operationId":"createJob","parameters":[{"type":"raw","value":{"contributor":"OpenPAI","description":"# Serving a TensorFlow MNIST Digit Recognition Model\nThis example shows you how to use TensorFlow Serving components to export a trained TensorFlow model\nand use the standard tensorflow_model_server to serve it on OpenPAI.\nThis example uses the simple Softmax Regression model introduced in the TensorFlow tutorial for handwritten image (MNIST data) classification.\nReference https://www.tensorflow.org/tfx/serving/serving_basic.\n","name":"sdk_test_job9b070682","parameters":{"modelPath":"/tmp/mnist_model"},"prerequisites":[{"contributor":"OpenPAI","description":"This is an [example TensorFlow Serving Docker image on OpenPAI](https://github.com/Microsoft/pai/tree/master/examples/serving).\n","name":"tf_serving_example","protocolVersion":2,"type":"dockerimage","uri":"openpai/pai.example.tensorflow-serving","version":"1.0-r1.4"}],"protocolVersion":2,"taskRoles":{"worker":{"commands":["bazel-bin/tensorflow_serving/example/mnist_saved_model <% $parameters.modelPath %>","tensorflow_model_server --port=$PAI_CONTAINER_HOST_model_server_PORT_LIST --model_name=mnist --model_base_path=<% $parameters.modelPath %>"],"dockerImage":"tf_serving_example","instances":1,"resourcePerInstance":{"cpu":4,"gpu":1,"memoryMB":8192,"ports":{"model_server":1}}}},"type":"job","version":"1.0"}}]}],"tests":[{"operation":{"parameters":[{"type":"raw","value":"sdk_test"},{"type":"raw","value":"sdk_test_job9b070682"}],"tag":"job history","operationId":"getJobAttempts","response":{"statusCode":200,"schema":{"type":"array","items":{"type":"object","description":"job attempt","properties":{"jobName":{"type":"string"},"frameworkName":{"type":"string"},"uid":{"type":"string"},"userName":{"type":"string"},"state":{"type":"string"},"originState":{"type":"string"},"maxAttemptCount":{"type":"integer"},"attemptIndex":{"type":"integer"},"jobStartedTime":{"type":"integer"},"attemptStartedTime":{"type":"integer"},"attemptCompletedTime":{"type":"integer","nullable":true},"exitCode":{"type":"integer","nullable":true},"exitPhrase":{"type":"string","nullable":true},"exitType":{"type":"string","nullable":true},"exitDiagnostics":{"type":"object","nullable":true,"properties":{"diagnosticsSummary":{"type":"string"},"runtime":{"type":"object","nullable":true,"properties":{"exitCode":{"type":"integer","nullable":true},"originUserExitCode":{"type":"integer","nullable":true},"errorLogs":{"type":"object","nullable":true,"properties":{"user":{"type":"string"},"platform":{"type":"string"}}},"name":{"type":"string"}}},"launcher":{"type":"string"}}},"appExitTriggerMessage":{"type":"string","nullable":true},"appExitTriggerTaskRoleName":{"type":"string","nullable":true},"appExitTriggerTaskIndex":{"type":"integer","nullable":true},"appExitSpec":{"type":"object","nullable":true,"properties":{"code":{"type":"integer"},"phrase":{"type":"string"},"issuer":{"type":"string"},"causer":{"type":"string"},"type":{"type":"string"},"stage":{"type":"string"},"behavior":{"type":"string"},"reaction":{"type":"string"},"reason":{"type":"string"},"repro":{"type":"array","items":{"type":"string"}},"solution":{"type":"array","items":{"type":"string"}}}},"appExitDiagnostics":{"type":"string","nullable":true},"appExitMessages":{"type":"object","nullable":true,"properties":{"container":{"type":"string","nullable":true},"runtime":{"type":"object","nullable":true,"properties":{"exitCode":{"type":"integer","nullable":true},"originUserExitCode":{"type":"integer","nullable":true},"errorLogs":{"type":"object","nullable":true,"properties":{"user":{"type":"string"},"platform":{"type":"string"}}},"name":{"type":"string"}}},"launcher":{"type":"string","nullable":true}}},"totalGpuNumber":{"type":"integer"},"totalTasknumber":{"type":"integer"},"totalTaskRoleNumber":{"type":"integer"},"taskRoles":{"type":"object","properties":{"taskrole":{"type":"object","properties":{"taskRoleStatus":{"type":"object","properties":{"name":{"type":"string"}},"required":["name"]},"taskStatuses":{"type":"array","items":{"type":"object","properties":{"taskIndex":{"type":"integer"},"taskState":{"type":"string","enum":["WAITING","RUNNING","STOPPING","STOPPED","SUCCEEDED","FAILED","UNKNOWN"]},"containerId":{"type":"string"},"containerIp":{"type":"string"},"containerGpus":{"type":"string","nullable":true},"containerLog":{"type":"string"},"containerExitCode":{"type":"integer","nullable":true}}}}},"required":["taskRoleStatus","taskStatuses"]}}},"isLatest":{"type":"boolean"}}},"description":"job attempts"},"contentType":"application/json"}}}],"after":[{"tag":"job","operationId":"updateJobExecutionType","parameters":[{"type":"raw","value":"sdk_test"},{"type":"raw","value":"sdk_test_job9b070682"},{"type":"raw","value":"STOP"}]}],"schemas":{"200":{"description":"Succeeded","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","description":"job attempt","properties":{"jobName":{"type":"string"},"frameworkName":{"type":"string"},"uid":{"type":"string"},"userName":{"type":"string"},"state":{"type":"string"},"originState":{"type":"string"},"maxAttemptCount":{"type":"integer"},"attemptIndex":{"type":"integer"},"jobStartedTime":{"type":"integer"},"attemptStartedTime":{"type":"integer"},"attemptCompletedTime":{"type":"integer","nullable":true},"exitCode":{"type":"integer","nullable":true},"exitPhrase":{"type":"string","nullable":true},"exitType":{"type":"string","nullable":true},"exitDiagnostics":{"type":"object","nullable":true,"properties":{"diagnosticsSummary":{"type":"string"},"runtime":{"type":"object","nullable":true,"properties":{"exitCode":{"type":"integer","nullable":true},"originUserExitCode":{"type":"integer","nullable":true},"errorLogs":{"type":"object","nullable":true,"properties":{"user":{"type":"string"},"platform":{"type":"string"}}},"name":{"type":"string"}}},"launcher":{"type":"string"}}},"appExitTriggerMessage":{"type":"string","nullable":true},"appExitTriggerTaskRoleName":{"type":"string","nullable":true},"appExitTriggerTaskIndex":{"type":"integer","nullable":true},"appExitSpec":{"type":"object","nullable":true,"properties":{"code":{"type":"integer"},"phrase":{"type":"string"},"issuer":{"type":"string"},"causer":{"type":"string"},"type":{"type":"string"},"stage":{"type":"string"},"behavior":{"type":"string"},"reaction":{"type":"string"},"reason":{"type":"string"},"repro":{"type":"array","items":{"type":"string"}},"solution":{"type":"array","items":{"type":"string"}}}},"appExitDiagnostics":{"type":"string","nullable":true},"appExitMessages":{"type":"object","nullable":true,"properties":{"container":{"type":"string","nullable":true},"runtime":{"type":"object","nullable":true,"properties":{"exitCode":{"type":"integer","nullable":true},"originUserExitCode":{"type":"integer","nullable":true},"errorLogs":{"type":"object","nullable":true,"properties":{"user":{"type":"string"},"platform":{"type":"string"}}},"name":{"type":"string"}}},"launcher":{"type":"string","nullable":true}}},"totalGpuNumber":{"type":"integer"},"totalTasknumber":{"type":"integer"},"totalTaskRoleNumber":{"type":"integer"},"taskRoles":{"type":"object","properties":{"taskrole":{"type":"object","properties":{"taskRoleStatus":{"type":"object","properties":{"name":{"type":"string"}},"required":["name"]},"taskStatuses":{"type":"array","items":{"type":"object","properties":{"taskIndex":{"type":"integer"},"taskState":{"type":"string","enum":["WAITING","RUNNING","STOPPING","STOPPED","SUCCEEDED","FAILED","UNKNOWN"]},"containerId":{"type":"string"},"containerIp":{"type":"string"},"containerGpus":{"type":"string","nullable":true},"containerLog":{"type":"string"},"containerExitCode":{"type":"integer","nullable":true}}}}},"required":["taskRoleStatus","taskStatuses"]}}},"isLatest":{"type":"boolean"}}},"description":"job attempts"},"example":[{"jobName":"jobName","frameworkName":"frameworkName","uid":"uid","userName":"userName","state":"SUCCEEDED","originState":"Completed","maxAttemptCount":1,"attemptIndex":0,"jobStartedTime":0,"attemptStartedTime":0,"attemptCompletedTime":0,"exitCode":0,"exitPhrase":"Succeeded","exitType":"Succeeded","exitDiagnostics":{"diagnosticsSummary":"Pod succeeded","runtime":null,"launcher":"Pod succeeded"},"appExitTriggerMessage":"All Tasks are completed","appExitTriggerTaskRoleName":"taskrole","appExitTriggerTaskIndex":0,"appExitSpec":{"code":0,"phrase":"Succeeded","issuer":"USER_CONTAINER","causer":"USER_CONTAINER","type":"USER_SUCCESS","stage":"COMPLETING","behavior":"UNKNOWN","reaction":"NEVER_RETRY","repro":["User program exits with exitcode 0"]},"appExitDiagnostics":"Pod succeeded","appExitMessages":{"container":null,"runtime":null,"launcher":"Pod succeeded"},"totalGpuNumber":1,"totalTaskNumber":1,"totalTaskRoleNumber":1,"taskRoles":{"taskrole":{"taskRoleStatus":{"name":"taskrole"},"taskStatuses":[{"taskIndex":0,"taskState":"SUCCEEDED","containerId":"","containerIp":"","containerExitCode":0}]}},"isLatest":true}]}}},"404":{"description":"NoJobError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"NoJobError":{"value":{"code":"NoJobError","message":"Job {job} is not found."}}}}}},"501":{"description":"UnknownError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"UnknownError":{"value":{"code":"UnknownError","message":"Internal error message."}}}}}}},"description":"get /api/v2/jobs/{user}~{job}/job-attempts"},{"before":[{"tag":"job","operationId":"createJob","parameters":[{"type":"raw","value":{"contributor":"OpenPAI","description":"# Serving a TensorFlow MNIST Digit Recognition Model\nThis example shows you how to use TensorFlow Serving components to export a trained TensorFlow model\nand use the standard tensorflow_model_server to serve it on OpenPAI.\nThis example uses the simple Softmax Regression model introduced in the TensorFlow tutorial for handwritten image (MNIST data) classification.\nReference https://www.tensorflow.org/tfx/serving/serving_basic.\n","name":"sdk_test_job6961cae2","parameters":{"modelPath":"/tmp/mnist_model"},"prerequisites":[{"contributor":"OpenPAI","description":"This is an [example TensorFlow Serving Docker image on OpenPAI](https://github.com/Microsoft/pai/tree/master/examples/serving).\n","name":"tf_serving_example","protocolVersion":2,"type":"dockerimage","uri":"openpai/pai.example.tensorflow-serving","version":"1.0-r1.4"}],"protocolVersion":2,"taskRoles":{"worker":{"commands":["bazel-bin/tensorflow_serving/example/mnist_saved_model <% $parameters.modelPath %>","tensorflow_model_server --port=$PAI_CONTAINER_HOST_model_server_PORT_LIST --model_name=mnist --model_base_path=<% $parameters.modelPath %>"],"dockerImage":"tf_serving_example","instances":1,"resourcePerInstance":{"cpu":4,"gpu":1,"memoryMB":8192,"ports":{"model_server":1}}}},"type":"job","version":"1.0"}}]}],"tests":[{"operation":{"parameters":[{"type":"raw","value":"sdk_test"},{"type":"raw","value":"sdk_test_job6961cae2"},{"type":"raw","value":0}],"tag":"job history","operationId":"getJobAttempt","response":{"statusCode":200,"schema":{"type":"object","description":"job attempt","properties":{"jobName":{"type":"string"},"frameworkName":{"type":"string"},"uid":{"type":"string"},"userName":{"type":"string"},"state":{"type":"string"},"originState":{"type":"string"},"maxAttemptCount":{"type":"integer"},"attemptIndex":{"type":"integer"},"jobStartedTime":{"type":"integer"},"attemptStartedTime":{"type":"integer"},"attemptCompletedTime":{"type":"integer","nullable":true},"exitCode":{"type":"integer","nullable":true},"exitPhrase":{"type":"string","nullable":true},"exitType":{"type":"string","nullable":true},"exitDiagnostics":{"type":"object","nullable":true,"properties":{"diagnosticsSummary":{"type":"string"},"runtime":{"type":"object","nullable":true,"properties":{"exitCode":{"type":"integer","nullable":true},"originUserExitCode":{"type":"integer","nullable":true},"errorLogs":{"type":"object","nullable":true,"properties":{"user":{"type":"string"},"platform":{"type":"string"}}},"name":{"type":"string"}}},"launcher":{"type":"string"}}},"appExitTriggerMessage":{"type":"string","nullable":true},"appExitTriggerTaskRoleName":{"type":"string","nullable":true},"appExitTriggerTaskIndex":{"type":"integer","nullable":true},"appExitSpec":{"type":"object","nullable":true,"properties":{"code":{"type":"integer"},"phrase":{"type":"string"},"issuer":{"type":"string"},"causer":{"type":"string"},"type":{"type":"string"},"stage":{"type":"string"},"behavior":{"type":"string"},"reaction":{"type":"string"},"reason":{"type":"string"},"repro":{"type":"array","items":{"type":"string"}},"solution":{"type":"array","items":{"type":"string"}}}},"appExitDiagnostics":{"type":"string","nullable":true},"appExitMessages":{"type":"object","nullable":true,"properties":{"container":{"type":"string","nullable":true},"runtime":{"type":"object","nullable":true,"properties":{"exitCode":{"type":"integer","nullable":true},"originUserExitCode":{"type":"integer","nullable":true},"errorLogs":{"type":"object","nullable":true,"properties":{"user":{"type":"string"},"platform":{"type":"string"}}},"name":{"type":"string"}}},"launcher":{"type":"string","nullable":true}}},"totalGpuNumber":{"type":"integer"},"totalTasknumber":{"type":"integer"},"totalTaskRoleNumber":{"type":"integer"},"taskRoles":{"type":"object","properties":{"taskrole":{"type":"object","properties":{"taskRoleStatus":{"type":"object","properties":{"name":{"type":"string"}},"required":["name"]},"taskStatuses":{"type":"array","items":{"type":"object","properties":{"taskIndex":{"type":"integer"},"taskState":{"type":"string","enum":["WAITING","RUNNING","STOPPING","STOPPED","SUCCEEDED","FAILED","UNKNOWN"]},"containerId":{"type":"string"},"containerIp":{"type":"string"},"containerGpus":{"type":"string","nullable":true},"containerLog":{"type":"string"},"containerExitCode":{"type":"integer","nullable":true}}}}},"required":["taskRoleStatus","taskStatuses"]}}},"isLatest":{"type":"boolean"}}},"contentType":"application/json"}}}],"after":[{"tag":"job","operationId":"updateJobExecutionType","parameters":[{"type":"raw","value":"sdk_test"},{"type":"raw","value":"sdk_test_job6961cae2"},{"type":"raw","value":"STOP"}]}],"schemas":{"200":{"description":"Succeeded","content":{"application/json":{"schema":{"type":"object","description":"job attempt","properties":{"jobName":{"type":"string"},"frameworkName":{"type":"string"},"uid":{"type":"string"},"userName":{"type":"string"},"state":{"type":"string"},"originState":{"type":"string"},"maxAttemptCount":{"type":"integer"},"attemptIndex":{"type":"integer"},"jobStartedTime":{"type":"integer"},"attemptStartedTime":{"type":"integer"},"attemptCompletedTime":{"type":"integer","nullable":true},"exitCode":{"type":"integer","nullable":true},"exitPhrase":{"type":"string","nullable":true},"exitType":{"type":"string","nullable":true},"exitDiagnostics":{"type":"object","nullable":true,"properties":{"diagnosticsSummary":{"type":"string"},"runtime":{"type":"object","nullable":true,"properties":{"exitCode":{"type":"integer","nullable":true},"originUserExitCode":{"type":"integer","nullable":true},"errorLogs":{"type":"object","nullable":true,"properties":{"user":{"type":"string"},"platform":{"type":"string"}}},"name":{"type":"string"}}},"launcher":{"type":"string"}}},"appExitTriggerMessage":{"type":"string","nullable":true},"appExitTriggerTaskRoleName":{"type":"string","nullable":true},"appExitTriggerTaskIndex":{"type":"integer","nullable":true},"appExitSpec":{"type":"object","nullable":true,"properties":{"code":{"type":"integer"},"phrase":{"type":"string"},"issuer":{"type":"string"},"causer":{"type":"string"},"type":{"type":"string"},"stage":{"type":"string"},"behavior":{"type":"string"},"reaction":{"type":"string"},"reason":{"type":"string"},"repro":{"type":"array","items":{"type":"string"}},"solution":{"type":"array","items":{"type":"string"}}}},"appExitDiagnostics":{"type":"string","nullable":true},"appExitMessages":{"type":"object","nullable":true,"properties":{"container":{"type":"string","nullable":true},"runtime":{"type":"object","nullable":true,"properties":{"exitCode":{"type":"integer","nullable":true},"originUserExitCode":{"type":"integer","nullable":true},"errorLogs":{"type":"object","nullable":true,"properties":{"user":{"type":"string"},"platform":{"type":"string"}}},"name":{"type":"string"}}},"launcher":{"type":"string","nullable":true}}},"totalGpuNumber":{"type":"integer"},"totalTasknumber":{"type":"integer"},"totalTaskRoleNumber":{"type":"integer"},"taskRoles":{"type":"object","properties":{"taskrole":{"type":"object","properties":{"taskRoleStatus":{"type":"object","properties":{"name":{"type":"string"}},"required":["name"]},"taskStatuses":{"type":"array","items":{"type":"object","properties":{"taskIndex":{"type":"integer"},"taskState":{"type":"string","enum":["WAITING","RUNNING","STOPPING","STOPPED","SUCCEEDED","FAILED","UNKNOWN"]},"containerId":{"type":"string"},"containerIp":{"type":"string"},"containerGpus":{"type":"string","nullable":true},"containerLog":{"type":"string"},"containerExitCode":{"type":"integer","nullable":true}}}}},"required":["taskRoleStatus","taskStatuses"]}}},"isLatest":{"type":"boolean"}}},"example":{"jobName":"jobName","frameworkName":"frameworkName","uid":"uid","userName":"userName","state":"SUCCEEDED","originState":"Completed","maxAttemptCount":1,"attemptIndex":0,"jobStartedTime":0,"attemptStartedTime":0,"attemptCompletedTime":0,"exitCode":0,"exitPhrase":"Succeeded","exitType":"Succeeded","exitDiagnostics":{"diagnosticsSummary":"Pod succeeded","runtime":null,"launcher":"Pod succeeded"},"appExitTriggerMessage":"All Tasks are completed","appExitTriggerTaskRoleName":"taskrole","appExitTriggerTaskIndex":0,"appExitSpec":{"code":0,"phrase":"Succeeded","issuer":"USER_CONTAINER","causer":"USER_CONTAINER","type":"USER_SUCCESS","stage":"COMPLETING","behavior":"UNKNOWN","reaction":"NEVER_RETRY","repro":["User program exits with exitcode 0"]},"appExitDiagnostics":"Pod succeeded","appExitMessages":{"container":null,"runtime":null,"launcher":"Pod succeeded"},"totalGpuNumber":1,"totalTaskNumber":1,"totalTaskRoleNumber":1,"taskRoles":{"taskrole":{"taskRoleStatus":{"name":"taskrole"},"taskStatuses":[{"taskIndex":0,"taskState":"SUCCEEDED","containerId":"","containerIp":"","containerExitCode":0}]}},"isLatest":true}}}},"404":{"description":"NoJobError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"NoJobError":{"value":{"code":"NoJobError","message":"Job {job} is not found."}}}}}},"501":{"description":"UnknownError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"UnknownError":{"value":{"code":"UnknownError","message":"Internal error message."}}}}}}},"description":"get /api/v2/jobs/{user}~{job}/job-attempts/{attemptIndex}"},{"description":"get /api/v2/kubernetes/nodes","tests":[{"operation":{"tag":"kubernetes","operationId":"getK8sNodes","parameters":[],"response":{"statusCode":200}}}],"schemas":{"200":{"description":"Succeeded","content":{"application/json":{"example":["Please refer to Kubernetes API doc","https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.17/#list-node-v1-core"]}}},"401":{"description":"UnauthorizedUserError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"UnauthorizedUserError":{"value":{"code":"UnauthorizedUserError","message":"Guest is not allowed to do this operation."}}}}}},"403":{"description":"ForbiddenUserError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"ForbiddenUserError":{"value":{"code":"ForbiddenUserError","message":"Non-admin is not allow to do this operation."}},"ForbiddenTokenError":{"value":{"code":"ForbiddenUserError","message":"Applications are not allowed to do this operation."}}}}}}}},{"description":"get /api/v2/kubernetes/pods","tests":[{"operation":{"tag":"kubernetes","operationId":"getK8sPods","parameters":[],"response":{"statusCode":200}}}],"schemas":{"200":{"description":"Succeeded","content":{"application/json":{"example":["Please refer to Kubernetes API doc","https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.17/#list-all-namespaces-pod-v1-core"]}}},"401":{"description":"UnauthorizedUserError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"UnauthorizedUserError":{"value":{"code":"UnauthorizedUserError","message":"Guest is not allowed to do this operation."}}}}}},"403":{"description":"ForbiddenUserError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"ForbiddenUserError":{"value":{"code":"ForbiddenUserError","message":"Non-admin is not allow to do this operation."}},"ForbiddenTokenError":{"value":{"code":"ForbiddenUserError","message":"Applications are not allowed to do this operation."}}}}}}}}],"map":{"getClusterInfo":{"path":"/api/v2/info","method":"get","examples":{"200":{"name":"PAI RESTful API","version":"v1.0.1","launcherType":"k8s","authnMethod":"basic"}}},"getTokens":{"path":"/api/v2/tokens","method":"get","examples":{"200":{"tokens":["JWT Token Example"]},"401":{"value":{"code":"UnauthorizedUserError","message":"Guest is not allowed to do this operation."}}}},"deleteToken":{"path":"/api/v2/tokens/{token}","method":"delete","examples":{"200":{"message":"revoke successfully"},"401":{"value":{"code":"UnauthorizedUserError","message":"Guest is not allowed to do this operation."}},"403":{"value":{"code":"ForbiddenUserError","message":"Non-admin is not allow to do this operation."}}}},"createApplicationToken":{"path":"/api/v2/tokens/application","method":"post","examples":{"200":{"token":"JWT Token Example","application":true},"401":{"value":{"code":"UnauthorizedUserError","message":"Guest is not allowed to do this operation."}}}},"oidcLogin":{"path":"/api/v2/authn/oidc/login","method":"get","examples":{}},"oidcLogout":{"path":"/api/v2/authn/oidc/logout","method":"get","examples":{}},"basicLogin":{"path":"/api/v2/authn/basic/login","method":"post","examples":{"200":{"token":"JWT Token Example","user":"user","admin":true},"404":{"value":{"code":"NoUserError","message":"User {user} is not found."}}}},"basicLogout":{"path":"/api/v2/authn/basic/logout","method":"delete","examples":{"200":{"message":"Logout successfully"},"401":{"value":{"code":"UnauthorizedUserError","message":"Guest is not allowed to do this operation."}},"403":{"value":{"code":"ForbiddenUserError","message":"Non-admin is not allow to do this operation."}}}},"createUser":{"path":"/api/v2/users","method":"post","examples":{"201":{"message":"User is created successfully"},"401":{"value":{"code":"UnauthorizedUserError","message":"Guest is not allowed to do this operation."}},"403":{"value":{"code":"ForbiddenUserError","message":"Non-admin is not allow to do this operation."}},"409":{"value":{"code":"ConflictUserError","message":"User name {user} already exists."}},"500":{"value":{"code":"UnknownError","message":"Internal error message."}}}},"getAllUser":{"path":"/api/v2/users","method":"get","examples":{"200":[{"username":"username","admin":true,"virtualCluster":[],"storageConfig":[],"email":"email@test.com","extension":{}}],"500":{"value":{"code":"UnknownError","message":"Internal error message."}}}},"updateUser":{"path":"/api/v2/users","method":"put","examples":{"201":{"message":"update group {username} successfully."},"401":{"value":{"code":"UnauthorizedUserError","message":"Guest is not allowed to do this operation."}},"403":{"value":{"code":"ForbiddenUserError","message":"Non-admin is not allow to do this operation."}},"404":{"value":{"code":"NoUserError","message":"User {user} is not found."}},"500":{"value":{"code":"UnknownError","message":"Internal error message."}}}},"updateUserSelf":{"path":"/api/v2/users/me","method":"put","examples":{"201":{"message":"update group {username} successfully."},"401":{"value":{"code":"UnauthorizedUserError","message":"Guest is not allowed to do this operation."}},"403":{"value":{"code":"ForbiddenUserError","message":"Non-admin is not allow to do this operation."}},"404":{"value":{"code":"NoUserError","message":"User {user} is not found."}},"500":{"value":{"code":"UnknownError","message":"Internal error message."}}}},"getUser":{"path":"/api/v2/users/{user}","method":"get","examples":{"200":{"username":"username","admin":true,"virtualCluster":[],"storageConfig":[],"email":"email@test.com","extension":{}},"401":{"value":{"code":"UnauthorizedUserError","message":"Guest is not allowed to do this operation."}},"404":{"value":{"code":"NoUserError","message":"User {user} is not found."}},"500":{"value":{"code":"UnknownError","message":"Internal error message."}}}},"deleteUser":{"path":"/api/v2/users/{user}","method":"delete","examples":{"200":{"message":"user is removed successfully"},"401":{"value":{"code":"UnauthorizedUserError","message":"Guest is not allowed to do this operation."}},"403":{"value":{"code":"ForbiddenUserError","message":"Non-admin is not allow to do this operation."}},"404":{"value":{"code":"NoUserError","message":"User {user} is not found."}},"500":{"value":{"code":"UnknownError","message":"Internal error message."}}}},"updateUserGroup":{"path":"/api/v2/users/{user}/group/","method":"put","examples":{"201":{"message":"User {username} is added into group {groupname}"},"401":{"value":{"code":"UnauthorizedUserError","message":"Guest is not allowed to do this operation."}},"403":{"value":{"code":"ForbiddenUserError","message":"Non-admin is not allow to do this operation."}},"404":{"value":{"code":"NoUserError","message":"User {user} is not found."}},"500":{"value":{"code":"UnknownError","message":"Internal error message."}}}},"deleteUserGroup":{"path":"/api/v2/users/{user}/group/","method":"delete","examples":{"201":{"message":"User {username} is removed from group {groupname}"},"401":{"value":{"code":"UnauthorizedUserError","message":"Guest is not allowed to do this operation."}},"403":{"value":{"code":"ForbiddenUserError","message":"Non-admin is not allow to do this operation."}},"404":{"value":{"code":"NoUserError","message":"User {user} is not found."}},"500":{"value":{"code":"UnknownError","message":"Internal error message."}}}},"updateUserGrouplist":{"path":"/api/v2/users/{user}/grouplist/","method":"put","examples":{"201":{"message":"update user grouplist successfully."},"401":{"value":{"code":"UnauthorizedUserError","message":"Guest is not allowed to do this operation."}},"403":{"value":{"code":"ForbiddenUserError","message":"Non-admin is not allow to do this operation."}},"404":{"value":{"code":"NoUserError","message":"User {user} is not found."}},"500":{"value":{"code":"UnknownError","message":"Internal error message."}}}},"getAllGroup":{"path":"/api/v2/groups","method":"get","examples":{"200":[{"groupname":"groupName","description":"description","externalName":"externalName","extension":{}}],"500":{"value":{"code":"UnknownError","message":"Internal error message."}}}},"createGroup":{"path":"/api/v2/groups","method":"post","examples":{"201":{"message":"group is created successfully"},"401":{"value":{"code":"UnauthorizedUserError","message":"Guest is not allowed to do this operation."}},"403":{"value":{"code":"ForbiddenUserError","message":"Non-admin is not allow to do this operation."}},"500":{"value":{"code":"UnknownError","message":"Internal error message."}}}},"updateGroup":{"path":"/api/v2/groups","method":"put","examples":{"201":{"message":"update group {groupname} successfully."},"401":{"value":{"code":"UnauthorizedUserError","message":"Guest is not allowed to do this operation."}},"403":{"value":{"code":"ForbiddenUserError","message":"Non-admin is not allow to do this operation."}},"404":{"value":{"code":"NoGroupError","message":"Group {groupname} is not found."}},"500":{"value":{"code":"UnknownError","message":"Internal error message."}}}},"getGroup":{"path":"/api/v2/groups/{group}","method":"get","examples":{"200":{"groupname":"groupName","description":"description","externalName":"externalName","extension":{}},"401":{"value":{"code":"UnauthorizedUserError","message":"Guest is not allowed to do this operation."}},"404":{"value":{"code":"NoGroupError","message":"Group {groupname} is not found."}},"500":{"value":{"code":"UnknownError","message":"Internal error message."}}}},"deleteGroup":{"path":"/api/v2/groups/{group}","method":"delete","examples":{"201":{"message":"group is removed successfully"},"401":{"value":{"code":"UnauthorizedUserError","message":"Guest is not allowed to do this operation."}},"403":{"value":{"code":"ForbiddenUserError","message":"Non-admin is not allow to do this operation."}},"500":{"value":{"code":"UnknownError","message":"Internal error message."}}}},"getGroupMembers":{"path":"/api/v2/groups/{group}/userlist","method":"get","examples":{"200":[{"username":"username","clusterAdmin":false}],"401":{"value":{"code":"UnauthorizedUserError","message":"Guest is not allowed to do this operation."}},"500":{"value":{"code":"UnknownError","message":"Internal error message."}}}},"listVirtualClusters":{"path":"/api/v2/virtual-clusters","method":"get","examples":{"500":{"value":{"code":"UnknownError","message":"Internal error message."}}}},"getVirtualCluster":{"path":"/api/v2/virtual-clusters/{vc}","method":"get","examples":{"200":{"capacity":70,"usedCapacity":30,"dedicated":false,"resourcesUsed":{"cpu":1,"memory":1024,"gpu":1,"vCores":1,"GPUs":1},"resourcesGuaranteed":{"cpu":2,"memory":2048,"gpu":2,"vCores":2,"GPUs":2},"resourcesTotal":{"cpu":2,"memory":2048,"gpu":2,"vCores":2,"GPUs":2},"maxCapacity":70},"404":{"value":{"code":"NoVirtualClusterError","message":"Virtual cluster {vc} is not found."}},"500":{"value":{"code":"UnknownError","message":"Internal error message."}}}},"getStorages":{"path":"/api/v2/storages","method":"get","examples":{"200":{"storages":[{"name":"name","share":true,"volumeName":"volumeName"}]},"500":{"value":{"code":"UnknownError","message":"Internal error message."}}}},"getStorage":{"path":"/api/v2/storages/{storage}","method":"get","examples":{"200":{"name":"nfs-storage-name","share":true,"volumeName":"nfs-volume-name","type":"nfs","data":{"server":"","path":"/data"}},"403":{"value":{"code":"ForbiddenUserError","message":"User {user} is not allowed to access {storage}."}},"404":{"value":{"code":"NoStorageError","message":"Storage {storage} is not found."}},"500":{"value":{"code":"UnknownError","message":"Internal error message."}}}},"createJob":{"path":"/api/v2/jobs","method":"post","examples":{"202":{"message":"update job {job} successfully"},"400":{"value":{"code":"NoVirtualClusterError","message":"Virtual cluster {vc} is not found."}},"403":{"value":{"code":"ForbiddenUserError","message":"Non-admin is not allow to do this operation."}},"409":{"value":{"code":"ConflictJobError","message":"Job name {job} already exists."}},"500":{"value":{"code":"UnknownError","message":"Internal error message."}}}},"listJobs":{"path":"/api/v2/jobs","method":"get","examples":{"200":[{"protocolVersion":"2","name":"job name","username":"user name","state":"SUCCEEDED","subState":"Completed","executionType":"STOP","retries":0,"createdTime":0,"completedTime":0,"appExitCode":0,"virtualCluster":"unknown"}],"500":{"value":{"code":"UnknownError","message":"Internal error message."}}}},"getJob":{"path":"/api/v2/jobs/{user}~{job}","method":"get","examples":{"200":{"name":"job name","jobStatus":{"username":"user name","state":"SUCCEEDED","subState":"Completed","executionType":"STOP","retries":0,"createdTime":0,"completedTime":0,"appId":"id","appLaunchedTime":0,"appCompletedTime":0,"appExitCode":0,"virtualCluster":"unknown"},"taskRoles":{"taskrole":{"taskRoleStatus":{"name":"task role name"},"taskStatuses":[{"taskIndex":0,"taskState":"SUCCEEDED"}]}}},"404":{"value":{"code":"NoJobError","message":"Job {job} is not found."}},"500":{"value":{"code":"UnknownError","message":"Internal error message."}}}},"getJobConfig":{"path":"/api/v2/jobs/{user}~{job}/config","method":"get","examples":{"200":{"protocolVersion":"2","name":"","type":"job","prerequisites":[{"name":"","type":"dockerimage","uri":"image_url"}],"taskRoles":{"train":{"instances":1,"dockerImage":"","resourcePerInstance":{"cpu":1,"memoryMB":16384,"gpu":1},"commands":["python "]}}},"404":{"value":{"code":"NoJobError","message":"Job {job} is not found."}},"500":{"value":{"code":"UnknownError","message":"Internal error message."}}}},"updateJobExecutionType":{"path":"/api/v2/jobs/{user}~{job}/executionType","method":"put","examples":{"202":{"message":"execute job {job} successfully"},"404":{"value":{"code":"NoJobError","message":"Job {job} is not found."}},"500":{"value":{"code":"UnknownError","message":"Internal error message."}}}},"getJobAttemptsHealthz":{"path":"/api/v2/jobs/{user}~{job}/job-attempts/healthz","method":"get","examples":{}},"getJobAttempts":{"path":"/api/v2/jobs/{user}~{job}/job-attempts","method":"get","examples":{"200":[{"jobName":"jobName","frameworkName":"frameworkName","uid":"uid","userName":"userName","state":"SUCCEEDED","originState":"Completed","maxAttemptCount":1,"attemptIndex":0,"jobStartedTime":0,"attemptStartedTime":0,"attemptCompletedTime":0,"exitCode":0,"exitPhrase":"Succeeded","exitType":"Succeeded","exitDiagnostics":{"diagnosticsSummary":"Pod succeeded","runtime":null,"launcher":"Pod succeeded"},"appExitTriggerMessage":"All Tasks are completed","appExitTriggerTaskRoleName":"taskrole","appExitTriggerTaskIndex":0,"appExitSpec":{"code":0,"phrase":"Succeeded","issuer":"USER_CONTAINER","causer":"USER_CONTAINER","type":"USER_SUCCESS","stage":"COMPLETING","behavior":"UNKNOWN","reaction":"NEVER_RETRY","repro":["User program exits with exitcode 0"]},"appExitDiagnostics":"Pod succeeded","appExitMessages":{"container":null,"runtime":null,"launcher":"Pod succeeded"},"totalGpuNumber":1,"totalTaskNumber":1,"totalTaskRoleNumber":1,"taskRoles":{"taskrole":{"taskRoleStatus":{"name":"taskrole"},"taskStatuses":[{"taskIndex":0,"taskState":"SUCCEEDED","containerId":"","containerIp":"","containerExitCode":0}]}},"isLatest":true}],"404":{"value":{"code":"NoJobError","message":"Job {job} is not found."}},"501":{"value":{"code":"UnknownError","message":"Internal error message."}}}},"getJobAttempt":{"path":"/api/v2/jobs/{user}~{job}/job-attempts/{attemptIndex}","method":"get","examples":{"200":{"jobName":"jobName","frameworkName":"frameworkName","uid":"uid","userName":"userName","state":"SUCCEEDED","originState":"Completed","maxAttemptCount":1,"attemptIndex":0,"jobStartedTime":0,"attemptStartedTime":0,"attemptCompletedTime":0,"exitCode":0,"exitPhrase":"Succeeded","exitType":"Succeeded","exitDiagnostics":{"diagnosticsSummary":"Pod succeeded","runtime":null,"launcher":"Pod succeeded"},"appExitTriggerMessage":"All Tasks are completed","appExitTriggerTaskRoleName":"taskrole","appExitTriggerTaskIndex":0,"appExitSpec":{"code":0,"phrase":"Succeeded","issuer":"USER_CONTAINER","causer":"USER_CONTAINER","type":"USER_SUCCESS","stage":"COMPLETING","behavior":"UNKNOWN","reaction":"NEVER_RETRY","repro":["User program exits with exitcode 0"]},"appExitDiagnostics":"Pod succeeded","appExitMessages":{"container":null,"runtime":null,"launcher":"Pod succeeded"},"totalGpuNumber":1,"totalTaskNumber":1,"totalTaskRoleNumber":1,"taskRoles":{"taskrole":{"taskRoleStatus":{"name":"taskrole"},"taskStatuses":[{"taskIndex":0,"taskState":"SUCCEEDED","containerId":"","containerIp":"","containerExitCode":0}]}},"isLatest":true},"404":{"value":{"code":"NoJobError","message":"Job {job} is not found."}},"501":{"value":{"code":"UnknownError","message":"Internal error message."}}}},"getK8sNodes":{"path":"/api/v2/kubernetes/nodes","method":"get","examples":{"200":["Please refer to Kubernetes API doc","https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.17/#list-node-v1-core"],"401":{"value":{"code":"UnauthorizedUserError","message":"Guest is not allowed to do this operation."}},"403":{"value":{"code":"ForbiddenUserError","message":"Non-admin is not allow to do this operation."}}}},"getK8sPods":{"path":"/api/v2/kubernetes/pods","method":"get","examples":{"200":["Please refer to Kubernetes API doc","https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.17/#list-all-namespaces-pod-v1-core"],"401":{"value":{"code":"UnauthorizedUserError","message":"Guest is not allowed to do this operation."}},"403":{"value":{"code":"ForbiddenUserError","message":"Non-admin is not allow to do this operation."}}}}}} \ No newline at end of file +[] From 09be73dd8ae91b0ecad08fe261bea5e85a30bf76 Mon Sep 17 00:00:00 2001 From: Yi Yi Date: Mon, 15 Jun 2020 01:45:52 +0800 Subject: [PATCH 06/24] update apiTestCase.json --- .github/workflows/cli_setup.yml | 70 ++--- .tests/apiTestCase.json | 5 +- .tests/clusters.json | 10 - CODE_OF_CONDUCT.md | 18 +- LICENSE | 42 +-- README.md | 212 ++++++------- SECURITY.md | 82 ++--- docs/rest-api.md | 512 ++++++++++++++++---------------- docs/storage.md | 180 +++++------ 9 files changed, 562 insertions(+), 569 deletions(-) delete mode 100644 .tests/clusters.json diff --git a/.github/workflows/cli_setup.yml b/.github/workflows/cli_setup.yml index 38ae1f1..7037073 100644 --- a/.github/workflows/cli_setup.yml +++ b/.github/workflows/cli_setup.yml @@ -1,35 +1,35 @@ -# This is a basic workflow to help you get started with Actions - -name: Test CLI Installation - -# Controls when the action will run. Triggers the workflow on push or pull request -# events but only for the master branch -on: [push] - -jobs: - build: - runs-on: ubuntu-latest - strategy: - matrix: - python-version: [2.7, 3.5] - - steps: - - uses: actions/checkout@v2 - - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v2 - with: - python-version: ${{ matrix.python-version }} - - name: Create node env - run: | - python -m pip install --upgrade pip - pip install nodeenv - nodeenv myenv - - name: Setup local install - run: | - . myenv/bin/activate - node --version - npm install typescript tslint tslint-microsoft-contrib - npm run build - npm link - pai -h - deactivate_node +# This is a basic workflow to help you get started with Actions + +name: Test CLI Installation + +# Controls when the action will run. Triggers the workflow on push or pull request +# events but only for the master branch +on: [push] + +jobs: + build: + runs-on: ubuntu-latest + strategy: + matrix: + python-version: [2.7, 3.5] + + steps: + - uses: actions/checkout@v2 + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v2 + with: + python-version: ${{ matrix.python-version }} + - name: Create node env + run: | + python -m pip install --upgrade pip + pip install nodeenv + nodeenv myenv + - name: Setup local install + run: | + . myenv/bin/activate + node --version + npm install typescript tslint tslint-microsoft-contrib + npm run build + npm link + pai -h + deactivate_node diff --git a/.tests/apiTestCase.json b/.tests/apiTestCase.json index fe51488..c5c8976 100644 --- a/.tests/apiTestCase.json +++ b/.tests/apiTestCase.json @@ -1 +1,4 @@ -[] +{ + "tests": [], + "map": {} +} diff --git a/.tests/clusters.json b/.tests/clusters.json deleted file mode 100644 index ae614b1..0000000 --- a/.tests/clusters.json +++ /dev/null @@ -1,10 +0,0 @@ -[ - { - "alias": "int", - "rest_server_uri": "openpai.test/rest-server", - "username": "sdk_test", - "password": "pwd", - "token": "", - "https": true - } -] diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md index c72a574..f9ba8cf 100644 --- a/CODE_OF_CONDUCT.md +++ b/CODE_OF_CONDUCT.md @@ -1,9 +1,9 @@ -# Microsoft Open Source Code of Conduct - -This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/). - -Resources: - -- [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/) -- [Microsoft Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) -- Contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with questions or concerns +# Microsoft Open Source Code of Conduct + +This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/). + +Resources: + +- [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/) +- [Microsoft Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) +- Contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with questions or concerns diff --git a/LICENSE b/LICENSE index 3d8b93b..9e841e7 100644 --- a/LICENSE +++ b/LICENSE @@ -1,21 +1,21 @@ - MIT License - - Copyright (c) Microsoft Corporation. - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to deal - in the Software without restriction, including without limitation the rights - to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in all - copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - SOFTWARE + MIT License + + Copyright (c) Microsoft Corporation. + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to deal + in the Software without restriction, including without limitation the rights + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in all + copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + SOFTWARE diff --git a/README.md b/README.md index 6a6d9e5..430c70d 100644 --- a/README.md +++ b/README.md @@ -1,106 +1,106 @@ -# OpenPAI JS SDK - -[![Build Status](https://www.travis-ci.org/microsoft/openpaisdk.svg?branch=master)](https://travis-ci.org/microsoft/openpaisdk) - -The `JavaScript` SDK is designed to facilitate the developers of [OpenPAI](https://github.com/microsoft/pai) to offer user friendly experience. - -The SDK mainly provides client side sharable functions such as RESTful API wrapping, error handling, storage accessing and processing of [job protocol](https://github.com/microsoft/openpai-protocol). *Now the OpenPAI RESTful API is updating, please waiting for our stable release.* - -It could be used to support existing or future front-ends (e.g. Web Portal, VS Code extension, Command Line Interface, Jupyter Notebook extension, and 3rd party clients), and also could be used to simplify the design of [kube runtime plugins](https://github.com/microsoft/openpai-runtime), which are executed in init containers. - -*Now we are porting some of the functions from existing `Python` [SDK](https://github.com/microsoft/pai/tree/v0.17.0/contrib/python-sdk) and command line tool. The whole functionality of this SDK will be ready soon.* - -## Installation - -```bash -npm install --save @microsoft/openpai-js-sdk -``` - -Initialize the `openPAIClient` - -```ts -import { PAIV2 } from '@microsoft/openpai-js-sdk'; - -const cluster: PAIV2.IPAICluster = { - username: '', - token: '', - rest_server_uri: '/rest-server' -}; -const openPAIClient = new PAIV2.OpenPAIClient(cluster); -``` - -### Installation of CLI tool - -The SDK offers a command line interface (CLI) prefixed by `pai`. For end users that use CLI only, we provide an easy way to install it via `pip` and the `Python` package `nodeenv`. - -```bash -pip install nodeenv -nodeenv myenv -source myenv/bin/activate # use `myenv/Scripts/activate` instead on Windows -npm i -g @microsoft/openpai-js-sdk -``` - -This installation commands will generate a virtual environment with latest `node` in the directory `./myenv`, and install the CLI in it. Then user could use `pai` command by any of below methods - -- activate the virtual environment first - - ```bash - source myenv/bin/activate # use `myenv/Scripts/activate` instead on Windows - pai -h - ``` - -- use a absolute path to `pai` - - ```bash - myenv/bin/pai -h # use `myenv/Scripts/pai` instead on Windows - ``` - -- add `myenv/bin` to environment variable `path` - -## RESTful API - -The SDK provides ease-of-use `JavaScript` and `TypeScript` wrapping of [OpenPAI RESTful APIs](https://github.com/microsoft/pai/blob/master/docs/rest-server/API.md). - -Details are in [rest-api.md](https://github.com/microsoft/openpaisdk/blob/master/docs/rest-api.md). - -## Storage Operations - -Multiple types of storages are supported by OpenPAI, however, the end user and developers should not be bothered by too much details of it. The SDK provides an abstract storage accessing methods to let users access the storages. - -User could get the `IStorageNode` object for each cluster provisioned storage by - -```ts -// get a storage object with its name -let storageDetail: IStorageDetail = await opanPAIClient.storage.getStorageByName(name) -let storageNode: IStorageNode = new StorageNode(storageDetail) -``` - -It would provide storage accessing methods (`getinfo, listdir, makedir, upload, download, delete`) and CLI storage operations. - -Details are in [storage.md](https://github.com/microsoft/openpaisdk/blob/master/docs/storage.md). - -## Local Cluster Management - -In some scenarios (e.g. cli or notebook extension), it is required to store the cluster information locally. - -## Unified error handling - -The SDK will center the error handling, thus all front ends depending on it could share the same way to warn users. - -## Common job config processing - -The interoperation of `OpenPAI` components depends on the [job protocol](https://github.com/microsoft/openpai-protocol), and there have been some common operations of it, such as validation, preprocessing before submission (e.g. embedding essential user information). The SDK will provide essential common operations for all the front ends. - -## Contributing - -This project welcomes contributions and suggestions. Most contributions require you to agree to a -Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us -the rights to use your contribution. For details, visit https://cla.opensource.microsoft.com. - -When you submit a pull request, a CLA bot will automatically determine whether you need to provide -a CLA and decorate the PR appropriately (e.g., status check, comment). Simply follow the instructions -provided by the bot. You will only need to do this once across all repos using our CLA. - -This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/). -For more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or -contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional questions or comments. +# OpenPAI JS SDK + +[![Build Status](https://www.travis-ci.org/microsoft/openpaisdk.svg?branch=master)](https://travis-ci.org/microsoft/openpaisdk) + +The `JavaScript` SDK is designed to facilitate the developers of [OpenPAI](https://github.com/microsoft/pai) to offer user friendly experience. + +The SDK mainly provides client side sharable functions such as RESTful API wrapping, error handling, storage accessing and processing of [job protocol](https://github.com/microsoft/openpai-protocol). *Now the OpenPAI RESTful API is updating, please waiting for our stable release.* + +It could be used to support existing or future front-ends (e.g. Web Portal, VS Code extension, Command Line Interface, Jupyter Notebook extension, and 3rd party clients), and also could be used to simplify the design of [kube runtime plugins](https://github.com/microsoft/openpai-runtime), which are executed in init containers. + +*Now we are porting some of the functions from existing `Python` [SDK](https://github.com/microsoft/pai/tree/v0.17.0/contrib/python-sdk) and command line tool. The whole functionality of this SDK will be ready soon.* + +## Installation + +```bash +npm install --save @microsoft/openpai-js-sdk +``` + +Initialize the `openPAIClient` + +```ts +import { PAIV2 } from '@microsoft/openpai-js-sdk'; + +const cluster: PAIV2.IPAICluster = { + username: '', + token: '', + rest_server_uri: '/rest-server' +}; +const openPAIClient = new PAIV2.OpenPAIClient(cluster); +``` + +### Installation of CLI tool + +The SDK offers a command line interface (CLI) prefixed by `pai`. For end users that use CLI only, we provide an easy way to install it via `pip` and the `Python` package `nodeenv`. + +```bash +pip install nodeenv +nodeenv myenv +source myenv/bin/activate # use `myenv/Scripts/activate` instead on Windows +npm i -g @microsoft/openpai-js-sdk +``` + +This installation commands will generate a virtual environment with latest `node` in the directory `./myenv`, and install the CLI in it. Then user could use `pai` command by any of below methods + +- activate the virtual environment first + + ```bash + source myenv/bin/activate # use `myenv/Scripts/activate` instead on Windows + pai -h + ``` + +- use a absolute path to `pai` + + ```bash + myenv/bin/pai -h # use `myenv/Scripts/pai` instead on Windows + ``` + +- add `myenv/bin` to environment variable `path` + +## RESTful API + +The SDK provides ease-of-use `JavaScript` and `TypeScript` wrapping of [OpenPAI RESTful APIs](https://github.com/microsoft/pai/blob/master/docs/rest-server/API.md). + +Details are in [rest-api.md](https://github.com/microsoft/openpaisdk/blob/master/docs/rest-api.md). + +## Storage Operations + +Multiple types of storages are supported by OpenPAI, however, the end user and developers should not be bothered by too much details of it. The SDK provides an abstract storage accessing methods to let users access the storages. + +User could get the `IStorageNode` object for each cluster provisioned storage by + +```ts +// get a storage object with its name +let storageDetail: IStorageDetail = await opanPAIClient.storage.getStorageByName(name) +let storageNode: IStorageNode = new StorageNode(storageDetail) +``` + +It would provide storage accessing methods (`getinfo, listdir, makedir, upload, download, delete`) and CLI storage operations. + +Details are in [storage.md](https://github.com/microsoft/openpaisdk/blob/master/docs/storage.md). + +## Local Cluster Management + +In some scenarios (e.g. cli or notebook extension), it is required to store the cluster information locally. + +## Unified error handling + +The SDK will center the error handling, thus all front ends depending on it could share the same way to warn users. + +## Common job config processing + +The interoperation of `OpenPAI` components depends on the [job protocol](https://github.com/microsoft/openpai-protocol), and there have been some common operations of it, such as validation, preprocessing before submission (e.g. embedding essential user information). The SDK will provide essential common operations for all the front ends. + +## Contributing + +This project welcomes contributions and suggestions. Most contributions require you to agree to a +Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us +the rights to use your contribution. For details, visit https://cla.opensource.microsoft.com. + +When you submit a pull request, a CLA bot will automatically determine whether you need to provide +a CLA and decorate the PR appropriately (e.g., status check, comment). Simply follow the instructions +provided by the bot. You will only need to do this once across all repos using our CLA. + +This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/). +For more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or +contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional questions or comments. diff --git a/SECURITY.md b/SECURITY.md index 7ab49eb..e0dfff5 100644 --- a/SECURITY.md +++ b/SECURITY.md @@ -1,41 +1,41 @@ - - -## Security - -Microsoft takes the security of our software products and services seriously, which includes all source code repositories managed through our GitHub organizations, which include [Microsoft](https://github.com/Microsoft), [Azure](https://github.com/Azure), [DotNet](https://github.com/dotnet), [AspNet](https://github.com/aspnet), [Xamarin](https://github.com/xamarin), and [our GitHub organizations](https://opensource.microsoft.com/). - -If you believe you have found a security vulnerability in any Microsoft-owned repository that meets Microsoft's [Microsoft's definition of a security vulnerability](https://docs.microsoft.com/en-us/previous-versions/tn-archive/cc751383(v=technet.10)) of a security vulnerability, please report it to us as described below. - -## Reporting Security Issues - -**Please do not report security vulnerabilities through public GitHub issues.** - -Instead, please report them to the Microsoft Security Response Center (MSRC) at [https://msrc.microsoft.com/create-report](https://msrc.microsoft.com/create-report). - -If you prefer to submit without logging in, send email to [secure@microsoft.com](mailto:secure@microsoft.com). If possible, encrypt your message with our PGP key; please download it from the the [Microsoft Security Response Center PGP Key page](https://www.microsoft.com/en-us/msrc/pgp-key-msrc). - -You should receive a response within 24 hours. If for some reason you do not, please follow up via email to ensure we received your original message. Additional information can be found at [microsoft.com/msrc](https://www.microsoft.com/msrc). - -Please include the requested information listed below (as much as you can provide) to help us better understand the nature and scope of the possible issue: - - * Type of issue (e.g. buffer overflow, SQL injection, cross-site scripting, etc.) - * Full paths of source file(s) related to the manifestation of the issue - * The location of the affected source code (tag/branch/commit or direct URL) - * Any special configuration required to reproduce the issue - * Step-by-step instructions to reproduce the issue - * Proof-of-concept or exploit code (if possible) - * Impact of the issue, including how an attacker might exploit the issue - -This information will help us triage your report more quickly. - -If you are reporting for a bug bounty, more complete reports can contribute to a higher bounty award. Please visit our [Microsoft Bug Bounty Program](https://microsoft.com/msrc/bounty) page for more details about our active programs. - -## Preferred Languages - -We prefer all communications to be in English. - -## Policy - -Microsoft follows the principle of [Coordinated Vulnerability Disclosure](https://www.microsoft.com/en-us/msrc/cvd). - - + + +## Security + +Microsoft takes the security of our software products and services seriously, which includes all source code repositories managed through our GitHub organizations, which include [Microsoft](https://github.com/Microsoft), [Azure](https://github.com/Azure), [DotNet](https://github.com/dotnet), [AspNet](https://github.com/aspnet), [Xamarin](https://github.com/xamarin), and [our GitHub organizations](https://opensource.microsoft.com/). + +If you believe you have found a security vulnerability in any Microsoft-owned repository that meets Microsoft's [Microsoft's definition of a security vulnerability](https://docs.microsoft.com/en-us/previous-versions/tn-archive/cc751383(v=technet.10)) of a security vulnerability, please report it to us as described below. + +## Reporting Security Issues + +**Please do not report security vulnerabilities through public GitHub issues.** + +Instead, please report them to the Microsoft Security Response Center (MSRC) at [https://msrc.microsoft.com/create-report](https://msrc.microsoft.com/create-report). + +If you prefer to submit without logging in, send email to [secure@microsoft.com](mailto:secure@microsoft.com). If possible, encrypt your message with our PGP key; please download it from the the [Microsoft Security Response Center PGP Key page](https://www.microsoft.com/en-us/msrc/pgp-key-msrc). + +You should receive a response within 24 hours. If for some reason you do not, please follow up via email to ensure we received your original message. Additional information can be found at [microsoft.com/msrc](https://www.microsoft.com/msrc). + +Please include the requested information listed below (as much as you can provide) to help us better understand the nature and scope of the possible issue: + + * Type of issue (e.g. buffer overflow, SQL injection, cross-site scripting, etc.) + * Full paths of source file(s) related to the manifestation of the issue + * The location of the affected source code (tag/branch/commit or direct URL) + * Any special configuration required to reproduce the issue + * Step-by-step instructions to reproduce the issue + * Proof-of-concept or exploit code (if possible) + * Impact of the issue, including how an attacker might exploit the issue + +This information will help us triage your report more quickly. + +If you are reporting for a bug bounty, more complete reports can contribute to a higher bounty award. Please visit our [Microsoft Bug Bounty Program](https://microsoft.com/msrc/bounty) page for more details about our active programs. + +## Preferred Languages + +We prefer all communications to be in English. + +## Policy + +Microsoft follows the principle of [Coordinated Vulnerability Disclosure](https://www.microsoft.com/en-us/msrc/cvd). + + diff --git a/docs/rest-api.md b/docs/rest-api.md index 8d9ab28..8daa4ba 100644 --- a/docs/rest-api.md +++ b/docs/rest-api.md @@ -1,256 +1,256 @@ -# RESTful APIs - -Initialize the `openPAIClient` - -```ts -import { PAIV2 } from '@microsoft/openpai-js-sdk'; - -const cluster: PAIV2.IPAICluster = { - username: '', - password: '', - token: '', - rest_server_uri: '/rest-server' -}; -const openPAIClient = new PAIV2.OpenPAIClient(cluster); -``` - -## api info - -## token - -- [x] Get your currently signed tokens (GET /api/v2/tokens) - - ```ts - tokens = await openPAIClient.auth.getTokens(); - ``` - -- [x] Revoke a token (DELETE /api/v2/tokens/{token}) - - ```ts - await openPAIClient.auth.deleteToken(token); - ``` - -- [x] Create an application access token in the system (POST /api/v2/tokens/application) - - ```ts - token = await openPAIClient.auth.createApplicationToken(); - ``` - -## authn - -- [x] User login with Azure AD (GET /api/v2/authn/oidc/login) - - ```ts - redirect = await openPAIClient.authn.oidcLogin(); - ``` - -- [x] User logout from Azure AD (GET /api/v2/authn/oidc/logout) - - ```ts - redirect = await openPAIClient.authn.oidcLogout(); - ``` - -- [x] Get an access token using username and password (POST /api/v2/authn/basic/login) - - ```ts - loginInfo = await openPAIClient.authn.login(username, password); - ``` - -- [x] Logout and revoke the token (DELETE /api/v2/authn/basic/logout) - - ```ts - await openPAIClient.authn.logout(); - ``` - -## user - -- [x] Create a user in the system (POST /api/v2/users/) - - ```ts - await openPAIClient.user.createUser(user); - await openPAIClient.user.createUser({username, password, admin, email, virtualClusters}); - ``` - -- [x] Get all users in the system (GET /api/v2/users/) - - ```ts - list = await openPAIClient.user.getAllUser(); - ``` - -- [x] Update a user in the system (PUT /api/v2/users) - - ```ts - await openPAIClient.user.updateVirtualcluster(user); - await openPAIClient.user.updateVirtualcluster(user, patch); - ``` - -- [x] Update user's own profile (PUT /api/v2/users/me) - - ```ts - await openPAIClient.user.updateUserSelf(user); - await openPAIClient.user.updateUserSelf(user, patch); - ``` - -- [x] Get a user's data (GET /api/v2/users/{username}) - - ```ts - user = await openPAIClient.user.getUser(username); - ``` - -- [x] Remove a user in the system (DELETE /api/v2/users/{username}) - - ```ts - await openPAIClient.user.deleteUser(username); - ``` - -- [x] Add a group for user (PUT /api/v2/users/{username}/group/) - - ```ts - await openPAIClient.user.updateUserGroup(username, groupname); - ``` - -- [x] Remove a group from user's grouplist (DELETE /api/v2/users/{username}/group) - - ```ts - await openPAIClient.user.removeGroup(username, groupName); - ``` - -- [x] Replace user's grouplist (PUT /api/v2/users/{username}/grouplist/) - - ```ts - await openPAIClient.user.updateUserGrouplist(username, grouplist); - ``` - -## group - -- [x] Get all group objects in the system (GET /api/v2/groups) - - ```ts - groups = await openPAIClient.group.getAllGroup(); - ``` - -- [x] Create a group in the system (POST /api/v2/groups) - - ```ts - await openPAIClient.group.createGroup(group); - ``` - -- [x] Update a group in the system (PUT /api/v2/groups) - - ```ts - await openPAIClient.group.updateGroup(group); - ``` - -- [x] Get a group in the system (GET /api/v2/groups/{groupname}) - - ```ts - group = await openPAIClient.group.getGroup(groupname); - ``` - -- [x] Delete a group in the system (DELETE /api/v2/groups/{groupname}) - - ```ts - await openPAIClient.group.deleteGroup(groupname); - ``` - -- [x] Get the user array of a group in the system (GET /api/v2/groups/{groupname}/userlist) - - ```ts - users = await openPAIClient.group.getGroupMembers(groupname); - ``` - -## virtual cluster - -- [x] Get the list of virtual clusters (GET /api/v2/virtual-clusters) - - ```ts - list = await openPAIClient.virtualCluster.listVirtualClusters(); - ``` - -- [x] Get virtual cluster status in the system (GET /api/v2/virtual-clusters/{vcName}) - - ```ts - vc = await openPAIClient.virtualCluster.getVirtualCluster(vcName); - ``` - -## job - -- [x] Submit a job in the system (POST /api/v2/jobs) - - ```ts - await openPAIClient.job.createJob(config); - ``` - -- [x] Get the list of jobs (GET /api/v2/jobs) - - ```ts - list = await openPAIClient.job.listJobs(); - list = await openPAIClient.job.listJobs(username); - ``` - -- [x] Get job status (GET /api/v2/jobs/{username}~{jobname}) - - ```ts - job = await openPAIClient.job.getJob(username, jobname); - ``` - -- [x] Get job config (GET /api/v2/jobs/{username}~{jobname}/config) - - ```ts - config = await openPAIClient.job.getJobConfig(username, jobname); - ``` - -- [x] Start or stop a job (PUT /api/v2/jobs/{username}~{jobname}/exectionType) - - ```ts - await openPAIClient.job.updateJobExecutionType(username, jobname, 'START'); - await openPAIClient.job.updateJobExecutionType(username, jobname, 'STOP'); - ``` - -## job history - -- [x] Check if job attempts is healthy (GET /api/v2/jobs/{username}~{jobname}/job-attempts/healthz) - - ```ts - response = await openPAIClient.job.getJobAttemptsHealthz(username, jobname); - ``` - -- [x] Get all attempts of a job (GET /api/v2/jobs/{user}~{job}/job-attempts) - - ```ts - attempts = await openPAIClient.job.getJobAttempts(username, jobname); - ``` - -- [x] Get a specific attempt by attempt index (GET /api/v2/jobs/{user}~{job}/job-attempts/{attempt}) - - ```ts - attempt = await openPAIClient.job.getJobAttempt(username, jobname, index); - ``` - -## storage - -- [x] Get storage list (persistent volume claims) for current user (GET /api/v2/storages) - - ```ts - storages = await openPAIClient.storage.getStorages(); - ``` - -- [x] Get storage (persistent volume claim) for the given name (GET /api/v2/storages/{storagename}) - - ```ts - storage = await openPAIClient.storage.getStorage(storagename); - ``` - -## kubernetes - -- [x] Get kubernetes node list (GET /api/v2/kubernetes/nodes) - - ```ts - nodes = await openPAIClient.kubernetes.getK8sNodes(); - ``` - -- [x] Get kubernetes pod list (GET /api/v2/kubernetes/pods) - - ```ts - pods = await openPAIClient.kubernetes.getK8sPods(); - ``` +# RESTful APIs + +Initialize the `openPAIClient` + +```ts +import { PAIV2 } from '@microsoft/openpai-js-sdk'; + +const cluster: PAIV2.IPAICluster = { + username: '', + password: '', + token: '', + rest_server_uri: '/rest-server' +}; +const openPAIClient = new PAIV2.OpenPAIClient(cluster); +``` + +## api info + +## token + +- [x] Get your currently signed tokens (GET /api/v2/tokens) + + ```ts + tokens = await openPAIClient.auth.getTokens(); + ``` + +- [x] Revoke a token (DELETE /api/v2/tokens/{token}) + + ```ts + await openPAIClient.auth.deleteToken(token); + ``` + +- [x] Create an application access token in the system (POST /api/v2/tokens/application) + + ```ts + token = await openPAIClient.auth.createApplicationToken(); + ``` + +## authn + +- [x] User login with Azure AD (GET /api/v2/authn/oidc/login) + + ```ts + redirect = await openPAIClient.authn.oidcLogin(); + ``` + +- [x] User logout from Azure AD (GET /api/v2/authn/oidc/logout) + + ```ts + redirect = await openPAIClient.authn.oidcLogout(); + ``` + +- [x] Get an access token using username and password (POST /api/v2/authn/basic/login) + + ```ts + loginInfo = await openPAIClient.authn.login(username, password); + ``` + +- [x] Logout and revoke the token (DELETE /api/v2/authn/basic/logout) + + ```ts + await openPAIClient.authn.logout(); + ``` + +## user + +- [x] Create a user in the system (POST /api/v2/users/) + + ```ts + await openPAIClient.user.createUser(user); + await openPAIClient.user.createUser({username, password, admin, email, virtualClusters}); + ``` + +- [x] Get all users in the system (GET /api/v2/users/) + + ```ts + list = await openPAIClient.user.getAllUser(); + ``` + +- [x] Update a user in the system (PUT /api/v2/users) + + ```ts + await openPAIClient.user.updateVirtualcluster(user); + await openPAIClient.user.updateVirtualcluster(user, patch); + ``` + +- [x] Update user's own profile (PUT /api/v2/users/me) + + ```ts + await openPAIClient.user.updateUserSelf(user); + await openPAIClient.user.updateUserSelf(user, patch); + ``` + +- [x] Get a user's data (GET /api/v2/users/{username}) + + ```ts + user = await openPAIClient.user.getUser(username); + ``` + +- [x] Remove a user in the system (DELETE /api/v2/users/{username}) + + ```ts + await openPAIClient.user.deleteUser(username); + ``` + +- [x] Add a group for user (PUT /api/v2/users/{username}/group/) + + ```ts + await openPAIClient.user.updateUserGroup(username, groupname); + ``` + +- [x] Remove a group from user's grouplist (DELETE /api/v2/users/{username}/group) + + ```ts + await openPAIClient.user.removeGroup(username, groupName); + ``` + +- [x] Replace user's grouplist (PUT /api/v2/users/{username}/grouplist/) + + ```ts + await openPAIClient.user.updateUserGrouplist(username, grouplist); + ``` + +## group + +- [x] Get all group objects in the system (GET /api/v2/groups) + + ```ts + groups = await openPAIClient.group.getAllGroup(); + ``` + +- [x] Create a group in the system (POST /api/v2/groups) + + ```ts + await openPAIClient.group.createGroup(group); + ``` + +- [x] Update a group in the system (PUT /api/v2/groups) + + ```ts + await openPAIClient.group.updateGroup(group); + ``` + +- [x] Get a group in the system (GET /api/v2/groups/{groupname}) + + ```ts + group = await openPAIClient.group.getGroup(groupname); + ``` + +- [x] Delete a group in the system (DELETE /api/v2/groups/{groupname}) + + ```ts + await openPAIClient.group.deleteGroup(groupname); + ``` + +- [x] Get the user array of a group in the system (GET /api/v2/groups/{groupname}/userlist) + + ```ts + users = await openPAIClient.group.getGroupMembers(groupname); + ``` + +## virtual cluster + +- [x] Get the list of virtual clusters (GET /api/v2/virtual-clusters) + + ```ts + list = await openPAIClient.virtualCluster.listVirtualClusters(); + ``` + +- [x] Get virtual cluster status in the system (GET /api/v2/virtual-clusters/{vcName}) + + ```ts + vc = await openPAIClient.virtualCluster.getVirtualCluster(vcName); + ``` + +## job + +- [x] Submit a job in the system (POST /api/v2/jobs) + + ```ts + await openPAIClient.job.createJob(config); + ``` + +- [x] Get the list of jobs (GET /api/v2/jobs) + + ```ts + list = await openPAIClient.job.listJobs(); + list = await openPAIClient.job.listJobs(username); + ``` + +- [x] Get job status (GET /api/v2/jobs/{username}~{jobname}) + + ```ts + job = await openPAIClient.job.getJob(username, jobname); + ``` + +- [x] Get job config (GET /api/v2/jobs/{username}~{jobname}/config) + + ```ts + config = await openPAIClient.job.getJobConfig(username, jobname); + ``` + +- [x] Start or stop a job (PUT /api/v2/jobs/{username}~{jobname}/exectionType) + + ```ts + await openPAIClient.job.updateJobExecutionType(username, jobname, 'START'); + await openPAIClient.job.updateJobExecutionType(username, jobname, 'STOP'); + ``` + +## job history + +- [x] Check if job attempts is healthy (GET /api/v2/jobs/{username}~{jobname}/job-attempts/healthz) + + ```ts + response = await openPAIClient.job.getJobAttemptsHealthz(username, jobname); + ``` + +- [x] Get all attempts of a job (GET /api/v2/jobs/{user}~{job}/job-attempts) + + ```ts + attempts = await openPAIClient.job.getJobAttempts(username, jobname); + ``` + +- [x] Get a specific attempt by attempt index (GET /api/v2/jobs/{user}~{job}/job-attempts/{attempt}) + + ```ts + attempt = await openPAIClient.job.getJobAttempt(username, jobname, index); + ``` + +## storage + +- [x] Get storage list (persistent volume claims) for current user (GET /api/v2/storages) + + ```ts + storages = await openPAIClient.storage.getStorages(); + ``` + +- [x] Get storage (persistent volume claim) for the given name (GET /api/v2/storages/{storagename}) + + ```ts + storage = await openPAIClient.storage.getStorage(storagename); + ``` + +## kubernetes + +- [x] Get kubernetes node list (GET /api/v2/kubernetes/nodes) + + ```ts + nodes = await openPAIClient.kubernetes.getK8sNodes(); + ``` + +- [x] Get kubernetes pod list (GET /api/v2/kubernetes/pods) + + ```ts + pods = await openPAIClient.kubernetes.getK8sPods(); + ``` diff --git a/docs/storage.md b/docs/storage.md index 6059a69..3eaec6a 100644 --- a/docs/storage.md +++ b/docs/storage.md @@ -1,90 +1,90 @@ -# Storage Operations - -Multiple types of storages are supported by OpenPAI, however, the end user and developers should not be bothered by too much details of it. The SDK offers an abstract storage accessing layer to let users access the cluster provisioned storages. - -## Fetch storage object -User could get the `IStorageNode` object for each cluster provisioned storage by - -```ts -// get a storage object with its name -let storageDetail: IStorageDetail = await opanPAIClient.storage.getStorageByName(name) -let storageNode: IStorageNode = new StorageNode(storageDetail) -``` - -**ToDo: change to new API document** - -The `storageNodeName` is the unique name for each storage node. Currently it is combined by the name of storage config (`storageConfigName`) and the mount point specified in it (`mountPoint`). The storage config could be queried by by the [get storage config API](https://redocly.github.io/redoc/?url=https://raw.githubusercontent.com/microsoft/pai/master/src/rest-server/docs/swagger.yaml#operation/getStorageConfigs), the response of which looks like below (more details about storage configuration refer to [here](https://github.com/microsoft/pai/tree/master/contrib/storage_plugin#config-data-structure-)) - -```json -{ - "name": "string", - "servers": [ - "string" - ], - "mountInfos": [ - { - "mountPoint": "string", - "path": "string", - "server": "string", - "permission": "string" - } - ] -} -``` -***Note that the storage config API is under changing, this doc will be updated when it is fixed*** - -## Access the storage - -The `IStorageNode` object provides essential methods to access the storage, such as query, copy and remove. - -- get status of a path - - ```ts - let stat: IFileInfo = await storageNode.getinfo(path); - let flagExists: bool = storageNode.existsSync(path); - let flagIsFolder: bool = storageNode.isdirSync(path); - ``` - -- list directory of a path - ```ts - let items: string[] = await storageNode.listdir(path) - ``` - -- delete (remove) a path - ```ts - await stoageNode.delete(path) - await stoageNode.deleteFolder(path) - ``` - -- create a directory - ```ts - await storageNode.makedir(path) - ``` - -- copy from local file (upload) - ```ts - await storageNode.upload(localPath, path) - await storageNode.uploadFolder(localPath, path) - ``` - -- copy to local file (download) - ```ts - await storageNode.download(path, localPath) - await storageNode.downloadFolder(path, localPath) - ``` - -- [TBD] open read or write file stream - -## CLI interface - -The users of CLI could be able to access the storage configs provisioned by the cluster like below -```bash -pai getinfo -a ${cluster} -s ${storageNodeName} path -pai listdir -a ${cluster} -s ${storageNodeName} path -pai makedir -a ${cluster} -s ${storageNodeName} path -pai delete -a ${cluster} -s ${storageNodeName} path -pai upload -a ${cluster} -s ${storageNodeName} localPath path -pai download -a ${cluster} -s ${storageNodeName} path localPath - -``` -Here, `${cluster}` is the cluster alias that could be indexed in local environment. +# Storage Operations + +Multiple types of storages are supported by OpenPAI, however, the end user and developers should not be bothered by too much details of it. The SDK offers an abstract storage accessing layer to let users access the cluster provisioned storages. + +## Fetch storage object +User could get the `IStorageNode` object for each cluster provisioned storage by + +```ts +// get a storage object with its name +let storageDetail: IStorageDetail = await opanPAIClient.storage.getStorageByName(name) +let storageNode: IStorageNode = new StorageNode(storageDetail) +``` + +**ToDo: change to new API document** + +The `storageNodeName` is the unique name for each storage node. Currently it is combined by the name of storage config (`storageConfigName`) and the mount point specified in it (`mountPoint`). The storage config could be queried by by the [get storage config API](https://redocly.github.io/redoc/?url=https://raw.githubusercontent.com/microsoft/pai/master/src/rest-server/docs/swagger.yaml#operation/getStorageConfigs), the response of which looks like below (more details about storage configuration refer to [here](https://github.com/microsoft/pai/tree/master/contrib/storage_plugin#config-data-structure-)) + +```json +{ + "name": "string", + "servers": [ + "string" + ], + "mountInfos": [ + { + "mountPoint": "string", + "path": "string", + "server": "string", + "permission": "string" + } + ] +} +``` +***Note that the storage config API is under changing, this doc will be updated when it is fixed*** + +## Access the storage + +The `IStorageNode` object provides essential methods to access the storage, such as query, copy and remove. + +- get status of a path + + ```ts + let stat: IFileInfo = await storageNode.getinfo(path); + let flagExists: bool = storageNode.existsSync(path); + let flagIsFolder: bool = storageNode.isdirSync(path); + ``` + +- list directory of a path + ```ts + let items: string[] = await storageNode.listdir(path) + ``` + +- delete (remove) a path + ```ts + await stoageNode.delete(path) + await stoageNode.deleteFolder(path) + ``` + +- create a directory + ```ts + await storageNode.makedir(path) + ``` + +- copy from local file (upload) + ```ts + await storageNode.upload(localPath, path) + await storageNode.uploadFolder(localPath, path) + ``` + +- copy to local file (download) + ```ts + await storageNode.download(path, localPath) + await storageNode.downloadFolder(path, localPath) + ``` + +- [TBD] open read or write file stream + +## CLI interface + +The users of CLI could be able to access the storage configs provisioned by the cluster like below +```bash +pai getinfo -a ${cluster} -s ${storageNodeName} path +pai listdir -a ${cluster} -s ${storageNodeName} path +pai makedir -a ${cluster} -s ${storageNodeName} path +pai delete -a ${cluster} -s ${storageNodeName} path +pai upload -a ${cluster} -s ${storageNodeName} localPath path +pai download -a ${cluster} -s ${storageNodeName} path localPath + +``` +Here, `${cluster}` is the cluster alias that could be indexed in local environment. From 872a743ba42e7bd4c9405af5d56c8c19face7cf5 Mon Sep 17 00:00:00 2001 From: Yi Yi Date: Mon, 15 Jun 2020 01:46:38 +0800 Subject: [PATCH 07/24] add coveralls --- .github/workflows/code_coverage.yml | 38 +++++++++++++++++++++++++++++ package-lock.json | 33 ++++++++++++++++++++++++- package.json | 2 ++ 3 files changed, 72 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/code_coverage.yml diff --git a/.github/workflows/code_coverage.yml b/.github/workflows/code_coverage.yml new file mode 100644 index 0000000..ee7ddc2 --- /dev/null +++ b/.github/workflows/code_coverage.yml @@ -0,0 +1,38 @@ +name: Code coverage + +# Controls when the action will run. Triggers the workflow on push or pull request +# events but only for the master branch +on: + push: + branches: [ master ] + pull_request: + branches: [ master ] + +# A workflow run is made up of one or more jobs that can run sequentially or in parallel +jobs: + # This workflow contains a single job called "build" + build: + # The type of runner that the job will run on + runs-on: ubuntu-latest + + # Steps represent a sequence of tasks that will be executed as part of the job + steps: + # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it + - uses: actions/checkout@v2 + + - name: Use Node.js 12.x + uses: actions/setup-node@v1 + with: + node-version: 12.x + + - name: npm install, build + run: | + npm install + npm run build + + - name: Coveralls GitHub Action + uses: coverallsapp/github-action@v1.1.1 + with: + github-token: ${{ secrets.GITHUB_TOKEN }} + # Path to lcov file + path-to-lcov: ./coverage/lcov.info diff --git a/package-lock.json b/package-lock.json index 68929f5..a7b6c14 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "@microsoft/openpai-js-sdk", - "version": "0.0.0", + "version": "0.1.0", "lockfileVersion": 1, "requires": true, "dependencies": { @@ -602,6 +602,19 @@ "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", "integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=" }, + "coveralls": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/coveralls/-/coveralls-3.1.0.tgz", + "integrity": "sha512-sHxOu2ELzW8/NC1UP5XVLbZDzO4S3VxfFye3XYCznopHy02YjNkHcj5bKaVw2O7hVaBdBjEdQGpie4II1mWhuQ==", + "dev": true, + "requires": { + "js-yaml": "^3.13.1", + "lcov-parse": "^1.0.0", + "log-driver": "^1.2.7", + "minimist": "^1.2.5", + "request": "^2.88.2" + } + }, "dashdash": { "version": "1.14.1", "resolved": "https://registry.npmjs.org/dashdash/-/dashdash-1.14.1.tgz", @@ -1039,6 +1052,12 @@ "verror": "1.10.0" } }, + "lcov-parse": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/lcov-parse/-/lcov-parse-1.0.0.tgz", + "integrity": "sha1-6w1GtUER68VhrLTECO+TY73I9+A=", + "dev": true + }, "locate-path": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-3.0.0.tgz", @@ -1064,6 +1083,12 @@ "resolved": "https://registry.npmjs.org/lodash.isequal/-/lodash.isequal-4.5.0.tgz", "integrity": "sha1-QVxEePK8wwEgwizhDtMib30+GOA=" }, + "log-driver": { + "version": "1.2.7", + "resolved": "https://registry.npmjs.org/log-driver/-/log-driver-1.2.7.tgz", + "integrity": "sha512-U7KCmLdqsGHBLeWqYlFA0V0Sl6P08EE1ZrmA9cxjUE0WVqT9qnyVDPz1kzpFEP0jdJuFnasWIfSd7fsaNXkpbg==", + "dev": true + }, "log-symbols": { "version": "2.2.0", "resolved": "https://registry.npmjs.org/log-symbols/-/log-symbols-2.2.0.tgz", @@ -1164,6 +1189,12 @@ } } }, + "mocha-lcov-reporter": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/mocha-lcov-reporter/-/mocha-lcov-reporter-1.3.0.tgz", + "integrity": "sha1-Rpve9PivyaEWBW8HnfYYLQr7A4Q=", + "dev": true + }, "mock-fs": { "version": "4.11.0", "resolved": "https://registry.npmjs.org/mock-fs/-/mock-fs-4.11.0.tgz", diff --git a/package.json b/package.json index 8f5d4d0..82616ab 100644 --- a/package.json +++ b/package.json @@ -45,9 +45,11 @@ "@types/table": "^4.0.7", "ajv": "^6.12.2", "chai": "^4.2.0", + "coveralls": "^3.1.0", "dirty-chai": "^2.0.1", "minimist": ">=1.2.2", "mocha": "^6.2.3", + "mocha-lcov-reporter": "^1.3.0", "mock-fs": "^4.11.0", "nock": "^12.0.3", "prettier": "^1.18.2", From b18f279c0ac0b1c7359f65bacf64d790133cad5b Mon Sep 17 00:00:00 2001 From: Yi Yi Date: Mon, 15 Jun 2020 01:51:32 +0800 Subject: [PATCH 08/24] update --- docs/storage.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/storage.md b/docs/storage.md index 3eaec6a..2ae5f61 100644 --- a/docs/storage.md +++ b/docs/storage.md @@ -3,7 +3,7 @@ Multiple types of storages are supported by OpenPAI, however, the end user and developers should not be bothered by too much details of it. The SDK offers an abstract storage accessing layer to let users access the cluster provisioned storages. ## Fetch storage object -User could get the `IStorageNode` object for each cluster provisioned storage by +User could get the `IStorageNode` object for each cluster provisioned storage by ```ts // get a storage object with its name @@ -35,7 +35,7 @@ The `storageNodeName` is the unique name for each storage node. Currently it is ## Access the storage -The `IStorageNode` object provides essential methods to access the storage, such as query, copy and remove. +The `IStorageNode` object provides essential methods to access the storage, such as query, copy and remove. - get status of a path @@ -43,7 +43,7 @@ The `IStorageNode` object provides essential methods to access the storage, such let stat: IFileInfo = await storageNode.getinfo(path); let flagExists: bool = storageNode.existsSync(path); let flagIsFolder: bool = storageNode.isdirSync(path); - ``` + ``` - list directory of a path ```ts From 79ac406fd2a96eb1e82c5827233b56f08db6aafb Mon Sep 17 00:00:00 2001 From: Yi Yi Date: Mon, 15 Jun 2020 01:56:45 +0800 Subject: [PATCH 09/24] update --- .github/workflows/cli_setup.yml | 70 ++-- .github/workflows/int_bed_api_tests.yml | 0 .tests/clusters.json | 10 + CODE_OF_CONDUCT.md | 18 +- LICENSE | 42 +- README.md | 212 +++++----- SECURITY.md | 82 ++-- docs/rest-api.md | 512 ++++++++++++------------ docs/storage.md | 180 ++++----- 9 files changed, 568 insertions(+), 558 deletions(-) delete mode 100644 .github/workflows/int_bed_api_tests.yml create mode 100644 .tests/clusters.json diff --git a/.github/workflows/cli_setup.yml b/.github/workflows/cli_setup.yml index 7037073..38ae1f1 100644 --- a/.github/workflows/cli_setup.yml +++ b/.github/workflows/cli_setup.yml @@ -1,35 +1,35 @@ -# This is a basic workflow to help you get started with Actions - -name: Test CLI Installation - -# Controls when the action will run. Triggers the workflow on push or pull request -# events but only for the master branch -on: [push] - -jobs: - build: - runs-on: ubuntu-latest - strategy: - matrix: - python-version: [2.7, 3.5] - - steps: - - uses: actions/checkout@v2 - - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v2 - with: - python-version: ${{ matrix.python-version }} - - name: Create node env - run: | - python -m pip install --upgrade pip - pip install nodeenv - nodeenv myenv - - name: Setup local install - run: | - . myenv/bin/activate - node --version - npm install typescript tslint tslint-microsoft-contrib - npm run build - npm link - pai -h - deactivate_node +# This is a basic workflow to help you get started with Actions + +name: Test CLI Installation + +# Controls when the action will run. Triggers the workflow on push or pull request +# events but only for the master branch +on: [push] + +jobs: + build: + runs-on: ubuntu-latest + strategy: + matrix: + python-version: [2.7, 3.5] + + steps: + - uses: actions/checkout@v2 + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v2 + with: + python-version: ${{ matrix.python-version }} + - name: Create node env + run: | + python -m pip install --upgrade pip + pip install nodeenv + nodeenv myenv + - name: Setup local install + run: | + . myenv/bin/activate + node --version + npm install typescript tslint tslint-microsoft-contrib + npm run build + npm link + pai -h + deactivate_node diff --git a/.github/workflows/int_bed_api_tests.yml b/.github/workflows/int_bed_api_tests.yml deleted file mode 100644 index e69de29..0000000 diff --git a/.tests/clusters.json b/.tests/clusters.json new file mode 100644 index 0000000..ae614b1 --- /dev/null +++ b/.tests/clusters.json @@ -0,0 +1,10 @@ +[ + { + "alias": "int", + "rest_server_uri": "openpai.test/rest-server", + "username": "sdk_test", + "password": "pwd", + "token": "", + "https": true + } +] diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md index f9ba8cf..c72a574 100644 --- a/CODE_OF_CONDUCT.md +++ b/CODE_OF_CONDUCT.md @@ -1,9 +1,9 @@ -# Microsoft Open Source Code of Conduct - -This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/). - -Resources: - -- [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/) -- [Microsoft Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) -- Contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with questions or concerns +# Microsoft Open Source Code of Conduct + +This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/). + +Resources: + +- [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/) +- [Microsoft Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) +- Contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with questions or concerns diff --git a/LICENSE b/LICENSE index 9e841e7..3d8b93b 100644 --- a/LICENSE +++ b/LICENSE @@ -1,21 +1,21 @@ - MIT License - - Copyright (c) Microsoft Corporation. - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to deal - in the Software without restriction, including without limitation the rights - to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in all - copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - SOFTWARE + MIT License + + Copyright (c) Microsoft Corporation. + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to deal + in the Software without restriction, including without limitation the rights + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in all + copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + SOFTWARE diff --git a/README.md b/README.md index 430c70d..6a6d9e5 100644 --- a/README.md +++ b/README.md @@ -1,106 +1,106 @@ -# OpenPAI JS SDK - -[![Build Status](https://www.travis-ci.org/microsoft/openpaisdk.svg?branch=master)](https://travis-ci.org/microsoft/openpaisdk) - -The `JavaScript` SDK is designed to facilitate the developers of [OpenPAI](https://github.com/microsoft/pai) to offer user friendly experience. - -The SDK mainly provides client side sharable functions such as RESTful API wrapping, error handling, storage accessing and processing of [job protocol](https://github.com/microsoft/openpai-protocol). *Now the OpenPAI RESTful API is updating, please waiting for our stable release.* - -It could be used to support existing or future front-ends (e.g. Web Portal, VS Code extension, Command Line Interface, Jupyter Notebook extension, and 3rd party clients), and also could be used to simplify the design of [kube runtime plugins](https://github.com/microsoft/openpai-runtime), which are executed in init containers. - -*Now we are porting some of the functions from existing `Python` [SDK](https://github.com/microsoft/pai/tree/v0.17.0/contrib/python-sdk) and command line tool. The whole functionality of this SDK will be ready soon.* - -## Installation - -```bash -npm install --save @microsoft/openpai-js-sdk -``` - -Initialize the `openPAIClient` - -```ts -import { PAIV2 } from '@microsoft/openpai-js-sdk'; - -const cluster: PAIV2.IPAICluster = { - username: '', - token: '', - rest_server_uri: '/rest-server' -}; -const openPAIClient = new PAIV2.OpenPAIClient(cluster); -``` - -### Installation of CLI tool - -The SDK offers a command line interface (CLI) prefixed by `pai`. For end users that use CLI only, we provide an easy way to install it via `pip` and the `Python` package `nodeenv`. - -```bash -pip install nodeenv -nodeenv myenv -source myenv/bin/activate # use `myenv/Scripts/activate` instead on Windows -npm i -g @microsoft/openpai-js-sdk -``` - -This installation commands will generate a virtual environment with latest `node` in the directory `./myenv`, and install the CLI in it. Then user could use `pai` command by any of below methods - -- activate the virtual environment first - - ```bash - source myenv/bin/activate # use `myenv/Scripts/activate` instead on Windows - pai -h - ``` - -- use a absolute path to `pai` - - ```bash - myenv/bin/pai -h # use `myenv/Scripts/pai` instead on Windows - ``` - -- add `myenv/bin` to environment variable `path` - -## RESTful API - -The SDK provides ease-of-use `JavaScript` and `TypeScript` wrapping of [OpenPAI RESTful APIs](https://github.com/microsoft/pai/blob/master/docs/rest-server/API.md). - -Details are in [rest-api.md](https://github.com/microsoft/openpaisdk/blob/master/docs/rest-api.md). - -## Storage Operations - -Multiple types of storages are supported by OpenPAI, however, the end user and developers should not be bothered by too much details of it. The SDK provides an abstract storage accessing methods to let users access the storages. - -User could get the `IStorageNode` object for each cluster provisioned storage by - -```ts -// get a storage object with its name -let storageDetail: IStorageDetail = await opanPAIClient.storage.getStorageByName(name) -let storageNode: IStorageNode = new StorageNode(storageDetail) -``` - -It would provide storage accessing methods (`getinfo, listdir, makedir, upload, download, delete`) and CLI storage operations. - -Details are in [storage.md](https://github.com/microsoft/openpaisdk/blob/master/docs/storage.md). - -## Local Cluster Management - -In some scenarios (e.g. cli or notebook extension), it is required to store the cluster information locally. - -## Unified error handling - -The SDK will center the error handling, thus all front ends depending on it could share the same way to warn users. - -## Common job config processing - -The interoperation of `OpenPAI` components depends on the [job protocol](https://github.com/microsoft/openpai-protocol), and there have been some common operations of it, such as validation, preprocessing before submission (e.g. embedding essential user information). The SDK will provide essential common operations for all the front ends. - -## Contributing - -This project welcomes contributions and suggestions. Most contributions require you to agree to a -Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us -the rights to use your contribution. For details, visit https://cla.opensource.microsoft.com. - -When you submit a pull request, a CLA bot will automatically determine whether you need to provide -a CLA and decorate the PR appropriately (e.g., status check, comment). Simply follow the instructions -provided by the bot. You will only need to do this once across all repos using our CLA. - -This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/). -For more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or -contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional questions or comments. +# OpenPAI JS SDK + +[![Build Status](https://www.travis-ci.org/microsoft/openpaisdk.svg?branch=master)](https://travis-ci.org/microsoft/openpaisdk) + +The `JavaScript` SDK is designed to facilitate the developers of [OpenPAI](https://github.com/microsoft/pai) to offer user friendly experience. + +The SDK mainly provides client side sharable functions such as RESTful API wrapping, error handling, storage accessing and processing of [job protocol](https://github.com/microsoft/openpai-protocol). *Now the OpenPAI RESTful API is updating, please waiting for our stable release.* + +It could be used to support existing or future front-ends (e.g. Web Portal, VS Code extension, Command Line Interface, Jupyter Notebook extension, and 3rd party clients), and also could be used to simplify the design of [kube runtime plugins](https://github.com/microsoft/openpai-runtime), which are executed in init containers. + +*Now we are porting some of the functions from existing `Python` [SDK](https://github.com/microsoft/pai/tree/v0.17.0/contrib/python-sdk) and command line tool. The whole functionality of this SDK will be ready soon.* + +## Installation + +```bash +npm install --save @microsoft/openpai-js-sdk +``` + +Initialize the `openPAIClient` + +```ts +import { PAIV2 } from '@microsoft/openpai-js-sdk'; + +const cluster: PAIV2.IPAICluster = { + username: '', + token: '', + rest_server_uri: '/rest-server' +}; +const openPAIClient = new PAIV2.OpenPAIClient(cluster); +``` + +### Installation of CLI tool + +The SDK offers a command line interface (CLI) prefixed by `pai`. For end users that use CLI only, we provide an easy way to install it via `pip` and the `Python` package `nodeenv`. + +```bash +pip install nodeenv +nodeenv myenv +source myenv/bin/activate # use `myenv/Scripts/activate` instead on Windows +npm i -g @microsoft/openpai-js-sdk +``` + +This installation commands will generate a virtual environment with latest `node` in the directory `./myenv`, and install the CLI in it. Then user could use `pai` command by any of below methods + +- activate the virtual environment first + + ```bash + source myenv/bin/activate # use `myenv/Scripts/activate` instead on Windows + pai -h + ``` + +- use a absolute path to `pai` + + ```bash + myenv/bin/pai -h # use `myenv/Scripts/pai` instead on Windows + ``` + +- add `myenv/bin` to environment variable `path` + +## RESTful API + +The SDK provides ease-of-use `JavaScript` and `TypeScript` wrapping of [OpenPAI RESTful APIs](https://github.com/microsoft/pai/blob/master/docs/rest-server/API.md). + +Details are in [rest-api.md](https://github.com/microsoft/openpaisdk/blob/master/docs/rest-api.md). + +## Storage Operations + +Multiple types of storages are supported by OpenPAI, however, the end user and developers should not be bothered by too much details of it. The SDK provides an abstract storage accessing methods to let users access the storages. + +User could get the `IStorageNode` object for each cluster provisioned storage by + +```ts +// get a storage object with its name +let storageDetail: IStorageDetail = await opanPAIClient.storage.getStorageByName(name) +let storageNode: IStorageNode = new StorageNode(storageDetail) +``` + +It would provide storage accessing methods (`getinfo, listdir, makedir, upload, download, delete`) and CLI storage operations. + +Details are in [storage.md](https://github.com/microsoft/openpaisdk/blob/master/docs/storage.md). + +## Local Cluster Management + +In some scenarios (e.g. cli or notebook extension), it is required to store the cluster information locally. + +## Unified error handling + +The SDK will center the error handling, thus all front ends depending on it could share the same way to warn users. + +## Common job config processing + +The interoperation of `OpenPAI` components depends on the [job protocol](https://github.com/microsoft/openpai-protocol), and there have been some common operations of it, such as validation, preprocessing before submission (e.g. embedding essential user information). The SDK will provide essential common operations for all the front ends. + +## Contributing + +This project welcomes contributions and suggestions. Most contributions require you to agree to a +Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us +the rights to use your contribution. For details, visit https://cla.opensource.microsoft.com. + +When you submit a pull request, a CLA bot will automatically determine whether you need to provide +a CLA and decorate the PR appropriately (e.g., status check, comment). Simply follow the instructions +provided by the bot. You will only need to do this once across all repos using our CLA. + +This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/). +For more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or +contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional questions or comments. diff --git a/SECURITY.md b/SECURITY.md index e0dfff5..7ab49eb 100644 --- a/SECURITY.md +++ b/SECURITY.md @@ -1,41 +1,41 @@ - - -## Security - -Microsoft takes the security of our software products and services seriously, which includes all source code repositories managed through our GitHub organizations, which include [Microsoft](https://github.com/Microsoft), [Azure](https://github.com/Azure), [DotNet](https://github.com/dotnet), [AspNet](https://github.com/aspnet), [Xamarin](https://github.com/xamarin), and [our GitHub organizations](https://opensource.microsoft.com/). - -If you believe you have found a security vulnerability in any Microsoft-owned repository that meets Microsoft's [Microsoft's definition of a security vulnerability](https://docs.microsoft.com/en-us/previous-versions/tn-archive/cc751383(v=technet.10)) of a security vulnerability, please report it to us as described below. - -## Reporting Security Issues - -**Please do not report security vulnerabilities through public GitHub issues.** - -Instead, please report them to the Microsoft Security Response Center (MSRC) at [https://msrc.microsoft.com/create-report](https://msrc.microsoft.com/create-report). - -If you prefer to submit without logging in, send email to [secure@microsoft.com](mailto:secure@microsoft.com). If possible, encrypt your message with our PGP key; please download it from the the [Microsoft Security Response Center PGP Key page](https://www.microsoft.com/en-us/msrc/pgp-key-msrc). - -You should receive a response within 24 hours. If for some reason you do not, please follow up via email to ensure we received your original message. Additional information can be found at [microsoft.com/msrc](https://www.microsoft.com/msrc). - -Please include the requested information listed below (as much as you can provide) to help us better understand the nature and scope of the possible issue: - - * Type of issue (e.g. buffer overflow, SQL injection, cross-site scripting, etc.) - * Full paths of source file(s) related to the manifestation of the issue - * The location of the affected source code (tag/branch/commit or direct URL) - * Any special configuration required to reproduce the issue - * Step-by-step instructions to reproduce the issue - * Proof-of-concept or exploit code (if possible) - * Impact of the issue, including how an attacker might exploit the issue - -This information will help us triage your report more quickly. - -If you are reporting for a bug bounty, more complete reports can contribute to a higher bounty award. Please visit our [Microsoft Bug Bounty Program](https://microsoft.com/msrc/bounty) page for more details about our active programs. - -## Preferred Languages - -We prefer all communications to be in English. - -## Policy - -Microsoft follows the principle of [Coordinated Vulnerability Disclosure](https://www.microsoft.com/en-us/msrc/cvd). - - + + +## Security + +Microsoft takes the security of our software products and services seriously, which includes all source code repositories managed through our GitHub organizations, which include [Microsoft](https://github.com/Microsoft), [Azure](https://github.com/Azure), [DotNet](https://github.com/dotnet), [AspNet](https://github.com/aspnet), [Xamarin](https://github.com/xamarin), and [our GitHub organizations](https://opensource.microsoft.com/). + +If you believe you have found a security vulnerability in any Microsoft-owned repository that meets Microsoft's [Microsoft's definition of a security vulnerability](https://docs.microsoft.com/en-us/previous-versions/tn-archive/cc751383(v=technet.10)) of a security vulnerability, please report it to us as described below. + +## Reporting Security Issues + +**Please do not report security vulnerabilities through public GitHub issues.** + +Instead, please report them to the Microsoft Security Response Center (MSRC) at [https://msrc.microsoft.com/create-report](https://msrc.microsoft.com/create-report). + +If you prefer to submit without logging in, send email to [secure@microsoft.com](mailto:secure@microsoft.com). If possible, encrypt your message with our PGP key; please download it from the the [Microsoft Security Response Center PGP Key page](https://www.microsoft.com/en-us/msrc/pgp-key-msrc). + +You should receive a response within 24 hours. If for some reason you do not, please follow up via email to ensure we received your original message. Additional information can be found at [microsoft.com/msrc](https://www.microsoft.com/msrc). + +Please include the requested information listed below (as much as you can provide) to help us better understand the nature and scope of the possible issue: + + * Type of issue (e.g. buffer overflow, SQL injection, cross-site scripting, etc.) + * Full paths of source file(s) related to the manifestation of the issue + * The location of the affected source code (tag/branch/commit or direct URL) + * Any special configuration required to reproduce the issue + * Step-by-step instructions to reproduce the issue + * Proof-of-concept or exploit code (if possible) + * Impact of the issue, including how an attacker might exploit the issue + +This information will help us triage your report more quickly. + +If you are reporting for a bug bounty, more complete reports can contribute to a higher bounty award. Please visit our [Microsoft Bug Bounty Program](https://microsoft.com/msrc/bounty) page for more details about our active programs. + +## Preferred Languages + +We prefer all communications to be in English. + +## Policy + +Microsoft follows the principle of [Coordinated Vulnerability Disclosure](https://www.microsoft.com/en-us/msrc/cvd). + + diff --git a/docs/rest-api.md b/docs/rest-api.md index 8daa4ba..8d9ab28 100644 --- a/docs/rest-api.md +++ b/docs/rest-api.md @@ -1,256 +1,256 @@ -# RESTful APIs - -Initialize the `openPAIClient` - -```ts -import { PAIV2 } from '@microsoft/openpai-js-sdk'; - -const cluster: PAIV2.IPAICluster = { - username: '', - password: '', - token: '', - rest_server_uri: '/rest-server' -}; -const openPAIClient = new PAIV2.OpenPAIClient(cluster); -``` - -## api info - -## token - -- [x] Get your currently signed tokens (GET /api/v2/tokens) - - ```ts - tokens = await openPAIClient.auth.getTokens(); - ``` - -- [x] Revoke a token (DELETE /api/v2/tokens/{token}) - - ```ts - await openPAIClient.auth.deleteToken(token); - ``` - -- [x] Create an application access token in the system (POST /api/v2/tokens/application) - - ```ts - token = await openPAIClient.auth.createApplicationToken(); - ``` - -## authn - -- [x] User login with Azure AD (GET /api/v2/authn/oidc/login) - - ```ts - redirect = await openPAIClient.authn.oidcLogin(); - ``` - -- [x] User logout from Azure AD (GET /api/v2/authn/oidc/logout) - - ```ts - redirect = await openPAIClient.authn.oidcLogout(); - ``` - -- [x] Get an access token using username and password (POST /api/v2/authn/basic/login) - - ```ts - loginInfo = await openPAIClient.authn.login(username, password); - ``` - -- [x] Logout and revoke the token (DELETE /api/v2/authn/basic/logout) - - ```ts - await openPAIClient.authn.logout(); - ``` - -## user - -- [x] Create a user in the system (POST /api/v2/users/) - - ```ts - await openPAIClient.user.createUser(user); - await openPAIClient.user.createUser({username, password, admin, email, virtualClusters}); - ``` - -- [x] Get all users in the system (GET /api/v2/users/) - - ```ts - list = await openPAIClient.user.getAllUser(); - ``` - -- [x] Update a user in the system (PUT /api/v2/users) - - ```ts - await openPAIClient.user.updateVirtualcluster(user); - await openPAIClient.user.updateVirtualcluster(user, patch); - ``` - -- [x] Update user's own profile (PUT /api/v2/users/me) - - ```ts - await openPAIClient.user.updateUserSelf(user); - await openPAIClient.user.updateUserSelf(user, patch); - ``` - -- [x] Get a user's data (GET /api/v2/users/{username}) - - ```ts - user = await openPAIClient.user.getUser(username); - ``` - -- [x] Remove a user in the system (DELETE /api/v2/users/{username}) - - ```ts - await openPAIClient.user.deleteUser(username); - ``` - -- [x] Add a group for user (PUT /api/v2/users/{username}/group/) - - ```ts - await openPAIClient.user.updateUserGroup(username, groupname); - ``` - -- [x] Remove a group from user's grouplist (DELETE /api/v2/users/{username}/group) - - ```ts - await openPAIClient.user.removeGroup(username, groupName); - ``` - -- [x] Replace user's grouplist (PUT /api/v2/users/{username}/grouplist/) - - ```ts - await openPAIClient.user.updateUserGrouplist(username, grouplist); - ``` - -## group - -- [x] Get all group objects in the system (GET /api/v2/groups) - - ```ts - groups = await openPAIClient.group.getAllGroup(); - ``` - -- [x] Create a group in the system (POST /api/v2/groups) - - ```ts - await openPAIClient.group.createGroup(group); - ``` - -- [x] Update a group in the system (PUT /api/v2/groups) - - ```ts - await openPAIClient.group.updateGroup(group); - ``` - -- [x] Get a group in the system (GET /api/v2/groups/{groupname}) - - ```ts - group = await openPAIClient.group.getGroup(groupname); - ``` - -- [x] Delete a group in the system (DELETE /api/v2/groups/{groupname}) - - ```ts - await openPAIClient.group.deleteGroup(groupname); - ``` - -- [x] Get the user array of a group in the system (GET /api/v2/groups/{groupname}/userlist) - - ```ts - users = await openPAIClient.group.getGroupMembers(groupname); - ``` - -## virtual cluster - -- [x] Get the list of virtual clusters (GET /api/v2/virtual-clusters) - - ```ts - list = await openPAIClient.virtualCluster.listVirtualClusters(); - ``` - -- [x] Get virtual cluster status in the system (GET /api/v2/virtual-clusters/{vcName}) - - ```ts - vc = await openPAIClient.virtualCluster.getVirtualCluster(vcName); - ``` - -## job - -- [x] Submit a job in the system (POST /api/v2/jobs) - - ```ts - await openPAIClient.job.createJob(config); - ``` - -- [x] Get the list of jobs (GET /api/v2/jobs) - - ```ts - list = await openPAIClient.job.listJobs(); - list = await openPAIClient.job.listJobs(username); - ``` - -- [x] Get job status (GET /api/v2/jobs/{username}~{jobname}) - - ```ts - job = await openPAIClient.job.getJob(username, jobname); - ``` - -- [x] Get job config (GET /api/v2/jobs/{username}~{jobname}/config) - - ```ts - config = await openPAIClient.job.getJobConfig(username, jobname); - ``` - -- [x] Start or stop a job (PUT /api/v2/jobs/{username}~{jobname}/exectionType) - - ```ts - await openPAIClient.job.updateJobExecutionType(username, jobname, 'START'); - await openPAIClient.job.updateJobExecutionType(username, jobname, 'STOP'); - ``` - -## job history - -- [x] Check if job attempts is healthy (GET /api/v2/jobs/{username}~{jobname}/job-attempts/healthz) - - ```ts - response = await openPAIClient.job.getJobAttemptsHealthz(username, jobname); - ``` - -- [x] Get all attempts of a job (GET /api/v2/jobs/{user}~{job}/job-attempts) - - ```ts - attempts = await openPAIClient.job.getJobAttempts(username, jobname); - ``` - -- [x] Get a specific attempt by attempt index (GET /api/v2/jobs/{user}~{job}/job-attempts/{attempt}) - - ```ts - attempt = await openPAIClient.job.getJobAttempt(username, jobname, index); - ``` - -## storage - -- [x] Get storage list (persistent volume claims) for current user (GET /api/v2/storages) - - ```ts - storages = await openPAIClient.storage.getStorages(); - ``` - -- [x] Get storage (persistent volume claim) for the given name (GET /api/v2/storages/{storagename}) - - ```ts - storage = await openPAIClient.storage.getStorage(storagename); - ``` - -## kubernetes - -- [x] Get kubernetes node list (GET /api/v2/kubernetes/nodes) - - ```ts - nodes = await openPAIClient.kubernetes.getK8sNodes(); - ``` - -- [x] Get kubernetes pod list (GET /api/v2/kubernetes/pods) - - ```ts - pods = await openPAIClient.kubernetes.getK8sPods(); - ``` +# RESTful APIs + +Initialize the `openPAIClient` + +```ts +import { PAIV2 } from '@microsoft/openpai-js-sdk'; + +const cluster: PAIV2.IPAICluster = { + username: '', + password: '', + token: '', + rest_server_uri: '/rest-server' +}; +const openPAIClient = new PAIV2.OpenPAIClient(cluster); +``` + +## api info + +## token + +- [x] Get your currently signed tokens (GET /api/v2/tokens) + + ```ts + tokens = await openPAIClient.auth.getTokens(); + ``` + +- [x] Revoke a token (DELETE /api/v2/tokens/{token}) + + ```ts + await openPAIClient.auth.deleteToken(token); + ``` + +- [x] Create an application access token in the system (POST /api/v2/tokens/application) + + ```ts + token = await openPAIClient.auth.createApplicationToken(); + ``` + +## authn + +- [x] User login with Azure AD (GET /api/v2/authn/oidc/login) + + ```ts + redirect = await openPAIClient.authn.oidcLogin(); + ``` + +- [x] User logout from Azure AD (GET /api/v2/authn/oidc/logout) + + ```ts + redirect = await openPAIClient.authn.oidcLogout(); + ``` + +- [x] Get an access token using username and password (POST /api/v2/authn/basic/login) + + ```ts + loginInfo = await openPAIClient.authn.login(username, password); + ``` + +- [x] Logout and revoke the token (DELETE /api/v2/authn/basic/logout) + + ```ts + await openPAIClient.authn.logout(); + ``` + +## user + +- [x] Create a user in the system (POST /api/v2/users/) + + ```ts + await openPAIClient.user.createUser(user); + await openPAIClient.user.createUser({username, password, admin, email, virtualClusters}); + ``` + +- [x] Get all users in the system (GET /api/v2/users/) + + ```ts + list = await openPAIClient.user.getAllUser(); + ``` + +- [x] Update a user in the system (PUT /api/v2/users) + + ```ts + await openPAIClient.user.updateVirtualcluster(user); + await openPAIClient.user.updateVirtualcluster(user, patch); + ``` + +- [x] Update user's own profile (PUT /api/v2/users/me) + + ```ts + await openPAIClient.user.updateUserSelf(user); + await openPAIClient.user.updateUserSelf(user, patch); + ``` + +- [x] Get a user's data (GET /api/v2/users/{username}) + + ```ts + user = await openPAIClient.user.getUser(username); + ``` + +- [x] Remove a user in the system (DELETE /api/v2/users/{username}) + + ```ts + await openPAIClient.user.deleteUser(username); + ``` + +- [x] Add a group for user (PUT /api/v2/users/{username}/group/) + + ```ts + await openPAIClient.user.updateUserGroup(username, groupname); + ``` + +- [x] Remove a group from user's grouplist (DELETE /api/v2/users/{username}/group) + + ```ts + await openPAIClient.user.removeGroup(username, groupName); + ``` + +- [x] Replace user's grouplist (PUT /api/v2/users/{username}/grouplist/) + + ```ts + await openPAIClient.user.updateUserGrouplist(username, grouplist); + ``` + +## group + +- [x] Get all group objects in the system (GET /api/v2/groups) + + ```ts + groups = await openPAIClient.group.getAllGroup(); + ``` + +- [x] Create a group in the system (POST /api/v2/groups) + + ```ts + await openPAIClient.group.createGroup(group); + ``` + +- [x] Update a group in the system (PUT /api/v2/groups) + + ```ts + await openPAIClient.group.updateGroup(group); + ``` + +- [x] Get a group in the system (GET /api/v2/groups/{groupname}) + + ```ts + group = await openPAIClient.group.getGroup(groupname); + ``` + +- [x] Delete a group in the system (DELETE /api/v2/groups/{groupname}) + + ```ts + await openPAIClient.group.deleteGroup(groupname); + ``` + +- [x] Get the user array of a group in the system (GET /api/v2/groups/{groupname}/userlist) + + ```ts + users = await openPAIClient.group.getGroupMembers(groupname); + ``` + +## virtual cluster + +- [x] Get the list of virtual clusters (GET /api/v2/virtual-clusters) + + ```ts + list = await openPAIClient.virtualCluster.listVirtualClusters(); + ``` + +- [x] Get virtual cluster status in the system (GET /api/v2/virtual-clusters/{vcName}) + + ```ts + vc = await openPAIClient.virtualCluster.getVirtualCluster(vcName); + ``` + +## job + +- [x] Submit a job in the system (POST /api/v2/jobs) + + ```ts + await openPAIClient.job.createJob(config); + ``` + +- [x] Get the list of jobs (GET /api/v2/jobs) + + ```ts + list = await openPAIClient.job.listJobs(); + list = await openPAIClient.job.listJobs(username); + ``` + +- [x] Get job status (GET /api/v2/jobs/{username}~{jobname}) + + ```ts + job = await openPAIClient.job.getJob(username, jobname); + ``` + +- [x] Get job config (GET /api/v2/jobs/{username}~{jobname}/config) + + ```ts + config = await openPAIClient.job.getJobConfig(username, jobname); + ``` + +- [x] Start or stop a job (PUT /api/v2/jobs/{username}~{jobname}/exectionType) + + ```ts + await openPAIClient.job.updateJobExecutionType(username, jobname, 'START'); + await openPAIClient.job.updateJobExecutionType(username, jobname, 'STOP'); + ``` + +## job history + +- [x] Check if job attempts is healthy (GET /api/v2/jobs/{username}~{jobname}/job-attempts/healthz) + + ```ts + response = await openPAIClient.job.getJobAttemptsHealthz(username, jobname); + ``` + +- [x] Get all attempts of a job (GET /api/v2/jobs/{user}~{job}/job-attempts) + + ```ts + attempts = await openPAIClient.job.getJobAttempts(username, jobname); + ``` + +- [x] Get a specific attempt by attempt index (GET /api/v2/jobs/{user}~{job}/job-attempts/{attempt}) + + ```ts + attempt = await openPAIClient.job.getJobAttempt(username, jobname, index); + ``` + +## storage + +- [x] Get storage list (persistent volume claims) for current user (GET /api/v2/storages) + + ```ts + storages = await openPAIClient.storage.getStorages(); + ``` + +- [x] Get storage (persistent volume claim) for the given name (GET /api/v2/storages/{storagename}) + + ```ts + storage = await openPAIClient.storage.getStorage(storagename); + ``` + +## kubernetes + +- [x] Get kubernetes node list (GET /api/v2/kubernetes/nodes) + + ```ts + nodes = await openPAIClient.kubernetes.getK8sNodes(); + ``` + +- [x] Get kubernetes pod list (GET /api/v2/kubernetes/pods) + + ```ts + pods = await openPAIClient.kubernetes.getK8sPods(); + ``` diff --git a/docs/storage.md b/docs/storage.md index 2ae5f61..6059a69 100644 --- a/docs/storage.md +++ b/docs/storage.md @@ -1,90 +1,90 @@ -# Storage Operations - -Multiple types of storages are supported by OpenPAI, however, the end user and developers should not be bothered by too much details of it. The SDK offers an abstract storage accessing layer to let users access the cluster provisioned storages. - -## Fetch storage object -User could get the `IStorageNode` object for each cluster provisioned storage by - -```ts -// get a storage object with its name -let storageDetail: IStorageDetail = await opanPAIClient.storage.getStorageByName(name) -let storageNode: IStorageNode = new StorageNode(storageDetail) -``` - -**ToDo: change to new API document** - -The `storageNodeName` is the unique name for each storage node. Currently it is combined by the name of storage config (`storageConfigName`) and the mount point specified in it (`mountPoint`). The storage config could be queried by by the [get storage config API](https://redocly.github.io/redoc/?url=https://raw.githubusercontent.com/microsoft/pai/master/src/rest-server/docs/swagger.yaml#operation/getStorageConfigs), the response of which looks like below (more details about storage configuration refer to [here](https://github.com/microsoft/pai/tree/master/contrib/storage_plugin#config-data-structure-)) - -```json -{ - "name": "string", - "servers": [ - "string" - ], - "mountInfos": [ - { - "mountPoint": "string", - "path": "string", - "server": "string", - "permission": "string" - } - ] -} -``` -***Note that the storage config API is under changing, this doc will be updated when it is fixed*** - -## Access the storage - -The `IStorageNode` object provides essential methods to access the storage, such as query, copy and remove. - -- get status of a path - - ```ts - let stat: IFileInfo = await storageNode.getinfo(path); - let flagExists: bool = storageNode.existsSync(path); - let flagIsFolder: bool = storageNode.isdirSync(path); - ``` - -- list directory of a path - ```ts - let items: string[] = await storageNode.listdir(path) - ``` - -- delete (remove) a path - ```ts - await stoageNode.delete(path) - await stoageNode.deleteFolder(path) - ``` - -- create a directory - ```ts - await storageNode.makedir(path) - ``` - -- copy from local file (upload) - ```ts - await storageNode.upload(localPath, path) - await storageNode.uploadFolder(localPath, path) - ``` - -- copy to local file (download) - ```ts - await storageNode.download(path, localPath) - await storageNode.downloadFolder(path, localPath) - ``` - -- [TBD] open read or write file stream - -## CLI interface - -The users of CLI could be able to access the storage configs provisioned by the cluster like below -```bash -pai getinfo -a ${cluster} -s ${storageNodeName} path -pai listdir -a ${cluster} -s ${storageNodeName} path -pai makedir -a ${cluster} -s ${storageNodeName} path -pai delete -a ${cluster} -s ${storageNodeName} path -pai upload -a ${cluster} -s ${storageNodeName} localPath path -pai download -a ${cluster} -s ${storageNodeName} path localPath - -``` -Here, `${cluster}` is the cluster alias that could be indexed in local environment. +# Storage Operations + +Multiple types of storages are supported by OpenPAI, however, the end user and developers should not be bothered by too much details of it. The SDK offers an abstract storage accessing layer to let users access the cluster provisioned storages. + +## Fetch storage object +User could get the `IStorageNode` object for each cluster provisioned storage by + +```ts +// get a storage object with its name +let storageDetail: IStorageDetail = await opanPAIClient.storage.getStorageByName(name) +let storageNode: IStorageNode = new StorageNode(storageDetail) +``` + +**ToDo: change to new API document** + +The `storageNodeName` is the unique name for each storage node. Currently it is combined by the name of storage config (`storageConfigName`) and the mount point specified in it (`mountPoint`). The storage config could be queried by by the [get storage config API](https://redocly.github.io/redoc/?url=https://raw.githubusercontent.com/microsoft/pai/master/src/rest-server/docs/swagger.yaml#operation/getStorageConfigs), the response of which looks like below (more details about storage configuration refer to [here](https://github.com/microsoft/pai/tree/master/contrib/storage_plugin#config-data-structure-)) + +```json +{ + "name": "string", + "servers": [ + "string" + ], + "mountInfos": [ + { + "mountPoint": "string", + "path": "string", + "server": "string", + "permission": "string" + } + ] +} +``` +***Note that the storage config API is under changing, this doc will be updated when it is fixed*** + +## Access the storage + +The `IStorageNode` object provides essential methods to access the storage, such as query, copy and remove. + +- get status of a path + + ```ts + let stat: IFileInfo = await storageNode.getinfo(path); + let flagExists: bool = storageNode.existsSync(path); + let flagIsFolder: bool = storageNode.isdirSync(path); + ``` + +- list directory of a path + ```ts + let items: string[] = await storageNode.listdir(path) + ``` + +- delete (remove) a path + ```ts + await stoageNode.delete(path) + await stoageNode.deleteFolder(path) + ``` + +- create a directory + ```ts + await storageNode.makedir(path) + ``` + +- copy from local file (upload) + ```ts + await storageNode.upload(localPath, path) + await storageNode.uploadFolder(localPath, path) + ``` + +- copy to local file (download) + ```ts + await storageNode.download(path, localPath) + await storageNode.downloadFolder(path, localPath) + ``` + +- [TBD] open read or write file stream + +## CLI interface + +The users of CLI could be able to access the storage configs provisioned by the cluster like below +```bash +pai getinfo -a ${cluster} -s ${storageNodeName} path +pai listdir -a ${cluster} -s ${storageNodeName} path +pai makedir -a ${cluster} -s ${storageNodeName} path +pai delete -a ${cluster} -s ${storageNodeName} path +pai upload -a ${cluster} -s ${storageNodeName} localPath path +pai download -a ${cluster} -s ${storageNodeName} path localPath + +``` +Here, `${cluster}` is the cluster alias that could be indexed in local environment. From d79cebbd023856aebff2669a4ac3b535727962df Mon Sep 17 00:00:00 2001 From: Yi Yi Date: Mon, 15 Jun 2020 01:58:59 +0800 Subject: [PATCH 10/24] update --- tests/common/apiTestRunner.ts | 12 +++--------- tests/unit_tests/v2/v2.spec.ts | 6 +----- 2 files changed, 4 insertions(+), 14 deletions(-) diff --git a/tests/common/apiTestRunner.ts b/tests/common/apiTestRunner.ts index 8843739..5e16d6a 100644 --- a/tests/common/apiTestRunner.ts +++ b/tests/common/apiTestRunner.ts @@ -1,18 +1,12 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. -import { IPAIClusterInfo, OpenPAIClient } from '@api/v2'; -import ajv, { Ajv } from 'ajv'; -import * as chai from 'chai'; +import { OpenPAIClient } from '@api/v2'; +import { Ajv } from 'ajv'; import { expect } from 'chai'; -import dirtyChai from 'dirty-chai'; import nock from 'nock'; -import apiTestCaseJson from '../../.tests/apiTestCase.json'; - -import { IApiOperation, IApiTestCase } from './apiTestCaseGenerator'; -import { CustomizedTests } from './apiTestCases'; -import { TestCluster } from './testCluster'; +import { IApiOperation } from './apiTestCaseGenerator'; export interface IOperationResults { beforeEachResults: any[]; diff --git a/tests/unit_tests/v2/v2.spec.ts b/tests/unit_tests/v2/v2.spec.ts index be4b49e..b08724b 100644 --- a/tests/unit_tests/v2/v2.spec.ts +++ b/tests/unit_tests/v2/v2.spec.ts @@ -4,15 +4,12 @@ import { IPAICluster, IPAIClusterInfo, OpenPAIClient } from '@api/v2'; import ajv, { Ajv } from 'ajv'; import * as chai from 'chai'; -import { expect } from 'chai'; import dirtyChai from 'dirty-chai'; import nock from 'nock'; import apiTestCaseJson from '../../../.tests/apiTestCase.json'; -import { IApiOperation, IApiTestCase } from '../../common/apiTestCaseGenerator'; -import { CustomizedTests } from '../../common/apiTestCases'; +import { IApiTestCase } from '../../common/apiTestCaseGenerator'; import { ApiTestRunner } from '../../common/apiTestRunner'; -import { TestCluster } from '../../common/testCluster'; /** * End to end tests for OpenPAI API v2. @@ -30,7 +27,6 @@ const testToken: string = const testUrl: string = 'https://openpai.test/rest-server'; const apiGetClusterInfo: string = '/api/v2/info'; -const basicLogin: string = '/api/v2/authn/basic/login'; const testClusterInfo: IPAIClusterInfo = { name: 'PAI RESTful API', From d973b7cbc328d2d6d28172cc44036aaace0ad6c4 Mon Sep 17 00:00:00 2001 From: Yi Yi Date: Mon, 15 Jun 2020 03:27:48 +0800 Subject: [PATCH 11/24] add nyc --- .gitignore | 2 + .nycrc | 14 + package-lock.json | 1234 ++++++++++++++++++++++++++++++++++++++++++-- package.json | 10 +- tsconfig.base.json | 1 + 5 files changed, 1218 insertions(+), 43 deletions(-) create mode 100644 .nycrc diff --git a/.gitignore b/.gitignore index df923da..fde34db 100644 --- a/.gitignore +++ b/.gitignore @@ -6,3 +6,5 @@ node_modules .tests/ .lib/ lib/ +.nyc_output/ +coverage/ diff --git a/.nycrc b/.nycrc new file mode 100644 index 0000000..ceeda07 --- /dev/null +++ b/.nycrc @@ -0,0 +1,14 @@ +{ + "extends": "@istanbuljs/nyc-config-typescript", + "all": true, + "cache": false, + "include": [ + "src/**/*.ts", + "lib/src/**/*.js" + ], + "require": [ + "ts-node/register", + "source-map-support/register", + "tsconfig-paths/register" + ] +} diff --git a/package-lock.json b/package-lock.json index a7b6c14..4ee4f61 100644 --- a/package-lock.json +++ b/package-lock.json @@ -146,12 +146,204 @@ "@babel/highlight": "^7.8.3" } }, + "@babel/core": { + "version": "7.10.2", + "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.10.2.tgz", + "integrity": "sha512-KQmV9yguEjQsXqyOUGKjS4+3K8/DlOCE2pZcq4augdQmtTy5iv5EHtmMSJ7V4c1BIPjuwtZYqYLCq9Ga+hGBRQ==", + "dev": true, + "requires": { + "@babel/code-frame": "^7.10.1", + "@babel/generator": "^7.10.2", + "@babel/helper-module-transforms": "^7.10.1", + "@babel/helpers": "^7.10.1", + "@babel/parser": "^7.10.2", + "@babel/template": "^7.10.1", + "@babel/traverse": "^7.10.1", + "@babel/types": "^7.10.2", + "convert-source-map": "^1.7.0", + "debug": "^4.1.0", + "gensync": "^1.0.0-beta.1", + "json5": "^2.1.2", + "lodash": "^4.17.13", + "resolve": "^1.3.2", + "semver": "^5.4.1", + "source-map": "^0.5.0" + }, + "dependencies": { + "@babel/code-frame": { + "version": "7.10.1", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.10.1.tgz", + "integrity": "sha512-IGhtTmpjGbYzcEDOw7DcQtbQSXcG9ftmAXtWTu9V936vDye4xjjekktFAtgZsWpzTj/X01jocB46mTywm/4SZw==", + "dev": true, + "requires": { + "@babel/highlight": "^7.10.1" + } + }, + "@babel/helper-validator-identifier": { + "version": "7.10.1", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.10.1.tgz", + "integrity": "sha512-5vW/JXLALhczRCWP0PnFDMCJAchlBvM7f4uk/jXritBnIa6E1KmqmtrS3yn1LAnxFBypQ3eneLuXjsnfQsgILw==", + "dev": true + }, + "@babel/highlight": { + "version": "7.10.1", + "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.10.1.tgz", + "integrity": "sha512-8rMof+gVP8mxYZApLF/JgNDAkdKa+aJt3ZYxF8z6+j/hpeXL7iMsKCPHa2jNMHu/qqBwzQF4OHNoYi8dMA/rYg==", + "dev": true, + "requires": { + "@babel/helper-validator-identifier": "^7.10.1", + "chalk": "^2.0.0", + "js-tokens": "^4.0.0" + } + }, + "debug": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.1.1.tgz", + "integrity": "sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw==", + "dev": true, + "requires": { + "ms": "^2.1.1" + } + }, + "json5": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/json5/-/json5-2.1.3.tgz", + "integrity": "sha512-KXPvOm8K9IJKFM0bmdn8QXh7udDh1g/giieX0NLCaMnb4hEiVFqnop2ImTXCc5e0/oHz3LTqmHGtExn5hfMkOA==", + "dev": true, + "requires": { + "minimist": "^1.2.5" + } + }, + "ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", + "dev": true + } + } + }, + "@babel/generator": { + "version": "7.10.2", + "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.10.2.tgz", + "integrity": "sha512-AxfBNHNu99DTMvlUPlt1h2+Hn7knPpH5ayJ8OqDWSeLld+Fi2AYBTC/IejWDM9Edcii4UzZRCsbUt0WlSDsDsA==", + "dev": true, + "requires": { + "@babel/types": "^7.10.2", + "jsesc": "^2.5.1", + "lodash": "^4.17.13", + "source-map": "^0.5.0" + } + }, + "@babel/helper-function-name": { + "version": "7.10.1", + "resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.10.1.tgz", + "integrity": "sha512-fcpumwhs3YyZ/ttd5Rz0xn0TpIwVkN7X0V38B9TWNfVF42KEkhkAAuPCQ3oXmtTRtiPJrmZ0TrfS0GKF0eMaRQ==", + "dev": true, + "requires": { + "@babel/helper-get-function-arity": "^7.10.1", + "@babel/template": "^7.10.1", + "@babel/types": "^7.10.1" + } + }, + "@babel/helper-get-function-arity": { + "version": "7.10.1", + "resolved": "https://registry.npmjs.org/@babel/helper-get-function-arity/-/helper-get-function-arity-7.10.1.tgz", + "integrity": "sha512-F5qdXkYGOQUb0hpRaPoetF9AnsXknKjWMZ+wmsIRsp5ge5sFh4c3h1eH2pRTTuy9KKAA2+TTYomGXAtEL2fQEw==", + "dev": true, + "requires": { + "@babel/types": "^7.10.1" + } + }, + "@babel/helper-member-expression-to-functions": { + "version": "7.10.1", + "resolved": "https://registry.npmjs.org/@babel/helper-member-expression-to-functions/-/helper-member-expression-to-functions-7.10.1.tgz", + "integrity": "sha512-u7XLXeM2n50gb6PWJ9hoO5oO7JFPaZtrh35t8RqKLT1jFKj9IWeD1zrcrYp1q1qiZTdEarfDWfTIP8nGsu0h5g==", + "dev": true, + "requires": { + "@babel/types": "^7.10.1" + } + }, + "@babel/helper-module-imports": { + "version": "7.10.1", + "resolved": "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.10.1.tgz", + "integrity": "sha512-SFxgwYmZ3HZPyZwJRiVNLRHWuW2OgE5k2nrVs6D9Iv4PPnXVffuEHy83Sfx/l4SqF+5kyJXjAyUmrG7tNm+qVg==", + "dev": true, + "requires": { + "@babel/types": "^7.10.1" + } + }, + "@babel/helper-module-transforms": { + "version": "7.10.1", + "resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.10.1.tgz", + "integrity": "sha512-RLHRCAzyJe7Q7sF4oy2cB+kRnU4wDZY/H2xJFGof+M+SJEGhZsb+GFj5j1AD8NiSaVBJ+Pf0/WObiXu/zxWpFg==", + "dev": true, + "requires": { + "@babel/helper-module-imports": "^7.10.1", + "@babel/helper-replace-supers": "^7.10.1", + "@babel/helper-simple-access": "^7.10.1", + "@babel/helper-split-export-declaration": "^7.10.1", + "@babel/template": "^7.10.1", + "@babel/types": "^7.10.1", + "lodash": "^4.17.13" + } + }, + "@babel/helper-optimise-call-expression": { + "version": "7.10.1", + "resolved": "https://registry.npmjs.org/@babel/helper-optimise-call-expression/-/helper-optimise-call-expression-7.10.1.tgz", + "integrity": "sha512-a0DjNS1prnBsoKx83dP2falChcs7p3i8VMzdrSbfLhuQra/2ENC4sbri34dz/rWmDADsmF1q5GbfaXydh0Jbjg==", + "dev": true, + "requires": { + "@babel/types": "^7.10.1" + } + }, + "@babel/helper-replace-supers": { + "version": "7.10.1", + "resolved": "https://registry.npmjs.org/@babel/helper-replace-supers/-/helper-replace-supers-7.10.1.tgz", + "integrity": "sha512-SOwJzEfpuQwInzzQJGjGaiG578UYmyi2Xw668klPWV5n07B73S0a9btjLk/52Mlcxa+5AdIYqws1KyXRfMoB7A==", + "dev": true, + "requires": { + "@babel/helper-member-expression-to-functions": "^7.10.1", + "@babel/helper-optimise-call-expression": "^7.10.1", + "@babel/traverse": "^7.10.1", + "@babel/types": "^7.10.1" + } + }, + "@babel/helper-simple-access": { + "version": "7.10.1", + "resolved": "https://registry.npmjs.org/@babel/helper-simple-access/-/helper-simple-access-7.10.1.tgz", + "integrity": "sha512-VSWpWzRzn9VtgMJBIWTZ+GP107kZdQ4YplJlCmIrjoLVSi/0upixezHCDG8kpPVTBJpKfxTH01wDhh+jS2zKbw==", + "dev": true, + "requires": { + "@babel/template": "^7.10.1", + "@babel/types": "^7.10.1" + } + }, + "@babel/helper-split-export-declaration": { + "version": "7.10.1", + "resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.10.1.tgz", + "integrity": "sha512-UQ1LVBPrYdbchNhLwj6fetj46BcFwfS4NllJo/1aJsT+1dLTEnXJL0qHqtY7gPzF8S2fXBJamf1biAXV3X077g==", + "dev": true, + "requires": { + "@babel/types": "^7.10.1" + } + }, "@babel/helper-validator-identifier": { "version": "7.9.5", "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.9.5.tgz", "integrity": "sha512-/8arLKUFq882w4tWGj9JYzRpAlZgiWUJ+dtteNTDqrRBz9Iguck9Rn3ykuBDoUwh2TO4tSAJlrxDUOXWklJe4g==", "dev": true }, + "@babel/helpers": { + "version": "7.10.1", + "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.10.1.tgz", + "integrity": "sha512-muQNHF+IdU6wGgkaJyhhEmI54MOZBKsFfsXFhboz1ybwJ1Kl7IHlbm2a++4jwrmY5UYsgitt5lfqo1wMFcHmyw==", + "dev": true, + "requires": { + "@babel/template": "^7.10.1", + "@babel/traverse": "^7.10.1", + "@babel/types": "^7.10.1" + } + }, "@babel/highlight": { "version": "7.9.0", "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.9.0.tgz", @@ -163,6 +355,194 @@ "js-tokens": "^4.0.0" } }, + "@babel/parser": { + "version": "7.10.2", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.10.2.tgz", + "integrity": "sha512-PApSXlNMJyB4JiGVhCOlzKIif+TKFTvu0aQAhnTvfP/z3vVSN6ZypH5bfUNwFXXjRQtUEBNFd2PtmCmG2Py3qQ==", + "dev": true + }, + "@babel/template": { + "version": "7.10.1", + "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.10.1.tgz", + "integrity": "sha512-OQDg6SqvFSsc9A0ej6SKINWrpJiNonRIniYondK2ViKhB06i3c0s+76XUft71iqBEe9S1OKsHwPAjfHnuvnCig==", + "dev": true, + "requires": { + "@babel/code-frame": "^7.10.1", + "@babel/parser": "^7.10.1", + "@babel/types": "^7.10.1" + }, + "dependencies": { + "@babel/code-frame": { + "version": "7.10.1", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.10.1.tgz", + "integrity": "sha512-IGhtTmpjGbYzcEDOw7DcQtbQSXcG9ftmAXtWTu9V936vDye4xjjekktFAtgZsWpzTj/X01jocB46mTywm/4SZw==", + "dev": true, + "requires": { + "@babel/highlight": "^7.10.1" + } + }, + "@babel/helper-validator-identifier": { + "version": "7.10.1", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.10.1.tgz", + "integrity": "sha512-5vW/JXLALhczRCWP0PnFDMCJAchlBvM7f4uk/jXritBnIa6E1KmqmtrS3yn1LAnxFBypQ3eneLuXjsnfQsgILw==", + "dev": true + }, + "@babel/highlight": { + "version": "7.10.1", + "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.10.1.tgz", + "integrity": "sha512-8rMof+gVP8mxYZApLF/JgNDAkdKa+aJt3ZYxF8z6+j/hpeXL7iMsKCPHa2jNMHu/qqBwzQF4OHNoYi8dMA/rYg==", + "dev": true, + "requires": { + "@babel/helper-validator-identifier": "^7.10.1", + "chalk": "^2.0.0", + "js-tokens": "^4.0.0" + } + } + } + }, + "@babel/traverse": { + "version": "7.10.1", + "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.10.1.tgz", + "integrity": "sha512-C/cTuXeKt85K+p08jN6vMDz8vSV0vZcI0wmQ36o6mjbuo++kPMdpOYw23W2XH04dbRt9/nMEfA4W3eR21CD+TQ==", + "dev": true, + "requires": { + "@babel/code-frame": "^7.10.1", + "@babel/generator": "^7.10.1", + "@babel/helper-function-name": "^7.10.1", + "@babel/helper-split-export-declaration": "^7.10.1", + "@babel/parser": "^7.10.1", + "@babel/types": "^7.10.1", + "debug": "^4.1.0", + "globals": "^11.1.0", + "lodash": "^4.17.13" + }, + "dependencies": { + "@babel/code-frame": { + "version": "7.10.1", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.10.1.tgz", + "integrity": "sha512-IGhtTmpjGbYzcEDOw7DcQtbQSXcG9ftmAXtWTu9V936vDye4xjjekktFAtgZsWpzTj/X01jocB46mTywm/4SZw==", + "dev": true, + "requires": { + "@babel/highlight": "^7.10.1" + } + }, + "@babel/helper-validator-identifier": { + "version": "7.10.1", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.10.1.tgz", + "integrity": "sha512-5vW/JXLALhczRCWP0PnFDMCJAchlBvM7f4uk/jXritBnIa6E1KmqmtrS3yn1LAnxFBypQ3eneLuXjsnfQsgILw==", + "dev": true + }, + "@babel/highlight": { + "version": "7.10.1", + "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.10.1.tgz", + "integrity": "sha512-8rMof+gVP8mxYZApLF/JgNDAkdKa+aJt3ZYxF8z6+j/hpeXL7iMsKCPHa2jNMHu/qqBwzQF4OHNoYi8dMA/rYg==", + "dev": true, + "requires": { + "@babel/helper-validator-identifier": "^7.10.1", + "chalk": "^2.0.0", + "js-tokens": "^4.0.0" + } + }, + "debug": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.1.1.tgz", + "integrity": "sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw==", + "dev": true, + "requires": { + "ms": "^2.1.1" + } + }, + "ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", + "dev": true + } + } + }, + "@babel/types": { + "version": "7.10.2", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.10.2.tgz", + "integrity": "sha512-AD3AwWBSz0AWF0AkCN9VPiWrvldXq+/e3cHa4J89vo4ymjz1XwrBFFVZmkJTsQIPNk+ZVomPSXUJqq8yyjZsng==", + "dev": true, + "requires": { + "@babel/helper-validator-identifier": "^7.10.1", + "lodash": "^4.17.13", + "to-fast-properties": "^2.0.0" + }, + "dependencies": { + "@babel/helper-validator-identifier": { + "version": "7.10.1", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.10.1.tgz", + "integrity": "sha512-5vW/JXLALhczRCWP0PnFDMCJAchlBvM7f4uk/jXritBnIa6E1KmqmtrS3yn1LAnxFBypQ3eneLuXjsnfQsgILw==", + "dev": true + } + } + }, + "@istanbuljs/load-nyc-config": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@istanbuljs/load-nyc-config/-/load-nyc-config-1.1.0.tgz", + "integrity": "sha512-VjeHSlIzpv/NyD3N0YuHfXOPDIixcA1q2ZV98wsMqcYlPmv2n3Yb2lYP9XMElnaFVXg5A7YLTeLu6V84uQDjmQ==", + "dev": true, + "requires": { + "camelcase": "^5.3.1", + "find-up": "^4.1.0", + "get-package-type": "^0.1.0", + "js-yaml": "^3.13.1", + "resolve-from": "^5.0.0" + }, + "dependencies": { + "find-up": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", + "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==", + "dev": true, + "requires": { + "locate-path": "^5.0.0", + "path-exists": "^4.0.0" + } + }, + "locate-path": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", + "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==", + "dev": true, + "requires": { + "p-locate": "^4.1.0" + } + }, + "p-locate": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz", + "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==", + "dev": true, + "requires": { + "p-limit": "^2.2.0" + } + }, + "path-exists": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", + "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", + "dev": true + } + } + }, + "@istanbuljs/nyc-config-typescript": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@istanbuljs/nyc-config-typescript/-/nyc-config-typescript-1.0.1.tgz", + "integrity": "sha512-/gz6LgVpky205LuoOfwEZmnUtaSmdk0QIMcNFj9OvxhiMhPpKftMgZmGN7jNj7jR+lr8IB1Yks3QSSSNSxfoaQ==", + "dev": true, + "requires": { + "@istanbuljs/schema": "^0.1.2" + } + }, + "@istanbuljs/schema": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/@istanbuljs/schema/-/schema-0.1.2.tgz", + "integrity": "sha512-tsAQNx32a8CoFhjhijUIhI4kccIAgmGhy8LZMZgGfmXcpMbPRUqn5LWmgRttILi6yeGmBJd2xsPkFMs0PzgPCw==", + "dev": true + }, "@jsdevtools/ono": { "version": "7.1.2", "resolved": "https://registry.npmjs.org/@jsdevtools/ono/-/ono-7.1.2.tgz", @@ -205,6 +585,12 @@ "@types/chai": "*" } }, + "@types/color-name": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/@types/color-name/-/color-name-1.1.1.tgz", + "integrity": "sha512-rr+OQyAjxze7GgWrSaJwydHStIhHq2lvY3BOC2Mj7KnzI7XK0Uw1TOOdI9lDoajEbSWLiYgoo4f1R51erQfhPQ==", + "dev": true + }, "@types/dirty-chai": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/@types/dirty-chai/-/dirty-chai-2.0.2.tgz", @@ -334,6 +720,16 @@ "@types/node": "*" } }, + "aggregate-error": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/aggregate-error/-/aggregate-error-3.0.1.tgz", + "integrity": "sha512-quoaXsZ9/BLNae5yiNoUz+Nhkwz83GhWwtYFglcjEQB2NDHCIpApbqXxIFnm4Pq/Nvhrsq5sYJFyohrrxnTGAA==", + "dev": true, + "requires": { + "clean-stack": "^2.0.0", + "indent-string": "^4.0.0" + } + }, "ajv": { "version": "6.12.2", "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.2.tgz", @@ -365,6 +761,21 @@ "color-convert": "^1.9.0" } }, + "append-transform": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/append-transform/-/append-transform-2.0.0.tgz", + "integrity": "sha512-7yeyCEurROLQJFv5Xj4lEGTy0borxepjFv1g22oAdqFu//SrAlDl1O1Nxx15SH1RoliUml6p8dwJW9jvZughhg==", + "dev": true, + "requires": { + "default-require-extensions": "^3.0.0" + } + }, + "archy": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/archy/-/archy-1.0.0.tgz", + "integrity": "sha1-+cjBN1fMHde8N5rHeyxipcKGjEA=", + "dev": true + }, "arg": { "version": "4.1.3", "resolved": "https://registry.npmjs.org/arg/-/arg-4.1.3.tgz", @@ -468,6 +879,18 @@ "integrity": "sha1-Jw8HbFpywC9bZaR9+Uxf46J4iS8=", "dev": true }, + "caching-transform": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/caching-transform/-/caching-transform-4.0.0.tgz", + "integrity": "sha512-kpqOvwXnjjN44D89K5ccQC+RUrsy7jB/XLlRrx0D7/2HNcTPqzsb6XgYoErwko6QsV184CA2YgS1fxDiiDZMWA==", + "dev": true, + "requires": { + "hasha": "^5.0.0", + "make-dir": "^3.0.0", + "package-hash": "^4.0.0", + "write-file-atomic": "^3.0.0" + } + }, "call-me-maybe": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/call-me-maybe/-/call-me-maybe-1.0.1.tgz", @@ -526,6 +949,12 @@ "integrity": "sha1-V00xLt2Iu13YkS6Sht1sCu1KrII=", "dev": true }, + "clean-stack": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/clean-stack/-/clean-stack-2.2.0.tgz", + "integrity": "sha512-4diC9HaTE+KRAMWhDhrGOECgWZxoevMc5TlkObMqNSsVU62PYzXZ/SMTjzyGAFF1YusgxGcSWTEXBhp0CPwQ1A==", + "dev": true + }, "cliui": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/cliui/-/cliui-5.0.0.tgz", @@ -591,12 +1020,35 @@ "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz", "integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==" }, + "commondir": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/commondir/-/commondir-1.0.1.tgz", + "integrity": "sha1-3dgA2gxmEnOTzKWVDqloo6rxJTs=", + "dev": true + }, "concat-map": { "version": "0.0.1", "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=", "dev": true }, + "convert-source-map": { + "version": "1.7.0", + "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.7.0.tgz", + "integrity": "sha512-4FJkXzKXEDB1snCFZlLP4gpC3JILicCpGbzG9f9G7tGqGCzETQ2hWPrcinA9oU4wtf2biUaEH5065UnMeR33oA==", + "dev": true, + "requires": { + "safe-buffer": "~5.1.1" + }, + "dependencies": { + "safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", + "dev": true + } + } + }, "core-util-is": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", @@ -615,6 +1067,28 @@ "request": "^2.88.2" } }, + "cross-spawn": { + "version": "7.0.3", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", + "integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==", + "dev": true, + "requires": { + "path-key": "^3.1.0", + "shebang-command": "^2.0.0", + "which": "^2.0.1" + }, + "dependencies": { + "which": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", + "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", + "dev": true, + "requires": { + "isexe": "^2.0.0" + } + } + } + }, "dashdash": { "version": "1.14.1", "resolved": "https://registry.npmjs.org/dashdash/-/dashdash-1.14.1.tgz", @@ -646,6 +1120,23 @@ "type-detect": "^4.0.0" } }, + "default-require-extensions": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/default-require-extensions/-/default-require-extensions-3.0.0.tgz", + "integrity": "sha512-ek6DpXq/SCpvjhpFsLFRVtIxJCRw6fUR42lYMVZuUMK7n8eMz4Uh5clckdBjEpLhn/gEBZo7hDJnJcwdKLKQjg==", + "dev": true, + "requires": { + "strip-bom": "^4.0.0" + }, + "dependencies": { + "strip-bom": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-4.0.0.tgz", + "integrity": "sha512-3xurFv5tEgii33Zi8Jtp55wEIILR9eh34FAW00PZf+JnSsTmV/ioewSgQl97JHvgjoRGwPShsWm+IdrxB35d0w==", + "dev": true + } + } + }, "define-properties": { "version": "1.1.3", "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.1.3.tgz", @@ -716,6 +1207,12 @@ "is-symbol": "^1.0.2" } }, + "es6-error": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/es6-error/-/es6-error-4.1.1.tgz", + "integrity": "sha512-Um/+FxMr9CISWh0bi5Zv0iOD+4cFh5qLeks1qhAopKVAJw3drgKbKySikp7wGhDL0HPeaja0P5ULZrxLkniUVg==", + "dev": true + }, "escape-string-regexp": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", @@ -752,6 +1249,17 @@ "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz", "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==" }, + "find-cache-dir": { + "version": "3.3.1", + "resolved": "https://registry.npmjs.org/find-cache-dir/-/find-cache-dir-3.3.1.tgz", + "integrity": "sha512-t2GDMt3oGC/v+BMwzmllWDuJF/xcDtE5j/fCGbqDD7OLuJkj0cfh1YSA5VKPvwMeLFLNDBkwOKZ2X85jGLVftQ==", + "dev": true, + "requires": { + "commondir": "^1.0.1", + "make-dir": "^3.0.2", + "pkg-dir": "^4.1.0" + } + }, "find-up": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/find-up/-/find-up-3.0.0.tgz", @@ -778,6 +1286,16 @@ "debug": "=3.1.0" } }, + "foreground-child": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/foreground-child/-/foreground-child-2.0.0.tgz", + "integrity": "sha512-dCIq9FpEcyQyXKCkyzmlPTFNgrCzPudOe+mhvJU5zAtlBnGVy2yKxtfsxK2tQBThwq225jcvBjpw1Gr40uzZCA==", + "dev": true, + "requires": { + "cross-spawn": "^7.0.0", + "signal-exit": "^3.0.2" + } + }, "forever-agent": { "version": "0.6.1", "resolved": "https://registry.npmjs.org/forever-agent/-/forever-agent-0.6.1.tgz", @@ -793,6 +1311,12 @@ "mime-types": "^2.1.12" } }, + "fromentries": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/fromentries/-/fromentries-1.2.0.tgz", + "integrity": "sha512-33X7H/wdfO99GdRLLgkjUrD4geAFdq/Uv0kl3HD4da6HDixd2GUg8Mw7dahLCV9r/EARkmtYBB6Tch4EEokFTQ==", + "dev": true + }, "fs-extra": { "version": "8.1.0", "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-8.1.0.tgz", @@ -815,6 +1339,12 @@ "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==", "dev": true }, + "gensync": { + "version": "1.0.0-beta.1", + "resolved": "https://registry.npmjs.org/gensync/-/gensync-1.0.0-beta.1.tgz", + "integrity": "sha512-r8EC6NO1sngH/zdD9fiRDLdcgnbayXah+mLgManTaIZJqEC1MZstmnox8KpnI2/fxQwrp5OpCOYWLp4rBl4Jcg==", + "dev": true + }, "get-caller-file": { "version": "2.0.5", "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", @@ -827,6 +1357,12 @@ "integrity": "sha1-6td0q+5y4gQJQzoGY2YCPdaIekE=", "dev": true }, + "get-package-type": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/get-package-type/-/get-package-type-0.1.0.tgz", + "integrity": "sha512-pjzuKtY64GYfWizNAJ0fr9VqttZkNiK2iS430LtIHzjBEr6bX8Am2zm4sW4Ro5wjWW5cAlRL1qAMTcXbjNAO2Q==", + "dev": true + }, "getpass": { "version": "0.1.7", "resolved": "https://registry.npmjs.org/getpass/-/getpass-0.1.7.tgz", @@ -849,6 +1385,12 @@ "path-is-absolute": "^1.0.0" } }, + "globals": { + "version": "11.12.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-11.12.0.tgz", + "integrity": "sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA==", + "dev": true + }, "graceful-fs": { "version": "4.2.3", "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.3.tgz", @@ -895,12 +1437,28 @@ "integrity": "sha512-PLcsoqu++dmEIZB+6totNFKq/7Do+Z0u4oT0zKOJNl3lYK6vGwwu2hjHs+68OEZbTjiUE9bgOABXbP/GvrS0Kg==", "dev": true }, + "hasha": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/hasha/-/hasha-5.2.0.tgz", + "integrity": "sha512-2W+jKdQbAdSIrggA8Q35Br8qKadTrqCTC8+XZvBWepKDK6m9XkX6Iz1a2yh2KP01kzAR/dpuMeUnocoLYDcskw==", + "dev": true, + "requires": { + "is-stream": "^2.0.0", + "type-fest": "^0.8.0" + } + }, "he": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/he/-/he-1.2.0.tgz", "integrity": "sha512-F/1DnUGPopORZi0ni+CvrCgHQ5FyEAHRLSApuYWMmrbSwoN2Mn/7k+Gl38gJnR7yyDZk6WLXwiGod1JOWNDKGw==", "dev": true }, + "html-escaper": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/html-escaper/-/html-escaper-2.0.2.tgz", + "integrity": "sha512-H2iMtd0I4Mt5eYiapRdIDjp+XzelXQ0tFE4JS7YFwFevXXMmOp9myNrUvCg0D6ws8iqkRPBfKHgbwig1SmlLfg==", + "dev": true + }, "http-signature": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/http-signature/-/http-signature-1.2.0.tgz", @@ -911,6 +1469,18 @@ "sshpk": "^1.7.0" } }, + "imurmurhash": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", + "integrity": "sha1-khi5srkoojixPcT7a21XbyMUU+o=", + "dev": true + }, + "indent-string": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/indent-string/-/indent-string-4.0.0.tgz", + "integrity": "sha512-EdDDZu4A2OyIK7Lr/2zG+w5jmbuk1DVBnEwREQvBzspBJkCEbRa8GxU1lghYcaGJCnRWibjDXlq779X1/y5xwg==", + "dev": true + }, "inflight": { "version": "1.0.6", "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", @@ -955,39 +1525,173 @@ "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=" }, - "is-regex": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.0.5.tgz", - "integrity": "sha512-vlKW17SNq44owv5AQR3Cq0bQPEb8+kF3UKZ2fiZNOWtztYE5i0CzCZxFDwO58qAOWtxdBRVO/V5Qin1wjCqFYQ==", + "is-regex": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.0.5.tgz", + "integrity": "sha512-vlKW17SNq44owv5AQR3Cq0bQPEb8+kF3UKZ2fiZNOWtztYE5i0CzCZxFDwO58qAOWtxdBRVO/V5Qin1wjCqFYQ==", + "dev": true, + "requires": { + "has": "^1.0.3" + } + }, + "is-stream": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-2.0.0.tgz", + "integrity": "sha512-XCoy+WlUr7d1+Z8GgSuXmpuUFC9fOhRXglJMx+dwLKTkL44Cjd4W1Z5P+BQZpr+cR93aGP4S/s7Ftw6Nd/kiEw==", + "dev": true + }, + "is-symbol": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/is-symbol/-/is-symbol-1.0.3.tgz", + "integrity": "sha512-OwijhaRSgqvhm/0ZdAcXNZt9lYdKFpcRDT5ULUuYXPoT794UNOdU+gpT6Rzo7b4V2HUl/op6GqY894AZwv9faQ==", + "dev": true, + "requires": { + "has-symbols": "^1.0.1" + } + }, + "is-typedarray": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-typedarray/-/is-typedarray-1.0.0.tgz", + "integrity": "sha1-5HnICFjfDBsR3dppQPlgEfzaSpo=" + }, + "is-windows": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-windows/-/is-windows-1.0.2.tgz", + "integrity": "sha512-eXK1UInq2bPmjyX6e3VHIzMLobc4J94i4AWn+Hpq3OU5KkrRC96OAcR3PRJ/pGu6m8TRnBHP9dkXQVsT/COVIA==", + "dev": true + }, + "isexe": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", + "integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=", + "dev": true + }, + "isstream": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/isstream/-/isstream-0.1.2.tgz", + "integrity": "sha1-R+Y/evVa+m+S4VAOaQ64uFKcCZo=" + }, + "istanbul-lib-coverage": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/istanbul-lib-coverage/-/istanbul-lib-coverage-3.0.0.tgz", + "integrity": "sha512-UiUIqxMgRDET6eR+o5HbfRYP1l0hqkWOs7vNxC/mggutCMUIhWMm8gAHb8tHlyfD3/l6rlgNA5cKdDzEAf6hEg==", + "dev": true + }, + "istanbul-lib-hook": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/istanbul-lib-hook/-/istanbul-lib-hook-3.0.0.tgz", + "integrity": "sha512-Pt/uge1Q9s+5VAZ+pCo16TYMWPBIl+oaNIjgLQxcX0itS6ueeaA+pEfThZpH8WxhFgCiEb8sAJY6MdUKgiIWaQ==", + "dev": true, + "requires": { + "append-transform": "^2.0.0" + } + }, + "istanbul-lib-instrument": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/istanbul-lib-instrument/-/istanbul-lib-instrument-4.0.3.tgz", + "integrity": "sha512-BXgQl9kf4WTCPCCpmFGoJkz/+uhvm7h7PFKUYxh7qarQd3ER33vHG//qaE8eN25l07YqZPpHXU9I09l/RD5aGQ==", + "dev": true, + "requires": { + "@babel/core": "^7.7.5", + "@istanbuljs/schema": "^0.1.2", + "istanbul-lib-coverage": "^3.0.0", + "semver": "^6.3.0" + }, + "dependencies": { + "semver": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", + "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", + "dev": true + } + } + }, + "istanbul-lib-processinfo": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/istanbul-lib-processinfo/-/istanbul-lib-processinfo-2.0.2.tgz", + "integrity": "sha512-kOwpa7z9hme+IBPZMzQ5vdQj8srYgAtaRqeI48NGmAQ+/5yKiHLV0QbYqQpxsdEF0+w14SoB8YbnHKcXE2KnYw==", "dev": true, "requires": { - "has": "^1.0.3" + "archy": "^1.0.0", + "cross-spawn": "^7.0.0", + "istanbul-lib-coverage": "^3.0.0-alpha.1", + "make-dir": "^3.0.0", + "p-map": "^3.0.0", + "rimraf": "^3.0.0", + "uuid": "^3.3.3" } }, - "is-symbol": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/is-symbol/-/is-symbol-1.0.3.tgz", - "integrity": "sha512-OwijhaRSgqvhm/0ZdAcXNZt9lYdKFpcRDT5ULUuYXPoT794UNOdU+gpT6Rzo7b4V2HUl/op6GqY894AZwv9faQ==", + "istanbul-lib-report": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/istanbul-lib-report/-/istanbul-lib-report-3.0.0.tgz", + "integrity": "sha512-wcdi+uAKzfiGT2abPpKZ0hSU1rGQjUQnLvtY5MpQ7QCTahD3VODhcu4wcfY1YtkGaDD5yuydOLINXsfbus9ROw==", "dev": true, "requires": { - "has-symbols": "^1.0.1" + "istanbul-lib-coverage": "^3.0.0", + "make-dir": "^3.0.0", + "supports-color": "^7.1.0" + }, + "dependencies": { + "has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true + }, + "supports-color": { + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.1.0.tgz", + "integrity": "sha512-oRSIpR8pxT1Wr2FquTNnGet79b3BWljqOuoW/h4oBhxJ/HUbX5nX6JSruTkvXDCFMwDPvsaTTbvMLKZWSy0R5g==", + "dev": true, + "requires": { + "has-flag": "^4.0.0" + } + } } }, - "is-typedarray": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-typedarray/-/is-typedarray-1.0.0.tgz", - "integrity": "sha1-5HnICFjfDBsR3dppQPlgEfzaSpo=" - }, - "isexe": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", - "integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=", - "dev": true + "istanbul-lib-source-maps": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/istanbul-lib-source-maps/-/istanbul-lib-source-maps-4.0.0.tgz", + "integrity": "sha512-c16LpFRkR8vQXyHZ5nLpY35JZtzj1PQY1iZmesUbf1FZHbIupcWfjgOXBY9YHkLEQ6puz1u4Dgj6qmU/DisrZg==", + "dev": true, + "requires": { + "debug": "^4.1.1", + "istanbul-lib-coverage": "^3.0.0", + "source-map": "^0.6.1" + }, + "dependencies": { + "debug": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.1.1.tgz", + "integrity": "sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw==", + "dev": true, + "requires": { + "ms": "^2.1.1" + } + }, + "ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", + "dev": true + }, + "source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "dev": true + } + } }, - "isstream": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/isstream/-/isstream-0.1.2.tgz", - "integrity": "sha1-R+Y/evVa+m+S4VAOaQ64uFKcCZo=" + "istanbul-reports": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/istanbul-reports/-/istanbul-reports-3.0.2.tgz", + "integrity": "sha512-9tZvz7AiR3PEDNGiV9vIouQ/EAcqMXFmkcA1CDFTwOB98OZVDL0PH9glHotf5Ugp6GCOTypfzGWI/OqjWNCRUw==", + "dev": true, + "requires": { + "html-escaper": "^2.0.0", + "istanbul-lib-report": "^3.0.0" + } }, "js-tokens": { "version": "4.0.0", @@ -1009,6 +1713,12 @@ "resolved": "https://registry.npmjs.org/jsbn/-/jsbn-0.1.1.tgz", "integrity": "sha1-peZUwuWi3rXyAdls77yoDA7y9RM=" }, + "jsesc": { + "version": "2.5.2", + "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-2.5.2.tgz", + "integrity": "sha512-OYu7XEzjkCQ3C5Ps3QIZsQfNpqoJyZZA99wd9aWd05NCtC5pWOkShK2mkL6HXQR6/Cy2lbNdPlZBpuQHXE63gA==", + "dev": true + }, "json-schema": { "version": "0.2.3", "resolved": "https://registry.npmjs.org/json-schema/-/json-schema-0.2.3.tgz", @@ -1073,6 +1783,12 @@ "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.15.tgz", "integrity": "sha512-8xOcRHvCjnocdS5cpwXQXVzmmh5e5+saE2QGoeQmbKmRS6J3VQppPOIt0MnmE+4xlZoumy0GPG0D0MVIQbNA1A==" }, + "lodash.flattendeep": { + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/lodash.flattendeep/-/lodash.flattendeep-4.4.0.tgz", + "integrity": "sha1-+wMJF/hqMTTlvJvsDWngAT3f7bI=", + "dev": true + }, "lodash.get": { "version": "4.4.2", "resolved": "https://registry.npmjs.org/lodash.get/-/lodash.get-4.4.2.tgz", @@ -1098,6 +1814,23 @@ "chalk": "^2.0.1" } }, + "make-dir": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-3.1.0.tgz", + "integrity": "sha512-g3FeP20LNwhALb/6Cz6Dd4F2ngze0jz7tbzrD2wAV+o9FeNHe4rL+yK2md0J/fiSf1sa1ADhXqi5+oVwOM/eGw==", + "dev": true, + "requires": { + "semver": "^6.0.0" + }, + "dependencies": { + "semver": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", + "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", + "dev": true + } + } + }, "make-error": { "version": "1.3.6", "resolved": "https://registry.npmjs.org/make-error/-/make-error-1.3.6.tgz", @@ -1189,12 +1922,6 @@ } } }, - "mocha-lcov-reporter": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/mocha-lcov-reporter/-/mocha-lcov-reporter-1.3.0.tgz", - "integrity": "sha1-Rpve9PivyaEWBW8HnfYYLQr7A4Q=", - "dev": true - }, "mock-fs": { "version": "4.11.0", "resolved": "https://registry.npmjs.org/mock-fs/-/mock-fs-4.11.0.tgz", @@ -1250,6 +1977,214 @@ "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.0.tgz", "integrity": "sha512-8dG4H5ujfvFiqDmVu9fQ5bOHUC15JMjMY/Zumv26oOvvVJjM67KF8koCWIabKQ1GJIa9r2mMZscBq/TbdOcmNA==" }, + "node-preload": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/node-preload/-/node-preload-0.2.1.tgz", + "integrity": "sha512-RM5oyBy45cLEoHqCeh+MNuFAxO0vTFBLskvQbOKnEE7YTTSN4tbN8QWDIPQ6L+WvKsB/qLEGpYe2ZZ9d4W9OIQ==", + "dev": true, + "requires": { + "process-on-spawn": "^1.0.0" + } + }, + "nyc": { + "version": "15.1.0", + "resolved": "https://registry.npmjs.org/nyc/-/nyc-15.1.0.tgz", + "integrity": "sha512-jMW04n9SxKdKi1ZMGhvUTHBN0EICCRkHemEoE5jm6mTYcqcdas0ATzgUgejlQUHMvpnOZqGB5Xxsv9KxJW1j8A==", + "dev": true, + "requires": { + "@istanbuljs/load-nyc-config": "^1.0.0", + "@istanbuljs/schema": "^0.1.2", + "caching-transform": "^4.0.0", + "convert-source-map": "^1.7.0", + "decamelize": "^1.2.0", + "find-cache-dir": "^3.2.0", + "find-up": "^4.1.0", + "foreground-child": "^2.0.0", + "get-package-type": "^0.1.0", + "glob": "^7.1.6", + "istanbul-lib-coverage": "^3.0.0", + "istanbul-lib-hook": "^3.0.0", + "istanbul-lib-instrument": "^4.0.0", + "istanbul-lib-processinfo": "^2.0.2", + "istanbul-lib-report": "^3.0.0", + "istanbul-lib-source-maps": "^4.0.0", + "istanbul-reports": "^3.0.2", + "make-dir": "^3.0.0", + "node-preload": "^0.2.1", + "p-map": "^3.0.0", + "process-on-spawn": "^1.0.0", + "resolve-from": "^5.0.0", + "rimraf": "^3.0.0", + "signal-exit": "^3.0.2", + "spawn-wrap": "^2.0.0", + "test-exclude": "^6.0.0", + "yargs": "^15.0.2" + }, + "dependencies": { + "ansi-regex": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.0.tgz", + "integrity": "sha512-bY6fj56OUQ0hU1KjFNDQuJFezqKdrAyFdIevADiqrWHwSlbmBNMHp5ak2f40Pm8JTFyM2mqxkG6ngkHO11f/lg==", + "dev": true + }, + "ansi-styles": { + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.2.1.tgz", + "integrity": "sha512-9VGjrMsG1vePxcSweQsN20KY/c4zN0h9fLjqAbwbPfahM3t+NL+M9HC8xeXG2I8pX5NoamTGNuomEUFI7fcUjA==", + "dev": true, + "requires": { + "@types/color-name": "^1.1.1", + "color-convert": "^2.0.1" + } + }, + "cliui": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-6.0.0.tgz", + "integrity": "sha512-t6wbgtoCXvAzst7QgXxJYqPt0usEfbgQdftEPbLL/cvv6HPE5VgvqCuAIDR0NgU52ds6rFwqrgakNLrHEjCbrQ==", + "dev": true, + "requires": { + "string-width": "^4.2.0", + "strip-ansi": "^6.0.0", + "wrap-ansi": "^6.2.0" + } + }, + "color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "requires": { + "color-name": "~1.1.4" + } + }, + "color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true + }, + "emoji-regex": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", + "dev": true + }, + "find-up": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", + "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==", + "dev": true, + "requires": { + "locate-path": "^5.0.0", + "path-exists": "^4.0.0" + } + }, + "glob": { + "version": "7.1.6", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.6.tgz", + "integrity": "sha512-LwaxwyZ72Lk7vZINtNNrywX0ZuLyStrdDtabefZKAY5ZGJhVtgdznluResxNmPitE0SAO+O26sWTHeKSI2wMBA==", + "dev": true, + "requires": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.0.4", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + } + }, + "is-fullwidth-code-point": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", + "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", + "dev": true + }, + "locate-path": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", + "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==", + "dev": true, + "requires": { + "p-locate": "^4.1.0" + } + }, + "p-locate": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz", + "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==", + "dev": true, + "requires": { + "p-limit": "^2.2.0" + } + }, + "path-exists": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", + "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", + "dev": true + }, + "string-width": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.0.tgz", + "integrity": "sha512-zUz5JD+tgqtuDjMhwIg5uFVV3dtqZ9yQJlZVfq4I01/K5Paj5UHj7VyrQOJvzawSVlKpObApbfD0Ed6yJc+1eg==", + "dev": true, + "requires": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.0" + } + }, + "strip-ansi": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.0.tgz", + "integrity": "sha512-AuvKTrTfQNYNIctbR1K/YGTR1756GycPsg7b9bdV9Duqur4gv6aKqHXah67Z8ImS7WEz5QVcOtlfW2rZEugt6w==", + "dev": true, + "requires": { + "ansi-regex": "^5.0.0" + } + }, + "wrap-ansi": { + "version": "6.2.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-6.2.0.tgz", + "integrity": "sha512-r6lPcBGxZXlIcymEu7InxDMhdW0KDxpLgoFLcguasxCaJ/SOIZwINatK9KY/tf+ZrlywOKU0UDj3ATXUBfxJXA==", + "dev": true, + "requires": { + "ansi-styles": "^4.0.0", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0" + } + }, + "yargs": { + "version": "15.3.1", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-15.3.1.tgz", + "integrity": "sha512-92O1HWEjw27sBfgmXiixJWT5hRBp2eobqXicLtPBIDBhYB+1HpwZlXmbW2luivBJHBzki+7VyCLRtAkScbTBQA==", + "dev": true, + "requires": { + "cliui": "^6.0.0", + "decamelize": "^1.2.0", + "find-up": "^4.1.0", + "get-caller-file": "^2.0.1", + "require-directory": "^2.1.1", + "require-main-filename": "^2.0.0", + "set-blocking": "^2.0.0", + "string-width": "^4.2.0", + "which-module": "^2.0.0", + "y18n": "^4.0.0", + "yargs-parser": "^18.1.1" + } + }, + "yargs-parser": { + "version": "18.1.3", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-18.1.3.tgz", + "integrity": "sha512-o50j0JeToy/4K6OZcaQmW6lyXXKhq7csREXcDwk2omFPJEwUNOVtJKvmDr9EI1fAJZUyZcRF7kxGBWmRXudrCQ==", + "dev": true, + "requires": { + "camelcase": "^5.0.0", + "decamelize": "^1.2.0" + } + } + } + }, "oauth-sign": { "version": "0.9.0", "resolved": "https://registry.npmjs.org/oauth-sign/-/oauth-sign-0.9.0.tgz", @@ -1321,12 +2256,33 @@ "p-limit": "^2.0.0" } }, + "p-map": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/p-map/-/p-map-3.0.0.tgz", + "integrity": "sha512-d3qXVTF/s+W+CdJ5A29wywV2n8CQQYahlgz2bFiA+4eVNJbHJodPZ+/gXwPGh0bOqA+j8S+6+ckmvLGPk1QpxQ==", + "dev": true, + "requires": { + "aggregate-error": "^3.0.0" + } + }, "p-try": { "version": "2.2.0", "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz", "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==", "dev": true }, + "package-hash": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/package-hash/-/package-hash-4.0.0.tgz", + "integrity": "sha512-whdkPIooSu/bASggZ96BWVvZTRMOFxnyUG5PnTSGKoJE2gd5mbVNmR2Nj20QFzxYYgAXpoqC+AiXzl+UMRh7zQ==", + "dev": true, + "requires": { + "graceful-fs": "^4.1.15", + "hasha": "^5.0.0", + "lodash.flattendeep": "^4.4.0", + "release-zalgo": "^1.0.0" + } + }, "path-exists": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-3.0.0.tgz", @@ -1339,6 +2295,12 @@ "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=", "dev": true }, + "path-key": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", + "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", + "dev": true + }, "path-parse": { "version": "1.0.6", "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.6.tgz", @@ -1356,6 +2318,51 @@ "resolved": "https://registry.npmjs.org/performance-now/-/performance-now-2.1.0.tgz", "integrity": "sha1-Ywn04OX6kT7BxpMHrjZLSzd8nns=" }, + "pkg-dir": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-4.2.0.tgz", + "integrity": "sha512-HRDzbaKjC+AOWVXxAU/x54COGeIv9eb+6CkDSQoNTt4XyWoIJvuPsXizxu/Fr23EiekbtZwmh1IcIG/l/a10GQ==", + "dev": true, + "requires": { + "find-up": "^4.0.0" + }, + "dependencies": { + "find-up": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", + "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==", + "dev": true, + "requires": { + "locate-path": "^5.0.0", + "path-exists": "^4.0.0" + } + }, + "locate-path": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", + "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==", + "dev": true, + "requires": { + "p-locate": "^4.1.0" + } + }, + "p-locate": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz", + "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==", + "dev": true, + "requires": { + "p-limit": "^2.2.0" + } + }, + "path-exists": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", + "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", + "dev": true + } + } + }, "prettier": { "version": "1.19.1", "resolved": "https://registry.npmjs.org/prettier/-/prettier-1.19.1.tgz", @@ -1367,6 +2374,15 @@ "resolved": "https://registry.npmjs.org/process/-/process-0.11.10.tgz", "integrity": "sha1-czIwDoQBYb2j5podHZGn1LwW8YI=" }, + "process-on-spawn": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/process-on-spawn/-/process-on-spawn-1.0.0.tgz", + "integrity": "sha512-1WsPDsUSMmZH5LeMLegqkPDrsGgsWwk1Exipy2hvB0o/F0ASzbpIctSCcZIK1ykJvtTJULEH+20WOFjMvGnCTg==", + "dev": true, + "requires": { + "fromentries": "^1.2.0" + } + }, "propagate": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/propagate/-/propagate-2.0.1.tgz", @@ -1388,6 +2404,15 @@ "resolved": "https://registry.npmjs.org/qs/-/qs-6.5.2.tgz", "integrity": "sha512-N5ZAX4/LxJmF+7wN74pUD6qAh9/wnvdQcjq9TZjevvXzSUo7bfmw91saqMjzGS2xq91/odN2dW/WOl7qQHNDGA==" }, + "release-zalgo": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/release-zalgo/-/release-zalgo-1.0.0.tgz", + "integrity": "sha1-CXALflB0Mpc5Mw5TXFqQ+2eFFzA=", + "dev": true, + "requires": { + "es6-error": "^4.0.1" + } + }, "request": { "version": "2.88.2", "resolved": "https://registry.npmjs.org/request/-/request-2.88.2.tgz", @@ -1486,6 +2511,21 @@ "path-parse": "^1.0.6" } }, + "resolve-from": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-5.0.0.tgz", + "integrity": "sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw==", + "dev": true + }, + "rimraf": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", + "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==", + "dev": true, + "requires": { + "glob": "^7.1.3" + } + }, "safe-buffer": { "version": "5.2.0", "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.0.tgz", @@ -1513,6 +2553,27 @@ "integrity": "sha1-BF+XgtARrppoA93TgrJDkrPYkPc=", "dev": true }, + "shebang-command": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", + "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", + "dev": true, + "requires": { + "shebang-regex": "^3.0.0" + } + }, + "shebang-regex": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", + "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", + "dev": true + }, + "signal-exit": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.3.tgz", + "integrity": "sha512-VUJ49FC8U1OxwZLxIbTTrDvLnf/6TDgxZcK8wxR8zs13xpx7xbG60ndBlhNrFi2EMuFRoeDoJO7wthSLq42EjA==", + "dev": true + }, "slash": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/slash/-/slash-3.0.0.tgz", @@ -1530,19 +2591,52 @@ } }, "source-map": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", - "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "version": "0.5.7", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", + "integrity": "sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w=", "dev": true }, "source-map-support": { - "version": "0.5.16", - "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.16.tgz", - "integrity": "sha512-efyLRJDr68D9hBBNIPWFjhpFzURh+KJykQwvMyW5UiZzYwoF6l4YMMDIJJEyFWxWCqfyxLzz6tSfUFR+kXXsVQ==", + "version": "0.5.19", + "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.19.tgz", + "integrity": "sha512-Wonm7zOCIJzBGQdB+thsPar0kYuCIzYvxZwlBa87yi/Mdjv7Tip2cyVbLj5o0cFPN4EVkuTwb3GDDyUx2DGnGw==", "dev": true, "requires": { "buffer-from": "^1.0.0", "source-map": "^0.6.0" + }, + "dependencies": { + "source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "dev": true + } + } + }, + "spawn-wrap": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/spawn-wrap/-/spawn-wrap-2.0.0.tgz", + "integrity": "sha512-EeajNjfN9zMnULLwhZZQU3GWBoFNkbngTUPfaawT4RkMiviTxcX0qfhVbGey39mfctfDHkWtuecgQ8NJcyQWHg==", + "dev": true, + "requires": { + "foreground-child": "^2.0.0", + "is-windows": "^1.0.2", + "make-dir": "^3.0.0", + "rimraf": "^3.0.0", + "signal-exit": "^3.0.2", + "which": "^2.0.1" + }, + "dependencies": { + "which": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", + "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", + "dev": true, + "requires": { + "isexe": "^2.0.0" + } + } } }, "sprintf-js": { @@ -1689,6 +2783,39 @@ } } }, + "test-exclude": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/test-exclude/-/test-exclude-6.0.0.tgz", + "integrity": "sha512-cAGWPIyOHU6zlmg88jwm7VRyXnMN7iV68OGAbYDk/Mh/xC/pzVPlQtY6ngoIH/5/tciuhGfvESU8GrHrcxD56w==", + "dev": true, + "requires": { + "@istanbuljs/schema": "^0.1.2", + "glob": "^7.1.4", + "minimatch": "^3.0.4" + }, + "dependencies": { + "glob": { + "version": "7.1.6", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.6.tgz", + "integrity": "sha512-LwaxwyZ72Lk7vZINtNNrywX0ZuLyStrdDtabefZKAY5ZGJhVtgdznluResxNmPitE0SAO+O26sWTHeKSI2wMBA==", + "dev": true, + "requires": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.0.4", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + } + } + } + }, + "to-fast-properties": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/to-fast-properties/-/to-fast-properties-2.0.0.tgz", + "integrity": "sha1-3F5pjL0HkmW8c+A3doGk5Og/YW4=", + "dev": true + }, "tough-cookie": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-3.0.1.tgz", @@ -1700,15 +2827,15 @@ } }, "ts-node": { - "version": "8.6.2", - "resolved": "https://registry.npmjs.org/ts-node/-/ts-node-8.6.2.tgz", - "integrity": "sha512-4mZEbofxGqLL2RImpe3zMJukvEvcO1XP8bj8ozBPySdCUXEcU5cIRwR0aM3R+VoZq7iXc8N86NC0FspGRqP4gg==", + "version": "8.10.2", + "resolved": "https://registry.npmjs.org/ts-node/-/ts-node-8.10.2.tgz", + "integrity": "sha512-ISJJGgkIpDdBhWVu3jufsWpK3Rzo7bdiIXJjQc0ynKxVOVcg2oIrf2H2cejminGrptVc6q6/uynAHNCuWGbpVA==", "dev": true, "requires": { "arg": "^4.1.0", "diff": "^4.0.1", "make-error": "^1.1.1", - "source-map-support": "^0.5.6", + "source-map-support": "^0.5.17", "yn": "3.1.1" }, "dependencies": { @@ -1843,6 +2970,21 @@ "integrity": "sha512-0fr/mIH1dlO+x7TlcMy+bIDqKPsw/70tVyeHW787goQjhmqaZe10uwLujubK9q9Lg6Fiho1KUKDYz0Z7k7g5/g==", "dev": true }, + "type-fest": { + "version": "0.8.1", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.8.1.tgz", + "integrity": "sha512-4dbzIzqvjtgiM5rw1k5rEHtBANKmdudhGyBEajN01fEyhaAIhsoKNy6y7+IN93IfpFtwY9iqi7kD+xwKhQsNJA==", + "dev": true + }, + "typedarray-to-buffer": { + "version": "3.1.5", + "resolved": "https://registry.npmjs.org/typedarray-to-buffer/-/typedarray-to-buffer-3.1.5.tgz", + "integrity": "sha512-zdu8XMNEDepKKR+XYOXAVPtWui0ly0NtohUscw+UmaHiAWT8hrV1rr//H6V+0DvJ3OQ19S979M0laLfX8rm82Q==", + "dev": true, + "requires": { + "is-typedarray": "^1.0.0" + } + }, "typescript": { "version": "3.8.2", "resolved": "https://registry.npmjs.org/typescript/-/typescript-3.8.2.tgz", @@ -1960,6 +3102,18 @@ "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=", "dev": true }, + "write-file-atomic": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/write-file-atomic/-/write-file-atomic-3.0.3.tgz", + "integrity": "sha512-AvHcyZ5JnSfq3ioSyjrBkH9yW4m7Ayk8/9My/DD9onKeu/94fwrMocemO2QAJFAlnnDN+ZDS+ZjAR5ua1/PV/Q==", + "dev": true, + "requires": { + "imurmurhash": "^0.1.4", + "is-typedarray": "^1.0.0", + "signal-exit": "^3.0.2", + "typedarray-to-buffer": "^3.1.5" + } + }, "xml2js": { "version": "0.4.23", "resolved": "https://registry.npmjs.org/xml2js/-/xml2js-0.4.23.tgz", diff --git a/package.json b/package.json index 82616ab..abdcab1 100644 --- a/package.json +++ b/package.json @@ -18,7 +18,9 @@ "mock-api-test": "npm run preapi-test && mocha -r ts-node/register -r tsconfig-paths/register tests/unit_tests/v2/v2.spec.ts", "prebuild": "tslint --config tslint.json --project tsconfig.build.json", "build": "ttsc -p tsconfig.json && npm run copy-swagger", - "copy-swagger": "node copy_swagger.js" + "copy-swagger": "node copy_swagger.js", + "precode-coverage": "npm run build && npm run pretest", + "code-coverage": "nyc mocha -r ts-node/register -r tsconfig-paths/register -r source-map-support/register --recursive tests/unit_tests/**/*.spec.ts" }, "homepage": "https://github.com/Microsoft/openpaisdk", "repository": { @@ -32,6 +34,7 @@ "author": "Microsoft", "license": "MIT", "devDependencies": { + "@istanbuljs/nyc-config-typescript": "^1.0.1", "@types/argparse": "^1.0.38", "@types/chai": "^4.2.0", "@types/dirty-chai": "^2.0.1", @@ -49,11 +52,12 @@ "dirty-chai": "^2.0.1", "minimist": ">=1.2.2", "mocha": "^6.2.3", - "mocha-lcov-reporter": "^1.3.0", "mock-fs": "^4.11.0", "nock": "^12.0.3", + "nyc": "^15.1.0", "prettier": "^1.18.2", - "ts-node": "^8.3.0", + "source-map-support": "^0.5.19", + "ts-node": "^8.10.2", "tsconfig-paths": "^3.9.0", "tslint": "^6.1.1", "tslint-config-prettier": "^1.18.0", diff --git a/tsconfig.base.json b/tsconfig.base.json index 711f1cd..d6a163a 100644 --- a/tsconfig.base.json +++ b/tsconfig.base.json @@ -10,6 +10,7 @@ "es2019", "DOM" ], + "sourceMap": true, "resolveJsonModule": true, "esModuleInterop": true, "allowSyntheticDefaultImports": true, From d353440dd2ecf9e5323a2f8696b297b55ba0f564 Mon Sep 17 00:00:00 2001 From: Yi Yi Date: Mon, 15 Jun 2020 03:33:08 +0800 Subject: [PATCH 12/24] update coveralls --- .github/workflows/code_coverage.yml | 4 +++- package.json | 3 ++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/.github/workflows/code_coverage.yml b/.github/workflows/code_coverage.yml index ee7ddc2..b85cce8 100644 --- a/.github/workflows/code_coverage.yml +++ b/.github/workflows/code_coverage.yml @@ -25,10 +25,12 @@ jobs: with: node-version: 12.x - - name: npm install, build + - name: npm install, build, test run: | npm install npm run build + npm run code-coverage + npm run coveralls - name: Coveralls GitHub Action uses: coverallsapp/github-action@v1.1.1 diff --git a/package.json b/package.json index abdcab1..b7e226e 100644 --- a/package.json +++ b/package.json @@ -20,7 +20,8 @@ "build": "ttsc -p tsconfig.json && npm run copy-swagger", "copy-swagger": "node copy_swagger.js", "precode-coverage": "npm run build && npm run pretest", - "code-coverage": "nyc mocha -r ts-node/register -r tsconfig-paths/register -r source-map-support/register --recursive tests/unit_tests/**/*.spec.ts" + "code-coverage": "nyc mocha -r ts-node/register -r tsconfig-paths/register -r source-map-support/register --recursive tests/unit_tests/**/*.spec.ts", + "coveralls": "nyc report --reporter=text-lcov | coveralls" }, "homepage": "https://github.com/Microsoft/openpaisdk", "repository": { From a60199fe440b0f04edb3ab58b1eb57b2e5170f81 Mon Sep 17 00:00:00 2001 From: Yi Yi Date: Mon, 15 Jun 2020 03:48:40 +0800 Subject: [PATCH 13/24] update --- .github/workflows/code_coverage.yml | 1 - .nycrc | 3 +-- .tests/apiTestCase.json | 5 +---- package.json | 2 +- tests/api_tests/v2/api.v2.spec.ts | 2 +- tests/unit_tests/v2/v2.spec.ts | 8 -------- 6 files changed, 4 insertions(+), 17 deletions(-) diff --git a/.github/workflows/code_coverage.yml b/.github/workflows/code_coverage.yml index b85cce8..876eee7 100644 --- a/.github/workflows/code_coverage.yml +++ b/.github/workflows/code_coverage.yml @@ -28,7 +28,6 @@ jobs: - name: npm install, build, test run: | npm install - npm run build npm run code-coverage npm run coveralls diff --git a/.nycrc b/.nycrc index ceeda07..6aa9556 100644 --- a/.nycrc +++ b/.nycrc @@ -3,8 +3,7 @@ "all": true, "cache": false, "include": [ - "src/**/*.ts", - "lib/src/**/*.js" + "src/**/*.ts" ], "require": [ "ts-node/register", diff --git a/.tests/apiTestCase.json b/.tests/apiTestCase.json index c5c8976..d63472d 100644 --- a/.tests/apiTestCase.json +++ b/.tests/apiTestCase.json @@ -1,4 +1 @@ -{ - "tests": [], - "map": {} -} +{"tests":[{"description":"get /api/v2/info","tests":[{"operation":{"tag":"api","operationId":"getClusterInfo","parameters":[],"response":{"statusCode":200,"schema":{"type":"object","properties":{"name":{"type":"string","description":"PAI RESTfulAPI"},"version":{"type":"string","description":"cluster version in v0.X.0 format"},"launcherType":{"type":"string","enum":["yarn","k8s"]},"authnMethod":{"type":"string","enum":["basic","OIDC"]}},"required":["name","version","launcherType","authnMethod"]},"contentType":"application/json"}}}],"schemas":{"200":{"description":"Succeeded","content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","description":"PAI RESTfulAPI"},"version":{"type":"string","description":"cluster version in v0.X.0 format"},"launcherType":{"type":"string","enum":["yarn","k8s"]},"authnMethod":{"type":"string","enum":["basic","OIDC"]}},"required":["name","version","launcherType","authnMethod"]},"example":{"name":"PAI RESTful API","version":"v1.0.1","launcherType":"k8s","authnMethod":"basic"}}}}}},{"before":[{"tag":"token","operationId":"createApplicationToken"}],"tests":[{"description":"Get tokens with user token","operation":{"tag":"token","operationId":"getTokens","parameters":[],"response":{"statusCode":200,"schema":{"type":"object","properties":{"tokens":{"type":"array","items":{"type":"string"},"description":"JWT string list"}},"required":["tokens"]},"contentType":"application/json"}}},{"description":"Get tokens with unauthorized token","customizedTest":"getTokensWithUnauthorizedUser","operation":{"tag":"token","operationId":"getTokens","parameters":[],"response":{"statusCode":200,"schema":{"type":"object","properties":{"tokens":{"type":"array","items":{"type":"string"},"description":"JWT string list"}},"required":["tokens"]},"contentType":"application/json"}}}],"after":[{"tag":"token","operationId":"deleteToken","parameters":[{"type":"fromResult","resultType":"beforeResults","resultPath":["token"],"resultIndex":0}]}],"schemas":{"200":{"description":"Succeeded","content":{"application/json":{"schema":{"type":"object","properties":{"tokens":{"type":"array","items":{"type":"string"},"description":"JWT string list"}},"required":["tokens"]},"example":{"tokens":["JWT Token Example"]}}}},"401":{"description":"UnauthorizedUserError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"UnauthorizedUserError":{"value":{"code":"UnauthorizedUserError","message":"Guest is not allowed to do this operation."}}}}}}},"description":"get /api/v2/tokens"},{"before":[{"tag":"token","operationId":"createApplicationToken"}],"tests":[{"operation":{"parameters":[{"type":"fromResult","resultType":"beforeResults","resultPath":["token"],"resultIndex":0}],"tag":"token","operationId":"deleteToken","response":{"statusCode":200,"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"contentType":"application/json"}}}],"schemas":{"200":{"description":"Succeeded","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"example":{"message":"revoke successfully"}}}},"401":{"description":"UnauthorizedUserError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"UnauthorizedUserError":{"value":{"code":"UnauthorizedUserError","message":"Guest is not allowed to do this operation."}}}}}},"403":{"description":"ForbiddenUserError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"ForbiddenUserError":{"value":{"code":"ForbiddenUserError","message":"Non-admin is not allow to do this operation."}},"ForbiddenTokenError":{"value":{"code":"ForbiddenUserError","message":"Applications are not allowed to do this operation."}}}}}}},"description":"delete /api/v2/tokens/{token}"},{"tests":[{"operation":{"tag":"token","operationId":"createApplicationToken","parameters":[],"response":{"statusCode":200,"schema":{"type":"object","properties":{"token":{"type":"string","description":"your access token"},"application":{"type":"boolean","description":"true"}}},"contentType":"application/json"}}}],"after":[{"tag":"token","operationId":"deleteToken","parameters":[{"type":"fromResult","resultType":"testResults","resultPath":["token"],"resultIndex":0}]}],"schemas":{"200":{"description":"Succeeded","content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string","description":"your access token"},"application":{"type":"boolean","description":"true"}}},"example":{"token":"JWT Token Example","application":true}}}},"401":{"description":"UnauthorizedUserError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"UnauthorizedUserError":{"value":{"code":"UnauthorizedUserError","message":"Guest is not allowed to do this operation."}}}}}}},"description":"post /api/v2/tokens/application"},{"description":"get /api/v2/authn/oidc/login","tests":[{"operation":{"tag":"authn","operationId":"oidcLogin","parameters":[]}}],"schemas":{"302":{"description":"Redirect"}}},{"description":"get /api/v2/authn/oidc/logout","tests":[{"operation":{"tag":"authn","operationId":"oidcLogout","parameters":[]}}],"schemas":{"302":{"description":"Redirect"}}},{"tests":[{"description":"login with correct username and password","operation":{"parameters":[{"type":"raw","value":"sdk_test"},{"type":"raw","value":"pwd"}],"tag":"authn","operationId":"basicLogin","response":{"statusCode":200,"schema":{"type":"object","properties":{"token":{"type":"string","description":"your access token"},"user":{"type":"string","description":"username"},"admin":{"type":"boolean","description":"true if user is admin"}},"required":["token","user","admin"]},"contentType":"application/json"}}},{"description":"login with non-existent username","operation":{"parameters":[{"type":"raw","value":"nonexistentuser"},{"type":"raw","value":"password"}],"response":{"statusCode":400,"expectResult":{"code":"NoUserError","message":"User nonexistentuser is not found."},"schema":{"description":"NoUserError or IncorrectPasswordError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]}}}}},"tag":"authn","operationId":"basicLogin"}},{"description":"login with incorrect password","operation":{"parameters":[{"type":"raw","value":"sdk_test"},{"type":"raw","value":"incorrectpassword"}],"response":{"statusCode":400,"expectResult":{"code":"IncorrectPasswordError","message":"Password is incorrect."},"schema":{"description":"NoUserError or IncorrectPasswordError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]}}}}},"tag":"authn","operationId":"basicLogin"}}],"after":[{"tag":"token","operationId":"deleteToken","parameters":[{"type":"fromResult","resultType":"testResults","resultPath":["token"],"resultIndex":0}]}],"schemas":{"200":{"description":"Succeeded","content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string","description":"your access token"},"user":{"type":"string","description":"username"},"admin":{"type":"boolean","description":"true if user is admin"}},"required":["token","user","admin"]},"example":{"token":"JWT Token Example","user":"user","admin":true}}}},"400":{"description":"NoUserError or IncorrectPasswordError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]}}}},"404":{"description":"NoUserError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"NoUserError":{"value":{"code":"NoUserError","message":"User {user} is not found."}}}}}}},"description":"post /api/v2/authn/basic/login"},{"before":[{"tag":"authn","operationId":"basicLogin","parameters":[{"type":"raw","value":"sdk_test"},{"type":"raw","value":"pwd"}]}],"tests":[{"description":"Logout with correct token","customizedTest":"logoutWithCorrectToken","operation":{"tag":"authn","operationId":"basicLogout","parameters":[],"response":{"statusCode":200,"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"contentType":"application/json"}}},{"description":"Logout with incorrect token","customizedTest":"logoutWithIncorrectToken","operation":{"tag":"authn","operationId":"basicLogout","parameters":[],"response":{"statusCode":200,"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"contentType":"application/json"}}}],"schemas":{"200":{"description":"Succeeded","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"example":{"message":"Logout successfully"}}}},"401":{"description":"UnauthorizedUserError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"UnauthorizedUserError":{"value":{"code":"UnauthorizedUserError","message":"Guest is not allowed to do this operation."}}}}}},"403":{"description":"ForbiddenUserError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"ForbiddenUserError":{"value":{"code":"ForbiddenUserError","message":"Non-admin is not allow to do this operation."}},"ForbiddenTokenError":{"value":{"code":"ForbiddenUserError","message":"Applications are not allowed to do this operation."}}}}}}},"description":"delete /api/v2/authn/basic/logout"},{"before":[{"tag":"token","operationId":"createApplicationToken"}],"tests":[{"description":"Create a user","operation":{"tag":"user","operationId":"createUser","parameters":[{"type":"raw","value":{"username":"sdk_test_user","password":"test_password"}}],"response":{"statusCode":201,"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"contentType":"application/json"}}},{"description":"Create a conflict user","operation":{"tag":"user","operationId":"createUser","parameters":[{"type":"raw","value":{"username":"sdk_test_user","password":"test_password"}}],"response":{"statusCode":409,"schema":{"description":"ConflictUserError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"ConflictUserError":{"value":{"code":"ConflictUserError","message":"User name {user} already exists."}}}}}}}}},{"description":"Create a user by application token","customizedTest":"createUserByApplicationToken","operation":{"tag":"user","operationId":"createUser","parameters":[],"response":{"statusCode":201,"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"contentType":"application/json"}}},{"description":"Create a user by non-admin user token","customizedTest":"createUserByNonadminToken","operation":{"tag":"user","operationId":"createUser","parameters":[],"response":{"statusCode":201,"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"contentType":"application/json"}}}],"after":[{"tag":"user","operationId":"deleteUser","parameters":[{"type":"raw","value":"sdk_test_user"}],"response":{"statusCode":200,"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"contentType":"application/json"}},{"tag":"token","operationId":"deleteToken","parameters":[{"type":"fromResult","resultType":"beforeResults","resultPath":["token"],"resultIndex":0}]}],"schemas":{"201":{"description":"Succeeded","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"example":{"message":"User is created successfully"}}}},"401":{"description":"UnauthorizedUserError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"UnauthorizedUserError":{"value":{"code":"UnauthorizedUserError","message":"Guest is not allowed to do this operation."}}}}}},"403":{"description":"ForbiddenUserError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"ForbiddenUserError":{"value":{"code":"ForbiddenUserError","message":"Non-admin is not allow to do this operation."}},"ForbiddenTokenError":{"value":{"code":"ForbiddenUserError","message":"Applications are not allowed to do this operation."}}}}}},"409":{"description":"ConflictUserError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"ConflictUserError":{"value":{"code":"ConflictUserError","message":"User name {user} already exists."}}}}}},"500":{"description":"UnknownError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"UnknownError":{"value":{"code":"UnknownError","message":"Internal error message."}}}}}}},"description":"post /api/v2/users"},{"description":"get /api/v2/users","tests":[{"operation":{"tag":"user","operationId":"getAllUser","parameters":[],"response":{"statusCode":200,"schema":{"description":"Array with all users in the system.","type":"array","items":{"type":"object","properties":{"username":{"type":"string","description":"user name"},"admin":{"type":"boolean","description":"Admin or not."},"virtualCluster":{"type":"array","description":"The list of virtualCluster which the user can access.","items":{"type":"string","description":"virtual cluster name."}},"storageConfig":{"type":"array","description":"storageconfig string arry","items":{"type":"string"}},"email":{"type":"string","description":"email address"},"extension":{"type":"object","description":"extension field."}},"required":["username","admin","virtualCluster","storageConfig","email","extension"]}},"contentType":"application/json"}}}],"schemas":{"200":{"description":"Succeeded","content":{"application/json":{"schema":{"description":"Array with all users in the system.","type":"array","items":{"type":"object","properties":{"username":{"type":"string","description":"user name"},"admin":{"type":"boolean","description":"Admin or not."},"virtualCluster":{"type":"array","description":"The list of virtualCluster which the user can access.","items":{"type":"string","description":"virtual cluster name."}},"storageConfig":{"type":"array","description":"storageconfig string arry","items":{"type":"string"}},"email":{"type":"string","description":"email address"},"extension":{"type":"object","description":"extension field."}},"required":["username","admin","virtualCluster","storageConfig","email","extension"]}},"example":[{"username":"username","admin":true,"virtualCluster":[],"storageConfig":[],"email":"email@test.com","extension":{}}]}}},"500":{"description":"UnknownError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"UnknownError":{"value":{"code":"UnknownError","message":"Internal error message."}}}}}}}},{"before":[{"tag":"user","operationId":"createUser","parameters":[{"type":"raw","value":{"username":"sdk_test_user","password":"test_password"}}],"response":{"statusCode":201,"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"contentType":"application/json"}},{"tag":"token","operationId":"createApplicationToken"}],"tests":[{"description":"Update a user, patch: true","operation":{"parameters":[{"type":"raw","value":{"username":"sdk_test_user","email":"new_email@test1.com"}}],"tag":"user","operationId":"updateUser","response":{"statusCode":201,"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"contentType":"application/json"}}},{"description":"Update a user, patch: false","operation":{"parameters":[{"type":"raw","value":{"username":"sdk_test_user","email":"new_email@test2.com","virtualCluster":["default"],"admin":false,"password":"new_test_password","extension":{}}},{"type":"raw","value":false}],"tag":"user","operationId":"updateUser","response":{"statusCode":201,"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"contentType":"application/json"}}},{"description":"Update a non-existent user","operation":{"parameters":[{"type":"raw","value":{"username":"non_exist_user","email":"new_email@test1.com"}}],"response":{"statusCode":404,"schema":{"description":"NoUserError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"NoUserError":{"value":{"code":"NoUserError","message":"User {user} is not found."}}}}}}},"tag":"user","operationId":"updateUser"}},{"description":"Update a user by application token","customizedTest":"updateUserByApplicationToken","operation":{"tag":"user","operationId":"updateUser","parameters":[],"response":{"statusCode":201,"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"contentType":"application/json"}}},{"description":"Update a user by non-admin user token","customizedTest":"updateUserByNonadminToken","operation":{"tag":"user","operationId":"updateUser","parameters":[],"response":{"statusCode":201,"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"contentType":"application/json"}}}],"after":[{"tag":"user","operationId":"deleteUser","parameters":[{"type":"raw","value":"sdk_test_user"}],"response":{"statusCode":200,"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"contentType":"application/json"}},{"tag":"token","operationId":"deleteToken","parameters":[{"type":"fromResult","resultType":"beforeResults","resultPath":["token"],"resultIndex":1}]}],"schemas":{"201":{"description":"Succeeded","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"example":{"message":"update group {username} successfully."}}}},"401":{"description":"UnauthorizedUserError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"UnauthorizedUserError":{"value":{"code":"UnauthorizedUserError","message":"Guest is not allowed to do this operation."}}}}}},"403":{"description":"ForbiddenUserError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"ForbiddenUserError":{"value":{"code":"ForbiddenUserError","message":"Non-admin is not allow to do this operation."}},"ForbiddenTokenError":{"value":{"code":"ForbiddenUserError","message":"Applications are not allowed to do this operation."}}}}}},"404":{"description":"NoUserError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"NoUserError":{"value":{"code":"NoUserError","message":"User {user} is not found."}}}}}},"500":{"description":"UnknownError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"UnknownError":{"value":{"code":"UnknownError","message":"Internal error message."}}}}}}},"description":"put /api/v2/users"},{"tests":[{"description":"Update user self, patch: true","operation":{"parameters":[{"type":"raw","value":{"username":"sdk_test","email":"new_email@test1.com"}}],"tag":"user","operationId":"updateUserSelf","response":{"statusCode":201,"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"contentType":"application/json"}}},{"description":"Update user self, patch: false","operation":{"parameters":[{"type":"raw","value":{"username":"sdk_test","email":"new_email@test2.com","oldPassword":"pwd","newPassword":"pwd"}},{"type":"raw","value":false}],"tag":"user","operationId":"updateUserSelf","response":{"statusCode":201,"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"contentType":"application/json"}}},{"description":"Update user self with incorrect username","operation":{"parameters":[{"type":"raw","value":{"username":"incorrect_username","email":"new_email@test1.com"}}],"response":{"statusCode":403,"schema":{"description":"ForbiddenUserError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"ForbiddenUserError":{"value":{"code":"ForbiddenUserError","message":"Non-admin is not allow to do this operation."}},"ForbiddenTokenError":{"value":{"code":"ForbiddenUserError","message":"Applications are not allowed to do this operation."}}}}}}},"tag":"user","operationId":"updateUserSelf"}}],"schemas":{"201":{"description":"Succeeded","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"example":{"message":"update group {username} successfully."}}}},"401":{"description":"UnauthorizedUserError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"UnauthorizedUserError":{"value":{"code":"UnauthorizedUserError","message":"Guest is not allowed to do this operation."}}}}}},"403":{"description":"ForbiddenUserError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"ForbiddenUserError":{"value":{"code":"ForbiddenUserError","message":"Non-admin is not allow to do this operation."}},"ForbiddenTokenError":{"value":{"code":"ForbiddenUserError","message":"Applications are not allowed to do this operation."}}}}}},"404":{"description":"NoUserError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"NoUserError":{"value":{"code":"NoUserError","message":"User {user} is not found."}}}}}},"500":{"description":"UnknownError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"UnknownError":{"value":{"code":"UnknownError","message":"Internal error message."}}}}}}},"description":"put /api/v2/users/me"},{"tests":[{"operation":{"parameters":[{"type":"raw","value":"sdk_test"}],"tag":"user","operationId":"getUser","response":{"statusCode":200,"schema":{"type":"object","properties":{"username":{"type":"string","description":"user name"},"admin":{"type":"boolean","description":"Admin or not."},"virtualCluster":{"type":"array","description":"The list of virtualCluster which the user can access.","items":{"type":"string","description":"virtual cluster name."}},"storageConfig":{"type":"array","description":"storageconfig string arry","items":{"type":"string"}},"email":{"type":"string","description":"email address"},"extension":{"type":"object","description":"extension field."}},"required":["username","admin","virtualCluster","storageConfig","email","extension"]},"contentType":"application/json"}}}],"schemas":{"200":{"description":"Succeeded","content":{"application/json":{"schema":{"type":"object","properties":{"username":{"type":"string","description":"user name"},"admin":{"type":"boolean","description":"Admin or not."},"virtualCluster":{"type":"array","description":"The list of virtualCluster which the user can access.","items":{"type":"string","description":"virtual cluster name."}},"storageConfig":{"type":"array","description":"storageconfig string arry","items":{"type":"string"}},"email":{"type":"string","description":"email address"},"extension":{"type":"object","description":"extension field."}},"required":["username","admin","virtualCluster","storageConfig","email","extension"]},"example":{"username":"username","admin":true,"virtualCluster":[],"storageConfig":[],"email":"email@test.com","extension":{}}}}},"401":{"description":"UnauthorizedUserError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"UnauthorizedUserError":{"value":{"code":"UnauthorizedUserError","message":"Guest is not allowed to do this operation."}}}}}},"404":{"description":"NoUserError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"NoUserError":{"value":{"code":"NoUserError","message":"User {user} is not found."}}}}}},"500":{"description":"UnknownError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"UnknownError":{"value":{"code":"UnknownError","message":"Internal error message."}}}}}}},"description":"get /api/v2/users/{user}"},{"before":[{"tag":"user","operationId":"createUser","parameters":[{"type":"raw","value":{"username":"sdk_test_user","password":"test_password"}}],"response":{"statusCode":201,"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"contentType":"application/json"}},{"tag":"token","operationId":"createApplicationToken"}],"tests":[{"description":"Delete a user","operation":{"tag":"user","operationId":"deleteUser","parameters":[{"type":"raw","value":"sdk_test_user"}],"response":{"statusCode":200,"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"contentType":"application/json"}}},{"description":"Delete a non-existent user","operation":{"parameters":[{"type":"raw","value":"non_exist_user"}],"response":{"statusCode":404,"schema":{"description":"NoUserError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"NoUserError":{"value":{"code":"NoUserError","message":"User {user} is not found."}}}}}}},"tag":"user","operationId":"deleteUser"}},{"description":"Delete a user by application token","customizedTest":"deleteUserByApplicationToken","operation":{"tag":"user","operationId":"deleteUser","parameters":[],"response":{"statusCode":200,"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"contentType":"application/json"}}},{"description":"Delete a user by non-admin user token","customizedTest":"deleteUserByNonadminToken","operation":{"tag":"user","operationId":"deleteUser","parameters":[],"response":{"statusCode":200,"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"contentType":"application/json"}}}],"after":[{"tag":"token","operationId":"deleteToken","parameters":[{"type":"fromResult","resultType":"beforeResults","resultPath":["token"],"resultIndex":1}]}],"schemas":{"200":{"description":"Succeeded","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"example":{"message":"user is removed successfully"}}}},"401":{"description":"UnauthorizedUserError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"UnauthorizedUserError":{"value":{"code":"UnauthorizedUserError","message":"Guest is not allowed to do this operation."}}}}}},"403":{"description":"ForbiddenUserError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"ForbiddenUserError":{"value":{"code":"ForbiddenUserError","message":"Non-admin is not allow to do this operation."}},"ForbiddenTokenError":{"value":{"code":"ForbiddenUserError","message":"Applications are not allowed to do this operation."}}}}}},"404":{"description":"NoUserError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"NoUserError":{"value":{"code":"NoUserError","message":"User {user} is not found."}}}}}},"500":{"description":"UnknownError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"UnknownError":{"value":{"code":"UnknownError","message":"Internal error message."}}}}}}},"description":"delete /api/v2/users/{user}"},{"before":[{"tag":"token","operationId":"createApplicationToken"},{"tag":"user","operationId":"createUser","parameters":[{"type":"raw","value":{"username":"sdk_test_user","password":"test_password"}}],"response":{"statusCode":201,"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"contentType":"application/json"}},{"tag":"group","operationId":"createGroup","parameters":[{"type":"raw","value":{"groupname":"sdktestgroup"}}],"response":{"statusCode":201,"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"contentType":"application/json"}}],"tests":[{"description":"Add a group to a user's grouplist","operation":{"parameters":[{"type":"raw","value":"sdk_test_user"},{"type":"raw","value":"sdktestgroup"}],"tag":"user","operationId":"updateUserGroup","response":{"statusCode":201,"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"contentType":"application/json"}}},{"description":"Add a group to a non-existent user's grouplist","operation":{"parameters":[{"type":"raw","value":"non_exist_user"},{"type":"raw","value":"sdktestgroup"}],"response":{"statusCode":404,"schema":{"description":"NoUserError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"NoUserError":{"value":{"code":"NoUserError","message":"User {user} is not found."}}}}}}},"tag":"user","operationId":"updateUserGroup"}},{"description":"Add a group to a user's grouplist by application token","customizedTest":"updateUserGroupByApplicationToken","operation":{"tag":"user","operationId":"updateUserGroup","parameters":[],"response":{"statusCode":201,"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"contentType":"application/json"}}},{"description":"Add a group to a user's grouplist by non-admin user token","customizedTest":"updateUserGroupByNonadminToken","operation":{"tag":"user","operationId":"updateUserGroup","parameters":[],"response":{"statusCode":201,"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"contentType":"application/json"}}}],"after":[{"tag":"token","operationId":"deleteToken","parameters":[{"type":"fromResult","resultType":"beforeResults","resultPath":["token"],"resultIndex":0}]},{"tag":"user","operationId":"deleteUser","parameters":[{"type":"raw","value":"sdk_test_user"}],"response":{"statusCode":200,"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"contentType":"application/json"}},{"tag":"group","operationId":"deleteGroup","parameters":[{"type":"raw","value":"sdktestgroup"}],"response":{"statusCode":201,"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"contentType":"application/json"}}],"schemas":{"201":{"description":"Succeeded","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"example":{"message":"User {username} is added into group {groupname}"}}}},"401":{"description":"UnauthorizedUserError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"UnauthorizedUserError":{"value":{"code":"UnauthorizedUserError","message":"Guest is not allowed to do this operation."}}}}}},"403":{"description":"ForbiddenUserError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"ForbiddenUserError":{"value":{"code":"ForbiddenUserError","message":"Non-admin is not allow to do this operation."}},"ForbiddenTokenError":{"value":{"code":"ForbiddenUserError","message":"Applications are not allowed to do this operation."}}}}}},"404":{"description":"NoUserError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"NoUserError":{"value":{"code":"NoUserError","message":"User {user} is not found."}}}}}},"500":{"description":"UnknownError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"UnknownError":{"value":{"code":"UnknownError","message":"Internal error message."}}}}}}},"description":"put /api/v2/users/{user}/group/"},{"before":[{"tag":"token","operationId":"createApplicationToken"},{"tag":"user","operationId":"createUser","parameters":[{"type":"raw","value":{"username":"sdk_test_user","password":"test_password"}}],"response":{"statusCode":201,"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"contentType":"application/json"}},{"tag":"group","operationId":"createGroup","parameters":[{"type":"raw","value":{"groupname":"sdktestgroup"}}],"response":{"statusCode":201,"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"contentType":"application/json"}},{"tag":"user","operationId":"updateUserGroup","parameters":[{"type":"raw","value":"sdk_test_user"},{"type":"raw","value":"sdktestgroup"}]}],"tests":[{"description":"Remove a group to a user's grouplist","operation":{"parameters":[{"type":"raw","value":"sdk_test_user"},{"type":"raw","value":"sdktestgroup"}],"tag":"user","operationId":"deleteUserGroup","response":{"statusCode":201,"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"contentType":"application/json"}}},{"description":"Remove a group to a non-existent user's grouplist","operation":{"parameters":[{"type":"raw","value":"non_exist_user"},{"type":"raw","value":"sdktestgroup"}],"response":{"statusCode":404,"schema":{"description":"NoUserError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"NoUserError":{"value":{"code":"NoUserError","message":"User {user} is not found."}}}}}}},"tag":"user","operationId":"deleteUserGroup"}},{"description":"Remove a group to a user's grouplist by application token","customizedTest":"deleteUserGroupByApplicationToken","operation":{"tag":"user","operationId":"deleteUserGroup","parameters":[],"response":{"statusCode":201,"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"contentType":"application/json"}}},{"description":"Remove a group to a user's grouplist by non-admin user token","customizedTest":"deleteUserGroupByNonadminToken","operation":{"tag":"user","operationId":"deleteUserGroup","parameters":[],"response":{"statusCode":201,"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"contentType":"application/json"}}}],"after":[{"tag":"token","operationId":"deleteToken","parameters":[{"type":"fromResult","resultType":"beforeResults","resultPath":["token"],"resultIndex":0}]},{"tag":"user","operationId":"deleteUser","parameters":[{"type":"raw","value":"sdk_test_user"}],"response":{"statusCode":200,"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"contentType":"application/json"}},{"tag":"group","operationId":"deleteGroup","parameters":[{"type":"raw","value":"sdktestgroup"}],"response":{"statusCode":201,"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"contentType":"application/json"}}],"schemas":{"201":{"description":"Succeeded","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"example":{"message":"User {username} is removed from group {groupname}"}}}},"401":{"description":"UnauthorizedUserError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"UnauthorizedUserError":{"value":{"code":"UnauthorizedUserError","message":"Guest is not allowed to do this operation."}}}}}},"403":{"description":"ForbiddenUserError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"ForbiddenUserError":{"value":{"code":"ForbiddenUserError","message":"Non-admin is not allow to do this operation."}},"ForbiddenTokenError":{"value":{"code":"ForbiddenUserError","message":"Applications are not allowed to do this operation."}}}}}},"404":{"description":"NoUserError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"NoUserError":{"value":{"code":"NoUserError","message":"User {user} is not found."}}}}}},"500":{"description":"UnknownError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"UnknownError":{"value":{"code":"UnknownError","message":"Internal error message."}}}}}}},"description":"delete /api/v2/users/{user}/group/"},{"before":[{"tag":"token","operationId":"createApplicationToken"},{"tag":"user","operationId":"createUser","parameters":[{"type":"raw","value":{"username":"sdk_test_user","password":"test_password"}}],"response":{"statusCode":201,"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"contentType":"application/json"}}],"tests":[{"description":"Replace a user's grouplist","operation":{"parameters":[{"type":"raw","value":"sdk_test_user"},{"type":"raw","value":["default"]}],"tag":"user","operationId":"updateUserGrouplist","response":{"statusCode":201,"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"contentType":"application/json"}}},{"description":"Replace a non-existent user's grouplist","operation":{"parameters":[{"type":"raw","value":"non_exist_user"},{"type":"raw","value":["default"]}],"response":{"statusCode":404,"schema":{"description":"NoUserError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"NoUserError":{"value":{"code":"NoUserError","message":"User {user} is not found."}}}}}}},"tag":"user","operationId":"updateUserGrouplist"}},{"description":"Replace a user's grouplist by application token","customizedTest":"updateUserGrouplistByApplicationToken","operation":{"tag":"user","operationId":"updateUserGrouplist","parameters":[],"response":{"statusCode":201,"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"contentType":"application/json"}}},{"description":"Replace a user's grouplist by non-admin user token","customizedTest":"updateUserGrouplistByNonadminToken","operation":{"tag":"user","operationId":"updateUserGrouplist","parameters":[],"response":{"statusCode":201,"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"contentType":"application/json"}}}],"after":[{"tag":"token","operationId":"deleteToken","parameters":[{"type":"fromResult","resultType":"beforeResults","resultPath":["token"],"resultIndex":0}]},{"tag":"user","operationId":"deleteUser","parameters":[{"type":"raw","value":"sdk_test_user"}],"response":{"statusCode":200,"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"contentType":"application/json"}}],"schemas":{"201":{"description":"Succeeded","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"example":{"message":"update user grouplist successfully."}}}},"401":{"description":"UnauthorizedUserError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"UnauthorizedUserError":{"value":{"code":"UnauthorizedUserError","message":"Guest is not allowed to do this operation."}}}}}},"403":{"description":"ForbiddenUserError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"ForbiddenUserError":{"value":{"code":"ForbiddenUserError","message":"Non-admin is not allow to do this operation."}},"ForbiddenTokenError":{"value":{"code":"ForbiddenUserError","message":"Applications are not allowed to do this operation."}}}}}},"404":{"description":"NoUserError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"NoUserError":{"value":{"code":"NoUserError","message":"User {user} is not found."}}}}}},"500":{"description":"UnknownError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"UnknownError":{"value":{"code":"UnknownError","message":"Internal error message."}}}}}}},"description":"put /api/v2/users/{user}/grouplist/"},{"description":"get /api/v2/groups","tests":[{"operation":{"tag":"group","operationId":"getAllGroup","parameters":[],"response":{"statusCode":200,"schema":{"description":"Array with all groups in the system.","type":"array","items":{"type":"object","properties":{"groupname":{"type":"string","description":"group name"},"description":{"type":"string","description":"description for the group"},"externalName":{"type":"string","description":"the external group name binding with the group in OpenPAI"},"extension":{"type":"object"}}}},"contentType":"application/json"}}}],"schemas":{"200":{"description":"Succeeded","content":{"application/json":{"schema":{"description":"Array with all groups in the system.","type":"array","items":{"type":"object","properties":{"groupname":{"type":"string","description":"group name"},"description":{"type":"string","description":"description for the group"},"externalName":{"type":"string","description":"the external group name binding with the group in OpenPAI"},"extension":{"type":"object"}}}},"example":[{"groupname":"groupName","description":"description","externalName":"externalName","extension":{}}]}}},"500":{"description":"UnknownError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"UnknownError":{"value":{"code":"UnknownError","message":"Internal error message."}}}}}}}},{"tests":[{"operation":{"tag":"group","operationId":"createGroup","parameters":[{"type":"raw","value":{"groupname":"sdktestgroup"}}],"response":{"statusCode":201,"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"contentType":"application/json"}}}],"after":[{"tag":"group","operationId":"deleteGroup","parameters":[{"type":"raw","value":"sdktestgroup"}],"response":{"statusCode":201,"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"contentType":"application/json"}}],"schemas":{"201":{"description":"Succeeded","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"example":{"message":"group is created successfully"}}}},"401":{"description":"UnauthorizedUserError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"UnauthorizedUserError":{"value":{"code":"UnauthorizedUserError","message":"Guest is not allowed to do this operation."}}}}}},"403":{"description":"ForbiddenUserError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"ForbiddenUserError":{"value":{"code":"ForbiddenUserError","message":"Non-admin is not allow to do this operation."}},"ForbiddenTokenError":{"value":{"code":"ForbiddenUserError","message":"Applications are not allowed to do this operation."}}}}}},"500":{"description":"UnknownError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"UnknownError":{"value":{"code":"UnknownError","message":"Internal error message."}}}}}}},"description":"post /api/v2/groups"},{"before":[{"tag":"group","operationId":"createGroup","parameters":[{"type":"raw","value":{"groupname":"sdktestgroup"}}],"response":{"statusCode":201,"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"contentType":"application/json"}}],"tests":[{"operation":{"parameters":[{"type":"raw","value":{"data":{"groupname":"sdktestgroup","description":"test update group"},"patch":true}}],"tag":"group","operationId":"updateGroup","response":{"statusCode":201,"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"contentType":"application/json"}}}],"after":[{"tag":"group","operationId":"deleteGroup","parameters":[{"type":"raw","value":"sdktestgroup"}],"response":{"statusCode":201,"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"contentType":"application/json"}}],"schemas":{"201":{"description":"Succeeded","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"example":{"message":"update group {groupname} successfully."}}}},"401":{"description":"UnauthorizedUserError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"UnauthorizedUserError":{"value":{"code":"UnauthorizedUserError","message":"Guest is not allowed to do this operation."}}}}}},"403":{"description":"ForbiddenUserError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"ForbiddenUserError":{"value":{"code":"ForbiddenUserError","message":"Non-admin is not allow to do this operation."}},"ForbiddenTokenError":{"value":{"code":"ForbiddenUserError","message":"Applications are not allowed to do this operation."}}}}}},"404":{"description":"NoGroupError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"NoGroupError":{"value":{"code":"NoGroupError","message":"Group {groupname} is not found."}}}}}},"500":{"description":"UnknownError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"UnknownError":{"value":{"code":"UnknownError","message":"Internal error message."}}}}}}},"description":"put /api/v2/groups"},{"before":[{"tag":"group","operationId":"createGroup","parameters":[{"type":"raw","value":{"groupname":"sdktestgroup"}}],"response":{"statusCode":201,"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"contentType":"application/json"}}],"tests":[{"operation":{"parameters":[{"type":"raw","value":"sdktestgroup"}],"tag":"group","operationId":"getGroup","response":{"statusCode":200,"schema":{"type":"object","properties":{"groupname":{"type":"string","description":"group name"},"description":{"type":"string","description":"description for the group"},"externalName":{"type":"string","description":"the external group name binding with the group in OpenPAI"},"extension":{"type":"object"}},"required":["groupname","description","externalName","extension"]},"contentType":"application/json"}}}],"after":[{"tag":"group","operationId":"deleteGroup","parameters":[{"type":"raw","value":"sdktestgroup"}],"response":{"statusCode":201,"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"contentType":"application/json"}}],"schemas":{"200":{"description":"Succeeded","content":{"application/json":{"schema":{"type":"object","properties":{"groupname":{"type":"string","description":"group name"},"description":{"type":"string","description":"description for the group"},"externalName":{"type":"string","description":"the external group name binding with the group in OpenPAI"},"extension":{"type":"object"}},"required":["groupname","description","externalName","extension"]},"example":{"groupname":"groupName","description":"description","externalName":"externalName","extension":{}}}}},"401":{"description":"UnauthorizedUserError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"UnauthorizedUserError":{"value":{"code":"UnauthorizedUserError","message":"Guest is not allowed to do this operation."}}}}}},"404":{"description":"NoGroupError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"NoGroupError":{"value":{"code":"NoGroupError","message":"Group {groupname} is not found."}}}}}},"500":{"description":"UnknownError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"UnknownError":{"value":{"code":"UnknownError","message":"Internal error message."}}}}}}},"description":"get /api/v2/groups/{group}"},{"before":[{"tag":"group","operationId":"createGroup","parameters":[{"type":"raw","value":{"groupname":"sdktestgroup"}}],"response":{"statusCode":201,"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"contentType":"application/json"}}],"tests":[{"operation":{"tag":"group","operationId":"deleteGroup","parameters":[{"type":"raw","value":"sdktestgroup"}],"response":{"statusCode":201,"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"contentType":"application/json"}}}],"schemas":{"201":{"description":"Succeeded","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"example":{"message":"group is removed successfully"}}}},"401":{"description":"UnauthorizedUserError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"UnauthorizedUserError":{"value":{"code":"UnauthorizedUserError","message":"Guest is not allowed to do this operation."}}}}}},"403":{"description":"ForbiddenUserError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"ForbiddenUserError":{"value":{"code":"ForbiddenUserError","message":"Non-admin is not allow to do this operation."}},"ForbiddenTokenError":{"value":{"code":"ForbiddenUserError","message":"Applications are not allowed to do this operation."}}}}}},"500":{"description":"UnknownError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"UnknownError":{"value":{"code":"UnknownError","message":"Internal error message."}}}}}}},"description":"delete /api/v2/groups/{group}"},{"description":"get /api/v2/groups/{group}/userlist","tests":[{"operation":{"tag":"group","operationId":"getGroupMembers","parameters":[],"response":{"statusCode":200,"schema":{"description":"Array with all users in the group.","type":"array","items":{"type":"object","properties":{"username":{"type":"string","description":"user name"},"clusterAdmin":{"type":"boolean","description":"Cluster admin or not."}}}},"contentType":"application/json"}}}],"schemas":{"200":{"description":"Succeeded","content":{"application/json":{"schema":{"description":"Array with all users in the group.","type":"array","items":{"type":"object","properties":{"username":{"type":"string","description":"user name"},"clusterAdmin":{"type":"boolean","description":"Cluster admin or not."}}}},"example":[{"username":"username","clusterAdmin":false}]}}},"401":{"description":"UnauthorizedUserError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"UnauthorizedUserError":{"value":{"code":"UnauthorizedUserError","message":"Guest is not allowed to do this operation."}}}}}},"500":{"description":"UnknownError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"UnknownError":{"value":{"code":"UnknownError","message":"Internal error message."}}}}}}}},{"description":"get /api/v2/virtual-clusters","tests":[{"operation":{"tag":"virtual cluster","operationId":"listVirtualClusters","parameters":[],"response":{"statusCode":200,"schema":{"type":"object","additionalProperties":{"type":"object","properties":{"capacity":{"type":"number","description":"capacity percentage this virtual cluster can use of entire cluster"},"usedCapacity":{"type":"number","description":"used capacity percentage this virtual cluster can use of entire cluster"},"maxCapacity":{"type":"number","description":"max capacity percentage this virtual cluster can use of entire cluster"},"dedicated":{"type":"boolean","description":"dedicated virtual cluster or not"},"resourcesUsed":{"type":"object","description":"used resources","properties":{"cpu":{"type":"integer","description":"used cpu number"},"vCores":{"type":"integer","description":"same as cpu"},"memory":{"type":"integer","description":"used memory in MB"},"gpu":{"type":"integer","description":"used gpu number"},"GPUs":{"type":"integer","description":"same as gpu"}}},"resourcesGuaranteed":{"type":"object","description":"guaranteed resources, including used and free","properties":{"cpu":{"type":"integer","description":"guaranteed cpu number"},"vCores":{"type":"integer","description":"same as cpu"},"memory":{"type":"integer","description":"guaranteed memory in MB"},"gpu":{"type":"integer","description":"guaranteed gpu number"},"GPUs":{"type":"integer","description":"same as gpu"}}},"resourcesTotal":{"type":"object","description":"total resources, including guaranteed and bad","properties":{"cpu":{"type":"integer","description":"total cpu number"},"vCores":{"type":"integer","description":"same as cpu"},"memory":{"type":"integer","description":"total memory in MB"},"gpu":{"type":"integer","description":"total gpu number"},"GPUs":{"type":"integer","description":"same as gpu"}}}},"required":["capacity","usedCapacity","maxCapacity","resourcesUsed","resourcesGuaranteed","resourcesTotal"]}},"contentType":"application/json"}}}],"schemas":{"200":{"description":"Succeeded","content":{"application/json":{"schema":{"type":"object","additionalProperties":{"type":"object","properties":{"capacity":{"type":"number","description":"capacity percentage this virtual cluster can use of entire cluster"},"usedCapacity":{"type":"number","description":"used capacity percentage this virtual cluster can use of entire cluster"},"maxCapacity":{"type":"number","description":"max capacity percentage this virtual cluster can use of entire cluster"},"dedicated":{"type":"boolean","description":"dedicated virtual cluster or not"},"resourcesUsed":{"type":"object","description":"used resources","properties":{"cpu":{"type":"integer","description":"used cpu number"},"vCores":{"type":"integer","description":"same as cpu"},"memory":{"type":"integer","description":"used memory in MB"},"gpu":{"type":"integer","description":"used gpu number"},"GPUs":{"type":"integer","description":"same as gpu"}}},"resourcesGuaranteed":{"type":"object","description":"guaranteed resources, including used and free","properties":{"cpu":{"type":"integer","description":"guaranteed cpu number"},"vCores":{"type":"integer","description":"same as cpu"},"memory":{"type":"integer","description":"guaranteed memory in MB"},"gpu":{"type":"integer","description":"guaranteed gpu number"},"GPUs":{"type":"integer","description":"same as gpu"}}},"resourcesTotal":{"type":"object","description":"total resources, including guaranteed and bad","properties":{"cpu":{"type":"integer","description":"total cpu number"},"vCores":{"type":"integer","description":"same as cpu"},"memory":{"type":"integer","description":"total memory in MB"},"gpu":{"type":"integer","description":"total gpu number"},"GPUs":{"type":"integer","description":"same as gpu"}}}},"required":["capacity","usedCapacity","maxCapacity","resourcesUsed","resourcesGuaranteed","resourcesTotal"]}}}}},"500":{"description":"UnknownError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"UnknownError":{"value":{"code":"UnknownError","message":"Internal error message."}}}}}}}},{"tests":[{"operation":{"parameters":[{"type":"raw","value":"default"}],"tag":"virtual cluster","operationId":"getVirtualCluster","response":{"statusCode":200,"schema":{"type":"object","properties":{"capacity":{"type":"number","description":"capacity percentage this virtual cluster can use of entire cluster"},"usedCapacity":{"type":"number","description":"used capacity percentage this virtual cluster can use of entire cluster"},"maxCapacity":{"type":"number","description":"max capacity percentage this virtual cluster can use of entire cluster"},"dedicated":{"type":"boolean","description":"dedicated virtual cluster or not"},"resourcesUsed":{"type":"object","description":"used resources","properties":{"cpu":{"type":"integer","description":"used cpu number"},"vCores":{"type":"integer","description":"same as cpu"},"memory":{"type":"integer","description":"used memory in MB"},"gpu":{"type":"integer","description":"used gpu number"},"GPUs":{"type":"integer","description":"same as gpu"}}},"resourcesGuaranteed":{"type":"object","description":"guaranteed resources, including used and free","properties":{"cpu":{"type":"integer","description":"guaranteed cpu number"},"vCores":{"type":"integer","description":"same as cpu"},"memory":{"type":"integer","description":"guaranteed memory in MB"},"gpu":{"type":"integer","description":"guaranteed gpu number"},"GPUs":{"type":"integer","description":"same as gpu"}}},"resourcesTotal":{"type":"object","description":"total resources, including guaranteed and bad","properties":{"cpu":{"type":"integer","description":"total cpu number"},"vCores":{"type":"integer","description":"same as cpu"},"memory":{"type":"integer","description":"total memory in MB"},"gpu":{"type":"integer","description":"total gpu number"},"GPUs":{"type":"integer","description":"same as gpu"}}}},"required":["capacity","usedCapacity","maxCapacity","resourcesUsed","resourcesGuaranteed","resourcesTotal"]},"contentType":"application/json"}}}],"schemas":{"200":{"description":"Succeeded","content":{"application/json":{"schema":{"type":"object","properties":{"capacity":{"type":"number","description":"capacity percentage this virtual cluster can use of entire cluster"},"usedCapacity":{"type":"number","description":"used capacity percentage this virtual cluster can use of entire cluster"},"maxCapacity":{"type":"number","description":"max capacity percentage this virtual cluster can use of entire cluster"},"dedicated":{"type":"boolean","description":"dedicated virtual cluster or not"},"resourcesUsed":{"type":"object","description":"used resources","properties":{"cpu":{"type":"integer","description":"used cpu number"},"vCores":{"type":"integer","description":"same as cpu"},"memory":{"type":"integer","description":"used memory in MB"},"gpu":{"type":"integer","description":"used gpu number"},"GPUs":{"type":"integer","description":"same as gpu"}}},"resourcesGuaranteed":{"type":"object","description":"guaranteed resources, including used and free","properties":{"cpu":{"type":"integer","description":"guaranteed cpu number"},"vCores":{"type":"integer","description":"same as cpu"},"memory":{"type":"integer","description":"guaranteed memory in MB"},"gpu":{"type":"integer","description":"guaranteed gpu number"},"GPUs":{"type":"integer","description":"same as gpu"}}},"resourcesTotal":{"type":"object","description":"total resources, including guaranteed and bad","properties":{"cpu":{"type":"integer","description":"total cpu number"},"vCores":{"type":"integer","description":"same as cpu"},"memory":{"type":"integer","description":"total memory in MB"},"gpu":{"type":"integer","description":"total gpu number"},"GPUs":{"type":"integer","description":"same as gpu"}}}},"required":["capacity","usedCapacity","maxCapacity","resourcesUsed","resourcesGuaranteed","resourcesTotal"]},"example":{"capacity":70,"usedCapacity":30,"dedicated":false,"resourcesUsed":{"cpu":1,"memory":1024,"gpu":1,"vCores":1,"GPUs":1},"resourcesGuaranteed":{"cpu":2,"memory":2048,"gpu":2,"vCores":2,"GPUs":2},"resourcesTotal":{"cpu":2,"memory":2048,"gpu":2,"vCores":2,"GPUs":2},"maxCapacity":70}}}},"404":{"description":"NoVirtualClusterError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"NoVirtualClusterError":{"value":{"code":"NoVirtualClusterError","message":"Virtual cluster {vc} is not found."}}}}}},"500":{"description":"UnknownError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"UnknownError":{"value":{"code":"UnknownError","message":"Internal error message."}}}}}}},"description":"get /api/v2/virtual-clusters/{vc}"},{"description":"get /api/v2/storages","tests":[{"operation":{"tag":"storage","operationId":"getStorages","parameters":[],"response":{"statusCode":200,"schema":{"type":"object","description":"summary of configured PV storage","properties":{"storages":{"type":"array","items":{"type":"object","description":"summary of each storage","properties":{"name":{"type":"string"},"share":{"type":"boolean"},"volumeName":{"type":"string"}},"required":["name","share","volumeName"]}}},"required":["storages"]},"contentType":"application/json"}}}],"schemas":{"200":{"description":"Succeeded","content":{"application/json":{"schema":{"type":"object","description":"summary of configured PV storage","properties":{"storages":{"type":"array","items":{"type":"object","description":"summary of each storage","properties":{"name":{"type":"string"},"share":{"type":"boolean"},"volumeName":{"type":"string"}},"required":["name","share","volumeName"]}}},"required":["storages"]},"example":{"storages":[{"name":"name","share":true,"volumeName":"volumeName"}]}}}},"500":{"description":"UnknownError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"UnknownError":{"value":{"code":"UnknownError","message":"Internal error message."}}}}}}}},{"before":[{"tag":"storage","operationId":"getStorages"}],"tests":[{"operation":{"parameters":[{"type":"fromResult","resultType":"beforeResults","resultPath":["storages",0,"name"],"resultIndex":0}],"tag":"storage","operationId":"getStorage","response":{"statusCode":200,"schema":{"type":"object","description":"detail of configured PV storage","properties":{"name":{"type":"string"},"share":{"type":"boolean"},"volumeName":{"type":"string"},"type":{"type":"string","enum":["nfs","samba","azureFile","azureBlob","other","unknown"]},"data":{"anyOf":[{"type":"object","description":"nfs type","properties":{"server":{"type":"string"},"path":{"type":"string"}},"required":["server","path"]},{"type":"object","description":"samba type","properties":{"address":{"type":"string"},"username":{"type":"string"},"password":{"type":"string"}},"required":["address"]},{"type":"object","description":"azureFile type","properties":{"shareName":{"type":"string"},"accountName":{"type":"string"},"accountKey":{"type":"string"}},"required":["shareName"]},{"type":"object","description":"azureBlob type","properties":{"containerName":{"type":"string"},"accountName":{"type":"string"},"accountKey":{"type":"string"},"accountSASToken":{"type":"string"}},"required":["containerName"]},{"type":"object","description":"other/unknown type","properties":{}}]},"readOnly":{"type":"boolean"},"secretName":{"type":"string"},"mountOptions":{"type":"array","items":{"type":"string"}}},"required":["name","share","volumeName","type","data"]},"contentType":"application/json"}}}],"schemas":{"200":{"description":"Succeeded","content":{"application/json":{"schema":{"type":"object","description":"detail of configured PV storage","properties":{"name":{"type":"string"},"share":{"type":"boolean"},"volumeName":{"type":"string"},"type":{"type":"string","enum":["nfs","samba","azureFile","azureBlob","other","unknown"]},"data":{"anyOf":[{"type":"object","description":"nfs type","properties":{"server":{"type":"string"},"path":{"type":"string"}},"required":["server","path"]},{"type":"object","description":"samba type","properties":{"address":{"type":"string"},"username":{"type":"string"},"password":{"type":"string"}},"required":["address"]},{"type":"object","description":"azureFile type","properties":{"shareName":{"type":"string"},"accountName":{"type":"string"},"accountKey":{"type":"string"}},"required":["shareName"]},{"type":"object","description":"azureBlob type","properties":{"containerName":{"type":"string"},"accountName":{"type":"string"},"accountKey":{"type":"string"},"accountSASToken":{"type":"string"}},"required":["containerName"]},{"type":"object","description":"other/unknown type","properties":{}}]},"readOnly":{"type":"boolean"},"secretName":{"type":"string"},"mountOptions":{"type":"array","items":{"type":"string"}}},"required":["name","share","volumeName","type","data"]},"example":{"name":"nfs-storage-name","share":true,"volumeName":"nfs-volume-name","type":"nfs","data":{"server":"","path":"/data"}}}}},"403":{"description":"ForbiddenUserError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"ForbiddenUserError":{"value":{"code":"ForbiddenUserError","message":"User {user} is not allowed to access {storage}."}}}}}},"404":{"description":"NoStorageError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"NoVirtualClusterError":{"value":{"code":"NoStorageError","message":"Storage {storage} is not found."}}}}}},"500":{"description":"UnknownError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"UnknownError":{"value":{"code":"UnknownError","message":"Internal error message."}}}}}}},"description":"get /api/v2/storages/{storage}"},{"tests":[{"operation":{"tag":"job","operationId":"createJob","parameters":[{"type":"raw","value":{"contributor":"OpenPAI","description":"# Serving a TensorFlow MNIST Digit Recognition Model\nThis example shows you how to use TensorFlow Serving components to export a trained TensorFlow model\nand use the standard tensorflow_model_server to serve it on OpenPAI.\nThis example uses the simple Softmax Regression model introduced in the TensorFlow tutorial for handwritten image (MNIST data) classification.\nReference https://www.tensorflow.org/tfx/serving/serving_basic.\n","name":"sdk_test_job0f565fe3","parameters":{"modelPath":"/tmp/mnist_model"},"prerequisites":[{"contributor":"OpenPAI","description":"This is an [example TensorFlow Serving Docker image on OpenPAI](https://github.com/Microsoft/pai/tree/master/examples/serving).\n","name":"tf_serving_example","protocolVersion":2,"type":"dockerimage","uri":"openpai/pai.example.tensorflow-serving","version":"1.0-r1.4"}],"protocolVersion":2,"taskRoles":{"worker":{"commands":["bazel-bin/tensorflow_serving/example/mnist_saved_model <% $parameters.modelPath %>","tensorflow_model_server --port=$PAI_CONTAINER_HOST_model_server_PORT_LIST --model_name=mnist --model_base_path=<% $parameters.modelPath %>"],"dockerImage":"tf_serving_example","instances":1,"resourcePerInstance":{"cpu":4,"gpu":1,"memoryMB":8192,"ports":{"model_server":1}}}},"type":"job","version":"1.0"}}],"response":{"statusCode":202,"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"contentType":"application/json"}}}],"after":[{"tag":"job","operationId":"updateJobExecutionType","parameters":[{"type":"raw","value":"sdk_test"},{"type":"raw","value":"sdk_test_job0f565fe3"},{"type":"raw","value":"STOP"}]}],"schemas":{"202":{"description":"Succeeded","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"example":{"message":"update job {job} successfully"}}}},"400":{"description":"NoVirtualClusterError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"NoVirtualClusterError":{"value":{"code":"NoVirtualClusterError","message":"Virtual cluster {vc} is not found."}}}}}},"403":{"description":"ForbiddenUserError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"ForbiddenUserError":{"value":{"code":"ForbiddenUserError","message":"Non-admin is not allow to do this operation."}},"ForbiddenTokenError":{"value":{"code":"ForbiddenUserError","message":"Applications are not allowed to do this operation."}}}}}},"409":{"description":"ConflictJobError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"ConflictJobError":{"value":{"code":"ConflictJobError","message":"Job name {job} already exists."}}}}}},"500":{"description":"UnknownError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"UnknownError":{"value":{"code":"UnknownError","message":"Internal error message."}}}}}}},"description":"post /api/v2/jobs"},{"description":"get /api/v2/jobs","tests":[{"operation":{"tag":"job","operationId":"listJobs","parameters":[],"response":{"statusCode":200,"schema":{"type":"array","description":"job summary list","items":{"type":"object","properties":{"name":{"type":"string","description":"job name"},"username":{"type":"string","description":"user name or \"unknown\""},"state":{"type":"string","description":"general job state","enum":["WAITING","RUNNING","STOPPING","STOPPED","SUCCEEDED","FAILED","UNKNOWN"]},"subState":{"type":"string","description":"job state in framework controller","enum":["AttemptCreationPending","AttemptCreationRequested","AttemptPreparing","AttemptRunning","AttemptDeletionPending","AttemptDeletionRequested","AttemptDeleting","AttemptCompleted","Completed"]},"executionType":{"type":"string","description":"start or stop","enum":["START","STOP"]},"retries":{"type":"integer","description":"job retried times"},"retryDetails":{"type":"object","properties":{"user":{"type":"integer"},"platform":{"type":"integer"},"resource":{"type":"integer"}}},"retryDelayTime":{"type":"integer","nullable":true,"description":"retry delay time"},"createdTime":{"type":"integer","description":"job created time, in number of milliseconds since the Unix Epoch."},"completedTime":{"type":"integer","nullable":true,"description":"job completed time, in number of milliseconds since the Unix Epoch."},"appExitCode":{"type":"integer","nullable":true,"description":"job exit code"},"virtualCluster":{"type":"string","description":"virtual cluster to which the job submitted, or \"unknown\""},"totalGpuNumber":{"type":"integer","description":"total gpu number used in the job"},"totalTaskNumber":{"type":"integer","description":"total task number used in the job"},"totalTaskRoleNumber":{"type":"integer","description":"total task role number used in the job"},"debugId":{"type":"string","description":"md5 hash name for the job in framework controller, used for debug purpose"}},"required":["name","username","virtualCluster","state","subState","executionType","retries","createdTime","completedTime","appExitCode"]}},"contentType":"application/json"}}}],"schemas":{"200":{"description":"Succeeded","content":{"application/json":{"schema":{"type":"array","description":"job summary list","items":{"type":"object","properties":{"name":{"type":"string","description":"job name"},"username":{"type":"string","description":"user name or \"unknown\""},"state":{"type":"string","description":"general job state","enum":["WAITING","RUNNING","STOPPING","STOPPED","SUCCEEDED","FAILED","UNKNOWN"]},"subState":{"type":"string","description":"job state in framework controller","enum":["AttemptCreationPending","AttemptCreationRequested","AttemptPreparing","AttemptRunning","AttemptDeletionPending","AttemptDeletionRequested","AttemptDeleting","AttemptCompleted","Completed"]},"executionType":{"type":"string","description":"start or stop","enum":["START","STOP"]},"retries":{"type":"integer","description":"job retried times"},"retryDetails":{"type":"object","properties":{"user":{"type":"integer"},"platform":{"type":"integer"},"resource":{"type":"integer"}}},"retryDelayTime":{"type":"integer","nullable":true,"description":"retry delay time"},"createdTime":{"type":"integer","description":"job created time, in number of milliseconds since the Unix Epoch."},"completedTime":{"type":"integer","nullable":true,"description":"job completed time, in number of milliseconds since the Unix Epoch."},"appExitCode":{"type":"integer","nullable":true,"description":"job exit code"},"virtualCluster":{"type":"string","description":"virtual cluster to which the job submitted, or \"unknown\""},"totalGpuNumber":{"type":"integer","description":"total gpu number used in the job"},"totalTaskNumber":{"type":"integer","description":"total task number used in the job"},"totalTaskRoleNumber":{"type":"integer","description":"total task role number used in the job"},"debugId":{"type":"string","description":"md5 hash name for the job in framework controller, used for debug purpose"}},"required":["name","username","virtualCluster","state","subState","executionType","retries","createdTime","completedTime","appExitCode"]}},"example":[{"protocolVersion":"2","name":"job name","username":"user name","state":"SUCCEEDED","subState":"Completed","executionType":"STOP","retries":0,"createdTime":0,"completedTime":0,"appExitCode":0,"virtualCluster":"unknown"}]}}},"500":{"description":"UnknownError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"UnknownError":{"value":{"code":"UnknownError","message":"Internal error message."}}}}}}}},{"before":[{"tag":"job","operationId":"createJob","parameters":[{"type":"raw","value":{"contributor":"OpenPAI","description":"# Serving a TensorFlow MNIST Digit Recognition Model\nThis example shows you how to use TensorFlow Serving components to export a trained TensorFlow model\nand use the standard tensorflow_model_server to serve it on OpenPAI.\nThis example uses the simple Softmax Regression model introduced in the TensorFlow tutorial for handwritten image (MNIST data) classification.\nReference https://www.tensorflow.org/tfx/serving/serving_basic.\n","name":"sdk_test_jobf6d9ceaa","parameters":{"modelPath":"/tmp/mnist_model"},"prerequisites":[{"contributor":"OpenPAI","description":"This is an [example TensorFlow Serving Docker image on OpenPAI](https://github.com/Microsoft/pai/tree/master/examples/serving).\n","name":"tf_serving_example","protocolVersion":2,"type":"dockerimage","uri":"openpai/pai.example.tensorflow-serving","version":"1.0-r1.4"}],"protocolVersion":2,"taskRoles":{"worker":{"commands":["bazel-bin/tensorflow_serving/example/mnist_saved_model <% $parameters.modelPath %>","tensorflow_model_server --port=$PAI_CONTAINER_HOST_model_server_PORT_LIST --model_name=mnist --model_base_path=<% $parameters.modelPath %>"],"dockerImage":"tf_serving_example","instances":1,"resourcePerInstance":{"cpu":4,"gpu":1,"memoryMB":8192,"ports":{"model_server":1}}}},"type":"job","version":"1.0"}}]}],"tests":[{"description":"Get a job detail","operation":{"parameters":[{"type":"raw","value":"sdk_test"},{"type":"raw","value":"sdk_test_jobf6d9ceaa"}],"tag":"job","operationId":"getJob","response":{"statusCode":200,"schema":{"type":"object","description":"job details","properties":{"name":{"type":"string","description":"job name"},"jobStatus":{"type":"object","description":"job status","properties":{"username":{"type":"string","description":"user name or \"unknown\""},"state":{"type":"string","description":"general job state","enum":["WAITING","RUNNING","STOPPING","STOPPED","SUCCEEDED","FAILED","UNKNOWN"]},"subState":{"type":"string","description":"job state in framework controller","enum":["AttemptCreationPending","AttemptCreationRequested","AttemptPreparing","AttemptRunning","AttemptDeletionPending","AttemptDeletionRequested","AttemptDeleting","AttemptCompleted","Completed"]},"executionType":{"type":"string","description":"start or stop","enum":["START","STOP"]},"retries":{"type":"integer","description":"job retried times"},"retryDetails":{"type":"object","properties":{"user":{"type":"integer"},"platform":{"type":"integer"},"resource":{"type":"integer"}}},"retryDelayTime":{"type":"integer","nullable":true,"description":"retry delay time"},"createdTime":{"type":"integer","description":"job created time, in number of milliseconds since the Unix Epoch."},"completedTime":{"type":"integer","nullable":true,"description":"job completed time, in number of milliseconds since the Unix Epoch."},"appId":{"type":"string","description":"unique id for the job"},"appLaunchedTime":{"type":"integer","nullable":true,"description":"job launched time for last attempt, in number of milliseconds since the Unix Epoch."},"appCompletedTime":{"type":"integer","nullable":true,"description":"job completed time for last attempt, in number of milliseconds since the Unix Epoch. to get durations for last attempt:\n wholeDuration = completedTime - createdTime;\n runningDuration = appCompletedTime - appLaunchedTime;\n waitingDuration = wholeDuration - runningDuration.\nto get durations for all attempts:\n runningDuration = sum(appCompletedTime - appLaunchedTime) for all attempts.\n"},"appExitCode":{"type":"integer","nullable":true,"description":"job exit code"},"appExitSpec":{"type":"object","nullable":true,"description":"job exit spec","properties":{"code":{"type":"integer"},"phrase":{"type":"string"},"issuer":{"type":"string"},"causer":{"type":"string"},"type":{"type":"string"},"stage":{"type":"string"},"behavior":{"type":"string"},"reaction":{"type":"string"},"repro":{"type":"array","items":{"type":"string"}}}},"appExitDiagnostics":{"type":"string","nullable":true,"description":"job exit diagnostics"},"appExitMessages":{"type":"object","nullable":true,"properties":{"container":{"type":"string","nullable":true},"runtime":{"type":"string","nullable":true},"launcher":{"type":"string","nullable":true}}},"appExitTriggerMessage":{"type":"string","nullable":true,"description":"job completion message"},"appExitTriggerTaskRoleName":{"type":"string","nullable":true,"description":"task role name which triggered job completion"},"appExitTriggerTaskIndex":{"type":"integer","nullable":true,"description":"task index which triggered job completion"},"appExitType":{"type":"string","nullable":true,"description":"job completion type"},"virtualCluster":{"type":"string","description":"virtual cluster to which the job submitted, or \"unknown\""}},"required":["username","virtualCluster","state","subState","executionType","retries","createdTime","completedTime","appId","appLaunchedTime","appCompletedTime","appExitCode"]},"taskRoles":{"type":"object","additionalProperties":{"type":"object","description":"task role status","properties":{"taskRoleStatus":{"type":"object","properties":{"name":{"type":"string","description":"task role name"}},"required":["name"]},"taskStatuses":{"type":"array","description":"task statuses in the task role","items":{"type":"object","properties":{"taskIndex":{"type":"integer","description":"task index"},"taskState":{"type":"string","description":"task state","enum":["WAITING","RUNNING","STOPPING","STOPPED","SUCCEEDED","FAILED","UNKNOWN"]},"containerId":{"type":"string","description":"uid of the task container"},"containerIp":{"type":"string","description":"ip of the task container"},"containerPorts":{"type":"object","description":"ports of the task container"},"containerGpus":{"type":"string","nullable":true,"description":"gpu of the task container"},"containerLog":{"type":"string","description":"log url of the task container"},"containerExitCode":{"type":"integer","nullable":true,"description":"exit code the task container"}}}}},"required":["taskRoleStatus","taskStatuses"]}},"debugId":{"type":"string","description":"md5 hash name for the job in framework controller, used for debug purpose"}},"required":["name","jobStatus","taskRoles"]},"contentType":"application/json"}}},{"description":"Get nonexist job detail","operation":{"parameters":[{"type":"raw","value":"sdk_test"},{"type":"raw","value":"sdk_test_nonexist_job"}],"response":{"statusCode":404,"schema":{"description":"NoJobError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"NoJobError":{"value":{"code":"NoJobError","message":"Job {job} is not found."}}}}}}},"tag":"job","operationId":"getJob"}}],"after":[{"tag":"job","operationId":"updateJobExecutionType","parameters":[{"type":"raw","value":"sdk_test"},{"type":"raw","value":"sdk_test_jobf6d9ceaa"},{"type":"raw","value":"STOP"}]}],"schemas":{"200":{"description":"Succeeded","content":{"application/json":{"schema":{"type":"object","description":"job details","properties":{"name":{"type":"string","description":"job name"},"jobStatus":{"type":"object","description":"job status","properties":{"username":{"type":"string","description":"user name or \"unknown\""},"state":{"type":"string","description":"general job state","enum":["WAITING","RUNNING","STOPPING","STOPPED","SUCCEEDED","FAILED","UNKNOWN"]},"subState":{"type":"string","description":"job state in framework controller","enum":["AttemptCreationPending","AttemptCreationRequested","AttemptPreparing","AttemptRunning","AttemptDeletionPending","AttemptDeletionRequested","AttemptDeleting","AttemptCompleted","Completed"]},"executionType":{"type":"string","description":"start or stop","enum":["START","STOP"]},"retries":{"type":"integer","description":"job retried times"},"retryDetails":{"type":"object","properties":{"user":{"type":"integer"},"platform":{"type":"integer"},"resource":{"type":"integer"}}},"retryDelayTime":{"type":"integer","nullable":true,"description":"retry delay time"},"createdTime":{"type":"integer","description":"job created time, in number of milliseconds since the Unix Epoch."},"completedTime":{"type":"integer","nullable":true,"description":"job completed time, in number of milliseconds since the Unix Epoch."},"appId":{"type":"string","description":"unique id for the job"},"appLaunchedTime":{"type":"integer","nullable":true,"description":"job launched time for last attempt, in number of milliseconds since the Unix Epoch."},"appCompletedTime":{"type":"integer","nullable":true,"description":"job completed time for last attempt, in number of milliseconds since the Unix Epoch. to get durations for last attempt:\n wholeDuration = completedTime - createdTime;\n runningDuration = appCompletedTime - appLaunchedTime;\n waitingDuration = wholeDuration - runningDuration.\nto get durations for all attempts:\n runningDuration = sum(appCompletedTime - appLaunchedTime) for all attempts.\n"},"appExitCode":{"type":"integer","nullable":true,"description":"job exit code"},"appExitSpec":{"type":"object","nullable":true,"description":"job exit spec","properties":{"code":{"type":"integer"},"phrase":{"type":"string"},"issuer":{"type":"string"},"causer":{"type":"string"},"type":{"type":"string"},"stage":{"type":"string"},"behavior":{"type":"string"},"reaction":{"type":"string"},"repro":{"type":"array","items":{"type":"string"}}}},"appExitDiagnostics":{"type":"string","nullable":true,"description":"job exit diagnostics"},"appExitMessages":{"type":"object","nullable":true,"properties":{"container":{"type":"string","nullable":true},"runtime":{"type":"string","nullable":true},"launcher":{"type":"string","nullable":true}}},"appExitTriggerMessage":{"type":"string","nullable":true,"description":"job completion message"},"appExitTriggerTaskRoleName":{"type":"string","nullable":true,"description":"task role name which triggered job completion"},"appExitTriggerTaskIndex":{"type":"integer","nullable":true,"description":"task index which triggered job completion"},"appExitType":{"type":"string","nullable":true,"description":"job completion type"},"virtualCluster":{"type":"string","description":"virtual cluster to which the job submitted, or \"unknown\""}},"required":["username","virtualCluster","state","subState","executionType","retries","createdTime","completedTime","appId","appLaunchedTime","appCompletedTime","appExitCode"]},"taskRoles":{"type":"object","additionalProperties":{"type":"object","description":"task role status","properties":{"taskRoleStatus":{"type":"object","properties":{"name":{"type":"string","description":"task role name"}},"required":["name"]},"taskStatuses":{"type":"array","description":"task statuses in the task role","items":{"type":"object","properties":{"taskIndex":{"type":"integer","description":"task index"},"taskState":{"type":"string","description":"task state","enum":["WAITING","RUNNING","STOPPING","STOPPED","SUCCEEDED","FAILED","UNKNOWN"]},"containerId":{"type":"string","description":"uid of the task container"},"containerIp":{"type":"string","description":"ip of the task container"},"containerPorts":{"type":"object","description":"ports of the task container"},"containerGpus":{"type":"string","nullable":true,"description":"gpu of the task container"},"containerLog":{"type":"string","description":"log url of the task container"},"containerExitCode":{"type":"integer","nullable":true,"description":"exit code the task container"}}}}},"required":["taskRoleStatus","taskStatuses"]}},"debugId":{"type":"string","description":"md5 hash name for the job in framework controller, used for debug purpose"}},"required":["name","jobStatus","taskRoles"]},"example":{"name":"job name","jobStatus":{"username":"user name","state":"SUCCEEDED","subState":"Completed","executionType":"STOP","retries":0,"createdTime":0,"completedTime":0,"appId":"id","appLaunchedTime":0,"appCompletedTime":0,"appExitCode":0,"virtualCluster":"unknown"},"taskRoles":{"taskrole":{"taskRoleStatus":{"name":"task role name"},"taskStatuses":[{"taskIndex":0,"taskState":"SUCCEEDED"}]}}}}}},"404":{"description":"NoJobError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"NoJobError":{"value":{"code":"NoJobError","message":"Job {job} is not found."}}}}}},"500":{"description":"UnknownError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"UnknownError":{"value":{"code":"UnknownError","message":"Internal error message."}}}}}}},"description":"get /api/v2/jobs/{user}~{job}"},{"before":[{"tag":"job","operationId":"createJob","parameters":[{"type":"raw","value":{"contributor":"OpenPAI","description":"# Serving a TensorFlow MNIST Digit Recognition Model\nThis example shows you how to use TensorFlow Serving components to export a trained TensorFlow model\nand use the standard tensorflow_model_server to serve it on OpenPAI.\nThis example uses the simple Softmax Regression model introduced in the TensorFlow tutorial for handwritten image (MNIST data) classification.\nReference https://www.tensorflow.org/tfx/serving/serving_basic.\n","name":"sdk_test_job34983b1e","parameters":{"modelPath":"/tmp/mnist_model"},"prerequisites":[{"contributor":"OpenPAI","description":"This is an [example TensorFlow Serving Docker image on OpenPAI](https://github.com/Microsoft/pai/tree/master/examples/serving).\n","name":"tf_serving_example","protocolVersion":2,"type":"dockerimage","uri":"openpai/pai.example.tensorflow-serving","version":"1.0-r1.4"}],"protocolVersion":2,"taskRoles":{"worker":{"commands":["bazel-bin/tensorflow_serving/example/mnist_saved_model <% $parameters.modelPath %>","tensorflow_model_server --port=$PAI_CONTAINER_HOST_model_server_PORT_LIST --model_name=mnist --model_base_path=<% $parameters.modelPath %>"],"dockerImage":"tf_serving_example","instances":1,"resourcePerInstance":{"cpu":4,"gpu":1,"memoryMB":8192,"ports":{"model_server":1}}}},"type":"job","version":"1.0"}}]}],"tests":[{"description":"Get a job config","operation":{"parameters":[{"type":"raw","value":"sdk_test"},{"type":"raw","value":"sdk_test_job34983b1e"}],"tag":"job","operationId":"getJobConfig","response":{"statusCode":200,"schema":{"type":"object","description":"openpai job protocol","properties":{"protocolVersion":{"oneOf":[{"type":"number"},{"type":"string"}],"description":"Protocol version, current version is 2."},"name":{"type":"string","maxLength":255,"description":"String in ^[a-zA-Z0-9_-]+$ format, no longer than 255 characters."},"type":{"type":"string","description":"Component type, should be \"job\" here."},"version":{"type":"string","description":"Component version, default is latest."},"contributor":{"type":"string"},"description":{"type":"string"},"prerequisites":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"type":{"type":"string","enum":["data","script","dockerimage","output"]},"version":{"type":"string"},"contributor":{"type":"string"},"description":{"type":"string"},"auth":{"type":"object","properties":{"username":{"type":"string"},"password":{"type":"string"},"registryuri":{"type":"string"}}},"uri":{"oneOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}]}}}},"parameters":{"type":"object","additionalProperties":true},"secrets":{"type":"object","additionalProperties":true},"jobRetryCount":{"type":"integer","description":"Default is 0."},"taskRoles":{"type":"object","additionalProperties":{"type":"object","properties":{"instances":{"type":"integer","description":"Default is 1, instances of a taskRole, no less than 1."},"completion":{"type":"object","description":"Completion poclicy for the job.","properties":{"minFailedInstances":{"type":"integer"},"minSucceededInstances":{"type":"integer"}}},"taskRetryCount":{"type":"integer","description":"Default is 0."},"dockerImage":{"type":"string","description":"Should reference to a dockerimage defined in prerequisites."},"data":{"type":"string"},"output":{"type":"string"},"script":{"type":"string"},"extraContainerOptions":{"type":"object","properties":{"shmMB":{"type":"integer","description":"Config the /dev/shm in a docker container."},"infiniband":{"type":"boolean","description":"Use InfiniBand devices or not in a docker container."}}},"resourcePerInstance":{"type":"object","properties":{"cpu":{"type":"integer","description":"CPU number, unit is CPU vcore."},"memoryMB":{"type":"integer","description":"Memory number, unit is MB."},"gpu":{"type":"integer","description":"GPU number, unit is GPU card."},"ports":{"type":"object","additionalProperties":{"type":"integer","description":"Port number for the port label."}}}},"commands":{"type":"array","items":{"type":"string"}}},"required":["dockerImage","resourcePerInstance","commands"]}},"deployments":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"taskRoles":{"type":"object","additionalProperties":{"type":"object","properties":{"preCommands":{"type":"array","items":{"type":"string"}},"postCommands":{"type":"array","items":{"type":"string"}}}}}}}},"defaults":{"type":"object","description":"Default cluster specific settings.","properties":{"virtualCluster":{"type":"string"},"deployment":{"type":"string"}}},"extras":{"type":"object","description":"Extra field, save any information that plugin may use.","properties":{"submitFrom":{"type":"string"},"hivedScheduler":{"type":"object","properties":{"jobPriorityClass":{"type":"string"},"taskRoles":{"type":"object","additionalProperties":{"type":"object","properties":{"skuType":{"type":"string"},"affinityGroupName":{"type":"string"}}}}}}}}},"required":["protocolVersion","name","type","taskRoles"]},"contentType":"text/yaml"}}},{"description":"Get nonexist job config","operation":{"parameters":[{"type":"raw","value":"sdk_test"},{"type":"raw","value":"sdk_test_nonexist_job"}],"response":{"statusCode":404,"schema":{"description":"NoJobError or NoJobConfigError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"NoJobError":{"value":{"code":"NoJobError","message":"Job {job} is not found."}},"NoJobConfigError":{"value":{"code":"NoJobConfigError","message":"Config of job {job} is not found."}}}}}}},"tag":"job","operationId":"getJobConfig"}}],"after":[{"tag":"job","operationId":"updateJobExecutionType","parameters":[{"type":"raw","value":"sdk_test"},{"type":"raw","value":"sdk_test_job34983b1e"},{"type":"raw","value":"STOP"}]}],"schemas":{"200":{"description":"Succeeded","content":{"text/yaml":{"schema":{"type":"object","description":"openpai job protocol","properties":{"protocolVersion":{"oneOf":[{"type":"number"},{"type":"string"}],"description":"Protocol version, current version is 2."},"name":{"type":"string","maxLength":255,"description":"String in ^[a-zA-Z0-9_-]+$ format, no longer than 255 characters."},"type":{"type":"string","description":"Component type, should be \"job\" here."},"version":{"type":"string","description":"Component version, default is latest."},"contributor":{"type":"string"},"description":{"type":"string"},"prerequisites":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"type":{"type":"string","enum":["data","script","dockerimage","output"]},"version":{"type":"string"},"contributor":{"type":"string"},"description":{"type":"string"},"auth":{"type":"object","properties":{"username":{"type":"string"},"password":{"type":"string"},"registryuri":{"type":"string"}}},"uri":{"oneOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}]}}}},"parameters":{"type":"object","additionalProperties":true},"secrets":{"type":"object","additionalProperties":true},"jobRetryCount":{"type":"integer","description":"Default is 0."},"taskRoles":{"type":"object","additionalProperties":{"type":"object","properties":{"instances":{"type":"integer","description":"Default is 1, instances of a taskRole, no less than 1."},"completion":{"type":"object","description":"Completion poclicy for the job.","properties":{"minFailedInstances":{"type":"integer"},"minSucceededInstances":{"type":"integer"}}},"taskRetryCount":{"type":"integer","description":"Default is 0."},"dockerImage":{"type":"string","description":"Should reference to a dockerimage defined in prerequisites."},"data":{"type":"string"},"output":{"type":"string"},"script":{"type":"string"},"extraContainerOptions":{"type":"object","properties":{"shmMB":{"type":"integer","description":"Config the /dev/shm in a docker container."},"infiniband":{"type":"boolean","description":"Use InfiniBand devices or not in a docker container."}}},"resourcePerInstance":{"type":"object","properties":{"cpu":{"type":"integer","description":"CPU number, unit is CPU vcore."},"memoryMB":{"type":"integer","description":"Memory number, unit is MB."},"gpu":{"type":"integer","description":"GPU number, unit is GPU card."},"ports":{"type":"object","additionalProperties":{"type":"integer","description":"Port number for the port label."}}}},"commands":{"type":"array","items":{"type":"string"}}},"required":["dockerImage","resourcePerInstance","commands"]}},"deployments":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"taskRoles":{"type":"object","additionalProperties":{"type":"object","properties":{"preCommands":{"type":"array","items":{"type":"string"}},"postCommands":{"type":"array","items":{"type":"string"}}}}}}}},"defaults":{"type":"object","description":"Default cluster specific settings.","properties":{"virtualCluster":{"type":"string"},"deployment":{"type":"string"}}},"extras":{"type":"object","description":"Extra field, save any information that plugin may use.","properties":{"submitFrom":{"type":"string"},"hivedScheduler":{"type":"object","properties":{"jobPriorityClass":{"type":"string"},"taskRoles":{"type":"object","additionalProperties":{"type":"object","properties":{"skuType":{"type":"string"},"affinityGroupName":{"type":"string"}}}}}}}}},"required":["protocolVersion","name","type","taskRoles"]},"example":{"protocolVersion":"2","name":"","type":"job","prerequisites":[{"name":"","type":"dockerimage","uri":"image_url"}],"taskRoles":{"train":{"instances":1,"dockerImage":"","resourcePerInstance":{"cpu":1,"memoryMB":16384,"gpu":1},"commands":["python "]}}}}}},"404":{"description":"NoJobError or NoJobConfigError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"NoJobError":{"value":{"code":"NoJobError","message":"Job {job} is not found."}},"NoJobConfigError":{"value":{"code":"NoJobConfigError","message":"Config of job {job} is not found."}}}}}},"500":{"description":"UnknownError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"UnknownError":{"value":{"code":"UnknownError","message":"Internal error message."}}}}}}},"description":"get /api/v2/jobs/{user}~{job}/config"},{"description":"put /api/v2/jobs/{user}~{job}/executionType","tests":[{"operation":{"tag":"job","operationId":"updateJobExecutionType","parameters":[],"response":{"statusCode":202,"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"contentType":"application/json"}}}],"schemas":{"202":{"description":"Succeeded","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"example":{"message":"execute job {job} successfully"}}}},"404":{"description":"NoJobError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"NoJobError":{"value":{"code":"NoJobError","message":"Job {job} is not found."}}}}}},"500":{"description":"UnknownError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"UnknownError":{"value":{"code":"UnknownError","message":"Internal error message."}}}}}}}},{"description":"get /api/v2/jobs/{user}~{job}/job-attempts/healthz","tests":[{"operation":{"tag":"job history","operationId":"getJobAttemptsHealthz","parameters":[],"response":{"statusCode":200}}}],"schemas":{"200":{"description":"OK"},"501":{"description":"Not healthy"}}},{"before":[{"tag":"job","operationId":"createJob","parameters":[{"type":"raw","value":{"contributor":"OpenPAI","description":"# Serving a TensorFlow MNIST Digit Recognition Model\nThis example shows you how to use TensorFlow Serving components to export a trained TensorFlow model\nand use the standard tensorflow_model_server to serve it on OpenPAI.\nThis example uses the simple Softmax Regression model introduced in the TensorFlow tutorial for handwritten image (MNIST data) classification.\nReference https://www.tensorflow.org/tfx/serving/serving_basic.\n","name":"sdk_test_jobafad2e2b","parameters":{"modelPath":"/tmp/mnist_model"},"prerequisites":[{"contributor":"OpenPAI","description":"This is an [example TensorFlow Serving Docker image on OpenPAI](https://github.com/Microsoft/pai/tree/master/examples/serving).\n","name":"tf_serving_example","protocolVersion":2,"type":"dockerimage","uri":"openpai/pai.example.tensorflow-serving","version":"1.0-r1.4"}],"protocolVersion":2,"taskRoles":{"worker":{"commands":["bazel-bin/tensorflow_serving/example/mnist_saved_model <% $parameters.modelPath %>","tensorflow_model_server --port=$PAI_CONTAINER_HOST_model_server_PORT_LIST --model_name=mnist --model_base_path=<% $parameters.modelPath %>"],"dockerImage":"tf_serving_example","instances":1,"resourcePerInstance":{"cpu":4,"gpu":1,"memoryMB":8192,"ports":{"model_server":1}}}},"type":"job","version":"1.0"}}]}],"tests":[{"operation":{"parameters":[{"type":"raw","value":"sdk_test"},{"type":"raw","value":"sdk_test_jobafad2e2b"}],"tag":"job history","operationId":"getJobAttempts","response":{"statusCode":200,"schema":{"type":"array","items":{"type":"object","description":"job attempt","properties":{"jobName":{"type":"string"},"frameworkName":{"type":"string"},"uid":{"type":"string"},"userName":{"type":"string"},"state":{"type":"string"},"originState":{"type":"string"},"maxAttemptCount":{"type":"integer"},"attemptIndex":{"type":"integer"},"jobStartedTime":{"type":"integer"},"attemptStartedTime":{"type":"integer"},"attemptCompletedTime":{"type":"integer","nullable":true},"exitCode":{"type":"integer","nullable":true},"exitPhrase":{"type":"string","nullable":true},"exitType":{"type":"string","nullable":true},"exitDiagnostics":{"type":"object","nullable":true,"properties":{"diagnosticsSummary":{"type":"string"},"runtime":{"type":"object","nullable":true,"properties":{"exitCode":{"type":"integer","nullable":true},"originUserExitCode":{"type":"integer","nullable":true},"errorLogs":{"type":"object","nullable":true,"properties":{"user":{"type":"string"},"platform":{"type":"string"}}},"name":{"type":"string"}}},"launcher":{"type":"string"}}},"appExitTriggerMessage":{"type":"string","nullable":true},"appExitTriggerTaskRoleName":{"type":"string","nullable":true},"appExitTriggerTaskIndex":{"type":"integer","nullable":true},"appExitSpec":{"type":"object","nullable":true,"properties":{"code":{"type":"integer"},"phrase":{"type":"string"},"issuer":{"type":"string"},"causer":{"type":"string"},"type":{"type":"string"},"stage":{"type":"string"},"behavior":{"type":"string"},"reaction":{"type":"string"},"reason":{"type":"string"},"repro":{"type":"array","items":{"type":"string"}},"solution":{"type":"array","items":{"type":"string"}}}},"appExitDiagnostics":{"type":"string","nullable":true},"appExitMessages":{"type":"object","nullable":true,"properties":{"container":{"type":"string","nullable":true},"runtime":{"type":"object","nullable":true,"properties":{"exitCode":{"type":"integer","nullable":true},"originUserExitCode":{"type":"integer","nullable":true},"errorLogs":{"type":"object","nullable":true,"properties":{"user":{"type":"string"},"platform":{"type":"string"}}},"name":{"type":"string"}}},"launcher":{"type":"string","nullable":true}}},"totalGpuNumber":{"type":"integer"},"totalTasknumber":{"type":"integer"},"totalTaskRoleNumber":{"type":"integer"},"taskRoles":{"type":"object","properties":{"taskrole":{"type":"object","properties":{"taskRoleStatus":{"type":"object","properties":{"name":{"type":"string"}},"required":["name"]},"taskStatuses":{"type":"array","items":{"type":"object","properties":{"taskIndex":{"type":"integer"},"taskState":{"type":"string","enum":["WAITING","RUNNING","STOPPING","STOPPED","SUCCEEDED","FAILED","UNKNOWN"]},"containerId":{"type":"string"},"containerIp":{"type":"string"},"containerGpus":{"type":"string","nullable":true},"containerLog":{"type":"string"},"containerExitCode":{"type":"integer","nullable":true}}}}},"required":["taskRoleStatus","taskStatuses"]}}},"isLatest":{"type":"boolean"}}},"description":"job attempts"},"contentType":"application/json"}}}],"after":[{"tag":"job","operationId":"updateJobExecutionType","parameters":[{"type":"raw","value":"sdk_test"},{"type":"raw","value":"sdk_test_jobafad2e2b"},{"type":"raw","value":"STOP"}]}],"schemas":{"200":{"description":"Succeeded","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","description":"job attempt","properties":{"jobName":{"type":"string"},"frameworkName":{"type":"string"},"uid":{"type":"string"},"userName":{"type":"string"},"state":{"type":"string"},"originState":{"type":"string"},"maxAttemptCount":{"type":"integer"},"attemptIndex":{"type":"integer"},"jobStartedTime":{"type":"integer"},"attemptStartedTime":{"type":"integer"},"attemptCompletedTime":{"type":"integer","nullable":true},"exitCode":{"type":"integer","nullable":true},"exitPhrase":{"type":"string","nullable":true},"exitType":{"type":"string","nullable":true},"exitDiagnostics":{"type":"object","nullable":true,"properties":{"diagnosticsSummary":{"type":"string"},"runtime":{"type":"object","nullable":true,"properties":{"exitCode":{"type":"integer","nullable":true},"originUserExitCode":{"type":"integer","nullable":true},"errorLogs":{"type":"object","nullable":true,"properties":{"user":{"type":"string"},"platform":{"type":"string"}}},"name":{"type":"string"}}},"launcher":{"type":"string"}}},"appExitTriggerMessage":{"type":"string","nullable":true},"appExitTriggerTaskRoleName":{"type":"string","nullable":true},"appExitTriggerTaskIndex":{"type":"integer","nullable":true},"appExitSpec":{"type":"object","nullable":true,"properties":{"code":{"type":"integer"},"phrase":{"type":"string"},"issuer":{"type":"string"},"causer":{"type":"string"},"type":{"type":"string"},"stage":{"type":"string"},"behavior":{"type":"string"},"reaction":{"type":"string"},"reason":{"type":"string"},"repro":{"type":"array","items":{"type":"string"}},"solution":{"type":"array","items":{"type":"string"}}}},"appExitDiagnostics":{"type":"string","nullable":true},"appExitMessages":{"type":"object","nullable":true,"properties":{"container":{"type":"string","nullable":true},"runtime":{"type":"object","nullable":true,"properties":{"exitCode":{"type":"integer","nullable":true},"originUserExitCode":{"type":"integer","nullable":true},"errorLogs":{"type":"object","nullable":true,"properties":{"user":{"type":"string"},"platform":{"type":"string"}}},"name":{"type":"string"}}},"launcher":{"type":"string","nullable":true}}},"totalGpuNumber":{"type":"integer"},"totalTasknumber":{"type":"integer"},"totalTaskRoleNumber":{"type":"integer"},"taskRoles":{"type":"object","properties":{"taskrole":{"type":"object","properties":{"taskRoleStatus":{"type":"object","properties":{"name":{"type":"string"}},"required":["name"]},"taskStatuses":{"type":"array","items":{"type":"object","properties":{"taskIndex":{"type":"integer"},"taskState":{"type":"string","enum":["WAITING","RUNNING","STOPPING","STOPPED","SUCCEEDED","FAILED","UNKNOWN"]},"containerId":{"type":"string"},"containerIp":{"type":"string"},"containerGpus":{"type":"string","nullable":true},"containerLog":{"type":"string"},"containerExitCode":{"type":"integer","nullable":true}}}}},"required":["taskRoleStatus","taskStatuses"]}}},"isLatest":{"type":"boolean"}}},"description":"job attempts"},"example":[{"jobName":"jobName","frameworkName":"frameworkName","uid":"uid","userName":"userName","state":"SUCCEEDED","originState":"Completed","maxAttemptCount":1,"attemptIndex":0,"jobStartedTime":0,"attemptStartedTime":0,"attemptCompletedTime":0,"exitCode":0,"exitPhrase":"Succeeded","exitType":"Succeeded","exitDiagnostics":{"diagnosticsSummary":"Pod succeeded","runtime":null,"launcher":"Pod succeeded"},"appExitTriggerMessage":"All Tasks are completed","appExitTriggerTaskRoleName":"taskrole","appExitTriggerTaskIndex":0,"appExitSpec":{"code":0,"phrase":"Succeeded","issuer":"USER_CONTAINER","causer":"USER_CONTAINER","type":"USER_SUCCESS","stage":"COMPLETING","behavior":"UNKNOWN","reaction":"NEVER_RETRY","repro":["User program exits with exitcode 0"]},"appExitDiagnostics":"Pod succeeded","appExitMessages":{"container":null,"runtime":null,"launcher":"Pod succeeded"},"totalGpuNumber":1,"totalTaskNumber":1,"totalTaskRoleNumber":1,"taskRoles":{"taskrole":{"taskRoleStatus":{"name":"taskrole"},"taskStatuses":[{"taskIndex":0,"taskState":"SUCCEEDED","containerId":"","containerIp":"","containerExitCode":0}]}},"isLatest":true}]}}},"404":{"description":"NoJobError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"NoJobError":{"value":{"code":"NoJobError","message":"Job {job} is not found."}}}}}},"501":{"description":"UnknownError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"UnknownError":{"value":{"code":"UnknownError","message":"Internal error message."}}}}}}},"description":"get /api/v2/jobs/{user}~{job}/job-attempts"},{"before":[{"tag":"job","operationId":"createJob","parameters":[{"type":"raw","value":{"contributor":"OpenPAI","description":"# Serving a TensorFlow MNIST Digit Recognition Model\nThis example shows you how to use TensorFlow Serving components to export a trained TensorFlow model\nand use the standard tensorflow_model_server to serve it on OpenPAI.\nThis example uses the simple Softmax Regression model introduced in the TensorFlow tutorial for handwritten image (MNIST data) classification.\nReference https://www.tensorflow.org/tfx/serving/serving_basic.\n","name":"sdk_test_jobe67c7770","parameters":{"modelPath":"/tmp/mnist_model"},"prerequisites":[{"contributor":"OpenPAI","description":"This is an [example TensorFlow Serving Docker image on OpenPAI](https://github.com/Microsoft/pai/tree/master/examples/serving).\n","name":"tf_serving_example","protocolVersion":2,"type":"dockerimage","uri":"openpai/pai.example.tensorflow-serving","version":"1.0-r1.4"}],"protocolVersion":2,"taskRoles":{"worker":{"commands":["bazel-bin/tensorflow_serving/example/mnist_saved_model <% $parameters.modelPath %>","tensorflow_model_server --port=$PAI_CONTAINER_HOST_model_server_PORT_LIST --model_name=mnist --model_base_path=<% $parameters.modelPath %>"],"dockerImage":"tf_serving_example","instances":1,"resourcePerInstance":{"cpu":4,"gpu":1,"memoryMB":8192,"ports":{"model_server":1}}}},"type":"job","version":"1.0"}}]}],"tests":[{"operation":{"parameters":[{"type":"raw","value":"sdk_test"},{"type":"raw","value":"sdk_test_jobe67c7770"},{"type":"raw","value":0}],"tag":"job history","operationId":"getJobAttempt","response":{"statusCode":200,"schema":{"type":"object","description":"job attempt","properties":{"jobName":{"type":"string"},"frameworkName":{"type":"string"},"uid":{"type":"string"},"userName":{"type":"string"},"state":{"type":"string"},"originState":{"type":"string"},"maxAttemptCount":{"type":"integer"},"attemptIndex":{"type":"integer"},"jobStartedTime":{"type":"integer"},"attemptStartedTime":{"type":"integer"},"attemptCompletedTime":{"type":"integer","nullable":true},"exitCode":{"type":"integer","nullable":true},"exitPhrase":{"type":"string","nullable":true},"exitType":{"type":"string","nullable":true},"exitDiagnostics":{"type":"object","nullable":true,"properties":{"diagnosticsSummary":{"type":"string"},"runtime":{"type":"object","nullable":true,"properties":{"exitCode":{"type":"integer","nullable":true},"originUserExitCode":{"type":"integer","nullable":true},"errorLogs":{"type":"object","nullable":true,"properties":{"user":{"type":"string"},"platform":{"type":"string"}}},"name":{"type":"string"}}},"launcher":{"type":"string"}}},"appExitTriggerMessage":{"type":"string","nullable":true},"appExitTriggerTaskRoleName":{"type":"string","nullable":true},"appExitTriggerTaskIndex":{"type":"integer","nullable":true},"appExitSpec":{"type":"object","nullable":true,"properties":{"code":{"type":"integer"},"phrase":{"type":"string"},"issuer":{"type":"string"},"causer":{"type":"string"},"type":{"type":"string"},"stage":{"type":"string"},"behavior":{"type":"string"},"reaction":{"type":"string"},"reason":{"type":"string"},"repro":{"type":"array","items":{"type":"string"}},"solution":{"type":"array","items":{"type":"string"}}}},"appExitDiagnostics":{"type":"string","nullable":true},"appExitMessages":{"type":"object","nullable":true,"properties":{"container":{"type":"string","nullable":true},"runtime":{"type":"object","nullable":true,"properties":{"exitCode":{"type":"integer","nullable":true},"originUserExitCode":{"type":"integer","nullable":true},"errorLogs":{"type":"object","nullable":true,"properties":{"user":{"type":"string"},"platform":{"type":"string"}}},"name":{"type":"string"}}},"launcher":{"type":"string","nullable":true}}},"totalGpuNumber":{"type":"integer"},"totalTasknumber":{"type":"integer"},"totalTaskRoleNumber":{"type":"integer"},"taskRoles":{"type":"object","properties":{"taskrole":{"type":"object","properties":{"taskRoleStatus":{"type":"object","properties":{"name":{"type":"string"}},"required":["name"]},"taskStatuses":{"type":"array","items":{"type":"object","properties":{"taskIndex":{"type":"integer"},"taskState":{"type":"string","enum":["WAITING","RUNNING","STOPPING","STOPPED","SUCCEEDED","FAILED","UNKNOWN"]},"containerId":{"type":"string"},"containerIp":{"type":"string"},"containerGpus":{"type":"string","nullable":true},"containerLog":{"type":"string"},"containerExitCode":{"type":"integer","nullable":true}}}}},"required":["taskRoleStatus","taskStatuses"]}}},"isLatest":{"type":"boolean"}}},"contentType":"application/json"}}}],"after":[{"tag":"job","operationId":"updateJobExecutionType","parameters":[{"type":"raw","value":"sdk_test"},{"type":"raw","value":"sdk_test_jobe67c7770"},{"type":"raw","value":"STOP"}]}],"schemas":{"200":{"description":"Succeeded","content":{"application/json":{"schema":{"type":"object","description":"job attempt","properties":{"jobName":{"type":"string"},"frameworkName":{"type":"string"},"uid":{"type":"string"},"userName":{"type":"string"},"state":{"type":"string"},"originState":{"type":"string"},"maxAttemptCount":{"type":"integer"},"attemptIndex":{"type":"integer"},"jobStartedTime":{"type":"integer"},"attemptStartedTime":{"type":"integer"},"attemptCompletedTime":{"type":"integer","nullable":true},"exitCode":{"type":"integer","nullable":true},"exitPhrase":{"type":"string","nullable":true},"exitType":{"type":"string","nullable":true},"exitDiagnostics":{"type":"object","nullable":true,"properties":{"diagnosticsSummary":{"type":"string"},"runtime":{"type":"object","nullable":true,"properties":{"exitCode":{"type":"integer","nullable":true},"originUserExitCode":{"type":"integer","nullable":true},"errorLogs":{"type":"object","nullable":true,"properties":{"user":{"type":"string"},"platform":{"type":"string"}}},"name":{"type":"string"}}},"launcher":{"type":"string"}}},"appExitTriggerMessage":{"type":"string","nullable":true},"appExitTriggerTaskRoleName":{"type":"string","nullable":true},"appExitTriggerTaskIndex":{"type":"integer","nullable":true},"appExitSpec":{"type":"object","nullable":true,"properties":{"code":{"type":"integer"},"phrase":{"type":"string"},"issuer":{"type":"string"},"causer":{"type":"string"},"type":{"type":"string"},"stage":{"type":"string"},"behavior":{"type":"string"},"reaction":{"type":"string"},"reason":{"type":"string"},"repro":{"type":"array","items":{"type":"string"}},"solution":{"type":"array","items":{"type":"string"}}}},"appExitDiagnostics":{"type":"string","nullable":true},"appExitMessages":{"type":"object","nullable":true,"properties":{"container":{"type":"string","nullable":true},"runtime":{"type":"object","nullable":true,"properties":{"exitCode":{"type":"integer","nullable":true},"originUserExitCode":{"type":"integer","nullable":true},"errorLogs":{"type":"object","nullable":true,"properties":{"user":{"type":"string"},"platform":{"type":"string"}}},"name":{"type":"string"}}},"launcher":{"type":"string","nullable":true}}},"totalGpuNumber":{"type":"integer"},"totalTasknumber":{"type":"integer"},"totalTaskRoleNumber":{"type":"integer"},"taskRoles":{"type":"object","properties":{"taskrole":{"type":"object","properties":{"taskRoleStatus":{"type":"object","properties":{"name":{"type":"string"}},"required":["name"]},"taskStatuses":{"type":"array","items":{"type":"object","properties":{"taskIndex":{"type":"integer"},"taskState":{"type":"string","enum":["WAITING","RUNNING","STOPPING","STOPPED","SUCCEEDED","FAILED","UNKNOWN"]},"containerId":{"type":"string"},"containerIp":{"type":"string"},"containerGpus":{"type":"string","nullable":true},"containerLog":{"type":"string"},"containerExitCode":{"type":"integer","nullable":true}}}}},"required":["taskRoleStatus","taskStatuses"]}}},"isLatest":{"type":"boolean"}}},"example":{"jobName":"jobName","frameworkName":"frameworkName","uid":"uid","userName":"userName","state":"SUCCEEDED","originState":"Completed","maxAttemptCount":1,"attemptIndex":0,"jobStartedTime":0,"attemptStartedTime":0,"attemptCompletedTime":0,"exitCode":0,"exitPhrase":"Succeeded","exitType":"Succeeded","exitDiagnostics":{"diagnosticsSummary":"Pod succeeded","runtime":null,"launcher":"Pod succeeded"},"appExitTriggerMessage":"All Tasks are completed","appExitTriggerTaskRoleName":"taskrole","appExitTriggerTaskIndex":0,"appExitSpec":{"code":0,"phrase":"Succeeded","issuer":"USER_CONTAINER","causer":"USER_CONTAINER","type":"USER_SUCCESS","stage":"COMPLETING","behavior":"UNKNOWN","reaction":"NEVER_RETRY","repro":["User program exits with exitcode 0"]},"appExitDiagnostics":"Pod succeeded","appExitMessages":{"container":null,"runtime":null,"launcher":"Pod succeeded"},"totalGpuNumber":1,"totalTaskNumber":1,"totalTaskRoleNumber":1,"taskRoles":{"taskrole":{"taskRoleStatus":{"name":"taskrole"},"taskStatuses":[{"taskIndex":0,"taskState":"SUCCEEDED","containerId":"","containerIp":"","containerExitCode":0}]}},"isLatest":true}}}},"404":{"description":"NoJobError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"NoJobError":{"value":{"code":"NoJobError","message":"Job {job} is not found."}}}}}},"501":{"description":"UnknownError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"UnknownError":{"value":{"code":"UnknownError","message":"Internal error message."}}}}}}},"description":"get /api/v2/jobs/{user}~{job}/job-attempts/{attemptIndex}"},{"description":"get /api/v2/kubernetes/nodes","tests":[{"operation":{"tag":"kubernetes","operationId":"getK8sNodes","parameters":[],"response":{"statusCode":200}}}],"schemas":{"200":{"description":"Succeeded","content":{"application/json":{"example":["Please refer to Kubernetes API doc","https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.17/#list-node-v1-core"]}}},"401":{"description":"UnauthorizedUserError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"UnauthorizedUserError":{"value":{"code":"UnauthorizedUserError","message":"Guest is not allowed to do this operation."}}}}}},"403":{"description":"ForbiddenUserError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"ForbiddenUserError":{"value":{"code":"ForbiddenUserError","message":"Non-admin is not allow to do this operation."}},"ForbiddenTokenError":{"value":{"code":"ForbiddenUserError","message":"Applications are not allowed to do this operation."}}}}}}}},{"description":"get /api/v2/kubernetes/pods","tests":[{"operation":{"tag":"kubernetes","operationId":"getK8sPods","parameters":[],"response":{"statusCode":200}}}],"schemas":{"200":{"description":"Succeeded","content":{"application/json":{"example":["Please refer to Kubernetes API doc","https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.17/#list-all-namespaces-pod-v1-core"]}}},"401":{"description":"UnauthorizedUserError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"UnauthorizedUserError":{"value":{"code":"UnauthorizedUserError","message":"Guest is not allowed to do this operation."}}}}}},"403":{"description":"ForbiddenUserError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"ForbiddenUserError":{"value":{"code":"ForbiddenUserError","message":"Non-admin is not allow to do this operation."}},"ForbiddenTokenError":{"value":{"code":"ForbiddenUserError","message":"Applications are not allowed to do this operation."}}}}}}}}],"map":{"getClusterInfo":{"path":"/api/v2/info","method":"get","examples":{"200":{"name":"PAI RESTful API","version":"v1.0.1","launcherType":"k8s","authnMethod":"basic"}}},"getTokens":{"path":"/api/v2/tokens","method":"get","examples":{"200":{"tokens":["JWT Token Example"]},"401":{"value":{"code":"UnauthorizedUserError","message":"Guest is not allowed to do this operation."}}}},"deleteToken":{"path":"/api/v2/tokens/{token}","method":"delete","examples":{"200":{"message":"revoke successfully"},"401":{"value":{"code":"UnauthorizedUserError","message":"Guest is not allowed to do this operation."}},"403":{"value":{"code":"ForbiddenUserError","message":"Non-admin is not allow to do this operation."}}}},"createApplicationToken":{"path":"/api/v2/tokens/application","method":"post","examples":{"200":{"token":"JWT Token Example","application":true},"401":{"value":{"code":"UnauthorizedUserError","message":"Guest is not allowed to do this operation."}}}},"oidcLogin":{"path":"/api/v2/authn/oidc/login","method":"get","examples":{}},"oidcLogout":{"path":"/api/v2/authn/oidc/logout","method":"get","examples":{}},"basicLogin":{"path":"/api/v2/authn/basic/login","method":"post","examples":{"200":{"token":"JWT Token Example","user":"user","admin":true},"404":{"value":{"code":"NoUserError","message":"User {user} is not found."}}}},"basicLogout":{"path":"/api/v2/authn/basic/logout","method":"delete","examples":{"200":{"message":"Logout successfully"},"401":{"value":{"code":"UnauthorizedUserError","message":"Guest is not allowed to do this operation."}},"403":{"value":{"code":"ForbiddenUserError","message":"Non-admin is not allow to do this operation."}}}},"createUser":{"path":"/api/v2/users","method":"post","examples":{"201":{"message":"User is created successfully"},"401":{"value":{"code":"UnauthorizedUserError","message":"Guest is not allowed to do this operation."}},"403":{"value":{"code":"ForbiddenUserError","message":"Non-admin is not allow to do this operation."}},"409":{"value":{"code":"ConflictUserError","message":"User name {user} already exists."}},"500":{"value":{"code":"UnknownError","message":"Internal error message."}}}},"getAllUser":{"path":"/api/v2/users","method":"get","examples":{"200":[{"username":"username","admin":true,"virtualCluster":[],"storageConfig":[],"email":"email@test.com","extension":{}}],"500":{"value":{"code":"UnknownError","message":"Internal error message."}}}},"updateUser":{"path":"/api/v2/users","method":"put","examples":{"201":{"message":"update group {username} successfully."},"401":{"value":{"code":"UnauthorizedUserError","message":"Guest is not allowed to do this operation."}},"403":{"value":{"code":"ForbiddenUserError","message":"Non-admin is not allow to do this operation."}},"404":{"value":{"code":"NoUserError","message":"User {user} is not found."}},"500":{"value":{"code":"UnknownError","message":"Internal error message."}}}},"updateUserSelf":{"path":"/api/v2/users/me","method":"put","examples":{"201":{"message":"update group {username} successfully."},"401":{"value":{"code":"UnauthorizedUserError","message":"Guest is not allowed to do this operation."}},"403":{"value":{"code":"ForbiddenUserError","message":"Non-admin is not allow to do this operation."}},"404":{"value":{"code":"NoUserError","message":"User {user} is not found."}},"500":{"value":{"code":"UnknownError","message":"Internal error message."}}}},"getUser":{"path":"/api/v2/users/{user}","method":"get","examples":{"200":{"username":"username","admin":true,"virtualCluster":[],"storageConfig":[],"email":"email@test.com","extension":{}},"401":{"value":{"code":"UnauthorizedUserError","message":"Guest is not allowed to do this operation."}},"404":{"value":{"code":"NoUserError","message":"User {user} is not found."}},"500":{"value":{"code":"UnknownError","message":"Internal error message."}}}},"deleteUser":{"path":"/api/v2/users/{user}","method":"delete","examples":{"200":{"message":"user is removed successfully"},"401":{"value":{"code":"UnauthorizedUserError","message":"Guest is not allowed to do this operation."}},"403":{"value":{"code":"ForbiddenUserError","message":"Non-admin is not allow to do this operation."}},"404":{"value":{"code":"NoUserError","message":"User {user} is not found."}},"500":{"value":{"code":"UnknownError","message":"Internal error message."}}}},"updateUserGroup":{"path":"/api/v2/users/{user}/group/","method":"put","examples":{"201":{"message":"User {username} is added into group {groupname}"},"401":{"value":{"code":"UnauthorizedUserError","message":"Guest is not allowed to do this operation."}},"403":{"value":{"code":"ForbiddenUserError","message":"Non-admin is not allow to do this operation."}},"404":{"value":{"code":"NoUserError","message":"User {user} is not found."}},"500":{"value":{"code":"UnknownError","message":"Internal error message."}}}},"deleteUserGroup":{"path":"/api/v2/users/{user}/group/","method":"delete","examples":{"201":{"message":"User {username} is removed from group {groupname}"},"401":{"value":{"code":"UnauthorizedUserError","message":"Guest is not allowed to do this operation."}},"403":{"value":{"code":"ForbiddenUserError","message":"Non-admin is not allow to do this operation."}},"404":{"value":{"code":"NoUserError","message":"User {user} is not found."}},"500":{"value":{"code":"UnknownError","message":"Internal error message."}}}},"updateUserGrouplist":{"path":"/api/v2/users/{user}/grouplist/","method":"put","examples":{"201":{"message":"update user grouplist successfully."},"401":{"value":{"code":"UnauthorizedUserError","message":"Guest is not allowed to do this operation."}},"403":{"value":{"code":"ForbiddenUserError","message":"Non-admin is not allow to do this operation."}},"404":{"value":{"code":"NoUserError","message":"User {user} is not found."}},"500":{"value":{"code":"UnknownError","message":"Internal error message."}}}},"getAllGroup":{"path":"/api/v2/groups","method":"get","examples":{"200":[{"groupname":"groupName","description":"description","externalName":"externalName","extension":{}}],"500":{"value":{"code":"UnknownError","message":"Internal error message."}}}},"createGroup":{"path":"/api/v2/groups","method":"post","examples":{"201":{"message":"group is created successfully"},"401":{"value":{"code":"UnauthorizedUserError","message":"Guest is not allowed to do this operation."}},"403":{"value":{"code":"ForbiddenUserError","message":"Non-admin is not allow to do this operation."}},"500":{"value":{"code":"UnknownError","message":"Internal error message."}}}},"updateGroup":{"path":"/api/v2/groups","method":"put","examples":{"201":{"message":"update group {groupname} successfully."},"401":{"value":{"code":"UnauthorizedUserError","message":"Guest is not allowed to do this operation."}},"403":{"value":{"code":"ForbiddenUserError","message":"Non-admin is not allow to do this operation."}},"404":{"value":{"code":"NoGroupError","message":"Group {groupname} is not found."}},"500":{"value":{"code":"UnknownError","message":"Internal error message."}}}},"getGroup":{"path":"/api/v2/groups/{group}","method":"get","examples":{"200":{"groupname":"groupName","description":"description","externalName":"externalName","extension":{}},"401":{"value":{"code":"UnauthorizedUserError","message":"Guest is not allowed to do this operation."}},"404":{"value":{"code":"NoGroupError","message":"Group {groupname} is not found."}},"500":{"value":{"code":"UnknownError","message":"Internal error message."}}}},"deleteGroup":{"path":"/api/v2/groups/{group}","method":"delete","examples":{"201":{"message":"group is removed successfully"},"401":{"value":{"code":"UnauthorizedUserError","message":"Guest is not allowed to do this operation."}},"403":{"value":{"code":"ForbiddenUserError","message":"Non-admin is not allow to do this operation."}},"500":{"value":{"code":"UnknownError","message":"Internal error message."}}}},"getGroupMembers":{"path":"/api/v2/groups/{group}/userlist","method":"get","examples":{"200":[{"username":"username","clusterAdmin":false}],"401":{"value":{"code":"UnauthorizedUserError","message":"Guest is not allowed to do this operation."}},"500":{"value":{"code":"UnknownError","message":"Internal error message."}}}},"listVirtualClusters":{"path":"/api/v2/virtual-clusters","method":"get","examples":{"500":{"value":{"code":"UnknownError","message":"Internal error message."}}}},"getVirtualCluster":{"path":"/api/v2/virtual-clusters/{vc}","method":"get","examples":{"200":{"capacity":70,"usedCapacity":30,"dedicated":false,"resourcesUsed":{"cpu":1,"memory":1024,"gpu":1,"vCores":1,"GPUs":1},"resourcesGuaranteed":{"cpu":2,"memory":2048,"gpu":2,"vCores":2,"GPUs":2},"resourcesTotal":{"cpu":2,"memory":2048,"gpu":2,"vCores":2,"GPUs":2},"maxCapacity":70},"404":{"value":{"code":"NoVirtualClusterError","message":"Virtual cluster {vc} is not found."}},"500":{"value":{"code":"UnknownError","message":"Internal error message."}}}},"getStorages":{"path":"/api/v2/storages","method":"get","examples":{"200":{"storages":[{"name":"name","share":true,"volumeName":"volumeName"}]},"500":{"value":{"code":"UnknownError","message":"Internal error message."}}}},"getStorage":{"path":"/api/v2/storages/{storage}","method":"get","examples":{"200":{"name":"nfs-storage-name","share":true,"volumeName":"nfs-volume-name","type":"nfs","data":{"server":"","path":"/data"}},"403":{"value":{"code":"ForbiddenUserError","message":"User {user} is not allowed to access {storage}."}},"404":{"value":{"code":"NoStorageError","message":"Storage {storage} is not found."}},"500":{"value":{"code":"UnknownError","message":"Internal error message."}}}},"createJob":{"path":"/api/v2/jobs","method":"post","examples":{"202":{"message":"update job {job} successfully"},"400":{"value":{"code":"NoVirtualClusterError","message":"Virtual cluster {vc} is not found."}},"403":{"value":{"code":"ForbiddenUserError","message":"Non-admin is not allow to do this operation."}},"409":{"value":{"code":"ConflictJobError","message":"Job name {job} already exists."}},"500":{"value":{"code":"UnknownError","message":"Internal error message."}}}},"listJobs":{"path":"/api/v2/jobs","method":"get","examples":{"200":[{"protocolVersion":"2","name":"job name","username":"user name","state":"SUCCEEDED","subState":"Completed","executionType":"STOP","retries":0,"createdTime":0,"completedTime":0,"appExitCode":0,"virtualCluster":"unknown"}],"500":{"value":{"code":"UnknownError","message":"Internal error message."}}}},"getJob":{"path":"/api/v2/jobs/{user}~{job}","method":"get","examples":{"200":{"name":"job name","jobStatus":{"username":"user name","state":"SUCCEEDED","subState":"Completed","executionType":"STOP","retries":0,"createdTime":0,"completedTime":0,"appId":"id","appLaunchedTime":0,"appCompletedTime":0,"appExitCode":0,"virtualCluster":"unknown"},"taskRoles":{"taskrole":{"taskRoleStatus":{"name":"task role name"},"taskStatuses":[{"taskIndex":0,"taskState":"SUCCEEDED"}]}}},"404":{"value":{"code":"NoJobError","message":"Job {job} is not found."}},"500":{"value":{"code":"UnknownError","message":"Internal error message."}}}},"getJobConfig":{"path":"/api/v2/jobs/{user}~{job}/config","method":"get","examples":{"200":{"protocolVersion":"2","name":"","type":"job","prerequisites":[{"name":"","type":"dockerimage","uri":"image_url"}],"taskRoles":{"train":{"instances":1,"dockerImage":"","resourcePerInstance":{"cpu":1,"memoryMB":16384,"gpu":1},"commands":["python "]}}},"404":{"value":{"code":"NoJobError","message":"Job {job} is not found."}},"500":{"value":{"code":"UnknownError","message":"Internal error message."}}}},"updateJobExecutionType":{"path":"/api/v2/jobs/{user}~{job}/executionType","method":"put","examples":{"202":{"message":"execute job {job} successfully"},"404":{"value":{"code":"NoJobError","message":"Job {job} is not found."}},"500":{"value":{"code":"UnknownError","message":"Internal error message."}}}},"getJobAttemptsHealthz":{"path":"/api/v2/jobs/{user}~{job}/job-attempts/healthz","method":"get","examples":{}},"getJobAttempts":{"path":"/api/v2/jobs/{user}~{job}/job-attempts","method":"get","examples":{"200":[{"jobName":"jobName","frameworkName":"frameworkName","uid":"uid","userName":"userName","state":"SUCCEEDED","originState":"Completed","maxAttemptCount":1,"attemptIndex":0,"jobStartedTime":0,"attemptStartedTime":0,"attemptCompletedTime":0,"exitCode":0,"exitPhrase":"Succeeded","exitType":"Succeeded","exitDiagnostics":{"diagnosticsSummary":"Pod succeeded","runtime":null,"launcher":"Pod succeeded"},"appExitTriggerMessage":"All Tasks are completed","appExitTriggerTaskRoleName":"taskrole","appExitTriggerTaskIndex":0,"appExitSpec":{"code":0,"phrase":"Succeeded","issuer":"USER_CONTAINER","causer":"USER_CONTAINER","type":"USER_SUCCESS","stage":"COMPLETING","behavior":"UNKNOWN","reaction":"NEVER_RETRY","repro":["User program exits with exitcode 0"]},"appExitDiagnostics":"Pod succeeded","appExitMessages":{"container":null,"runtime":null,"launcher":"Pod succeeded"},"totalGpuNumber":1,"totalTaskNumber":1,"totalTaskRoleNumber":1,"taskRoles":{"taskrole":{"taskRoleStatus":{"name":"taskrole"},"taskStatuses":[{"taskIndex":0,"taskState":"SUCCEEDED","containerId":"","containerIp":"","containerExitCode":0}]}},"isLatest":true}],"404":{"value":{"code":"NoJobError","message":"Job {job} is not found."}},"501":{"value":{"code":"UnknownError","message":"Internal error message."}}}},"getJobAttempt":{"path":"/api/v2/jobs/{user}~{job}/job-attempts/{attemptIndex}","method":"get","examples":{"200":{"jobName":"jobName","frameworkName":"frameworkName","uid":"uid","userName":"userName","state":"SUCCEEDED","originState":"Completed","maxAttemptCount":1,"attemptIndex":0,"jobStartedTime":0,"attemptStartedTime":0,"attemptCompletedTime":0,"exitCode":0,"exitPhrase":"Succeeded","exitType":"Succeeded","exitDiagnostics":{"diagnosticsSummary":"Pod succeeded","runtime":null,"launcher":"Pod succeeded"},"appExitTriggerMessage":"All Tasks are completed","appExitTriggerTaskRoleName":"taskrole","appExitTriggerTaskIndex":0,"appExitSpec":{"code":0,"phrase":"Succeeded","issuer":"USER_CONTAINER","causer":"USER_CONTAINER","type":"USER_SUCCESS","stage":"COMPLETING","behavior":"UNKNOWN","reaction":"NEVER_RETRY","repro":["User program exits with exitcode 0"]},"appExitDiagnostics":"Pod succeeded","appExitMessages":{"container":null,"runtime":null,"launcher":"Pod succeeded"},"totalGpuNumber":1,"totalTaskNumber":1,"totalTaskRoleNumber":1,"taskRoles":{"taskrole":{"taskRoleStatus":{"name":"taskrole"},"taskStatuses":[{"taskIndex":0,"taskState":"SUCCEEDED","containerId":"","containerIp":"","containerExitCode":0}]}},"isLatest":true},"404":{"value":{"code":"NoJobError","message":"Job {job} is not found."}},"501":{"value":{"code":"UnknownError","message":"Internal error message."}}}},"getK8sNodes":{"path":"/api/v2/kubernetes/nodes","method":"get","examples":{"200":["Please refer to Kubernetes API doc","https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.17/#list-node-v1-core"],"401":{"value":{"code":"UnauthorizedUserError","message":"Guest is not allowed to do this operation."}},"403":{"value":{"code":"ForbiddenUserError","message":"Non-admin is not allow to do this operation."}}}},"getK8sPods":{"path":"/api/v2/kubernetes/pods","method":"get","examples":{"200":["Please refer to Kubernetes API doc","https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.17/#list-all-namespaces-pod-v1-core"],"401":{"value":{"code":"UnauthorizedUserError","message":"Guest is not allowed to do this operation."}},"403":{"value":{"code":"ForbiddenUserError","message":"Non-admin is not allow to do this operation."}}}}}} \ No newline at end of file diff --git a/package.json b/package.json index b7e226e..73a7af5 100644 --- a/package.json +++ b/package.json @@ -12,7 +12,7 @@ "format": "prettier --write \"src/**/*.ts\" \"src/**/*.js\"", "lint": "tslint -p tsconfig.json", "pretest": "npm run preapi-test && tslint --config tslint.json --project tsconfig.json", - "test": "mocha -r ts-node/register -r tsconfig-paths/register tests/unit_tests/**/*.spec.ts", + "test": "mocha -r ts-node/register -r tsconfig-paths/register -r source-map-support/register --recursive tests/unit_tests/**/*.spec.ts", "preapi-test": "ts-node -r tsconfig-paths/register tests/common/apiTestCaseGenerator.ts -- \"src/api/v2/swagger.yaml\" \".tests/apiTestCase.json\"", "api-test": "mocha -r ts-node/register -r tsconfig-paths/register tests/api_tests/**/*.spec.ts -t 20000", "mock-api-test": "npm run preapi-test && mocha -r ts-node/register -r tsconfig-paths/register tests/unit_tests/v2/v2.spec.ts", diff --git a/tests/api_tests/v2/api.v2.spec.ts b/tests/api_tests/v2/api.v2.spec.ts index 8907b26..15401e7 100644 --- a/tests/api_tests/v2/api.v2.spec.ts +++ b/tests/api_tests/v2/api.v2.spec.ts @@ -9,7 +9,7 @@ import dirtyChai from 'dirty-chai'; import apiTestCaseJson from '../../../.tests/apiTestCase.json'; import { IApiOperation, IApiTestCase } from '../../common/apiTestCaseGenerator'; import { CustomizedTests } from '../../common/apiTestCases'; -import { ApiTestRunner } from '../../common/apiTestRunner.js'; +import { ApiTestRunner } from '../../common/apiTestRunner'; import { TestCluster } from '../../common/testCluster'; /** diff --git a/tests/unit_tests/v2/v2.spec.ts b/tests/unit_tests/v2/v2.spec.ts index b08724b..9890e84 100644 --- a/tests/unit_tests/v2/v2.spec.ts +++ b/tests/unit_tests/v2/v2.spec.ts @@ -67,14 +67,6 @@ for (const test of apiTestCaseJson.tests as IApiTestCase[]) { it (testItem.description || test.description || 'unknown test', async () => { if (testItem.customizedTest) { return; - /*await (CustomizedTests as any)[testItem.customizedTest]( - testItem, - { - beforeEachResults, - beforeResults, - testResults - } - );*/ } else { const res: any = await runner.runOperation( testItem.operation!, From 739d1cce150194ecc4844fb03c73571c5ab98ed3 Mon Sep 17 00:00:00 2001 From: Yi Yi Date: Mon, 15 Jun 2020 03:57:44 +0800 Subject: [PATCH 14/24] fix coverall --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 73a7af5..c6c28f3 100644 --- a/package.json +++ b/package.json @@ -21,7 +21,7 @@ "copy-swagger": "node copy_swagger.js", "precode-coverage": "npm run build && npm run pretest", "code-coverage": "nyc mocha -r ts-node/register -r tsconfig-paths/register -r source-map-support/register --recursive tests/unit_tests/**/*.spec.ts", - "coveralls": "nyc report --reporter=text-lcov | coveralls" + "coveralls": "nyc report --reporter=text-lcov" }, "homepage": "https://github.com/Microsoft/openpaisdk", "repository": { From b2276a8f62c71b9f9a01e6412e3862f46ea8f405 Mon Sep 17 00:00:00 2001 From: Yi Yi Date: Mon, 15 Jun 2020 04:03:54 +0800 Subject: [PATCH 15/24] fix --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index c6c28f3..1407753 100644 --- a/package.json +++ b/package.json @@ -21,7 +21,7 @@ "copy-swagger": "node copy_swagger.js", "precode-coverage": "npm run build && npm run pretest", "code-coverage": "nyc mocha -r ts-node/register -r tsconfig-paths/register -r source-map-support/register --recursive tests/unit_tests/**/*.spec.ts", - "coveralls": "nyc report --reporter=text-lcov" + "coveralls": "nyc report --reporter=text-lcov > coverage/lcov.info" }, "homepage": "https://github.com/Microsoft/openpaisdk", "repository": { From 7662b3c58fdd8e4a0808ef5ae9a3e33d9cae8629 Mon Sep 17 00:00:00 2001 From: Yi Yi Date: Mon, 15 Jun 2020 04:08:47 +0800 Subject: [PATCH 16/24] fix --- .github/workflows/code_coverage.yml | 1 + package.json | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/code_coverage.yml b/.github/workflows/code_coverage.yml index 876eee7..1bd42d6 100644 --- a/.github/workflows/code_coverage.yml +++ b/.github/workflows/code_coverage.yml @@ -29,6 +29,7 @@ jobs: run: | npm install npm run code-coverage + mkdir coverage npm run coveralls - name: Coveralls GitHub Action diff --git a/package.json b/package.json index 1407753..cb8f50c 100644 --- a/package.json +++ b/package.json @@ -12,7 +12,7 @@ "format": "prettier --write \"src/**/*.ts\" \"src/**/*.js\"", "lint": "tslint -p tsconfig.json", "pretest": "npm run preapi-test && tslint --config tslint.json --project tsconfig.json", - "test": "mocha -r ts-node/register -r tsconfig-paths/register -r source-map-support/register --recursive tests/unit_tests/**/*.spec.ts", + "test": "mocha -r ts-node/register -r tsconfig-paths/register -r source-map-support/register tests/unit_tests/**/*.spec.ts", "preapi-test": "ts-node -r tsconfig-paths/register tests/common/apiTestCaseGenerator.ts -- \"src/api/v2/swagger.yaml\" \".tests/apiTestCase.json\"", "api-test": "mocha -r ts-node/register -r tsconfig-paths/register tests/api_tests/**/*.spec.ts -t 20000", "mock-api-test": "npm run preapi-test && mocha -r ts-node/register -r tsconfig-paths/register tests/unit_tests/v2/v2.spec.ts", @@ -20,7 +20,7 @@ "build": "ttsc -p tsconfig.json && npm run copy-swagger", "copy-swagger": "node copy_swagger.js", "precode-coverage": "npm run build && npm run pretest", - "code-coverage": "nyc mocha -r ts-node/register -r tsconfig-paths/register -r source-map-support/register --recursive tests/unit_tests/**/*.spec.ts", + "code-coverage": "nyc mocha -r ts-node/register -r tsconfig-paths/register -r source-map-support/register tests/unit_tests/**/*.spec.ts", "coveralls": "nyc report --reporter=text-lcov > coverage/lcov.info" }, "homepage": "https://github.com/Microsoft/openpaisdk", From 0d8c358d49b5b30f8aac9a9497b8d20f4fb96f06 Mon Sep 17 00:00:00 2001 From: Yi Yi Date: Mon, 15 Jun 2020 04:12:12 +0800 Subject: [PATCH 17/24] add code coverage badge to readme --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index 6a6d9e5..7be5bf3 100644 --- a/README.md +++ b/README.md @@ -2,6 +2,8 @@ [![Build Status](https://www.travis-ci.org/microsoft/openpaisdk.svg?branch=master)](https://travis-ci.org/microsoft/openpaisdk) +[![Coverage Status](https://coveralls.io/repos/github/microsoft/openpaisdk/badge.svg)](https://coveralls.io/github/microsoft/openpaisdk) + The `JavaScript` SDK is designed to facilitate the developers of [OpenPAI](https://github.com/microsoft/pai) to offer user friendly experience. The SDK mainly provides client side sharable functions such as RESTful API wrapping, error handling, storage accessing and processing of [job protocol](https://github.com/microsoft/openpai-protocol). *Now the OpenPAI RESTful API is updating, please waiting for our stable release.* From a778d1eac88aaaedc1b5f9158bd5a2e31d1d7863 Mon Sep 17 00:00:00 2001 From: Yi Yi Date: Mon, 15 Jun 2020 04:13:33 +0800 Subject: [PATCH 18/24] update --- README.md | 1 - 1 file changed, 1 deletion(-) diff --git a/README.md b/README.md index 7be5bf3..a02a473 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,6 @@ # OpenPAI JS SDK [![Build Status](https://www.travis-ci.org/microsoft/openpaisdk.svg?branch=master)](https://travis-ci.org/microsoft/openpaisdk) - [![Coverage Status](https://coveralls.io/repos/github/microsoft/openpaisdk/badge.svg)](https://coveralls.io/github/microsoft/openpaisdk) The `JavaScript` SDK is designed to facilitate the developers of [OpenPAI](https://github.com/microsoft/pai) to offer user friendly experience. From bb1928b83e9493e1ec8c4d7e2e726d1c4eb06d35 Mon Sep 17 00:00:00 2001 From: Yi Yi Date: Mon, 15 Jun 2020 04:24:05 +0800 Subject: [PATCH 19/24] update --- .tests/apiTestCase.json | 2 +- package.json | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.tests/apiTestCase.json b/.tests/apiTestCase.json index d63472d..3d8ce63 100644 --- a/.tests/apiTestCase.json +++ b/.tests/apiTestCase.json @@ -1 +1 @@ -{"tests":[{"description":"get /api/v2/info","tests":[{"operation":{"tag":"api","operationId":"getClusterInfo","parameters":[],"response":{"statusCode":200,"schema":{"type":"object","properties":{"name":{"type":"string","description":"PAI RESTfulAPI"},"version":{"type":"string","description":"cluster version in v0.X.0 format"},"launcherType":{"type":"string","enum":["yarn","k8s"]},"authnMethod":{"type":"string","enum":["basic","OIDC"]}},"required":["name","version","launcherType","authnMethod"]},"contentType":"application/json"}}}],"schemas":{"200":{"description":"Succeeded","content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","description":"PAI RESTfulAPI"},"version":{"type":"string","description":"cluster version in v0.X.0 format"},"launcherType":{"type":"string","enum":["yarn","k8s"]},"authnMethod":{"type":"string","enum":["basic","OIDC"]}},"required":["name","version","launcherType","authnMethod"]},"example":{"name":"PAI RESTful API","version":"v1.0.1","launcherType":"k8s","authnMethod":"basic"}}}}}},{"before":[{"tag":"token","operationId":"createApplicationToken"}],"tests":[{"description":"Get tokens with user token","operation":{"tag":"token","operationId":"getTokens","parameters":[],"response":{"statusCode":200,"schema":{"type":"object","properties":{"tokens":{"type":"array","items":{"type":"string"},"description":"JWT string list"}},"required":["tokens"]},"contentType":"application/json"}}},{"description":"Get tokens with unauthorized token","customizedTest":"getTokensWithUnauthorizedUser","operation":{"tag":"token","operationId":"getTokens","parameters":[],"response":{"statusCode":200,"schema":{"type":"object","properties":{"tokens":{"type":"array","items":{"type":"string"},"description":"JWT string list"}},"required":["tokens"]},"contentType":"application/json"}}}],"after":[{"tag":"token","operationId":"deleteToken","parameters":[{"type":"fromResult","resultType":"beforeResults","resultPath":["token"],"resultIndex":0}]}],"schemas":{"200":{"description":"Succeeded","content":{"application/json":{"schema":{"type":"object","properties":{"tokens":{"type":"array","items":{"type":"string"},"description":"JWT string list"}},"required":["tokens"]},"example":{"tokens":["JWT Token Example"]}}}},"401":{"description":"UnauthorizedUserError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"UnauthorizedUserError":{"value":{"code":"UnauthorizedUserError","message":"Guest is not allowed to do this operation."}}}}}}},"description":"get /api/v2/tokens"},{"before":[{"tag":"token","operationId":"createApplicationToken"}],"tests":[{"operation":{"parameters":[{"type":"fromResult","resultType":"beforeResults","resultPath":["token"],"resultIndex":0}],"tag":"token","operationId":"deleteToken","response":{"statusCode":200,"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"contentType":"application/json"}}}],"schemas":{"200":{"description":"Succeeded","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"example":{"message":"revoke successfully"}}}},"401":{"description":"UnauthorizedUserError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"UnauthorizedUserError":{"value":{"code":"UnauthorizedUserError","message":"Guest is not allowed to do this operation."}}}}}},"403":{"description":"ForbiddenUserError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"ForbiddenUserError":{"value":{"code":"ForbiddenUserError","message":"Non-admin is not allow to do this operation."}},"ForbiddenTokenError":{"value":{"code":"ForbiddenUserError","message":"Applications are not allowed to do this operation."}}}}}}},"description":"delete /api/v2/tokens/{token}"},{"tests":[{"operation":{"tag":"token","operationId":"createApplicationToken","parameters":[],"response":{"statusCode":200,"schema":{"type":"object","properties":{"token":{"type":"string","description":"your access token"},"application":{"type":"boolean","description":"true"}}},"contentType":"application/json"}}}],"after":[{"tag":"token","operationId":"deleteToken","parameters":[{"type":"fromResult","resultType":"testResults","resultPath":["token"],"resultIndex":0}]}],"schemas":{"200":{"description":"Succeeded","content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string","description":"your access token"},"application":{"type":"boolean","description":"true"}}},"example":{"token":"JWT Token Example","application":true}}}},"401":{"description":"UnauthorizedUserError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"UnauthorizedUserError":{"value":{"code":"UnauthorizedUserError","message":"Guest is not allowed to do this operation."}}}}}}},"description":"post /api/v2/tokens/application"},{"description":"get /api/v2/authn/oidc/login","tests":[{"operation":{"tag":"authn","operationId":"oidcLogin","parameters":[]}}],"schemas":{"302":{"description":"Redirect"}}},{"description":"get /api/v2/authn/oidc/logout","tests":[{"operation":{"tag":"authn","operationId":"oidcLogout","parameters":[]}}],"schemas":{"302":{"description":"Redirect"}}},{"tests":[{"description":"login with correct username and password","operation":{"parameters":[{"type":"raw","value":"sdk_test"},{"type":"raw","value":"pwd"}],"tag":"authn","operationId":"basicLogin","response":{"statusCode":200,"schema":{"type":"object","properties":{"token":{"type":"string","description":"your access token"},"user":{"type":"string","description":"username"},"admin":{"type":"boolean","description":"true if user is admin"}},"required":["token","user","admin"]},"contentType":"application/json"}}},{"description":"login with non-existent username","operation":{"parameters":[{"type":"raw","value":"nonexistentuser"},{"type":"raw","value":"password"}],"response":{"statusCode":400,"expectResult":{"code":"NoUserError","message":"User nonexistentuser is not found."},"schema":{"description":"NoUserError or IncorrectPasswordError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]}}}}},"tag":"authn","operationId":"basicLogin"}},{"description":"login with incorrect password","operation":{"parameters":[{"type":"raw","value":"sdk_test"},{"type":"raw","value":"incorrectpassword"}],"response":{"statusCode":400,"expectResult":{"code":"IncorrectPasswordError","message":"Password is incorrect."},"schema":{"description":"NoUserError or IncorrectPasswordError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]}}}}},"tag":"authn","operationId":"basicLogin"}}],"after":[{"tag":"token","operationId":"deleteToken","parameters":[{"type":"fromResult","resultType":"testResults","resultPath":["token"],"resultIndex":0}]}],"schemas":{"200":{"description":"Succeeded","content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string","description":"your access token"},"user":{"type":"string","description":"username"},"admin":{"type":"boolean","description":"true if user is admin"}},"required":["token","user","admin"]},"example":{"token":"JWT Token Example","user":"user","admin":true}}}},"400":{"description":"NoUserError or IncorrectPasswordError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]}}}},"404":{"description":"NoUserError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"NoUserError":{"value":{"code":"NoUserError","message":"User {user} is not found."}}}}}}},"description":"post /api/v2/authn/basic/login"},{"before":[{"tag":"authn","operationId":"basicLogin","parameters":[{"type":"raw","value":"sdk_test"},{"type":"raw","value":"pwd"}]}],"tests":[{"description":"Logout with correct token","customizedTest":"logoutWithCorrectToken","operation":{"tag":"authn","operationId":"basicLogout","parameters":[],"response":{"statusCode":200,"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"contentType":"application/json"}}},{"description":"Logout with incorrect token","customizedTest":"logoutWithIncorrectToken","operation":{"tag":"authn","operationId":"basicLogout","parameters":[],"response":{"statusCode":200,"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"contentType":"application/json"}}}],"schemas":{"200":{"description":"Succeeded","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"example":{"message":"Logout successfully"}}}},"401":{"description":"UnauthorizedUserError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"UnauthorizedUserError":{"value":{"code":"UnauthorizedUserError","message":"Guest is not allowed to do this operation."}}}}}},"403":{"description":"ForbiddenUserError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"ForbiddenUserError":{"value":{"code":"ForbiddenUserError","message":"Non-admin is not allow to do this operation."}},"ForbiddenTokenError":{"value":{"code":"ForbiddenUserError","message":"Applications are not allowed to do this operation."}}}}}}},"description":"delete /api/v2/authn/basic/logout"},{"before":[{"tag":"token","operationId":"createApplicationToken"}],"tests":[{"description":"Create a user","operation":{"tag":"user","operationId":"createUser","parameters":[{"type":"raw","value":{"username":"sdk_test_user","password":"test_password"}}],"response":{"statusCode":201,"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"contentType":"application/json"}}},{"description":"Create a conflict user","operation":{"tag":"user","operationId":"createUser","parameters":[{"type":"raw","value":{"username":"sdk_test_user","password":"test_password"}}],"response":{"statusCode":409,"schema":{"description":"ConflictUserError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"ConflictUserError":{"value":{"code":"ConflictUserError","message":"User name {user} already exists."}}}}}}}}},{"description":"Create a user by application token","customizedTest":"createUserByApplicationToken","operation":{"tag":"user","operationId":"createUser","parameters":[],"response":{"statusCode":201,"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"contentType":"application/json"}}},{"description":"Create a user by non-admin user token","customizedTest":"createUserByNonadminToken","operation":{"tag":"user","operationId":"createUser","parameters":[],"response":{"statusCode":201,"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"contentType":"application/json"}}}],"after":[{"tag":"user","operationId":"deleteUser","parameters":[{"type":"raw","value":"sdk_test_user"}],"response":{"statusCode":200,"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"contentType":"application/json"}},{"tag":"token","operationId":"deleteToken","parameters":[{"type":"fromResult","resultType":"beforeResults","resultPath":["token"],"resultIndex":0}]}],"schemas":{"201":{"description":"Succeeded","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"example":{"message":"User is created successfully"}}}},"401":{"description":"UnauthorizedUserError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"UnauthorizedUserError":{"value":{"code":"UnauthorizedUserError","message":"Guest is not allowed to do this operation."}}}}}},"403":{"description":"ForbiddenUserError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"ForbiddenUserError":{"value":{"code":"ForbiddenUserError","message":"Non-admin is not allow to do this operation."}},"ForbiddenTokenError":{"value":{"code":"ForbiddenUserError","message":"Applications are not allowed to do this operation."}}}}}},"409":{"description":"ConflictUserError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"ConflictUserError":{"value":{"code":"ConflictUserError","message":"User name {user} already exists."}}}}}},"500":{"description":"UnknownError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"UnknownError":{"value":{"code":"UnknownError","message":"Internal error message."}}}}}}},"description":"post /api/v2/users"},{"description":"get /api/v2/users","tests":[{"operation":{"tag":"user","operationId":"getAllUser","parameters":[],"response":{"statusCode":200,"schema":{"description":"Array with all users in the system.","type":"array","items":{"type":"object","properties":{"username":{"type":"string","description":"user name"},"admin":{"type":"boolean","description":"Admin or not."},"virtualCluster":{"type":"array","description":"The list of virtualCluster which the user can access.","items":{"type":"string","description":"virtual cluster name."}},"storageConfig":{"type":"array","description":"storageconfig string arry","items":{"type":"string"}},"email":{"type":"string","description":"email address"},"extension":{"type":"object","description":"extension field."}},"required":["username","admin","virtualCluster","storageConfig","email","extension"]}},"contentType":"application/json"}}}],"schemas":{"200":{"description":"Succeeded","content":{"application/json":{"schema":{"description":"Array with all users in the system.","type":"array","items":{"type":"object","properties":{"username":{"type":"string","description":"user name"},"admin":{"type":"boolean","description":"Admin or not."},"virtualCluster":{"type":"array","description":"The list of virtualCluster which the user can access.","items":{"type":"string","description":"virtual cluster name."}},"storageConfig":{"type":"array","description":"storageconfig string arry","items":{"type":"string"}},"email":{"type":"string","description":"email address"},"extension":{"type":"object","description":"extension field."}},"required":["username","admin","virtualCluster","storageConfig","email","extension"]}},"example":[{"username":"username","admin":true,"virtualCluster":[],"storageConfig":[],"email":"email@test.com","extension":{}}]}}},"500":{"description":"UnknownError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"UnknownError":{"value":{"code":"UnknownError","message":"Internal error message."}}}}}}}},{"before":[{"tag":"user","operationId":"createUser","parameters":[{"type":"raw","value":{"username":"sdk_test_user","password":"test_password"}}],"response":{"statusCode":201,"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"contentType":"application/json"}},{"tag":"token","operationId":"createApplicationToken"}],"tests":[{"description":"Update a user, patch: true","operation":{"parameters":[{"type":"raw","value":{"username":"sdk_test_user","email":"new_email@test1.com"}}],"tag":"user","operationId":"updateUser","response":{"statusCode":201,"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"contentType":"application/json"}}},{"description":"Update a user, patch: false","operation":{"parameters":[{"type":"raw","value":{"username":"sdk_test_user","email":"new_email@test2.com","virtualCluster":["default"],"admin":false,"password":"new_test_password","extension":{}}},{"type":"raw","value":false}],"tag":"user","operationId":"updateUser","response":{"statusCode":201,"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"contentType":"application/json"}}},{"description":"Update a non-existent user","operation":{"parameters":[{"type":"raw","value":{"username":"non_exist_user","email":"new_email@test1.com"}}],"response":{"statusCode":404,"schema":{"description":"NoUserError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"NoUserError":{"value":{"code":"NoUserError","message":"User {user} is not found."}}}}}}},"tag":"user","operationId":"updateUser"}},{"description":"Update a user by application token","customizedTest":"updateUserByApplicationToken","operation":{"tag":"user","operationId":"updateUser","parameters":[],"response":{"statusCode":201,"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"contentType":"application/json"}}},{"description":"Update a user by non-admin user token","customizedTest":"updateUserByNonadminToken","operation":{"tag":"user","operationId":"updateUser","parameters":[],"response":{"statusCode":201,"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"contentType":"application/json"}}}],"after":[{"tag":"user","operationId":"deleteUser","parameters":[{"type":"raw","value":"sdk_test_user"}],"response":{"statusCode":200,"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"contentType":"application/json"}},{"tag":"token","operationId":"deleteToken","parameters":[{"type":"fromResult","resultType":"beforeResults","resultPath":["token"],"resultIndex":1}]}],"schemas":{"201":{"description":"Succeeded","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"example":{"message":"update group {username} successfully."}}}},"401":{"description":"UnauthorizedUserError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"UnauthorizedUserError":{"value":{"code":"UnauthorizedUserError","message":"Guest is not allowed to do this operation."}}}}}},"403":{"description":"ForbiddenUserError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"ForbiddenUserError":{"value":{"code":"ForbiddenUserError","message":"Non-admin is not allow to do this operation."}},"ForbiddenTokenError":{"value":{"code":"ForbiddenUserError","message":"Applications are not allowed to do this operation."}}}}}},"404":{"description":"NoUserError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"NoUserError":{"value":{"code":"NoUserError","message":"User {user} is not found."}}}}}},"500":{"description":"UnknownError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"UnknownError":{"value":{"code":"UnknownError","message":"Internal error message."}}}}}}},"description":"put /api/v2/users"},{"tests":[{"description":"Update user self, patch: true","operation":{"parameters":[{"type":"raw","value":{"username":"sdk_test","email":"new_email@test1.com"}}],"tag":"user","operationId":"updateUserSelf","response":{"statusCode":201,"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"contentType":"application/json"}}},{"description":"Update user self, patch: false","operation":{"parameters":[{"type":"raw","value":{"username":"sdk_test","email":"new_email@test2.com","oldPassword":"pwd","newPassword":"pwd"}},{"type":"raw","value":false}],"tag":"user","operationId":"updateUserSelf","response":{"statusCode":201,"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"contentType":"application/json"}}},{"description":"Update user self with incorrect username","operation":{"parameters":[{"type":"raw","value":{"username":"incorrect_username","email":"new_email@test1.com"}}],"response":{"statusCode":403,"schema":{"description":"ForbiddenUserError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"ForbiddenUserError":{"value":{"code":"ForbiddenUserError","message":"Non-admin is not allow to do this operation."}},"ForbiddenTokenError":{"value":{"code":"ForbiddenUserError","message":"Applications are not allowed to do this operation."}}}}}}},"tag":"user","operationId":"updateUserSelf"}}],"schemas":{"201":{"description":"Succeeded","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"example":{"message":"update group {username} successfully."}}}},"401":{"description":"UnauthorizedUserError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"UnauthorizedUserError":{"value":{"code":"UnauthorizedUserError","message":"Guest is not allowed to do this operation."}}}}}},"403":{"description":"ForbiddenUserError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"ForbiddenUserError":{"value":{"code":"ForbiddenUserError","message":"Non-admin is not allow to do this operation."}},"ForbiddenTokenError":{"value":{"code":"ForbiddenUserError","message":"Applications are not allowed to do this operation."}}}}}},"404":{"description":"NoUserError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"NoUserError":{"value":{"code":"NoUserError","message":"User {user} is not found."}}}}}},"500":{"description":"UnknownError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"UnknownError":{"value":{"code":"UnknownError","message":"Internal error message."}}}}}}},"description":"put /api/v2/users/me"},{"tests":[{"operation":{"parameters":[{"type":"raw","value":"sdk_test"}],"tag":"user","operationId":"getUser","response":{"statusCode":200,"schema":{"type":"object","properties":{"username":{"type":"string","description":"user name"},"admin":{"type":"boolean","description":"Admin or not."},"virtualCluster":{"type":"array","description":"The list of virtualCluster which the user can access.","items":{"type":"string","description":"virtual cluster name."}},"storageConfig":{"type":"array","description":"storageconfig string arry","items":{"type":"string"}},"email":{"type":"string","description":"email address"},"extension":{"type":"object","description":"extension field."}},"required":["username","admin","virtualCluster","storageConfig","email","extension"]},"contentType":"application/json"}}}],"schemas":{"200":{"description":"Succeeded","content":{"application/json":{"schema":{"type":"object","properties":{"username":{"type":"string","description":"user name"},"admin":{"type":"boolean","description":"Admin or not."},"virtualCluster":{"type":"array","description":"The list of virtualCluster which the user can access.","items":{"type":"string","description":"virtual cluster name."}},"storageConfig":{"type":"array","description":"storageconfig string arry","items":{"type":"string"}},"email":{"type":"string","description":"email address"},"extension":{"type":"object","description":"extension field."}},"required":["username","admin","virtualCluster","storageConfig","email","extension"]},"example":{"username":"username","admin":true,"virtualCluster":[],"storageConfig":[],"email":"email@test.com","extension":{}}}}},"401":{"description":"UnauthorizedUserError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"UnauthorizedUserError":{"value":{"code":"UnauthorizedUserError","message":"Guest is not allowed to do this operation."}}}}}},"404":{"description":"NoUserError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"NoUserError":{"value":{"code":"NoUserError","message":"User {user} is not found."}}}}}},"500":{"description":"UnknownError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"UnknownError":{"value":{"code":"UnknownError","message":"Internal error message."}}}}}}},"description":"get /api/v2/users/{user}"},{"before":[{"tag":"user","operationId":"createUser","parameters":[{"type":"raw","value":{"username":"sdk_test_user","password":"test_password"}}],"response":{"statusCode":201,"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"contentType":"application/json"}},{"tag":"token","operationId":"createApplicationToken"}],"tests":[{"description":"Delete a user","operation":{"tag":"user","operationId":"deleteUser","parameters":[{"type":"raw","value":"sdk_test_user"}],"response":{"statusCode":200,"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"contentType":"application/json"}}},{"description":"Delete a non-existent user","operation":{"parameters":[{"type":"raw","value":"non_exist_user"}],"response":{"statusCode":404,"schema":{"description":"NoUserError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"NoUserError":{"value":{"code":"NoUserError","message":"User {user} is not found."}}}}}}},"tag":"user","operationId":"deleteUser"}},{"description":"Delete a user by application token","customizedTest":"deleteUserByApplicationToken","operation":{"tag":"user","operationId":"deleteUser","parameters":[],"response":{"statusCode":200,"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"contentType":"application/json"}}},{"description":"Delete a user by non-admin user token","customizedTest":"deleteUserByNonadminToken","operation":{"tag":"user","operationId":"deleteUser","parameters":[],"response":{"statusCode":200,"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"contentType":"application/json"}}}],"after":[{"tag":"token","operationId":"deleteToken","parameters":[{"type":"fromResult","resultType":"beforeResults","resultPath":["token"],"resultIndex":1}]}],"schemas":{"200":{"description":"Succeeded","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"example":{"message":"user is removed successfully"}}}},"401":{"description":"UnauthorizedUserError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"UnauthorizedUserError":{"value":{"code":"UnauthorizedUserError","message":"Guest is not allowed to do this operation."}}}}}},"403":{"description":"ForbiddenUserError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"ForbiddenUserError":{"value":{"code":"ForbiddenUserError","message":"Non-admin is not allow to do this operation."}},"ForbiddenTokenError":{"value":{"code":"ForbiddenUserError","message":"Applications are not allowed to do this operation."}}}}}},"404":{"description":"NoUserError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"NoUserError":{"value":{"code":"NoUserError","message":"User {user} is not found."}}}}}},"500":{"description":"UnknownError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"UnknownError":{"value":{"code":"UnknownError","message":"Internal error message."}}}}}}},"description":"delete /api/v2/users/{user}"},{"before":[{"tag":"token","operationId":"createApplicationToken"},{"tag":"user","operationId":"createUser","parameters":[{"type":"raw","value":{"username":"sdk_test_user","password":"test_password"}}],"response":{"statusCode":201,"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"contentType":"application/json"}},{"tag":"group","operationId":"createGroup","parameters":[{"type":"raw","value":{"groupname":"sdktestgroup"}}],"response":{"statusCode":201,"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"contentType":"application/json"}}],"tests":[{"description":"Add a group to a user's grouplist","operation":{"parameters":[{"type":"raw","value":"sdk_test_user"},{"type":"raw","value":"sdktestgroup"}],"tag":"user","operationId":"updateUserGroup","response":{"statusCode":201,"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"contentType":"application/json"}}},{"description":"Add a group to a non-existent user's grouplist","operation":{"parameters":[{"type":"raw","value":"non_exist_user"},{"type":"raw","value":"sdktestgroup"}],"response":{"statusCode":404,"schema":{"description":"NoUserError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"NoUserError":{"value":{"code":"NoUserError","message":"User {user} is not found."}}}}}}},"tag":"user","operationId":"updateUserGroup"}},{"description":"Add a group to a user's grouplist by application token","customizedTest":"updateUserGroupByApplicationToken","operation":{"tag":"user","operationId":"updateUserGroup","parameters":[],"response":{"statusCode":201,"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"contentType":"application/json"}}},{"description":"Add a group to a user's grouplist by non-admin user token","customizedTest":"updateUserGroupByNonadminToken","operation":{"tag":"user","operationId":"updateUserGroup","parameters":[],"response":{"statusCode":201,"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"contentType":"application/json"}}}],"after":[{"tag":"token","operationId":"deleteToken","parameters":[{"type":"fromResult","resultType":"beforeResults","resultPath":["token"],"resultIndex":0}]},{"tag":"user","operationId":"deleteUser","parameters":[{"type":"raw","value":"sdk_test_user"}],"response":{"statusCode":200,"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"contentType":"application/json"}},{"tag":"group","operationId":"deleteGroup","parameters":[{"type":"raw","value":"sdktestgroup"}],"response":{"statusCode":201,"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"contentType":"application/json"}}],"schemas":{"201":{"description":"Succeeded","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"example":{"message":"User {username} is added into group {groupname}"}}}},"401":{"description":"UnauthorizedUserError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"UnauthorizedUserError":{"value":{"code":"UnauthorizedUserError","message":"Guest is not allowed to do this operation."}}}}}},"403":{"description":"ForbiddenUserError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"ForbiddenUserError":{"value":{"code":"ForbiddenUserError","message":"Non-admin is not allow to do this operation."}},"ForbiddenTokenError":{"value":{"code":"ForbiddenUserError","message":"Applications are not allowed to do this operation."}}}}}},"404":{"description":"NoUserError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"NoUserError":{"value":{"code":"NoUserError","message":"User {user} is not found."}}}}}},"500":{"description":"UnknownError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"UnknownError":{"value":{"code":"UnknownError","message":"Internal error message."}}}}}}},"description":"put /api/v2/users/{user}/group/"},{"before":[{"tag":"token","operationId":"createApplicationToken"},{"tag":"user","operationId":"createUser","parameters":[{"type":"raw","value":{"username":"sdk_test_user","password":"test_password"}}],"response":{"statusCode":201,"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"contentType":"application/json"}},{"tag":"group","operationId":"createGroup","parameters":[{"type":"raw","value":{"groupname":"sdktestgroup"}}],"response":{"statusCode":201,"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"contentType":"application/json"}},{"tag":"user","operationId":"updateUserGroup","parameters":[{"type":"raw","value":"sdk_test_user"},{"type":"raw","value":"sdktestgroup"}]}],"tests":[{"description":"Remove a group to a user's grouplist","operation":{"parameters":[{"type":"raw","value":"sdk_test_user"},{"type":"raw","value":"sdktestgroup"}],"tag":"user","operationId":"deleteUserGroup","response":{"statusCode":201,"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"contentType":"application/json"}}},{"description":"Remove a group to a non-existent user's grouplist","operation":{"parameters":[{"type":"raw","value":"non_exist_user"},{"type":"raw","value":"sdktestgroup"}],"response":{"statusCode":404,"schema":{"description":"NoUserError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"NoUserError":{"value":{"code":"NoUserError","message":"User {user} is not found."}}}}}}},"tag":"user","operationId":"deleteUserGroup"}},{"description":"Remove a group to a user's grouplist by application token","customizedTest":"deleteUserGroupByApplicationToken","operation":{"tag":"user","operationId":"deleteUserGroup","parameters":[],"response":{"statusCode":201,"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"contentType":"application/json"}}},{"description":"Remove a group to a user's grouplist by non-admin user token","customizedTest":"deleteUserGroupByNonadminToken","operation":{"tag":"user","operationId":"deleteUserGroup","parameters":[],"response":{"statusCode":201,"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"contentType":"application/json"}}}],"after":[{"tag":"token","operationId":"deleteToken","parameters":[{"type":"fromResult","resultType":"beforeResults","resultPath":["token"],"resultIndex":0}]},{"tag":"user","operationId":"deleteUser","parameters":[{"type":"raw","value":"sdk_test_user"}],"response":{"statusCode":200,"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"contentType":"application/json"}},{"tag":"group","operationId":"deleteGroup","parameters":[{"type":"raw","value":"sdktestgroup"}],"response":{"statusCode":201,"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"contentType":"application/json"}}],"schemas":{"201":{"description":"Succeeded","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"example":{"message":"User {username} is removed from group {groupname}"}}}},"401":{"description":"UnauthorizedUserError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"UnauthorizedUserError":{"value":{"code":"UnauthorizedUserError","message":"Guest is not allowed to do this operation."}}}}}},"403":{"description":"ForbiddenUserError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"ForbiddenUserError":{"value":{"code":"ForbiddenUserError","message":"Non-admin is not allow to do this operation."}},"ForbiddenTokenError":{"value":{"code":"ForbiddenUserError","message":"Applications are not allowed to do this operation."}}}}}},"404":{"description":"NoUserError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"NoUserError":{"value":{"code":"NoUserError","message":"User {user} is not found."}}}}}},"500":{"description":"UnknownError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"UnknownError":{"value":{"code":"UnknownError","message":"Internal error message."}}}}}}},"description":"delete /api/v2/users/{user}/group/"},{"before":[{"tag":"token","operationId":"createApplicationToken"},{"tag":"user","operationId":"createUser","parameters":[{"type":"raw","value":{"username":"sdk_test_user","password":"test_password"}}],"response":{"statusCode":201,"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"contentType":"application/json"}}],"tests":[{"description":"Replace a user's grouplist","operation":{"parameters":[{"type":"raw","value":"sdk_test_user"},{"type":"raw","value":["default"]}],"tag":"user","operationId":"updateUserGrouplist","response":{"statusCode":201,"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"contentType":"application/json"}}},{"description":"Replace a non-existent user's grouplist","operation":{"parameters":[{"type":"raw","value":"non_exist_user"},{"type":"raw","value":["default"]}],"response":{"statusCode":404,"schema":{"description":"NoUserError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"NoUserError":{"value":{"code":"NoUserError","message":"User {user} is not found."}}}}}}},"tag":"user","operationId":"updateUserGrouplist"}},{"description":"Replace a user's grouplist by application token","customizedTest":"updateUserGrouplistByApplicationToken","operation":{"tag":"user","operationId":"updateUserGrouplist","parameters":[],"response":{"statusCode":201,"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"contentType":"application/json"}}},{"description":"Replace a user's grouplist by non-admin user token","customizedTest":"updateUserGrouplistByNonadminToken","operation":{"tag":"user","operationId":"updateUserGrouplist","parameters":[],"response":{"statusCode":201,"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"contentType":"application/json"}}}],"after":[{"tag":"token","operationId":"deleteToken","parameters":[{"type":"fromResult","resultType":"beforeResults","resultPath":["token"],"resultIndex":0}]},{"tag":"user","operationId":"deleteUser","parameters":[{"type":"raw","value":"sdk_test_user"}],"response":{"statusCode":200,"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"contentType":"application/json"}}],"schemas":{"201":{"description":"Succeeded","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"example":{"message":"update user grouplist successfully."}}}},"401":{"description":"UnauthorizedUserError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"UnauthorizedUserError":{"value":{"code":"UnauthorizedUserError","message":"Guest is not allowed to do this operation."}}}}}},"403":{"description":"ForbiddenUserError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"ForbiddenUserError":{"value":{"code":"ForbiddenUserError","message":"Non-admin is not allow to do this operation."}},"ForbiddenTokenError":{"value":{"code":"ForbiddenUserError","message":"Applications are not allowed to do this operation."}}}}}},"404":{"description":"NoUserError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"NoUserError":{"value":{"code":"NoUserError","message":"User {user} is not found."}}}}}},"500":{"description":"UnknownError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"UnknownError":{"value":{"code":"UnknownError","message":"Internal error message."}}}}}}},"description":"put /api/v2/users/{user}/grouplist/"},{"description":"get /api/v2/groups","tests":[{"operation":{"tag":"group","operationId":"getAllGroup","parameters":[],"response":{"statusCode":200,"schema":{"description":"Array with all groups in the system.","type":"array","items":{"type":"object","properties":{"groupname":{"type":"string","description":"group name"},"description":{"type":"string","description":"description for the group"},"externalName":{"type":"string","description":"the external group name binding with the group in OpenPAI"},"extension":{"type":"object"}}}},"contentType":"application/json"}}}],"schemas":{"200":{"description":"Succeeded","content":{"application/json":{"schema":{"description":"Array with all groups in the system.","type":"array","items":{"type":"object","properties":{"groupname":{"type":"string","description":"group name"},"description":{"type":"string","description":"description for the group"},"externalName":{"type":"string","description":"the external group name binding with the group in OpenPAI"},"extension":{"type":"object"}}}},"example":[{"groupname":"groupName","description":"description","externalName":"externalName","extension":{}}]}}},"500":{"description":"UnknownError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"UnknownError":{"value":{"code":"UnknownError","message":"Internal error message."}}}}}}}},{"tests":[{"operation":{"tag":"group","operationId":"createGroup","parameters":[{"type":"raw","value":{"groupname":"sdktestgroup"}}],"response":{"statusCode":201,"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"contentType":"application/json"}}}],"after":[{"tag":"group","operationId":"deleteGroup","parameters":[{"type":"raw","value":"sdktestgroup"}],"response":{"statusCode":201,"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"contentType":"application/json"}}],"schemas":{"201":{"description":"Succeeded","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"example":{"message":"group is created successfully"}}}},"401":{"description":"UnauthorizedUserError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"UnauthorizedUserError":{"value":{"code":"UnauthorizedUserError","message":"Guest is not allowed to do this operation."}}}}}},"403":{"description":"ForbiddenUserError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"ForbiddenUserError":{"value":{"code":"ForbiddenUserError","message":"Non-admin is not allow to do this operation."}},"ForbiddenTokenError":{"value":{"code":"ForbiddenUserError","message":"Applications are not allowed to do this operation."}}}}}},"500":{"description":"UnknownError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"UnknownError":{"value":{"code":"UnknownError","message":"Internal error message."}}}}}}},"description":"post /api/v2/groups"},{"before":[{"tag":"group","operationId":"createGroup","parameters":[{"type":"raw","value":{"groupname":"sdktestgroup"}}],"response":{"statusCode":201,"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"contentType":"application/json"}}],"tests":[{"operation":{"parameters":[{"type":"raw","value":{"data":{"groupname":"sdktestgroup","description":"test update group"},"patch":true}}],"tag":"group","operationId":"updateGroup","response":{"statusCode":201,"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"contentType":"application/json"}}}],"after":[{"tag":"group","operationId":"deleteGroup","parameters":[{"type":"raw","value":"sdktestgroup"}],"response":{"statusCode":201,"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"contentType":"application/json"}}],"schemas":{"201":{"description":"Succeeded","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"example":{"message":"update group {groupname} successfully."}}}},"401":{"description":"UnauthorizedUserError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"UnauthorizedUserError":{"value":{"code":"UnauthorizedUserError","message":"Guest is not allowed to do this operation."}}}}}},"403":{"description":"ForbiddenUserError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"ForbiddenUserError":{"value":{"code":"ForbiddenUserError","message":"Non-admin is not allow to do this operation."}},"ForbiddenTokenError":{"value":{"code":"ForbiddenUserError","message":"Applications are not allowed to do this operation."}}}}}},"404":{"description":"NoGroupError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"NoGroupError":{"value":{"code":"NoGroupError","message":"Group {groupname} is not found."}}}}}},"500":{"description":"UnknownError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"UnknownError":{"value":{"code":"UnknownError","message":"Internal error message."}}}}}}},"description":"put /api/v2/groups"},{"before":[{"tag":"group","operationId":"createGroup","parameters":[{"type":"raw","value":{"groupname":"sdktestgroup"}}],"response":{"statusCode":201,"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"contentType":"application/json"}}],"tests":[{"operation":{"parameters":[{"type":"raw","value":"sdktestgroup"}],"tag":"group","operationId":"getGroup","response":{"statusCode":200,"schema":{"type":"object","properties":{"groupname":{"type":"string","description":"group name"},"description":{"type":"string","description":"description for the group"},"externalName":{"type":"string","description":"the external group name binding with the group in OpenPAI"},"extension":{"type":"object"}},"required":["groupname","description","externalName","extension"]},"contentType":"application/json"}}}],"after":[{"tag":"group","operationId":"deleteGroup","parameters":[{"type":"raw","value":"sdktestgroup"}],"response":{"statusCode":201,"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"contentType":"application/json"}}],"schemas":{"200":{"description":"Succeeded","content":{"application/json":{"schema":{"type":"object","properties":{"groupname":{"type":"string","description":"group name"},"description":{"type":"string","description":"description for the group"},"externalName":{"type":"string","description":"the external group name binding with the group in OpenPAI"},"extension":{"type":"object"}},"required":["groupname","description","externalName","extension"]},"example":{"groupname":"groupName","description":"description","externalName":"externalName","extension":{}}}}},"401":{"description":"UnauthorizedUserError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"UnauthorizedUserError":{"value":{"code":"UnauthorizedUserError","message":"Guest is not allowed to do this operation."}}}}}},"404":{"description":"NoGroupError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"NoGroupError":{"value":{"code":"NoGroupError","message":"Group {groupname} is not found."}}}}}},"500":{"description":"UnknownError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"UnknownError":{"value":{"code":"UnknownError","message":"Internal error message."}}}}}}},"description":"get /api/v2/groups/{group}"},{"before":[{"tag":"group","operationId":"createGroup","parameters":[{"type":"raw","value":{"groupname":"sdktestgroup"}}],"response":{"statusCode":201,"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"contentType":"application/json"}}],"tests":[{"operation":{"tag":"group","operationId":"deleteGroup","parameters":[{"type":"raw","value":"sdktestgroup"}],"response":{"statusCode":201,"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"contentType":"application/json"}}}],"schemas":{"201":{"description":"Succeeded","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"example":{"message":"group is removed successfully"}}}},"401":{"description":"UnauthorizedUserError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"UnauthorizedUserError":{"value":{"code":"UnauthorizedUserError","message":"Guest is not allowed to do this operation."}}}}}},"403":{"description":"ForbiddenUserError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"ForbiddenUserError":{"value":{"code":"ForbiddenUserError","message":"Non-admin is not allow to do this operation."}},"ForbiddenTokenError":{"value":{"code":"ForbiddenUserError","message":"Applications are not allowed to do this operation."}}}}}},"500":{"description":"UnknownError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"UnknownError":{"value":{"code":"UnknownError","message":"Internal error message."}}}}}}},"description":"delete /api/v2/groups/{group}"},{"description":"get /api/v2/groups/{group}/userlist","tests":[{"operation":{"tag":"group","operationId":"getGroupMembers","parameters":[],"response":{"statusCode":200,"schema":{"description":"Array with all users in the group.","type":"array","items":{"type":"object","properties":{"username":{"type":"string","description":"user name"},"clusterAdmin":{"type":"boolean","description":"Cluster admin or not."}}}},"contentType":"application/json"}}}],"schemas":{"200":{"description":"Succeeded","content":{"application/json":{"schema":{"description":"Array with all users in the group.","type":"array","items":{"type":"object","properties":{"username":{"type":"string","description":"user name"},"clusterAdmin":{"type":"boolean","description":"Cluster admin or not."}}}},"example":[{"username":"username","clusterAdmin":false}]}}},"401":{"description":"UnauthorizedUserError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"UnauthorizedUserError":{"value":{"code":"UnauthorizedUserError","message":"Guest is not allowed to do this operation."}}}}}},"500":{"description":"UnknownError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"UnknownError":{"value":{"code":"UnknownError","message":"Internal error message."}}}}}}}},{"description":"get /api/v2/virtual-clusters","tests":[{"operation":{"tag":"virtual cluster","operationId":"listVirtualClusters","parameters":[],"response":{"statusCode":200,"schema":{"type":"object","additionalProperties":{"type":"object","properties":{"capacity":{"type":"number","description":"capacity percentage this virtual cluster can use of entire cluster"},"usedCapacity":{"type":"number","description":"used capacity percentage this virtual cluster can use of entire cluster"},"maxCapacity":{"type":"number","description":"max capacity percentage this virtual cluster can use of entire cluster"},"dedicated":{"type":"boolean","description":"dedicated virtual cluster or not"},"resourcesUsed":{"type":"object","description":"used resources","properties":{"cpu":{"type":"integer","description":"used cpu number"},"vCores":{"type":"integer","description":"same as cpu"},"memory":{"type":"integer","description":"used memory in MB"},"gpu":{"type":"integer","description":"used gpu number"},"GPUs":{"type":"integer","description":"same as gpu"}}},"resourcesGuaranteed":{"type":"object","description":"guaranteed resources, including used and free","properties":{"cpu":{"type":"integer","description":"guaranteed cpu number"},"vCores":{"type":"integer","description":"same as cpu"},"memory":{"type":"integer","description":"guaranteed memory in MB"},"gpu":{"type":"integer","description":"guaranteed gpu number"},"GPUs":{"type":"integer","description":"same as gpu"}}},"resourcesTotal":{"type":"object","description":"total resources, including guaranteed and bad","properties":{"cpu":{"type":"integer","description":"total cpu number"},"vCores":{"type":"integer","description":"same as cpu"},"memory":{"type":"integer","description":"total memory in MB"},"gpu":{"type":"integer","description":"total gpu number"},"GPUs":{"type":"integer","description":"same as gpu"}}}},"required":["capacity","usedCapacity","maxCapacity","resourcesUsed","resourcesGuaranteed","resourcesTotal"]}},"contentType":"application/json"}}}],"schemas":{"200":{"description":"Succeeded","content":{"application/json":{"schema":{"type":"object","additionalProperties":{"type":"object","properties":{"capacity":{"type":"number","description":"capacity percentage this virtual cluster can use of entire cluster"},"usedCapacity":{"type":"number","description":"used capacity percentage this virtual cluster can use of entire cluster"},"maxCapacity":{"type":"number","description":"max capacity percentage this virtual cluster can use of entire cluster"},"dedicated":{"type":"boolean","description":"dedicated virtual cluster or not"},"resourcesUsed":{"type":"object","description":"used resources","properties":{"cpu":{"type":"integer","description":"used cpu number"},"vCores":{"type":"integer","description":"same as cpu"},"memory":{"type":"integer","description":"used memory in MB"},"gpu":{"type":"integer","description":"used gpu number"},"GPUs":{"type":"integer","description":"same as gpu"}}},"resourcesGuaranteed":{"type":"object","description":"guaranteed resources, including used and free","properties":{"cpu":{"type":"integer","description":"guaranteed cpu number"},"vCores":{"type":"integer","description":"same as cpu"},"memory":{"type":"integer","description":"guaranteed memory in MB"},"gpu":{"type":"integer","description":"guaranteed gpu number"},"GPUs":{"type":"integer","description":"same as gpu"}}},"resourcesTotal":{"type":"object","description":"total resources, including guaranteed and bad","properties":{"cpu":{"type":"integer","description":"total cpu number"},"vCores":{"type":"integer","description":"same as cpu"},"memory":{"type":"integer","description":"total memory in MB"},"gpu":{"type":"integer","description":"total gpu number"},"GPUs":{"type":"integer","description":"same as gpu"}}}},"required":["capacity","usedCapacity","maxCapacity","resourcesUsed","resourcesGuaranteed","resourcesTotal"]}}}}},"500":{"description":"UnknownError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"UnknownError":{"value":{"code":"UnknownError","message":"Internal error message."}}}}}}}},{"tests":[{"operation":{"parameters":[{"type":"raw","value":"default"}],"tag":"virtual cluster","operationId":"getVirtualCluster","response":{"statusCode":200,"schema":{"type":"object","properties":{"capacity":{"type":"number","description":"capacity percentage this virtual cluster can use of entire cluster"},"usedCapacity":{"type":"number","description":"used capacity percentage this virtual cluster can use of entire cluster"},"maxCapacity":{"type":"number","description":"max capacity percentage this virtual cluster can use of entire cluster"},"dedicated":{"type":"boolean","description":"dedicated virtual cluster or not"},"resourcesUsed":{"type":"object","description":"used resources","properties":{"cpu":{"type":"integer","description":"used cpu number"},"vCores":{"type":"integer","description":"same as cpu"},"memory":{"type":"integer","description":"used memory in MB"},"gpu":{"type":"integer","description":"used gpu number"},"GPUs":{"type":"integer","description":"same as gpu"}}},"resourcesGuaranteed":{"type":"object","description":"guaranteed resources, including used and free","properties":{"cpu":{"type":"integer","description":"guaranteed cpu number"},"vCores":{"type":"integer","description":"same as cpu"},"memory":{"type":"integer","description":"guaranteed memory in MB"},"gpu":{"type":"integer","description":"guaranteed gpu number"},"GPUs":{"type":"integer","description":"same as gpu"}}},"resourcesTotal":{"type":"object","description":"total resources, including guaranteed and bad","properties":{"cpu":{"type":"integer","description":"total cpu number"},"vCores":{"type":"integer","description":"same as cpu"},"memory":{"type":"integer","description":"total memory in MB"},"gpu":{"type":"integer","description":"total gpu number"},"GPUs":{"type":"integer","description":"same as gpu"}}}},"required":["capacity","usedCapacity","maxCapacity","resourcesUsed","resourcesGuaranteed","resourcesTotal"]},"contentType":"application/json"}}}],"schemas":{"200":{"description":"Succeeded","content":{"application/json":{"schema":{"type":"object","properties":{"capacity":{"type":"number","description":"capacity percentage this virtual cluster can use of entire cluster"},"usedCapacity":{"type":"number","description":"used capacity percentage this virtual cluster can use of entire cluster"},"maxCapacity":{"type":"number","description":"max capacity percentage this virtual cluster can use of entire cluster"},"dedicated":{"type":"boolean","description":"dedicated virtual cluster or not"},"resourcesUsed":{"type":"object","description":"used resources","properties":{"cpu":{"type":"integer","description":"used cpu number"},"vCores":{"type":"integer","description":"same as cpu"},"memory":{"type":"integer","description":"used memory in MB"},"gpu":{"type":"integer","description":"used gpu number"},"GPUs":{"type":"integer","description":"same as gpu"}}},"resourcesGuaranteed":{"type":"object","description":"guaranteed resources, including used and free","properties":{"cpu":{"type":"integer","description":"guaranteed cpu number"},"vCores":{"type":"integer","description":"same as cpu"},"memory":{"type":"integer","description":"guaranteed memory in MB"},"gpu":{"type":"integer","description":"guaranteed gpu number"},"GPUs":{"type":"integer","description":"same as gpu"}}},"resourcesTotal":{"type":"object","description":"total resources, including guaranteed and bad","properties":{"cpu":{"type":"integer","description":"total cpu number"},"vCores":{"type":"integer","description":"same as cpu"},"memory":{"type":"integer","description":"total memory in MB"},"gpu":{"type":"integer","description":"total gpu number"},"GPUs":{"type":"integer","description":"same as gpu"}}}},"required":["capacity","usedCapacity","maxCapacity","resourcesUsed","resourcesGuaranteed","resourcesTotal"]},"example":{"capacity":70,"usedCapacity":30,"dedicated":false,"resourcesUsed":{"cpu":1,"memory":1024,"gpu":1,"vCores":1,"GPUs":1},"resourcesGuaranteed":{"cpu":2,"memory":2048,"gpu":2,"vCores":2,"GPUs":2},"resourcesTotal":{"cpu":2,"memory":2048,"gpu":2,"vCores":2,"GPUs":2},"maxCapacity":70}}}},"404":{"description":"NoVirtualClusterError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"NoVirtualClusterError":{"value":{"code":"NoVirtualClusterError","message":"Virtual cluster {vc} is not found."}}}}}},"500":{"description":"UnknownError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"UnknownError":{"value":{"code":"UnknownError","message":"Internal error message."}}}}}}},"description":"get /api/v2/virtual-clusters/{vc}"},{"description":"get /api/v2/storages","tests":[{"operation":{"tag":"storage","operationId":"getStorages","parameters":[],"response":{"statusCode":200,"schema":{"type":"object","description":"summary of configured PV storage","properties":{"storages":{"type":"array","items":{"type":"object","description":"summary of each storage","properties":{"name":{"type":"string"},"share":{"type":"boolean"},"volumeName":{"type":"string"}},"required":["name","share","volumeName"]}}},"required":["storages"]},"contentType":"application/json"}}}],"schemas":{"200":{"description":"Succeeded","content":{"application/json":{"schema":{"type":"object","description":"summary of configured PV storage","properties":{"storages":{"type":"array","items":{"type":"object","description":"summary of each storage","properties":{"name":{"type":"string"},"share":{"type":"boolean"},"volumeName":{"type":"string"}},"required":["name","share","volumeName"]}}},"required":["storages"]},"example":{"storages":[{"name":"name","share":true,"volumeName":"volumeName"}]}}}},"500":{"description":"UnknownError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"UnknownError":{"value":{"code":"UnknownError","message":"Internal error message."}}}}}}}},{"before":[{"tag":"storage","operationId":"getStorages"}],"tests":[{"operation":{"parameters":[{"type":"fromResult","resultType":"beforeResults","resultPath":["storages",0,"name"],"resultIndex":0}],"tag":"storage","operationId":"getStorage","response":{"statusCode":200,"schema":{"type":"object","description":"detail of configured PV storage","properties":{"name":{"type":"string"},"share":{"type":"boolean"},"volumeName":{"type":"string"},"type":{"type":"string","enum":["nfs","samba","azureFile","azureBlob","other","unknown"]},"data":{"anyOf":[{"type":"object","description":"nfs type","properties":{"server":{"type":"string"},"path":{"type":"string"}},"required":["server","path"]},{"type":"object","description":"samba type","properties":{"address":{"type":"string"},"username":{"type":"string"},"password":{"type":"string"}},"required":["address"]},{"type":"object","description":"azureFile type","properties":{"shareName":{"type":"string"},"accountName":{"type":"string"},"accountKey":{"type":"string"}},"required":["shareName"]},{"type":"object","description":"azureBlob type","properties":{"containerName":{"type":"string"},"accountName":{"type":"string"},"accountKey":{"type":"string"},"accountSASToken":{"type":"string"}},"required":["containerName"]},{"type":"object","description":"other/unknown type","properties":{}}]},"readOnly":{"type":"boolean"},"secretName":{"type":"string"},"mountOptions":{"type":"array","items":{"type":"string"}}},"required":["name","share","volumeName","type","data"]},"contentType":"application/json"}}}],"schemas":{"200":{"description":"Succeeded","content":{"application/json":{"schema":{"type":"object","description":"detail of configured PV storage","properties":{"name":{"type":"string"},"share":{"type":"boolean"},"volumeName":{"type":"string"},"type":{"type":"string","enum":["nfs","samba","azureFile","azureBlob","other","unknown"]},"data":{"anyOf":[{"type":"object","description":"nfs type","properties":{"server":{"type":"string"},"path":{"type":"string"}},"required":["server","path"]},{"type":"object","description":"samba type","properties":{"address":{"type":"string"},"username":{"type":"string"},"password":{"type":"string"}},"required":["address"]},{"type":"object","description":"azureFile type","properties":{"shareName":{"type":"string"},"accountName":{"type":"string"},"accountKey":{"type":"string"}},"required":["shareName"]},{"type":"object","description":"azureBlob type","properties":{"containerName":{"type":"string"},"accountName":{"type":"string"},"accountKey":{"type":"string"},"accountSASToken":{"type":"string"}},"required":["containerName"]},{"type":"object","description":"other/unknown type","properties":{}}]},"readOnly":{"type":"boolean"},"secretName":{"type":"string"},"mountOptions":{"type":"array","items":{"type":"string"}}},"required":["name","share","volumeName","type","data"]},"example":{"name":"nfs-storage-name","share":true,"volumeName":"nfs-volume-name","type":"nfs","data":{"server":"","path":"/data"}}}}},"403":{"description":"ForbiddenUserError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"ForbiddenUserError":{"value":{"code":"ForbiddenUserError","message":"User {user} is not allowed to access {storage}."}}}}}},"404":{"description":"NoStorageError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"NoVirtualClusterError":{"value":{"code":"NoStorageError","message":"Storage {storage} is not found."}}}}}},"500":{"description":"UnknownError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"UnknownError":{"value":{"code":"UnknownError","message":"Internal error message."}}}}}}},"description":"get /api/v2/storages/{storage}"},{"tests":[{"operation":{"tag":"job","operationId":"createJob","parameters":[{"type":"raw","value":{"contributor":"OpenPAI","description":"# Serving a TensorFlow MNIST Digit Recognition Model\nThis example shows you how to use TensorFlow Serving components to export a trained TensorFlow model\nand use the standard tensorflow_model_server to serve it on OpenPAI.\nThis example uses the simple Softmax Regression model introduced in the TensorFlow tutorial for handwritten image (MNIST data) classification.\nReference https://www.tensorflow.org/tfx/serving/serving_basic.\n","name":"sdk_test_job0f565fe3","parameters":{"modelPath":"/tmp/mnist_model"},"prerequisites":[{"contributor":"OpenPAI","description":"This is an [example TensorFlow Serving Docker image on OpenPAI](https://github.com/Microsoft/pai/tree/master/examples/serving).\n","name":"tf_serving_example","protocolVersion":2,"type":"dockerimage","uri":"openpai/pai.example.tensorflow-serving","version":"1.0-r1.4"}],"protocolVersion":2,"taskRoles":{"worker":{"commands":["bazel-bin/tensorflow_serving/example/mnist_saved_model <% $parameters.modelPath %>","tensorflow_model_server --port=$PAI_CONTAINER_HOST_model_server_PORT_LIST --model_name=mnist --model_base_path=<% $parameters.modelPath %>"],"dockerImage":"tf_serving_example","instances":1,"resourcePerInstance":{"cpu":4,"gpu":1,"memoryMB":8192,"ports":{"model_server":1}}}},"type":"job","version":"1.0"}}],"response":{"statusCode":202,"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"contentType":"application/json"}}}],"after":[{"tag":"job","operationId":"updateJobExecutionType","parameters":[{"type":"raw","value":"sdk_test"},{"type":"raw","value":"sdk_test_job0f565fe3"},{"type":"raw","value":"STOP"}]}],"schemas":{"202":{"description":"Succeeded","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"example":{"message":"update job {job} successfully"}}}},"400":{"description":"NoVirtualClusterError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"NoVirtualClusterError":{"value":{"code":"NoVirtualClusterError","message":"Virtual cluster {vc} is not found."}}}}}},"403":{"description":"ForbiddenUserError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"ForbiddenUserError":{"value":{"code":"ForbiddenUserError","message":"Non-admin is not allow to do this operation."}},"ForbiddenTokenError":{"value":{"code":"ForbiddenUserError","message":"Applications are not allowed to do this operation."}}}}}},"409":{"description":"ConflictJobError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"ConflictJobError":{"value":{"code":"ConflictJobError","message":"Job name {job} already exists."}}}}}},"500":{"description":"UnknownError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"UnknownError":{"value":{"code":"UnknownError","message":"Internal error message."}}}}}}},"description":"post /api/v2/jobs"},{"description":"get /api/v2/jobs","tests":[{"operation":{"tag":"job","operationId":"listJobs","parameters":[],"response":{"statusCode":200,"schema":{"type":"array","description":"job summary list","items":{"type":"object","properties":{"name":{"type":"string","description":"job name"},"username":{"type":"string","description":"user name or \"unknown\""},"state":{"type":"string","description":"general job state","enum":["WAITING","RUNNING","STOPPING","STOPPED","SUCCEEDED","FAILED","UNKNOWN"]},"subState":{"type":"string","description":"job state in framework controller","enum":["AttemptCreationPending","AttemptCreationRequested","AttemptPreparing","AttemptRunning","AttemptDeletionPending","AttemptDeletionRequested","AttemptDeleting","AttemptCompleted","Completed"]},"executionType":{"type":"string","description":"start or stop","enum":["START","STOP"]},"retries":{"type":"integer","description":"job retried times"},"retryDetails":{"type":"object","properties":{"user":{"type":"integer"},"platform":{"type":"integer"},"resource":{"type":"integer"}}},"retryDelayTime":{"type":"integer","nullable":true,"description":"retry delay time"},"createdTime":{"type":"integer","description":"job created time, in number of milliseconds since the Unix Epoch."},"completedTime":{"type":"integer","nullable":true,"description":"job completed time, in number of milliseconds since the Unix Epoch."},"appExitCode":{"type":"integer","nullable":true,"description":"job exit code"},"virtualCluster":{"type":"string","description":"virtual cluster to which the job submitted, or \"unknown\""},"totalGpuNumber":{"type":"integer","description":"total gpu number used in the job"},"totalTaskNumber":{"type":"integer","description":"total task number used in the job"},"totalTaskRoleNumber":{"type":"integer","description":"total task role number used in the job"},"debugId":{"type":"string","description":"md5 hash name for the job in framework controller, used for debug purpose"}},"required":["name","username","virtualCluster","state","subState","executionType","retries","createdTime","completedTime","appExitCode"]}},"contentType":"application/json"}}}],"schemas":{"200":{"description":"Succeeded","content":{"application/json":{"schema":{"type":"array","description":"job summary list","items":{"type":"object","properties":{"name":{"type":"string","description":"job name"},"username":{"type":"string","description":"user name or \"unknown\""},"state":{"type":"string","description":"general job state","enum":["WAITING","RUNNING","STOPPING","STOPPED","SUCCEEDED","FAILED","UNKNOWN"]},"subState":{"type":"string","description":"job state in framework controller","enum":["AttemptCreationPending","AttemptCreationRequested","AttemptPreparing","AttemptRunning","AttemptDeletionPending","AttemptDeletionRequested","AttemptDeleting","AttemptCompleted","Completed"]},"executionType":{"type":"string","description":"start or stop","enum":["START","STOP"]},"retries":{"type":"integer","description":"job retried times"},"retryDetails":{"type":"object","properties":{"user":{"type":"integer"},"platform":{"type":"integer"},"resource":{"type":"integer"}}},"retryDelayTime":{"type":"integer","nullable":true,"description":"retry delay time"},"createdTime":{"type":"integer","description":"job created time, in number of milliseconds since the Unix Epoch."},"completedTime":{"type":"integer","nullable":true,"description":"job completed time, in number of milliseconds since the Unix Epoch."},"appExitCode":{"type":"integer","nullable":true,"description":"job exit code"},"virtualCluster":{"type":"string","description":"virtual cluster to which the job submitted, or \"unknown\""},"totalGpuNumber":{"type":"integer","description":"total gpu number used in the job"},"totalTaskNumber":{"type":"integer","description":"total task number used in the job"},"totalTaskRoleNumber":{"type":"integer","description":"total task role number used in the job"},"debugId":{"type":"string","description":"md5 hash name for the job in framework controller, used for debug purpose"}},"required":["name","username","virtualCluster","state","subState","executionType","retries","createdTime","completedTime","appExitCode"]}},"example":[{"protocolVersion":"2","name":"job name","username":"user name","state":"SUCCEEDED","subState":"Completed","executionType":"STOP","retries":0,"createdTime":0,"completedTime":0,"appExitCode":0,"virtualCluster":"unknown"}]}}},"500":{"description":"UnknownError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"UnknownError":{"value":{"code":"UnknownError","message":"Internal error message."}}}}}}}},{"before":[{"tag":"job","operationId":"createJob","parameters":[{"type":"raw","value":{"contributor":"OpenPAI","description":"# Serving a TensorFlow MNIST Digit Recognition Model\nThis example shows you how to use TensorFlow Serving components to export a trained TensorFlow model\nand use the standard tensorflow_model_server to serve it on OpenPAI.\nThis example uses the simple Softmax Regression model introduced in the TensorFlow tutorial for handwritten image (MNIST data) classification.\nReference https://www.tensorflow.org/tfx/serving/serving_basic.\n","name":"sdk_test_jobf6d9ceaa","parameters":{"modelPath":"/tmp/mnist_model"},"prerequisites":[{"contributor":"OpenPAI","description":"This is an [example TensorFlow Serving Docker image on OpenPAI](https://github.com/Microsoft/pai/tree/master/examples/serving).\n","name":"tf_serving_example","protocolVersion":2,"type":"dockerimage","uri":"openpai/pai.example.tensorflow-serving","version":"1.0-r1.4"}],"protocolVersion":2,"taskRoles":{"worker":{"commands":["bazel-bin/tensorflow_serving/example/mnist_saved_model <% $parameters.modelPath %>","tensorflow_model_server --port=$PAI_CONTAINER_HOST_model_server_PORT_LIST --model_name=mnist --model_base_path=<% $parameters.modelPath %>"],"dockerImage":"tf_serving_example","instances":1,"resourcePerInstance":{"cpu":4,"gpu":1,"memoryMB":8192,"ports":{"model_server":1}}}},"type":"job","version":"1.0"}}]}],"tests":[{"description":"Get a job detail","operation":{"parameters":[{"type":"raw","value":"sdk_test"},{"type":"raw","value":"sdk_test_jobf6d9ceaa"}],"tag":"job","operationId":"getJob","response":{"statusCode":200,"schema":{"type":"object","description":"job details","properties":{"name":{"type":"string","description":"job name"},"jobStatus":{"type":"object","description":"job status","properties":{"username":{"type":"string","description":"user name or \"unknown\""},"state":{"type":"string","description":"general job state","enum":["WAITING","RUNNING","STOPPING","STOPPED","SUCCEEDED","FAILED","UNKNOWN"]},"subState":{"type":"string","description":"job state in framework controller","enum":["AttemptCreationPending","AttemptCreationRequested","AttemptPreparing","AttemptRunning","AttemptDeletionPending","AttemptDeletionRequested","AttemptDeleting","AttemptCompleted","Completed"]},"executionType":{"type":"string","description":"start or stop","enum":["START","STOP"]},"retries":{"type":"integer","description":"job retried times"},"retryDetails":{"type":"object","properties":{"user":{"type":"integer"},"platform":{"type":"integer"},"resource":{"type":"integer"}}},"retryDelayTime":{"type":"integer","nullable":true,"description":"retry delay time"},"createdTime":{"type":"integer","description":"job created time, in number of milliseconds since the Unix Epoch."},"completedTime":{"type":"integer","nullable":true,"description":"job completed time, in number of milliseconds since the Unix Epoch."},"appId":{"type":"string","description":"unique id for the job"},"appLaunchedTime":{"type":"integer","nullable":true,"description":"job launched time for last attempt, in number of milliseconds since the Unix Epoch."},"appCompletedTime":{"type":"integer","nullable":true,"description":"job completed time for last attempt, in number of milliseconds since the Unix Epoch. to get durations for last attempt:\n wholeDuration = completedTime - createdTime;\n runningDuration = appCompletedTime - appLaunchedTime;\n waitingDuration = wholeDuration - runningDuration.\nto get durations for all attempts:\n runningDuration = sum(appCompletedTime - appLaunchedTime) for all attempts.\n"},"appExitCode":{"type":"integer","nullable":true,"description":"job exit code"},"appExitSpec":{"type":"object","nullable":true,"description":"job exit spec","properties":{"code":{"type":"integer"},"phrase":{"type":"string"},"issuer":{"type":"string"},"causer":{"type":"string"},"type":{"type":"string"},"stage":{"type":"string"},"behavior":{"type":"string"},"reaction":{"type":"string"},"repro":{"type":"array","items":{"type":"string"}}}},"appExitDiagnostics":{"type":"string","nullable":true,"description":"job exit diagnostics"},"appExitMessages":{"type":"object","nullable":true,"properties":{"container":{"type":"string","nullable":true},"runtime":{"type":"string","nullable":true},"launcher":{"type":"string","nullable":true}}},"appExitTriggerMessage":{"type":"string","nullable":true,"description":"job completion message"},"appExitTriggerTaskRoleName":{"type":"string","nullable":true,"description":"task role name which triggered job completion"},"appExitTriggerTaskIndex":{"type":"integer","nullable":true,"description":"task index which triggered job completion"},"appExitType":{"type":"string","nullable":true,"description":"job completion type"},"virtualCluster":{"type":"string","description":"virtual cluster to which the job submitted, or \"unknown\""}},"required":["username","virtualCluster","state","subState","executionType","retries","createdTime","completedTime","appId","appLaunchedTime","appCompletedTime","appExitCode"]},"taskRoles":{"type":"object","additionalProperties":{"type":"object","description":"task role status","properties":{"taskRoleStatus":{"type":"object","properties":{"name":{"type":"string","description":"task role name"}},"required":["name"]},"taskStatuses":{"type":"array","description":"task statuses in the task role","items":{"type":"object","properties":{"taskIndex":{"type":"integer","description":"task index"},"taskState":{"type":"string","description":"task state","enum":["WAITING","RUNNING","STOPPING","STOPPED","SUCCEEDED","FAILED","UNKNOWN"]},"containerId":{"type":"string","description":"uid of the task container"},"containerIp":{"type":"string","description":"ip of the task container"},"containerPorts":{"type":"object","description":"ports of the task container"},"containerGpus":{"type":"string","nullable":true,"description":"gpu of the task container"},"containerLog":{"type":"string","description":"log url of the task container"},"containerExitCode":{"type":"integer","nullable":true,"description":"exit code the task container"}}}}},"required":["taskRoleStatus","taskStatuses"]}},"debugId":{"type":"string","description":"md5 hash name for the job in framework controller, used for debug purpose"}},"required":["name","jobStatus","taskRoles"]},"contentType":"application/json"}}},{"description":"Get nonexist job detail","operation":{"parameters":[{"type":"raw","value":"sdk_test"},{"type":"raw","value":"sdk_test_nonexist_job"}],"response":{"statusCode":404,"schema":{"description":"NoJobError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"NoJobError":{"value":{"code":"NoJobError","message":"Job {job} is not found."}}}}}}},"tag":"job","operationId":"getJob"}}],"after":[{"tag":"job","operationId":"updateJobExecutionType","parameters":[{"type":"raw","value":"sdk_test"},{"type":"raw","value":"sdk_test_jobf6d9ceaa"},{"type":"raw","value":"STOP"}]}],"schemas":{"200":{"description":"Succeeded","content":{"application/json":{"schema":{"type":"object","description":"job details","properties":{"name":{"type":"string","description":"job name"},"jobStatus":{"type":"object","description":"job status","properties":{"username":{"type":"string","description":"user name or \"unknown\""},"state":{"type":"string","description":"general job state","enum":["WAITING","RUNNING","STOPPING","STOPPED","SUCCEEDED","FAILED","UNKNOWN"]},"subState":{"type":"string","description":"job state in framework controller","enum":["AttemptCreationPending","AttemptCreationRequested","AttemptPreparing","AttemptRunning","AttemptDeletionPending","AttemptDeletionRequested","AttemptDeleting","AttemptCompleted","Completed"]},"executionType":{"type":"string","description":"start or stop","enum":["START","STOP"]},"retries":{"type":"integer","description":"job retried times"},"retryDetails":{"type":"object","properties":{"user":{"type":"integer"},"platform":{"type":"integer"},"resource":{"type":"integer"}}},"retryDelayTime":{"type":"integer","nullable":true,"description":"retry delay time"},"createdTime":{"type":"integer","description":"job created time, in number of milliseconds since the Unix Epoch."},"completedTime":{"type":"integer","nullable":true,"description":"job completed time, in number of milliseconds since the Unix Epoch."},"appId":{"type":"string","description":"unique id for the job"},"appLaunchedTime":{"type":"integer","nullable":true,"description":"job launched time for last attempt, in number of milliseconds since the Unix Epoch."},"appCompletedTime":{"type":"integer","nullable":true,"description":"job completed time for last attempt, in number of milliseconds since the Unix Epoch. to get durations for last attempt:\n wholeDuration = completedTime - createdTime;\n runningDuration = appCompletedTime - appLaunchedTime;\n waitingDuration = wholeDuration - runningDuration.\nto get durations for all attempts:\n runningDuration = sum(appCompletedTime - appLaunchedTime) for all attempts.\n"},"appExitCode":{"type":"integer","nullable":true,"description":"job exit code"},"appExitSpec":{"type":"object","nullable":true,"description":"job exit spec","properties":{"code":{"type":"integer"},"phrase":{"type":"string"},"issuer":{"type":"string"},"causer":{"type":"string"},"type":{"type":"string"},"stage":{"type":"string"},"behavior":{"type":"string"},"reaction":{"type":"string"},"repro":{"type":"array","items":{"type":"string"}}}},"appExitDiagnostics":{"type":"string","nullable":true,"description":"job exit diagnostics"},"appExitMessages":{"type":"object","nullable":true,"properties":{"container":{"type":"string","nullable":true},"runtime":{"type":"string","nullable":true},"launcher":{"type":"string","nullable":true}}},"appExitTriggerMessage":{"type":"string","nullable":true,"description":"job completion message"},"appExitTriggerTaskRoleName":{"type":"string","nullable":true,"description":"task role name which triggered job completion"},"appExitTriggerTaskIndex":{"type":"integer","nullable":true,"description":"task index which triggered job completion"},"appExitType":{"type":"string","nullable":true,"description":"job completion type"},"virtualCluster":{"type":"string","description":"virtual cluster to which the job submitted, or \"unknown\""}},"required":["username","virtualCluster","state","subState","executionType","retries","createdTime","completedTime","appId","appLaunchedTime","appCompletedTime","appExitCode"]},"taskRoles":{"type":"object","additionalProperties":{"type":"object","description":"task role status","properties":{"taskRoleStatus":{"type":"object","properties":{"name":{"type":"string","description":"task role name"}},"required":["name"]},"taskStatuses":{"type":"array","description":"task statuses in the task role","items":{"type":"object","properties":{"taskIndex":{"type":"integer","description":"task index"},"taskState":{"type":"string","description":"task state","enum":["WAITING","RUNNING","STOPPING","STOPPED","SUCCEEDED","FAILED","UNKNOWN"]},"containerId":{"type":"string","description":"uid of the task container"},"containerIp":{"type":"string","description":"ip of the task container"},"containerPorts":{"type":"object","description":"ports of the task container"},"containerGpus":{"type":"string","nullable":true,"description":"gpu of the task container"},"containerLog":{"type":"string","description":"log url of the task container"},"containerExitCode":{"type":"integer","nullable":true,"description":"exit code the task container"}}}}},"required":["taskRoleStatus","taskStatuses"]}},"debugId":{"type":"string","description":"md5 hash name for the job in framework controller, used for debug purpose"}},"required":["name","jobStatus","taskRoles"]},"example":{"name":"job name","jobStatus":{"username":"user name","state":"SUCCEEDED","subState":"Completed","executionType":"STOP","retries":0,"createdTime":0,"completedTime":0,"appId":"id","appLaunchedTime":0,"appCompletedTime":0,"appExitCode":0,"virtualCluster":"unknown"},"taskRoles":{"taskrole":{"taskRoleStatus":{"name":"task role name"},"taskStatuses":[{"taskIndex":0,"taskState":"SUCCEEDED"}]}}}}}},"404":{"description":"NoJobError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"NoJobError":{"value":{"code":"NoJobError","message":"Job {job} is not found."}}}}}},"500":{"description":"UnknownError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"UnknownError":{"value":{"code":"UnknownError","message":"Internal error message."}}}}}}},"description":"get /api/v2/jobs/{user}~{job}"},{"before":[{"tag":"job","operationId":"createJob","parameters":[{"type":"raw","value":{"contributor":"OpenPAI","description":"# Serving a TensorFlow MNIST Digit Recognition Model\nThis example shows you how to use TensorFlow Serving components to export a trained TensorFlow model\nand use the standard tensorflow_model_server to serve it on OpenPAI.\nThis example uses the simple Softmax Regression model introduced in the TensorFlow tutorial for handwritten image (MNIST data) classification.\nReference https://www.tensorflow.org/tfx/serving/serving_basic.\n","name":"sdk_test_job34983b1e","parameters":{"modelPath":"/tmp/mnist_model"},"prerequisites":[{"contributor":"OpenPAI","description":"This is an [example TensorFlow Serving Docker image on OpenPAI](https://github.com/Microsoft/pai/tree/master/examples/serving).\n","name":"tf_serving_example","protocolVersion":2,"type":"dockerimage","uri":"openpai/pai.example.tensorflow-serving","version":"1.0-r1.4"}],"protocolVersion":2,"taskRoles":{"worker":{"commands":["bazel-bin/tensorflow_serving/example/mnist_saved_model <% $parameters.modelPath %>","tensorflow_model_server --port=$PAI_CONTAINER_HOST_model_server_PORT_LIST --model_name=mnist --model_base_path=<% $parameters.modelPath %>"],"dockerImage":"tf_serving_example","instances":1,"resourcePerInstance":{"cpu":4,"gpu":1,"memoryMB":8192,"ports":{"model_server":1}}}},"type":"job","version":"1.0"}}]}],"tests":[{"description":"Get a job config","operation":{"parameters":[{"type":"raw","value":"sdk_test"},{"type":"raw","value":"sdk_test_job34983b1e"}],"tag":"job","operationId":"getJobConfig","response":{"statusCode":200,"schema":{"type":"object","description":"openpai job protocol","properties":{"protocolVersion":{"oneOf":[{"type":"number"},{"type":"string"}],"description":"Protocol version, current version is 2."},"name":{"type":"string","maxLength":255,"description":"String in ^[a-zA-Z0-9_-]+$ format, no longer than 255 characters."},"type":{"type":"string","description":"Component type, should be \"job\" here."},"version":{"type":"string","description":"Component version, default is latest."},"contributor":{"type":"string"},"description":{"type":"string"},"prerequisites":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"type":{"type":"string","enum":["data","script","dockerimage","output"]},"version":{"type":"string"},"contributor":{"type":"string"},"description":{"type":"string"},"auth":{"type":"object","properties":{"username":{"type":"string"},"password":{"type":"string"},"registryuri":{"type":"string"}}},"uri":{"oneOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}]}}}},"parameters":{"type":"object","additionalProperties":true},"secrets":{"type":"object","additionalProperties":true},"jobRetryCount":{"type":"integer","description":"Default is 0."},"taskRoles":{"type":"object","additionalProperties":{"type":"object","properties":{"instances":{"type":"integer","description":"Default is 1, instances of a taskRole, no less than 1."},"completion":{"type":"object","description":"Completion poclicy for the job.","properties":{"minFailedInstances":{"type":"integer"},"minSucceededInstances":{"type":"integer"}}},"taskRetryCount":{"type":"integer","description":"Default is 0."},"dockerImage":{"type":"string","description":"Should reference to a dockerimage defined in prerequisites."},"data":{"type":"string"},"output":{"type":"string"},"script":{"type":"string"},"extraContainerOptions":{"type":"object","properties":{"shmMB":{"type":"integer","description":"Config the /dev/shm in a docker container."},"infiniband":{"type":"boolean","description":"Use InfiniBand devices or not in a docker container."}}},"resourcePerInstance":{"type":"object","properties":{"cpu":{"type":"integer","description":"CPU number, unit is CPU vcore."},"memoryMB":{"type":"integer","description":"Memory number, unit is MB."},"gpu":{"type":"integer","description":"GPU number, unit is GPU card."},"ports":{"type":"object","additionalProperties":{"type":"integer","description":"Port number for the port label."}}}},"commands":{"type":"array","items":{"type":"string"}}},"required":["dockerImage","resourcePerInstance","commands"]}},"deployments":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"taskRoles":{"type":"object","additionalProperties":{"type":"object","properties":{"preCommands":{"type":"array","items":{"type":"string"}},"postCommands":{"type":"array","items":{"type":"string"}}}}}}}},"defaults":{"type":"object","description":"Default cluster specific settings.","properties":{"virtualCluster":{"type":"string"},"deployment":{"type":"string"}}},"extras":{"type":"object","description":"Extra field, save any information that plugin may use.","properties":{"submitFrom":{"type":"string"},"hivedScheduler":{"type":"object","properties":{"jobPriorityClass":{"type":"string"},"taskRoles":{"type":"object","additionalProperties":{"type":"object","properties":{"skuType":{"type":"string"},"affinityGroupName":{"type":"string"}}}}}}}}},"required":["protocolVersion","name","type","taskRoles"]},"contentType":"text/yaml"}}},{"description":"Get nonexist job config","operation":{"parameters":[{"type":"raw","value":"sdk_test"},{"type":"raw","value":"sdk_test_nonexist_job"}],"response":{"statusCode":404,"schema":{"description":"NoJobError or NoJobConfigError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"NoJobError":{"value":{"code":"NoJobError","message":"Job {job} is not found."}},"NoJobConfigError":{"value":{"code":"NoJobConfigError","message":"Config of job {job} is not found."}}}}}}},"tag":"job","operationId":"getJobConfig"}}],"after":[{"tag":"job","operationId":"updateJobExecutionType","parameters":[{"type":"raw","value":"sdk_test"},{"type":"raw","value":"sdk_test_job34983b1e"},{"type":"raw","value":"STOP"}]}],"schemas":{"200":{"description":"Succeeded","content":{"text/yaml":{"schema":{"type":"object","description":"openpai job protocol","properties":{"protocolVersion":{"oneOf":[{"type":"number"},{"type":"string"}],"description":"Protocol version, current version is 2."},"name":{"type":"string","maxLength":255,"description":"String in ^[a-zA-Z0-9_-]+$ format, no longer than 255 characters."},"type":{"type":"string","description":"Component type, should be \"job\" here."},"version":{"type":"string","description":"Component version, default is latest."},"contributor":{"type":"string"},"description":{"type":"string"},"prerequisites":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"type":{"type":"string","enum":["data","script","dockerimage","output"]},"version":{"type":"string"},"contributor":{"type":"string"},"description":{"type":"string"},"auth":{"type":"object","properties":{"username":{"type":"string"},"password":{"type":"string"},"registryuri":{"type":"string"}}},"uri":{"oneOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}]}}}},"parameters":{"type":"object","additionalProperties":true},"secrets":{"type":"object","additionalProperties":true},"jobRetryCount":{"type":"integer","description":"Default is 0."},"taskRoles":{"type":"object","additionalProperties":{"type":"object","properties":{"instances":{"type":"integer","description":"Default is 1, instances of a taskRole, no less than 1."},"completion":{"type":"object","description":"Completion poclicy for the job.","properties":{"minFailedInstances":{"type":"integer"},"minSucceededInstances":{"type":"integer"}}},"taskRetryCount":{"type":"integer","description":"Default is 0."},"dockerImage":{"type":"string","description":"Should reference to a dockerimage defined in prerequisites."},"data":{"type":"string"},"output":{"type":"string"},"script":{"type":"string"},"extraContainerOptions":{"type":"object","properties":{"shmMB":{"type":"integer","description":"Config the /dev/shm in a docker container."},"infiniband":{"type":"boolean","description":"Use InfiniBand devices or not in a docker container."}}},"resourcePerInstance":{"type":"object","properties":{"cpu":{"type":"integer","description":"CPU number, unit is CPU vcore."},"memoryMB":{"type":"integer","description":"Memory number, unit is MB."},"gpu":{"type":"integer","description":"GPU number, unit is GPU card."},"ports":{"type":"object","additionalProperties":{"type":"integer","description":"Port number for the port label."}}}},"commands":{"type":"array","items":{"type":"string"}}},"required":["dockerImage","resourcePerInstance","commands"]}},"deployments":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"taskRoles":{"type":"object","additionalProperties":{"type":"object","properties":{"preCommands":{"type":"array","items":{"type":"string"}},"postCommands":{"type":"array","items":{"type":"string"}}}}}}}},"defaults":{"type":"object","description":"Default cluster specific settings.","properties":{"virtualCluster":{"type":"string"},"deployment":{"type":"string"}}},"extras":{"type":"object","description":"Extra field, save any information that plugin may use.","properties":{"submitFrom":{"type":"string"},"hivedScheduler":{"type":"object","properties":{"jobPriorityClass":{"type":"string"},"taskRoles":{"type":"object","additionalProperties":{"type":"object","properties":{"skuType":{"type":"string"},"affinityGroupName":{"type":"string"}}}}}}}}},"required":["protocolVersion","name","type","taskRoles"]},"example":{"protocolVersion":"2","name":"","type":"job","prerequisites":[{"name":"","type":"dockerimage","uri":"image_url"}],"taskRoles":{"train":{"instances":1,"dockerImage":"","resourcePerInstance":{"cpu":1,"memoryMB":16384,"gpu":1},"commands":["python "]}}}}}},"404":{"description":"NoJobError or NoJobConfigError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"NoJobError":{"value":{"code":"NoJobError","message":"Job {job} is not found."}},"NoJobConfigError":{"value":{"code":"NoJobConfigError","message":"Config of job {job} is not found."}}}}}},"500":{"description":"UnknownError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"UnknownError":{"value":{"code":"UnknownError","message":"Internal error message."}}}}}}},"description":"get /api/v2/jobs/{user}~{job}/config"},{"description":"put /api/v2/jobs/{user}~{job}/executionType","tests":[{"operation":{"tag":"job","operationId":"updateJobExecutionType","parameters":[],"response":{"statusCode":202,"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"contentType":"application/json"}}}],"schemas":{"202":{"description":"Succeeded","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"example":{"message":"execute job {job} successfully"}}}},"404":{"description":"NoJobError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"NoJobError":{"value":{"code":"NoJobError","message":"Job {job} is not found."}}}}}},"500":{"description":"UnknownError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"UnknownError":{"value":{"code":"UnknownError","message":"Internal error message."}}}}}}}},{"description":"get /api/v2/jobs/{user}~{job}/job-attempts/healthz","tests":[{"operation":{"tag":"job history","operationId":"getJobAttemptsHealthz","parameters":[],"response":{"statusCode":200}}}],"schemas":{"200":{"description":"OK"},"501":{"description":"Not healthy"}}},{"before":[{"tag":"job","operationId":"createJob","parameters":[{"type":"raw","value":{"contributor":"OpenPAI","description":"# Serving a TensorFlow MNIST Digit Recognition Model\nThis example shows you how to use TensorFlow Serving components to export a trained TensorFlow model\nand use the standard tensorflow_model_server to serve it on OpenPAI.\nThis example uses the simple Softmax Regression model introduced in the TensorFlow tutorial for handwritten image (MNIST data) classification.\nReference https://www.tensorflow.org/tfx/serving/serving_basic.\n","name":"sdk_test_jobafad2e2b","parameters":{"modelPath":"/tmp/mnist_model"},"prerequisites":[{"contributor":"OpenPAI","description":"This is an [example TensorFlow Serving Docker image on OpenPAI](https://github.com/Microsoft/pai/tree/master/examples/serving).\n","name":"tf_serving_example","protocolVersion":2,"type":"dockerimage","uri":"openpai/pai.example.tensorflow-serving","version":"1.0-r1.4"}],"protocolVersion":2,"taskRoles":{"worker":{"commands":["bazel-bin/tensorflow_serving/example/mnist_saved_model <% $parameters.modelPath %>","tensorflow_model_server --port=$PAI_CONTAINER_HOST_model_server_PORT_LIST --model_name=mnist --model_base_path=<% $parameters.modelPath %>"],"dockerImage":"tf_serving_example","instances":1,"resourcePerInstance":{"cpu":4,"gpu":1,"memoryMB":8192,"ports":{"model_server":1}}}},"type":"job","version":"1.0"}}]}],"tests":[{"operation":{"parameters":[{"type":"raw","value":"sdk_test"},{"type":"raw","value":"sdk_test_jobafad2e2b"}],"tag":"job history","operationId":"getJobAttempts","response":{"statusCode":200,"schema":{"type":"array","items":{"type":"object","description":"job attempt","properties":{"jobName":{"type":"string"},"frameworkName":{"type":"string"},"uid":{"type":"string"},"userName":{"type":"string"},"state":{"type":"string"},"originState":{"type":"string"},"maxAttemptCount":{"type":"integer"},"attemptIndex":{"type":"integer"},"jobStartedTime":{"type":"integer"},"attemptStartedTime":{"type":"integer"},"attemptCompletedTime":{"type":"integer","nullable":true},"exitCode":{"type":"integer","nullable":true},"exitPhrase":{"type":"string","nullable":true},"exitType":{"type":"string","nullable":true},"exitDiagnostics":{"type":"object","nullable":true,"properties":{"diagnosticsSummary":{"type":"string"},"runtime":{"type":"object","nullable":true,"properties":{"exitCode":{"type":"integer","nullable":true},"originUserExitCode":{"type":"integer","nullable":true},"errorLogs":{"type":"object","nullable":true,"properties":{"user":{"type":"string"},"platform":{"type":"string"}}},"name":{"type":"string"}}},"launcher":{"type":"string"}}},"appExitTriggerMessage":{"type":"string","nullable":true},"appExitTriggerTaskRoleName":{"type":"string","nullable":true},"appExitTriggerTaskIndex":{"type":"integer","nullable":true},"appExitSpec":{"type":"object","nullable":true,"properties":{"code":{"type":"integer"},"phrase":{"type":"string"},"issuer":{"type":"string"},"causer":{"type":"string"},"type":{"type":"string"},"stage":{"type":"string"},"behavior":{"type":"string"},"reaction":{"type":"string"},"reason":{"type":"string"},"repro":{"type":"array","items":{"type":"string"}},"solution":{"type":"array","items":{"type":"string"}}}},"appExitDiagnostics":{"type":"string","nullable":true},"appExitMessages":{"type":"object","nullable":true,"properties":{"container":{"type":"string","nullable":true},"runtime":{"type":"object","nullable":true,"properties":{"exitCode":{"type":"integer","nullable":true},"originUserExitCode":{"type":"integer","nullable":true},"errorLogs":{"type":"object","nullable":true,"properties":{"user":{"type":"string"},"platform":{"type":"string"}}},"name":{"type":"string"}}},"launcher":{"type":"string","nullable":true}}},"totalGpuNumber":{"type":"integer"},"totalTasknumber":{"type":"integer"},"totalTaskRoleNumber":{"type":"integer"},"taskRoles":{"type":"object","properties":{"taskrole":{"type":"object","properties":{"taskRoleStatus":{"type":"object","properties":{"name":{"type":"string"}},"required":["name"]},"taskStatuses":{"type":"array","items":{"type":"object","properties":{"taskIndex":{"type":"integer"},"taskState":{"type":"string","enum":["WAITING","RUNNING","STOPPING","STOPPED","SUCCEEDED","FAILED","UNKNOWN"]},"containerId":{"type":"string"},"containerIp":{"type":"string"},"containerGpus":{"type":"string","nullable":true},"containerLog":{"type":"string"},"containerExitCode":{"type":"integer","nullable":true}}}}},"required":["taskRoleStatus","taskStatuses"]}}},"isLatest":{"type":"boolean"}}},"description":"job attempts"},"contentType":"application/json"}}}],"after":[{"tag":"job","operationId":"updateJobExecutionType","parameters":[{"type":"raw","value":"sdk_test"},{"type":"raw","value":"sdk_test_jobafad2e2b"},{"type":"raw","value":"STOP"}]}],"schemas":{"200":{"description":"Succeeded","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","description":"job attempt","properties":{"jobName":{"type":"string"},"frameworkName":{"type":"string"},"uid":{"type":"string"},"userName":{"type":"string"},"state":{"type":"string"},"originState":{"type":"string"},"maxAttemptCount":{"type":"integer"},"attemptIndex":{"type":"integer"},"jobStartedTime":{"type":"integer"},"attemptStartedTime":{"type":"integer"},"attemptCompletedTime":{"type":"integer","nullable":true},"exitCode":{"type":"integer","nullable":true},"exitPhrase":{"type":"string","nullable":true},"exitType":{"type":"string","nullable":true},"exitDiagnostics":{"type":"object","nullable":true,"properties":{"diagnosticsSummary":{"type":"string"},"runtime":{"type":"object","nullable":true,"properties":{"exitCode":{"type":"integer","nullable":true},"originUserExitCode":{"type":"integer","nullable":true},"errorLogs":{"type":"object","nullable":true,"properties":{"user":{"type":"string"},"platform":{"type":"string"}}},"name":{"type":"string"}}},"launcher":{"type":"string"}}},"appExitTriggerMessage":{"type":"string","nullable":true},"appExitTriggerTaskRoleName":{"type":"string","nullable":true},"appExitTriggerTaskIndex":{"type":"integer","nullable":true},"appExitSpec":{"type":"object","nullable":true,"properties":{"code":{"type":"integer"},"phrase":{"type":"string"},"issuer":{"type":"string"},"causer":{"type":"string"},"type":{"type":"string"},"stage":{"type":"string"},"behavior":{"type":"string"},"reaction":{"type":"string"},"reason":{"type":"string"},"repro":{"type":"array","items":{"type":"string"}},"solution":{"type":"array","items":{"type":"string"}}}},"appExitDiagnostics":{"type":"string","nullable":true},"appExitMessages":{"type":"object","nullable":true,"properties":{"container":{"type":"string","nullable":true},"runtime":{"type":"object","nullable":true,"properties":{"exitCode":{"type":"integer","nullable":true},"originUserExitCode":{"type":"integer","nullable":true},"errorLogs":{"type":"object","nullable":true,"properties":{"user":{"type":"string"},"platform":{"type":"string"}}},"name":{"type":"string"}}},"launcher":{"type":"string","nullable":true}}},"totalGpuNumber":{"type":"integer"},"totalTasknumber":{"type":"integer"},"totalTaskRoleNumber":{"type":"integer"},"taskRoles":{"type":"object","properties":{"taskrole":{"type":"object","properties":{"taskRoleStatus":{"type":"object","properties":{"name":{"type":"string"}},"required":["name"]},"taskStatuses":{"type":"array","items":{"type":"object","properties":{"taskIndex":{"type":"integer"},"taskState":{"type":"string","enum":["WAITING","RUNNING","STOPPING","STOPPED","SUCCEEDED","FAILED","UNKNOWN"]},"containerId":{"type":"string"},"containerIp":{"type":"string"},"containerGpus":{"type":"string","nullable":true},"containerLog":{"type":"string"},"containerExitCode":{"type":"integer","nullable":true}}}}},"required":["taskRoleStatus","taskStatuses"]}}},"isLatest":{"type":"boolean"}}},"description":"job attempts"},"example":[{"jobName":"jobName","frameworkName":"frameworkName","uid":"uid","userName":"userName","state":"SUCCEEDED","originState":"Completed","maxAttemptCount":1,"attemptIndex":0,"jobStartedTime":0,"attemptStartedTime":0,"attemptCompletedTime":0,"exitCode":0,"exitPhrase":"Succeeded","exitType":"Succeeded","exitDiagnostics":{"diagnosticsSummary":"Pod succeeded","runtime":null,"launcher":"Pod succeeded"},"appExitTriggerMessage":"All Tasks are completed","appExitTriggerTaskRoleName":"taskrole","appExitTriggerTaskIndex":0,"appExitSpec":{"code":0,"phrase":"Succeeded","issuer":"USER_CONTAINER","causer":"USER_CONTAINER","type":"USER_SUCCESS","stage":"COMPLETING","behavior":"UNKNOWN","reaction":"NEVER_RETRY","repro":["User program exits with exitcode 0"]},"appExitDiagnostics":"Pod succeeded","appExitMessages":{"container":null,"runtime":null,"launcher":"Pod succeeded"},"totalGpuNumber":1,"totalTaskNumber":1,"totalTaskRoleNumber":1,"taskRoles":{"taskrole":{"taskRoleStatus":{"name":"taskrole"},"taskStatuses":[{"taskIndex":0,"taskState":"SUCCEEDED","containerId":"","containerIp":"","containerExitCode":0}]}},"isLatest":true}]}}},"404":{"description":"NoJobError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"NoJobError":{"value":{"code":"NoJobError","message":"Job {job} is not found."}}}}}},"501":{"description":"UnknownError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"UnknownError":{"value":{"code":"UnknownError","message":"Internal error message."}}}}}}},"description":"get /api/v2/jobs/{user}~{job}/job-attempts"},{"before":[{"tag":"job","operationId":"createJob","parameters":[{"type":"raw","value":{"contributor":"OpenPAI","description":"# Serving a TensorFlow MNIST Digit Recognition Model\nThis example shows you how to use TensorFlow Serving components to export a trained TensorFlow model\nand use the standard tensorflow_model_server to serve it on OpenPAI.\nThis example uses the simple Softmax Regression model introduced in the TensorFlow tutorial for handwritten image (MNIST data) classification.\nReference https://www.tensorflow.org/tfx/serving/serving_basic.\n","name":"sdk_test_jobe67c7770","parameters":{"modelPath":"/tmp/mnist_model"},"prerequisites":[{"contributor":"OpenPAI","description":"This is an [example TensorFlow Serving Docker image on OpenPAI](https://github.com/Microsoft/pai/tree/master/examples/serving).\n","name":"tf_serving_example","protocolVersion":2,"type":"dockerimage","uri":"openpai/pai.example.tensorflow-serving","version":"1.0-r1.4"}],"protocolVersion":2,"taskRoles":{"worker":{"commands":["bazel-bin/tensorflow_serving/example/mnist_saved_model <% $parameters.modelPath %>","tensorflow_model_server --port=$PAI_CONTAINER_HOST_model_server_PORT_LIST --model_name=mnist --model_base_path=<% $parameters.modelPath %>"],"dockerImage":"tf_serving_example","instances":1,"resourcePerInstance":{"cpu":4,"gpu":1,"memoryMB":8192,"ports":{"model_server":1}}}},"type":"job","version":"1.0"}}]}],"tests":[{"operation":{"parameters":[{"type":"raw","value":"sdk_test"},{"type":"raw","value":"sdk_test_jobe67c7770"},{"type":"raw","value":0}],"tag":"job history","operationId":"getJobAttempt","response":{"statusCode":200,"schema":{"type":"object","description":"job attempt","properties":{"jobName":{"type":"string"},"frameworkName":{"type":"string"},"uid":{"type":"string"},"userName":{"type":"string"},"state":{"type":"string"},"originState":{"type":"string"},"maxAttemptCount":{"type":"integer"},"attemptIndex":{"type":"integer"},"jobStartedTime":{"type":"integer"},"attemptStartedTime":{"type":"integer"},"attemptCompletedTime":{"type":"integer","nullable":true},"exitCode":{"type":"integer","nullable":true},"exitPhrase":{"type":"string","nullable":true},"exitType":{"type":"string","nullable":true},"exitDiagnostics":{"type":"object","nullable":true,"properties":{"diagnosticsSummary":{"type":"string"},"runtime":{"type":"object","nullable":true,"properties":{"exitCode":{"type":"integer","nullable":true},"originUserExitCode":{"type":"integer","nullable":true},"errorLogs":{"type":"object","nullable":true,"properties":{"user":{"type":"string"},"platform":{"type":"string"}}},"name":{"type":"string"}}},"launcher":{"type":"string"}}},"appExitTriggerMessage":{"type":"string","nullable":true},"appExitTriggerTaskRoleName":{"type":"string","nullable":true},"appExitTriggerTaskIndex":{"type":"integer","nullable":true},"appExitSpec":{"type":"object","nullable":true,"properties":{"code":{"type":"integer"},"phrase":{"type":"string"},"issuer":{"type":"string"},"causer":{"type":"string"},"type":{"type":"string"},"stage":{"type":"string"},"behavior":{"type":"string"},"reaction":{"type":"string"},"reason":{"type":"string"},"repro":{"type":"array","items":{"type":"string"}},"solution":{"type":"array","items":{"type":"string"}}}},"appExitDiagnostics":{"type":"string","nullable":true},"appExitMessages":{"type":"object","nullable":true,"properties":{"container":{"type":"string","nullable":true},"runtime":{"type":"object","nullable":true,"properties":{"exitCode":{"type":"integer","nullable":true},"originUserExitCode":{"type":"integer","nullable":true},"errorLogs":{"type":"object","nullable":true,"properties":{"user":{"type":"string"},"platform":{"type":"string"}}},"name":{"type":"string"}}},"launcher":{"type":"string","nullable":true}}},"totalGpuNumber":{"type":"integer"},"totalTasknumber":{"type":"integer"},"totalTaskRoleNumber":{"type":"integer"},"taskRoles":{"type":"object","properties":{"taskrole":{"type":"object","properties":{"taskRoleStatus":{"type":"object","properties":{"name":{"type":"string"}},"required":["name"]},"taskStatuses":{"type":"array","items":{"type":"object","properties":{"taskIndex":{"type":"integer"},"taskState":{"type":"string","enum":["WAITING","RUNNING","STOPPING","STOPPED","SUCCEEDED","FAILED","UNKNOWN"]},"containerId":{"type":"string"},"containerIp":{"type":"string"},"containerGpus":{"type":"string","nullable":true},"containerLog":{"type":"string"},"containerExitCode":{"type":"integer","nullable":true}}}}},"required":["taskRoleStatus","taskStatuses"]}}},"isLatest":{"type":"boolean"}}},"contentType":"application/json"}}}],"after":[{"tag":"job","operationId":"updateJobExecutionType","parameters":[{"type":"raw","value":"sdk_test"},{"type":"raw","value":"sdk_test_jobe67c7770"},{"type":"raw","value":"STOP"}]}],"schemas":{"200":{"description":"Succeeded","content":{"application/json":{"schema":{"type":"object","description":"job attempt","properties":{"jobName":{"type":"string"},"frameworkName":{"type":"string"},"uid":{"type":"string"},"userName":{"type":"string"},"state":{"type":"string"},"originState":{"type":"string"},"maxAttemptCount":{"type":"integer"},"attemptIndex":{"type":"integer"},"jobStartedTime":{"type":"integer"},"attemptStartedTime":{"type":"integer"},"attemptCompletedTime":{"type":"integer","nullable":true},"exitCode":{"type":"integer","nullable":true},"exitPhrase":{"type":"string","nullable":true},"exitType":{"type":"string","nullable":true},"exitDiagnostics":{"type":"object","nullable":true,"properties":{"diagnosticsSummary":{"type":"string"},"runtime":{"type":"object","nullable":true,"properties":{"exitCode":{"type":"integer","nullable":true},"originUserExitCode":{"type":"integer","nullable":true},"errorLogs":{"type":"object","nullable":true,"properties":{"user":{"type":"string"},"platform":{"type":"string"}}},"name":{"type":"string"}}},"launcher":{"type":"string"}}},"appExitTriggerMessage":{"type":"string","nullable":true},"appExitTriggerTaskRoleName":{"type":"string","nullable":true},"appExitTriggerTaskIndex":{"type":"integer","nullable":true},"appExitSpec":{"type":"object","nullable":true,"properties":{"code":{"type":"integer"},"phrase":{"type":"string"},"issuer":{"type":"string"},"causer":{"type":"string"},"type":{"type":"string"},"stage":{"type":"string"},"behavior":{"type":"string"},"reaction":{"type":"string"},"reason":{"type":"string"},"repro":{"type":"array","items":{"type":"string"}},"solution":{"type":"array","items":{"type":"string"}}}},"appExitDiagnostics":{"type":"string","nullable":true},"appExitMessages":{"type":"object","nullable":true,"properties":{"container":{"type":"string","nullable":true},"runtime":{"type":"object","nullable":true,"properties":{"exitCode":{"type":"integer","nullable":true},"originUserExitCode":{"type":"integer","nullable":true},"errorLogs":{"type":"object","nullable":true,"properties":{"user":{"type":"string"},"platform":{"type":"string"}}},"name":{"type":"string"}}},"launcher":{"type":"string","nullable":true}}},"totalGpuNumber":{"type":"integer"},"totalTasknumber":{"type":"integer"},"totalTaskRoleNumber":{"type":"integer"},"taskRoles":{"type":"object","properties":{"taskrole":{"type":"object","properties":{"taskRoleStatus":{"type":"object","properties":{"name":{"type":"string"}},"required":["name"]},"taskStatuses":{"type":"array","items":{"type":"object","properties":{"taskIndex":{"type":"integer"},"taskState":{"type":"string","enum":["WAITING","RUNNING","STOPPING","STOPPED","SUCCEEDED","FAILED","UNKNOWN"]},"containerId":{"type":"string"},"containerIp":{"type":"string"},"containerGpus":{"type":"string","nullable":true},"containerLog":{"type":"string"},"containerExitCode":{"type":"integer","nullable":true}}}}},"required":["taskRoleStatus","taskStatuses"]}}},"isLatest":{"type":"boolean"}}},"example":{"jobName":"jobName","frameworkName":"frameworkName","uid":"uid","userName":"userName","state":"SUCCEEDED","originState":"Completed","maxAttemptCount":1,"attemptIndex":0,"jobStartedTime":0,"attemptStartedTime":0,"attemptCompletedTime":0,"exitCode":0,"exitPhrase":"Succeeded","exitType":"Succeeded","exitDiagnostics":{"diagnosticsSummary":"Pod succeeded","runtime":null,"launcher":"Pod succeeded"},"appExitTriggerMessage":"All Tasks are completed","appExitTriggerTaskRoleName":"taskrole","appExitTriggerTaskIndex":0,"appExitSpec":{"code":0,"phrase":"Succeeded","issuer":"USER_CONTAINER","causer":"USER_CONTAINER","type":"USER_SUCCESS","stage":"COMPLETING","behavior":"UNKNOWN","reaction":"NEVER_RETRY","repro":["User program exits with exitcode 0"]},"appExitDiagnostics":"Pod succeeded","appExitMessages":{"container":null,"runtime":null,"launcher":"Pod succeeded"},"totalGpuNumber":1,"totalTaskNumber":1,"totalTaskRoleNumber":1,"taskRoles":{"taskrole":{"taskRoleStatus":{"name":"taskrole"},"taskStatuses":[{"taskIndex":0,"taskState":"SUCCEEDED","containerId":"","containerIp":"","containerExitCode":0}]}},"isLatest":true}}}},"404":{"description":"NoJobError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"NoJobError":{"value":{"code":"NoJobError","message":"Job {job} is not found."}}}}}},"501":{"description":"UnknownError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"UnknownError":{"value":{"code":"UnknownError","message":"Internal error message."}}}}}}},"description":"get /api/v2/jobs/{user}~{job}/job-attempts/{attemptIndex}"},{"description":"get /api/v2/kubernetes/nodes","tests":[{"operation":{"tag":"kubernetes","operationId":"getK8sNodes","parameters":[],"response":{"statusCode":200}}}],"schemas":{"200":{"description":"Succeeded","content":{"application/json":{"example":["Please refer to Kubernetes API doc","https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.17/#list-node-v1-core"]}}},"401":{"description":"UnauthorizedUserError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"UnauthorizedUserError":{"value":{"code":"UnauthorizedUserError","message":"Guest is not allowed to do this operation."}}}}}},"403":{"description":"ForbiddenUserError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"ForbiddenUserError":{"value":{"code":"ForbiddenUserError","message":"Non-admin is not allow to do this operation."}},"ForbiddenTokenError":{"value":{"code":"ForbiddenUserError","message":"Applications are not allowed to do this operation."}}}}}}}},{"description":"get /api/v2/kubernetes/pods","tests":[{"operation":{"tag":"kubernetes","operationId":"getK8sPods","parameters":[],"response":{"statusCode":200}}}],"schemas":{"200":{"description":"Succeeded","content":{"application/json":{"example":["Please refer to Kubernetes API doc","https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.17/#list-all-namespaces-pod-v1-core"]}}},"401":{"description":"UnauthorizedUserError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"UnauthorizedUserError":{"value":{"code":"UnauthorizedUserError","message":"Guest is not allowed to do this operation."}}}}}},"403":{"description":"ForbiddenUserError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"ForbiddenUserError":{"value":{"code":"ForbiddenUserError","message":"Non-admin is not allow to do this operation."}},"ForbiddenTokenError":{"value":{"code":"ForbiddenUserError","message":"Applications are not allowed to do this operation."}}}}}}}}],"map":{"getClusterInfo":{"path":"/api/v2/info","method":"get","examples":{"200":{"name":"PAI RESTful API","version":"v1.0.1","launcherType":"k8s","authnMethod":"basic"}}},"getTokens":{"path":"/api/v2/tokens","method":"get","examples":{"200":{"tokens":["JWT Token Example"]},"401":{"value":{"code":"UnauthorizedUserError","message":"Guest is not allowed to do this operation."}}}},"deleteToken":{"path":"/api/v2/tokens/{token}","method":"delete","examples":{"200":{"message":"revoke successfully"},"401":{"value":{"code":"UnauthorizedUserError","message":"Guest is not allowed to do this operation."}},"403":{"value":{"code":"ForbiddenUserError","message":"Non-admin is not allow to do this operation."}}}},"createApplicationToken":{"path":"/api/v2/tokens/application","method":"post","examples":{"200":{"token":"JWT Token Example","application":true},"401":{"value":{"code":"UnauthorizedUserError","message":"Guest is not allowed to do this operation."}}}},"oidcLogin":{"path":"/api/v2/authn/oidc/login","method":"get","examples":{}},"oidcLogout":{"path":"/api/v2/authn/oidc/logout","method":"get","examples":{}},"basicLogin":{"path":"/api/v2/authn/basic/login","method":"post","examples":{"200":{"token":"JWT Token Example","user":"user","admin":true},"404":{"value":{"code":"NoUserError","message":"User {user} is not found."}}}},"basicLogout":{"path":"/api/v2/authn/basic/logout","method":"delete","examples":{"200":{"message":"Logout successfully"},"401":{"value":{"code":"UnauthorizedUserError","message":"Guest is not allowed to do this operation."}},"403":{"value":{"code":"ForbiddenUserError","message":"Non-admin is not allow to do this operation."}}}},"createUser":{"path":"/api/v2/users","method":"post","examples":{"201":{"message":"User is created successfully"},"401":{"value":{"code":"UnauthorizedUserError","message":"Guest is not allowed to do this operation."}},"403":{"value":{"code":"ForbiddenUserError","message":"Non-admin is not allow to do this operation."}},"409":{"value":{"code":"ConflictUserError","message":"User name {user} already exists."}},"500":{"value":{"code":"UnknownError","message":"Internal error message."}}}},"getAllUser":{"path":"/api/v2/users","method":"get","examples":{"200":[{"username":"username","admin":true,"virtualCluster":[],"storageConfig":[],"email":"email@test.com","extension":{}}],"500":{"value":{"code":"UnknownError","message":"Internal error message."}}}},"updateUser":{"path":"/api/v2/users","method":"put","examples":{"201":{"message":"update group {username} successfully."},"401":{"value":{"code":"UnauthorizedUserError","message":"Guest is not allowed to do this operation."}},"403":{"value":{"code":"ForbiddenUserError","message":"Non-admin is not allow to do this operation."}},"404":{"value":{"code":"NoUserError","message":"User {user} is not found."}},"500":{"value":{"code":"UnknownError","message":"Internal error message."}}}},"updateUserSelf":{"path":"/api/v2/users/me","method":"put","examples":{"201":{"message":"update group {username} successfully."},"401":{"value":{"code":"UnauthorizedUserError","message":"Guest is not allowed to do this operation."}},"403":{"value":{"code":"ForbiddenUserError","message":"Non-admin is not allow to do this operation."}},"404":{"value":{"code":"NoUserError","message":"User {user} is not found."}},"500":{"value":{"code":"UnknownError","message":"Internal error message."}}}},"getUser":{"path":"/api/v2/users/{user}","method":"get","examples":{"200":{"username":"username","admin":true,"virtualCluster":[],"storageConfig":[],"email":"email@test.com","extension":{}},"401":{"value":{"code":"UnauthorizedUserError","message":"Guest is not allowed to do this operation."}},"404":{"value":{"code":"NoUserError","message":"User {user} is not found."}},"500":{"value":{"code":"UnknownError","message":"Internal error message."}}}},"deleteUser":{"path":"/api/v2/users/{user}","method":"delete","examples":{"200":{"message":"user is removed successfully"},"401":{"value":{"code":"UnauthorizedUserError","message":"Guest is not allowed to do this operation."}},"403":{"value":{"code":"ForbiddenUserError","message":"Non-admin is not allow to do this operation."}},"404":{"value":{"code":"NoUserError","message":"User {user} is not found."}},"500":{"value":{"code":"UnknownError","message":"Internal error message."}}}},"updateUserGroup":{"path":"/api/v2/users/{user}/group/","method":"put","examples":{"201":{"message":"User {username} is added into group {groupname}"},"401":{"value":{"code":"UnauthorizedUserError","message":"Guest is not allowed to do this operation."}},"403":{"value":{"code":"ForbiddenUserError","message":"Non-admin is not allow to do this operation."}},"404":{"value":{"code":"NoUserError","message":"User {user} is not found."}},"500":{"value":{"code":"UnknownError","message":"Internal error message."}}}},"deleteUserGroup":{"path":"/api/v2/users/{user}/group/","method":"delete","examples":{"201":{"message":"User {username} is removed from group {groupname}"},"401":{"value":{"code":"UnauthorizedUserError","message":"Guest is not allowed to do this operation."}},"403":{"value":{"code":"ForbiddenUserError","message":"Non-admin is not allow to do this operation."}},"404":{"value":{"code":"NoUserError","message":"User {user} is not found."}},"500":{"value":{"code":"UnknownError","message":"Internal error message."}}}},"updateUserGrouplist":{"path":"/api/v2/users/{user}/grouplist/","method":"put","examples":{"201":{"message":"update user grouplist successfully."},"401":{"value":{"code":"UnauthorizedUserError","message":"Guest is not allowed to do this operation."}},"403":{"value":{"code":"ForbiddenUserError","message":"Non-admin is not allow to do this operation."}},"404":{"value":{"code":"NoUserError","message":"User {user} is not found."}},"500":{"value":{"code":"UnknownError","message":"Internal error message."}}}},"getAllGroup":{"path":"/api/v2/groups","method":"get","examples":{"200":[{"groupname":"groupName","description":"description","externalName":"externalName","extension":{}}],"500":{"value":{"code":"UnknownError","message":"Internal error message."}}}},"createGroup":{"path":"/api/v2/groups","method":"post","examples":{"201":{"message":"group is created successfully"},"401":{"value":{"code":"UnauthorizedUserError","message":"Guest is not allowed to do this operation."}},"403":{"value":{"code":"ForbiddenUserError","message":"Non-admin is not allow to do this operation."}},"500":{"value":{"code":"UnknownError","message":"Internal error message."}}}},"updateGroup":{"path":"/api/v2/groups","method":"put","examples":{"201":{"message":"update group {groupname} successfully."},"401":{"value":{"code":"UnauthorizedUserError","message":"Guest is not allowed to do this operation."}},"403":{"value":{"code":"ForbiddenUserError","message":"Non-admin is not allow to do this operation."}},"404":{"value":{"code":"NoGroupError","message":"Group {groupname} is not found."}},"500":{"value":{"code":"UnknownError","message":"Internal error message."}}}},"getGroup":{"path":"/api/v2/groups/{group}","method":"get","examples":{"200":{"groupname":"groupName","description":"description","externalName":"externalName","extension":{}},"401":{"value":{"code":"UnauthorizedUserError","message":"Guest is not allowed to do this operation."}},"404":{"value":{"code":"NoGroupError","message":"Group {groupname} is not found."}},"500":{"value":{"code":"UnknownError","message":"Internal error message."}}}},"deleteGroup":{"path":"/api/v2/groups/{group}","method":"delete","examples":{"201":{"message":"group is removed successfully"},"401":{"value":{"code":"UnauthorizedUserError","message":"Guest is not allowed to do this operation."}},"403":{"value":{"code":"ForbiddenUserError","message":"Non-admin is not allow to do this operation."}},"500":{"value":{"code":"UnknownError","message":"Internal error message."}}}},"getGroupMembers":{"path":"/api/v2/groups/{group}/userlist","method":"get","examples":{"200":[{"username":"username","clusterAdmin":false}],"401":{"value":{"code":"UnauthorizedUserError","message":"Guest is not allowed to do this operation."}},"500":{"value":{"code":"UnknownError","message":"Internal error message."}}}},"listVirtualClusters":{"path":"/api/v2/virtual-clusters","method":"get","examples":{"500":{"value":{"code":"UnknownError","message":"Internal error message."}}}},"getVirtualCluster":{"path":"/api/v2/virtual-clusters/{vc}","method":"get","examples":{"200":{"capacity":70,"usedCapacity":30,"dedicated":false,"resourcesUsed":{"cpu":1,"memory":1024,"gpu":1,"vCores":1,"GPUs":1},"resourcesGuaranteed":{"cpu":2,"memory":2048,"gpu":2,"vCores":2,"GPUs":2},"resourcesTotal":{"cpu":2,"memory":2048,"gpu":2,"vCores":2,"GPUs":2},"maxCapacity":70},"404":{"value":{"code":"NoVirtualClusterError","message":"Virtual cluster {vc} is not found."}},"500":{"value":{"code":"UnknownError","message":"Internal error message."}}}},"getStorages":{"path":"/api/v2/storages","method":"get","examples":{"200":{"storages":[{"name":"name","share":true,"volumeName":"volumeName"}]},"500":{"value":{"code":"UnknownError","message":"Internal error message."}}}},"getStorage":{"path":"/api/v2/storages/{storage}","method":"get","examples":{"200":{"name":"nfs-storage-name","share":true,"volumeName":"nfs-volume-name","type":"nfs","data":{"server":"","path":"/data"}},"403":{"value":{"code":"ForbiddenUserError","message":"User {user} is not allowed to access {storage}."}},"404":{"value":{"code":"NoStorageError","message":"Storage {storage} is not found."}},"500":{"value":{"code":"UnknownError","message":"Internal error message."}}}},"createJob":{"path":"/api/v2/jobs","method":"post","examples":{"202":{"message":"update job {job} successfully"},"400":{"value":{"code":"NoVirtualClusterError","message":"Virtual cluster {vc} is not found."}},"403":{"value":{"code":"ForbiddenUserError","message":"Non-admin is not allow to do this operation."}},"409":{"value":{"code":"ConflictJobError","message":"Job name {job} already exists."}},"500":{"value":{"code":"UnknownError","message":"Internal error message."}}}},"listJobs":{"path":"/api/v2/jobs","method":"get","examples":{"200":[{"protocolVersion":"2","name":"job name","username":"user name","state":"SUCCEEDED","subState":"Completed","executionType":"STOP","retries":0,"createdTime":0,"completedTime":0,"appExitCode":0,"virtualCluster":"unknown"}],"500":{"value":{"code":"UnknownError","message":"Internal error message."}}}},"getJob":{"path":"/api/v2/jobs/{user}~{job}","method":"get","examples":{"200":{"name":"job name","jobStatus":{"username":"user name","state":"SUCCEEDED","subState":"Completed","executionType":"STOP","retries":0,"createdTime":0,"completedTime":0,"appId":"id","appLaunchedTime":0,"appCompletedTime":0,"appExitCode":0,"virtualCluster":"unknown"},"taskRoles":{"taskrole":{"taskRoleStatus":{"name":"task role name"},"taskStatuses":[{"taskIndex":0,"taskState":"SUCCEEDED"}]}}},"404":{"value":{"code":"NoJobError","message":"Job {job} is not found."}},"500":{"value":{"code":"UnknownError","message":"Internal error message."}}}},"getJobConfig":{"path":"/api/v2/jobs/{user}~{job}/config","method":"get","examples":{"200":{"protocolVersion":"2","name":"","type":"job","prerequisites":[{"name":"","type":"dockerimage","uri":"image_url"}],"taskRoles":{"train":{"instances":1,"dockerImage":"","resourcePerInstance":{"cpu":1,"memoryMB":16384,"gpu":1},"commands":["python "]}}},"404":{"value":{"code":"NoJobError","message":"Job {job} is not found."}},"500":{"value":{"code":"UnknownError","message":"Internal error message."}}}},"updateJobExecutionType":{"path":"/api/v2/jobs/{user}~{job}/executionType","method":"put","examples":{"202":{"message":"execute job {job} successfully"},"404":{"value":{"code":"NoJobError","message":"Job {job} is not found."}},"500":{"value":{"code":"UnknownError","message":"Internal error message."}}}},"getJobAttemptsHealthz":{"path":"/api/v2/jobs/{user}~{job}/job-attempts/healthz","method":"get","examples":{}},"getJobAttempts":{"path":"/api/v2/jobs/{user}~{job}/job-attempts","method":"get","examples":{"200":[{"jobName":"jobName","frameworkName":"frameworkName","uid":"uid","userName":"userName","state":"SUCCEEDED","originState":"Completed","maxAttemptCount":1,"attemptIndex":0,"jobStartedTime":0,"attemptStartedTime":0,"attemptCompletedTime":0,"exitCode":0,"exitPhrase":"Succeeded","exitType":"Succeeded","exitDiagnostics":{"diagnosticsSummary":"Pod succeeded","runtime":null,"launcher":"Pod succeeded"},"appExitTriggerMessage":"All Tasks are completed","appExitTriggerTaskRoleName":"taskrole","appExitTriggerTaskIndex":0,"appExitSpec":{"code":0,"phrase":"Succeeded","issuer":"USER_CONTAINER","causer":"USER_CONTAINER","type":"USER_SUCCESS","stage":"COMPLETING","behavior":"UNKNOWN","reaction":"NEVER_RETRY","repro":["User program exits with exitcode 0"]},"appExitDiagnostics":"Pod succeeded","appExitMessages":{"container":null,"runtime":null,"launcher":"Pod succeeded"},"totalGpuNumber":1,"totalTaskNumber":1,"totalTaskRoleNumber":1,"taskRoles":{"taskrole":{"taskRoleStatus":{"name":"taskrole"},"taskStatuses":[{"taskIndex":0,"taskState":"SUCCEEDED","containerId":"","containerIp":"","containerExitCode":0}]}},"isLatest":true}],"404":{"value":{"code":"NoJobError","message":"Job {job} is not found."}},"501":{"value":{"code":"UnknownError","message":"Internal error message."}}}},"getJobAttempt":{"path":"/api/v2/jobs/{user}~{job}/job-attempts/{attemptIndex}","method":"get","examples":{"200":{"jobName":"jobName","frameworkName":"frameworkName","uid":"uid","userName":"userName","state":"SUCCEEDED","originState":"Completed","maxAttemptCount":1,"attemptIndex":0,"jobStartedTime":0,"attemptStartedTime":0,"attemptCompletedTime":0,"exitCode":0,"exitPhrase":"Succeeded","exitType":"Succeeded","exitDiagnostics":{"diagnosticsSummary":"Pod succeeded","runtime":null,"launcher":"Pod succeeded"},"appExitTriggerMessage":"All Tasks are completed","appExitTriggerTaskRoleName":"taskrole","appExitTriggerTaskIndex":0,"appExitSpec":{"code":0,"phrase":"Succeeded","issuer":"USER_CONTAINER","causer":"USER_CONTAINER","type":"USER_SUCCESS","stage":"COMPLETING","behavior":"UNKNOWN","reaction":"NEVER_RETRY","repro":["User program exits with exitcode 0"]},"appExitDiagnostics":"Pod succeeded","appExitMessages":{"container":null,"runtime":null,"launcher":"Pod succeeded"},"totalGpuNumber":1,"totalTaskNumber":1,"totalTaskRoleNumber":1,"taskRoles":{"taskrole":{"taskRoleStatus":{"name":"taskrole"},"taskStatuses":[{"taskIndex":0,"taskState":"SUCCEEDED","containerId":"","containerIp":"","containerExitCode":0}]}},"isLatest":true},"404":{"value":{"code":"NoJobError","message":"Job {job} is not found."}},"501":{"value":{"code":"UnknownError","message":"Internal error message."}}}},"getK8sNodes":{"path":"/api/v2/kubernetes/nodes","method":"get","examples":{"200":["Please refer to Kubernetes API doc","https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.17/#list-node-v1-core"],"401":{"value":{"code":"UnauthorizedUserError","message":"Guest is not allowed to do this operation."}},"403":{"value":{"code":"ForbiddenUserError","message":"Non-admin is not allow to do this operation."}}}},"getK8sPods":{"path":"/api/v2/kubernetes/pods","method":"get","examples":{"200":["Please refer to Kubernetes API doc","https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.17/#list-all-namespaces-pod-v1-core"],"401":{"value":{"code":"UnauthorizedUserError","message":"Guest is not allowed to do this operation."}},"403":{"value":{"code":"ForbiddenUserError","message":"Non-admin is not allow to do this operation."}}}}}} \ No newline at end of file +{"tests":[],"map":{}} diff --git a/package.json b/package.json index cb8f50c..76b2a7d 100644 --- a/package.json +++ b/package.json @@ -12,7 +12,7 @@ "format": "prettier --write \"src/**/*.ts\" \"src/**/*.js\"", "lint": "tslint -p tsconfig.json", "pretest": "npm run preapi-test && tslint --config tslint.json --project tsconfig.json", - "test": "mocha -r ts-node/register -r tsconfig-paths/register -r source-map-support/register tests/unit_tests/**/*.spec.ts", + "test": "mocha -r ts-node/register -r tsconfig-paths/register -r source-map-support/register --recursive \"tests/unit_tests/**/*.spec.ts\"", "preapi-test": "ts-node -r tsconfig-paths/register tests/common/apiTestCaseGenerator.ts -- \"src/api/v2/swagger.yaml\" \".tests/apiTestCase.json\"", "api-test": "mocha -r ts-node/register -r tsconfig-paths/register tests/api_tests/**/*.spec.ts -t 20000", "mock-api-test": "npm run preapi-test && mocha -r ts-node/register -r tsconfig-paths/register tests/unit_tests/v2/v2.spec.ts", @@ -20,7 +20,7 @@ "build": "ttsc -p tsconfig.json && npm run copy-swagger", "copy-swagger": "node copy_swagger.js", "precode-coverage": "npm run build && npm run pretest", - "code-coverage": "nyc mocha -r ts-node/register -r tsconfig-paths/register -r source-map-support/register tests/unit_tests/**/*.spec.ts", + "code-coverage": "nyc mocha -r ts-node/register -r tsconfig-paths/register -r source-map-support/register \"tests/unit_tests/**/*.spec.ts\"", "coveralls": "nyc report --reporter=text-lcov > coverage/lcov.info" }, "homepage": "https://github.com/Microsoft/openpaisdk", From d02791c349fce1dcd7305aa7b9761b0ebaa4dd96 Mon Sep 17 00:00:00 2001 From: Yi Yi Date: Mon, 15 Jun 2020 04:27:16 +0800 Subject: [PATCH 20/24] update --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 76b2a7d..c7e71fd 100644 --- a/package.json +++ b/package.json @@ -20,7 +20,7 @@ "build": "ttsc -p tsconfig.json && npm run copy-swagger", "copy-swagger": "node copy_swagger.js", "precode-coverage": "npm run build && npm run pretest", - "code-coverage": "nyc mocha -r ts-node/register -r tsconfig-paths/register -r source-map-support/register \"tests/unit_tests/**/*.spec.ts\"", + "code-coverage": "nyc mocha -r ts-node/register -r tsconfig-paths/register -r source-map-support/register \"tests/unit_tests/**/*.spec.ts\" --exit", "coveralls": "nyc report --reporter=text-lcov > coverage/lcov.info" }, "homepage": "https://github.com/Microsoft/openpaisdk", From 4f19ac5ab5c804b271b290abeb8ba5b22aed0c54 Mon Sep 17 00:00:00 2001 From: Yi Yi Date: Mon, 15 Jun 2020 04:33:18 +0800 Subject: [PATCH 21/24] fix --- .tests/apiTestCase.json | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.tests/apiTestCase.json b/.tests/apiTestCase.json index 3d8ce63..e58fd07 100644 --- a/.tests/apiTestCase.json +++ b/.tests/apiTestCase.json @@ -1 +1 @@ -{"tests":[],"map":{}} +{"tests":[{"description":"get /api/v2/info","tests":[{"operation":{"tag":"api","operationId":"getClusterInfo","parameters":[],"response":{"statusCode":200,"schema":{"type":"object","properties":{"name":{"type":"string","description":"PAI RESTfulAPI"},"version":{"type":"string","description":"cluster version in v0.X.0 format"},"launcherType":{"type":"string","enum":["yarn","k8s"]},"authnMethod":{"type":"string","enum":["basic","OIDC"]}},"required":["name","version","launcherType","authnMethod"]},"contentType":"application/json"}}}],"schemas":{"200":{"description":"Succeeded","content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","description":"PAI RESTfulAPI"},"version":{"type":"string","description":"cluster version in v0.X.0 format"},"launcherType":{"type":"string","enum":["yarn","k8s"]},"authnMethod":{"type":"string","enum":["basic","OIDC"]}},"required":["name","version","launcherType","authnMethod"]},"example":{"name":"PAI RESTful API","version":"v1.0.1","launcherType":"k8s","authnMethod":"basic"}}}}}},{"before":[{"tag":"token","operationId":"createApplicationToken"}],"tests":[{"description":"Get tokens with user token","operation":{"tag":"token","operationId":"getTokens","parameters":[],"response":{"statusCode":200,"schema":{"type":"object","properties":{"tokens":{"type":"array","items":{"type":"string"},"description":"JWT string list"}},"required":["tokens"]},"contentType":"application/json"}}},{"description":"Get tokens with unauthorized token","customizedTest":"getTokensWithUnauthorizedUser","operation":{"tag":"token","operationId":"getTokens","parameters":[],"response":{"statusCode":200,"schema":{"type":"object","properties":{"tokens":{"type":"array","items":{"type":"string"},"description":"JWT string list"}},"required":["tokens"]},"contentType":"application/json"}}}],"after":[{"tag":"token","operationId":"deleteToken","parameters":[{"type":"fromResult","resultType":"beforeResults","resultPath":["token"],"resultIndex":0}]}],"schemas":{"200":{"description":"Succeeded","content":{"application/json":{"schema":{"type":"object","properties":{"tokens":{"type":"array","items":{"type":"string"},"description":"JWT string list"}},"required":["tokens"]},"example":{"tokens":["JWT Token Example"]}}}},"401":{"description":"UnauthorizedUserError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"UnauthorizedUserError":{"value":{"code":"UnauthorizedUserError","message":"Guest is not allowed to do this operation."}}}}}}},"description":"get /api/v2/tokens"},{"before":[{"tag":"token","operationId":"createApplicationToken"}],"tests":[{"operation":{"parameters":[{"type":"fromResult","resultType":"beforeResults","resultPath":["token"],"resultIndex":0}],"tag":"token","operationId":"deleteToken","response":{"statusCode":200,"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"contentType":"application/json"}}}],"schemas":{"200":{"description":"Succeeded","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"example":{"message":"revoke successfully"}}}},"401":{"description":"UnauthorizedUserError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"UnauthorizedUserError":{"value":{"code":"UnauthorizedUserError","message":"Guest is not allowed to do this operation."}}}}}},"403":{"description":"ForbiddenUserError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"ForbiddenUserError":{"value":{"code":"ForbiddenUserError","message":"Non-admin is not allow to do this operation."}},"ForbiddenTokenError":{"value":{"code":"ForbiddenUserError","message":"Applications are not allowed to do this operation."}}}}}}},"description":"delete /api/v2/tokens/{token}"},{"tests":[{"operation":{"tag":"token","operationId":"createApplicationToken","parameters":[],"response":{"statusCode":200,"schema":{"type":"object","properties":{"token":{"type":"string","description":"your access token"},"application":{"type":"boolean","description":"true"}}},"contentType":"application/json"}}}],"after":[{"tag":"token","operationId":"deleteToken","parameters":[{"type":"fromResult","resultType":"testResults","resultPath":["token"],"resultIndex":0}]}],"schemas":{"200":{"description":"Succeeded","content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string","description":"your access token"},"application":{"type":"boolean","description":"true"}}},"example":{"token":"JWT Token Example","application":true}}}},"401":{"description":"UnauthorizedUserError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"UnauthorizedUserError":{"value":{"code":"UnauthorizedUserError","message":"Guest is not allowed to do this operation."}}}}}}},"description":"post /api/v2/tokens/application"},{"description":"get /api/v2/authn/oidc/login","tests":[{"operation":{"tag":"authn","operationId":"oidcLogin","parameters":[]}}],"schemas":{"302":{"description":"Redirect"}}},{"description":"get /api/v2/authn/oidc/logout","tests":[{"operation":{"tag":"authn","operationId":"oidcLogout","parameters":[]}}],"schemas":{"302":{"description":"Redirect"}}},{"tests":[{"description":"login with correct username and password","operation":{"parameters":[{"type":"raw","value":"sdk_test"},{"type":"raw","value":"pwd"}],"tag":"authn","operationId":"basicLogin","response":{"statusCode":200,"schema":{"type":"object","properties":{"token":{"type":"string","description":"your access token"},"user":{"type":"string","description":"username"},"admin":{"type":"boolean","description":"true if user is admin"}},"required":["token","user","admin"]},"contentType":"application/json"}}},{"description":"login with non-existent username","operation":{"parameters":[{"type":"raw","value":"nonexistentuser"},{"type":"raw","value":"password"}],"response":{"statusCode":400,"expectResult":{"code":"NoUserError","message":"User nonexistentuser is not found."},"schema":{"description":"NoUserError or IncorrectPasswordError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]}}}}},"tag":"authn","operationId":"basicLogin"}},{"description":"login with incorrect password","operation":{"parameters":[{"type":"raw","value":"sdk_test"},{"type":"raw","value":"incorrectpassword"}],"response":{"statusCode":400,"expectResult":{"code":"IncorrectPasswordError","message":"Password is incorrect."},"schema":{"description":"NoUserError or IncorrectPasswordError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]}}}}},"tag":"authn","operationId":"basicLogin"}}],"after":[{"tag":"token","operationId":"deleteToken","parameters":[{"type":"fromResult","resultType":"testResults","resultPath":["token"],"resultIndex":0}]}],"schemas":{"200":{"description":"Succeeded","content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string","description":"your access token"},"user":{"type":"string","description":"username"},"admin":{"type":"boolean","description":"true if user is admin"}},"required":["token","user","admin"]},"example":{"token":"JWT Token Example","user":"user","admin":true}}}},"400":{"description":"NoUserError or IncorrectPasswordError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]}}}},"404":{"description":"NoUserError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"NoUserError":{"value":{"code":"NoUserError","message":"User {user} is not found."}}}}}}},"description":"post /api/v2/authn/basic/login"},{"before":[{"tag":"authn","operationId":"basicLogin","parameters":[{"type":"raw","value":"sdk_test"},{"type":"raw","value":"pwd"}]}],"tests":[{"description":"Logout with correct token","customizedTest":"logoutWithCorrectToken","operation":{"tag":"authn","operationId":"basicLogout","parameters":[],"response":{"statusCode":200,"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"contentType":"application/json"}}},{"description":"Logout with incorrect token","customizedTest":"logoutWithIncorrectToken","operation":{"tag":"authn","operationId":"basicLogout","parameters":[],"response":{"statusCode":200,"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"contentType":"application/json"}}}],"schemas":{"200":{"description":"Succeeded","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"example":{"message":"Logout successfully"}}}},"401":{"description":"UnauthorizedUserError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"UnauthorizedUserError":{"value":{"code":"UnauthorizedUserError","message":"Guest is not allowed to do this operation."}}}}}},"403":{"description":"ForbiddenUserError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"ForbiddenUserError":{"value":{"code":"ForbiddenUserError","message":"Non-admin is not allow to do this operation."}},"ForbiddenTokenError":{"value":{"code":"ForbiddenUserError","message":"Applications are not allowed to do this operation."}}}}}}},"description":"delete /api/v2/authn/basic/logout"},{"before":[{"tag":"token","operationId":"createApplicationToken"}],"tests":[{"description":"Create a user","operation":{"tag":"user","operationId":"createUser","parameters":[{"type":"raw","value":{"username":"sdk_test_user","password":"test_password"}}],"response":{"statusCode":201,"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"contentType":"application/json"}}},{"description":"Create a conflict user","operation":{"tag":"user","operationId":"createUser","parameters":[{"type":"raw","value":{"username":"sdk_test_user","password":"test_password"}}],"response":{"statusCode":409,"schema":{"description":"ConflictUserError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"ConflictUserError":{"value":{"code":"ConflictUserError","message":"User name {user} already exists."}}}}}}}}},{"description":"Create a user by application token","customizedTest":"createUserByApplicationToken","operation":{"tag":"user","operationId":"createUser","parameters":[],"response":{"statusCode":201,"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"contentType":"application/json"}}},{"description":"Create a user by non-admin user token","customizedTest":"createUserByNonadminToken","operation":{"tag":"user","operationId":"createUser","parameters":[],"response":{"statusCode":201,"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"contentType":"application/json"}}}],"after":[{"tag":"user","operationId":"deleteUser","parameters":[{"type":"raw","value":"sdk_test_user"}],"response":{"statusCode":200,"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"contentType":"application/json"}},{"tag":"token","operationId":"deleteToken","parameters":[{"type":"fromResult","resultType":"beforeResults","resultPath":["token"],"resultIndex":0}]}],"schemas":{"201":{"description":"Succeeded","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"example":{"message":"User is created successfully"}}}},"401":{"description":"UnauthorizedUserError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"UnauthorizedUserError":{"value":{"code":"UnauthorizedUserError","message":"Guest is not allowed to do this operation."}}}}}},"403":{"description":"ForbiddenUserError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"ForbiddenUserError":{"value":{"code":"ForbiddenUserError","message":"Non-admin is not allow to do this operation."}},"ForbiddenTokenError":{"value":{"code":"ForbiddenUserError","message":"Applications are not allowed to do this operation."}}}}}},"409":{"description":"ConflictUserError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"ConflictUserError":{"value":{"code":"ConflictUserError","message":"User name {user} already exists."}}}}}},"500":{"description":"UnknownError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"UnknownError":{"value":{"code":"UnknownError","message":"Internal error message."}}}}}}},"description":"post /api/v2/users"},{"description":"get /api/v2/users","tests":[{"operation":{"tag":"user","operationId":"getAllUser","parameters":[],"response":{"statusCode":200,"schema":{"description":"Array with all users in the system.","type":"array","items":{"type":"object","properties":{"username":{"type":"string","description":"user name"},"admin":{"type":"boolean","description":"Admin or not."},"virtualCluster":{"type":"array","description":"The list of virtualCluster which the user can access.","items":{"type":"string","description":"virtual cluster name."}},"storageConfig":{"type":"array","description":"storageconfig string arry","items":{"type":"string"}},"email":{"type":"string","description":"email address"},"extension":{"type":"object","description":"extension field."}},"required":["username","admin","virtualCluster","storageConfig","email","extension"]}},"contentType":"application/json"}}}],"schemas":{"200":{"description":"Succeeded","content":{"application/json":{"schema":{"description":"Array with all users in the system.","type":"array","items":{"type":"object","properties":{"username":{"type":"string","description":"user name"},"admin":{"type":"boolean","description":"Admin or not."},"virtualCluster":{"type":"array","description":"The list of virtualCluster which the user can access.","items":{"type":"string","description":"virtual cluster name."}},"storageConfig":{"type":"array","description":"storageconfig string arry","items":{"type":"string"}},"email":{"type":"string","description":"email address"},"extension":{"type":"object","description":"extension field."}},"required":["username","admin","virtualCluster","storageConfig","email","extension"]}},"example":[{"username":"username","admin":true,"virtualCluster":[],"storageConfig":[],"email":"email@test.com","extension":{}}]}}},"500":{"description":"UnknownError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"UnknownError":{"value":{"code":"UnknownError","message":"Internal error message."}}}}}}}},{"before":[{"tag":"user","operationId":"createUser","parameters":[{"type":"raw","value":{"username":"sdk_test_user","password":"test_password"}}],"response":{"statusCode":201,"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"contentType":"application/json"}},{"tag":"token","operationId":"createApplicationToken"}],"tests":[{"description":"Update a user, patch: true","operation":{"parameters":[{"type":"raw","value":{"username":"sdk_test_user","email":"new_email@test1.com"}}],"tag":"user","operationId":"updateUser","response":{"statusCode":201,"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"contentType":"application/json"}}},{"description":"Update a user, patch: false","operation":{"parameters":[{"type":"raw","value":{"username":"sdk_test_user","email":"new_email@test2.com","virtualCluster":["default"],"admin":false,"password":"new_test_password","extension":{}}},{"type":"raw","value":false}],"tag":"user","operationId":"updateUser","response":{"statusCode":201,"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"contentType":"application/json"}}},{"description":"Update a non-existent user","operation":{"parameters":[{"type":"raw","value":{"username":"non_exist_user","email":"new_email@test1.com"}}],"response":{"statusCode":404,"schema":{"description":"NoUserError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"NoUserError":{"value":{"code":"NoUserError","message":"User {user} is not found."}}}}}}},"tag":"user","operationId":"updateUser"}},{"description":"Update a user by application token","customizedTest":"updateUserByApplicationToken","operation":{"tag":"user","operationId":"updateUser","parameters":[],"response":{"statusCode":201,"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"contentType":"application/json"}}},{"description":"Update a user by non-admin user token","customizedTest":"updateUserByNonadminToken","operation":{"tag":"user","operationId":"updateUser","parameters":[],"response":{"statusCode":201,"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"contentType":"application/json"}}}],"after":[{"tag":"user","operationId":"deleteUser","parameters":[{"type":"raw","value":"sdk_test_user"}],"response":{"statusCode":200,"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"contentType":"application/json"}},{"tag":"token","operationId":"deleteToken","parameters":[{"type":"fromResult","resultType":"beforeResults","resultPath":["token"],"resultIndex":1}]}],"schemas":{"201":{"description":"Succeeded","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"example":{"message":"update group {username} successfully."}}}},"401":{"description":"UnauthorizedUserError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"UnauthorizedUserError":{"value":{"code":"UnauthorizedUserError","message":"Guest is not allowed to do this operation."}}}}}},"403":{"description":"ForbiddenUserError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"ForbiddenUserError":{"value":{"code":"ForbiddenUserError","message":"Non-admin is not allow to do this operation."}},"ForbiddenTokenError":{"value":{"code":"ForbiddenUserError","message":"Applications are not allowed to do this operation."}}}}}},"404":{"description":"NoUserError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"NoUserError":{"value":{"code":"NoUserError","message":"User {user} is not found."}}}}}},"500":{"description":"UnknownError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"UnknownError":{"value":{"code":"UnknownError","message":"Internal error message."}}}}}}},"description":"put /api/v2/users"},{"tests":[{"description":"Update user self, patch: true","operation":{"parameters":[{"type":"raw","value":{"username":"sdk_test","email":"new_email@test1.com"}}],"tag":"user","operationId":"updateUserSelf","response":{"statusCode":201,"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"contentType":"application/json"}}},{"description":"Update user self, patch: false","operation":{"parameters":[{"type":"raw","value":{"username":"sdk_test","email":"new_email@test2.com","oldPassword":"pwd","newPassword":"pwd"}},{"type":"raw","value":false}],"tag":"user","operationId":"updateUserSelf","response":{"statusCode":201,"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"contentType":"application/json"}}},{"description":"Update user self with incorrect username","operation":{"parameters":[{"type":"raw","value":{"username":"incorrect_username","email":"new_email@test1.com"}}],"response":{"statusCode":403,"schema":{"description":"ForbiddenUserError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"ForbiddenUserError":{"value":{"code":"ForbiddenUserError","message":"Non-admin is not allow to do this operation."}},"ForbiddenTokenError":{"value":{"code":"ForbiddenUserError","message":"Applications are not allowed to do this operation."}}}}}}},"tag":"user","operationId":"updateUserSelf"}}],"schemas":{"201":{"description":"Succeeded","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"example":{"message":"update group {username} successfully."}}}},"401":{"description":"UnauthorizedUserError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"UnauthorizedUserError":{"value":{"code":"UnauthorizedUserError","message":"Guest is not allowed to do this operation."}}}}}},"403":{"description":"ForbiddenUserError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"ForbiddenUserError":{"value":{"code":"ForbiddenUserError","message":"Non-admin is not allow to do this operation."}},"ForbiddenTokenError":{"value":{"code":"ForbiddenUserError","message":"Applications are not allowed to do this operation."}}}}}},"404":{"description":"NoUserError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"NoUserError":{"value":{"code":"NoUserError","message":"User {user} is not found."}}}}}},"500":{"description":"UnknownError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"UnknownError":{"value":{"code":"UnknownError","message":"Internal error message."}}}}}}},"description":"put /api/v2/users/me"},{"tests":[{"operation":{"parameters":[{"type":"raw","value":"sdk_test"}],"tag":"user","operationId":"getUser","response":{"statusCode":200,"schema":{"type":"object","properties":{"username":{"type":"string","description":"user name"},"admin":{"type":"boolean","description":"Admin or not."},"virtualCluster":{"type":"array","description":"The list of virtualCluster which the user can access.","items":{"type":"string","description":"virtual cluster name."}},"storageConfig":{"type":"array","description":"storageconfig string arry","items":{"type":"string"}},"email":{"type":"string","description":"email address"},"extension":{"type":"object","description":"extension field."}},"required":["username","admin","virtualCluster","storageConfig","email","extension"]},"contentType":"application/json"}}}],"schemas":{"200":{"description":"Succeeded","content":{"application/json":{"schema":{"type":"object","properties":{"username":{"type":"string","description":"user name"},"admin":{"type":"boolean","description":"Admin or not."},"virtualCluster":{"type":"array","description":"The list of virtualCluster which the user can access.","items":{"type":"string","description":"virtual cluster name."}},"storageConfig":{"type":"array","description":"storageconfig string arry","items":{"type":"string"}},"email":{"type":"string","description":"email address"},"extension":{"type":"object","description":"extension field."}},"required":["username","admin","virtualCluster","storageConfig","email","extension"]},"example":{"username":"username","admin":true,"virtualCluster":[],"storageConfig":[],"email":"email@test.com","extension":{}}}}},"401":{"description":"UnauthorizedUserError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"UnauthorizedUserError":{"value":{"code":"UnauthorizedUserError","message":"Guest is not allowed to do this operation."}}}}}},"404":{"description":"NoUserError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"NoUserError":{"value":{"code":"NoUserError","message":"User {user} is not found."}}}}}},"500":{"description":"UnknownError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"UnknownError":{"value":{"code":"UnknownError","message":"Internal error message."}}}}}}},"description":"get /api/v2/users/{user}"},{"before":[{"tag":"user","operationId":"createUser","parameters":[{"type":"raw","value":{"username":"sdk_test_user","password":"test_password"}}],"response":{"statusCode":201,"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"contentType":"application/json"}},{"tag":"token","operationId":"createApplicationToken"}],"tests":[{"description":"Delete a user","operation":{"tag":"user","operationId":"deleteUser","parameters":[{"type":"raw","value":"sdk_test_user"}],"response":{"statusCode":200,"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"contentType":"application/json"}}},{"description":"Delete a non-existent user","operation":{"parameters":[{"type":"raw","value":"non_exist_user"}],"response":{"statusCode":404,"schema":{"description":"NoUserError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"NoUserError":{"value":{"code":"NoUserError","message":"User {user} is not found."}}}}}}},"tag":"user","operationId":"deleteUser"}},{"description":"Delete a user by application token","customizedTest":"deleteUserByApplicationToken","operation":{"tag":"user","operationId":"deleteUser","parameters":[],"response":{"statusCode":200,"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"contentType":"application/json"}}},{"description":"Delete a user by non-admin user token","customizedTest":"deleteUserByNonadminToken","operation":{"tag":"user","operationId":"deleteUser","parameters":[],"response":{"statusCode":200,"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"contentType":"application/json"}}}],"after":[{"tag":"token","operationId":"deleteToken","parameters":[{"type":"fromResult","resultType":"beforeResults","resultPath":["token"],"resultIndex":1}]}],"schemas":{"200":{"description":"Succeeded","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"example":{"message":"user is removed successfully"}}}},"401":{"description":"UnauthorizedUserError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"UnauthorizedUserError":{"value":{"code":"UnauthorizedUserError","message":"Guest is not allowed to do this operation."}}}}}},"403":{"description":"ForbiddenUserError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"ForbiddenUserError":{"value":{"code":"ForbiddenUserError","message":"Non-admin is not allow to do this operation."}},"ForbiddenTokenError":{"value":{"code":"ForbiddenUserError","message":"Applications are not allowed to do this operation."}}}}}},"404":{"description":"NoUserError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"NoUserError":{"value":{"code":"NoUserError","message":"User {user} is not found."}}}}}},"500":{"description":"UnknownError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"UnknownError":{"value":{"code":"UnknownError","message":"Internal error message."}}}}}}},"description":"delete /api/v2/users/{user}"},{"before":[{"tag":"token","operationId":"createApplicationToken"},{"tag":"user","operationId":"createUser","parameters":[{"type":"raw","value":{"username":"sdk_test_user","password":"test_password"}}],"response":{"statusCode":201,"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"contentType":"application/json"}},{"tag":"group","operationId":"createGroup","parameters":[{"type":"raw","value":{"groupname":"sdktestgroup"}}],"response":{"statusCode":201,"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"contentType":"application/json"}}],"tests":[{"description":"Add a group to a user's grouplist","operation":{"parameters":[{"type":"raw","value":"sdk_test_user"},{"type":"raw","value":"sdktestgroup"}],"tag":"user","operationId":"updateUserGroup","response":{"statusCode":201,"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"contentType":"application/json"}}},{"description":"Add a group to a non-existent user's grouplist","operation":{"parameters":[{"type":"raw","value":"non_exist_user"},{"type":"raw","value":"sdktestgroup"}],"response":{"statusCode":404,"schema":{"description":"NoUserError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"NoUserError":{"value":{"code":"NoUserError","message":"User {user} is not found."}}}}}}},"tag":"user","operationId":"updateUserGroup"}},{"description":"Add a group to a user's grouplist by application token","customizedTest":"updateUserGroupByApplicationToken","operation":{"tag":"user","operationId":"updateUserGroup","parameters":[],"response":{"statusCode":201,"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"contentType":"application/json"}}},{"description":"Add a group to a user's grouplist by non-admin user token","customizedTest":"updateUserGroupByNonadminToken","operation":{"tag":"user","operationId":"updateUserGroup","parameters":[],"response":{"statusCode":201,"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"contentType":"application/json"}}}],"after":[{"tag":"token","operationId":"deleteToken","parameters":[{"type":"fromResult","resultType":"beforeResults","resultPath":["token"],"resultIndex":0}]},{"tag":"user","operationId":"deleteUser","parameters":[{"type":"raw","value":"sdk_test_user"}],"response":{"statusCode":200,"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"contentType":"application/json"}},{"tag":"group","operationId":"deleteGroup","parameters":[{"type":"raw","value":"sdktestgroup"}],"response":{"statusCode":201,"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"contentType":"application/json"}}],"schemas":{"201":{"description":"Succeeded","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"example":{"message":"User {username} is added into group {groupname}"}}}},"401":{"description":"UnauthorizedUserError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"UnauthorizedUserError":{"value":{"code":"UnauthorizedUserError","message":"Guest is not allowed to do this operation."}}}}}},"403":{"description":"ForbiddenUserError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"ForbiddenUserError":{"value":{"code":"ForbiddenUserError","message":"Non-admin is not allow to do this operation."}},"ForbiddenTokenError":{"value":{"code":"ForbiddenUserError","message":"Applications are not allowed to do this operation."}}}}}},"404":{"description":"NoUserError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"NoUserError":{"value":{"code":"NoUserError","message":"User {user} is not found."}}}}}},"500":{"description":"UnknownError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"UnknownError":{"value":{"code":"UnknownError","message":"Internal error message."}}}}}}},"description":"put /api/v2/users/{user}/group/"},{"before":[{"tag":"token","operationId":"createApplicationToken"},{"tag":"user","operationId":"createUser","parameters":[{"type":"raw","value":{"username":"sdk_test_user","password":"test_password"}}],"response":{"statusCode":201,"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"contentType":"application/json"}},{"tag":"group","operationId":"createGroup","parameters":[{"type":"raw","value":{"groupname":"sdktestgroup"}}],"response":{"statusCode":201,"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"contentType":"application/json"}},{"tag":"user","operationId":"updateUserGroup","parameters":[{"type":"raw","value":"sdk_test_user"},{"type":"raw","value":"sdktestgroup"}]}],"tests":[{"description":"Remove a group to a user's grouplist","operation":{"parameters":[{"type":"raw","value":"sdk_test_user"},{"type":"raw","value":"sdktestgroup"}],"tag":"user","operationId":"deleteUserGroup","response":{"statusCode":201,"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"contentType":"application/json"}}},{"description":"Remove a group to a non-existent user's grouplist","operation":{"parameters":[{"type":"raw","value":"non_exist_user"},{"type":"raw","value":"sdktestgroup"}],"response":{"statusCode":404,"schema":{"description":"NoUserError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"NoUserError":{"value":{"code":"NoUserError","message":"User {user} is not found."}}}}}}},"tag":"user","operationId":"deleteUserGroup"}},{"description":"Remove a group to a user's grouplist by application token","customizedTest":"deleteUserGroupByApplicationToken","operation":{"tag":"user","operationId":"deleteUserGroup","parameters":[],"response":{"statusCode":201,"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"contentType":"application/json"}}},{"description":"Remove a group to a user's grouplist by non-admin user token","customizedTest":"deleteUserGroupByNonadminToken","operation":{"tag":"user","operationId":"deleteUserGroup","parameters":[],"response":{"statusCode":201,"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"contentType":"application/json"}}}],"after":[{"tag":"token","operationId":"deleteToken","parameters":[{"type":"fromResult","resultType":"beforeResults","resultPath":["token"],"resultIndex":0}]},{"tag":"user","operationId":"deleteUser","parameters":[{"type":"raw","value":"sdk_test_user"}],"response":{"statusCode":200,"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"contentType":"application/json"}},{"tag":"group","operationId":"deleteGroup","parameters":[{"type":"raw","value":"sdktestgroup"}],"response":{"statusCode":201,"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"contentType":"application/json"}}],"schemas":{"201":{"description":"Succeeded","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"example":{"message":"User {username} is removed from group {groupname}"}}}},"401":{"description":"UnauthorizedUserError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"UnauthorizedUserError":{"value":{"code":"UnauthorizedUserError","message":"Guest is not allowed to do this operation."}}}}}},"403":{"description":"ForbiddenUserError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"ForbiddenUserError":{"value":{"code":"ForbiddenUserError","message":"Non-admin is not allow to do this operation."}},"ForbiddenTokenError":{"value":{"code":"ForbiddenUserError","message":"Applications are not allowed to do this operation."}}}}}},"404":{"description":"NoUserError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"NoUserError":{"value":{"code":"NoUserError","message":"User {user} is not found."}}}}}},"500":{"description":"UnknownError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"UnknownError":{"value":{"code":"UnknownError","message":"Internal error message."}}}}}}},"description":"delete /api/v2/users/{user}/group/"},{"before":[{"tag":"token","operationId":"createApplicationToken"},{"tag":"user","operationId":"createUser","parameters":[{"type":"raw","value":{"username":"sdk_test_user","password":"test_password"}}],"response":{"statusCode":201,"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"contentType":"application/json"}}],"tests":[{"description":"Replace a user's grouplist","operation":{"parameters":[{"type":"raw","value":"sdk_test_user"},{"type":"raw","value":["default"]}],"tag":"user","operationId":"updateUserGrouplist","response":{"statusCode":201,"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"contentType":"application/json"}}},{"description":"Replace a non-existent user's grouplist","operation":{"parameters":[{"type":"raw","value":"non_exist_user"},{"type":"raw","value":["default"]}],"response":{"statusCode":404,"schema":{"description":"NoUserError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"NoUserError":{"value":{"code":"NoUserError","message":"User {user} is not found."}}}}}}},"tag":"user","operationId":"updateUserGrouplist"}},{"description":"Replace a user's grouplist by application token","customizedTest":"updateUserGrouplistByApplicationToken","operation":{"tag":"user","operationId":"updateUserGrouplist","parameters":[],"response":{"statusCode":201,"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"contentType":"application/json"}}},{"description":"Replace a user's grouplist by non-admin user token","customizedTest":"updateUserGrouplistByNonadminToken","operation":{"tag":"user","operationId":"updateUserGrouplist","parameters":[],"response":{"statusCode":201,"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"contentType":"application/json"}}}],"after":[{"tag":"token","operationId":"deleteToken","parameters":[{"type":"fromResult","resultType":"beforeResults","resultPath":["token"],"resultIndex":0}]},{"tag":"user","operationId":"deleteUser","parameters":[{"type":"raw","value":"sdk_test_user"}],"response":{"statusCode":200,"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"contentType":"application/json"}}],"schemas":{"201":{"description":"Succeeded","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"example":{"message":"update user grouplist successfully."}}}},"401":{"description":"UnauthorizedUserError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"UnauthorizedUserError":{"value":{"code":"UnauthorizedUserError","message":"Guest is not allowed to do this operation."}}}}}},"403":{"description":"ForbiddenUserError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"ForbiddenUserError":{"value":{"code":"ForbiddenUserError","message":"Non-admin is not allow to do this operation."}},"ForbiddenTokenError":{"value":{"code":"ForbiddenUserError","message":"Applications are not allowed to do this operation."}}}}}},"404":{"description":"NoUserError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"NoUserError":{"value":{"code":"NoUserError","message":"User {user} is not found."}}}}}},"500":{"description":"UnknownError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"UnknownError":{"value":{"code":"UnknownError","message":"Internal error message."}}}}}}},"description":"put /api/v2/users/{user}/grouplist/"},{"description":"get /api/v2/groups","tests":[{"operation":{"tag":"group","operationId":"getAllGroup","parameters":[],"response":{"statusCode":200,"schema":{"description":"Array with all groups in the system.","type":"array","items":{"type":"object","properties":{"groupname":{"type":"string","description":"group name"},"description":{"type":"string","description":"description for the group"},"externalName":{"type":"string","description":"the external group name binding with the group in OpenPAI"},"extension":{"type":"object"}}}},"contentType":"application/json"}}}],"schemas":{"200":{"description":"Succeeded","content":{"application/json":{"schema":{"description":"Array with all groups in the system.","type":"array","items":{"type":"object","properties":{"groupname":{"type":"string","description":"group name"},"description":{"type":"string","description":"description for the group"},"externalName":{"type":"string","description":"the external group name binding with the group in OpenPAI"},"extension":{"type":"object"}}}},"example":[{"groupname":"groupName","description":"description","externalName":"externalName","extension":{}}]}}},"500":{"description":"UnknownError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"UnknownError":{"value":{"code":"UnknownError","message":"Internal error message."}}}}}}}},{"tests":[{"operation":{"tag":"group","operationId":"createGroup","parameters":[{"type":"raw","value":{"groupname":"sdktestgroup"}}],"response":{"statusCode":201,"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"contentType":"application/json"}}}],"after":[{"tag":"group","operationId":"deleteGroup","parameters":[{"type":"raw","value":"sdktestgroup"}],"response":{"statusCode":201,"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"contentType":"application/json"}}],"schemas":{"201":{"description":"Succeeded","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"example":{"message":"group is created successfully"}}}},"401":{"description":"UnauthorizedUserError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"UnauthorizedUserError":{"value":{"code":"UnauthorizedUserError","message":"Guest is not allowed to do this operation."}}}}}},"403":{"description":"ForbiddenUserError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"ForbiddenUserError":{"value":{"code":"ForbiddenUserError","message":"Non-admin is not allow to do this operation."}},"ForbiddenTokenError":{"value":{"code":"ForbiddenUserError","message":"Applications are not allowed to do this operation."}}}}}},"500":{"description":"UnknownError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"UnknownError":{"value":{"code":"UnknownError","message":"Internal error message."}}}}}}},"description":"post /api/v2/groups"},{"before":[{"tag":"group","operationId":"createGroup","parameters":[{"type":"raw","value":{"groupname":"sdktestgroup"}}],"response":{"statusCode":201,"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"contentType":"application/json"}}],"tests":[{"operation":{"parameters":[{"type":"raw","value":{"data":{"groupname":"sdktestgroup","description":"test update group"},"patch":true}}],"tag":"group","operationId":"updateGroup","response":{"statusCode":201,"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"contentType":"application/json"}}}],"after":[{"tag":"group","operationId":"deleteGroup","parameters":[{"type":"raw","value":"sdktestgroup"}],"response":{"statusCode":201,"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"contentType":"application/json"}}],"schemas":{"201":{"description":"Succeeded","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"example":{"message":"update group {groupname} successfully."}}}},"401":{"description":"UnauthorizedUserError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"UnauthorizedUserError":{"value":{"code":"UnauthorizedUserError","message":"Guest is not allowed to do this operation."}}}}}},"403":{"description":"ForbiddenUserError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"ForbiddenUserError":{"value":{"code":"ForbiddenUserError","message":"Non-admin is not allow to do this operation."}},"ForbiddenTokenError":{"value":{"code":"ForbiddenUserError","message":"Applications are not allowed to do this operation."}}}}}},"404":{"description":"NoGroupError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"NoGroupError":{"value":{"code":"NoGroupError","message":"Group {groupname} is not found."}}}}}},"500":{"description":"UnknownError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"UnknownError":{"value":{"code":"UnknownError","message":"Internal error message."}}}}}}},"description":"put /api/v2/groups"},{"before":[{"tag":"group","operationId":"createGroup","parameters":[{"type":"raw","value":{"groupname":"sdktestgroup"}}],"response":{"statusCode":201,"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"contentType":"application/json"}}],"tests":[{"operation":{"parameters":[{"type":"raw","value":"sdktestgroup"}],"tag":"group","operationId":"getGroup","response":{"statusCode":200,"schema":{"type":"object","properties":{"groupname":{"type":"string","description":"group name"},"description":{"type":"string","description":"description for the group"},"externalName":{"type":"string","description":"the external group name binding with the group in OpenPAI"},"extension":{"type":"object"}},"required":["groupname","description","externalName","extension"]},"contentType":"application/json"}}}],"after":[{"tag":"group","operationId":"deleteGroup","parameters":[{"type":"raw","value":"sdktestgroup"}],"response":{"statusCode":201,"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"contentType":"application/json"}}],"schemas":{"200":{"description":"Succeeded","content":{"application/json":{"schema":{"type":"object","properties":{"groupname":{"type":"string","description":"group name"},"description":{"type":"string","description":"description for the group"},"externalName":{"type":"string","description":"the external group name binding with the group in OpenPAI"},"extension":{"type":"object"}},"required":["groupname","description","externalName","extension"]},"example":{"groupname":"groupName","description":"description","externalName":"externalName","extension":{}}}}},"401":{"description":"UnauthorizedUserError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"UnauthorizedUserError":{"value":{"code":"UnauthorizedUserError","message":"Guest is not allowed to do this operation."}}}}}},"404":{"description":"NoGroupError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"NoGroupError":{"value":{"code":"NoGroupError","message":"Group {groupname} is not found."}}}}}},"500":{"description":"UnknownError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"UnknownError":{"value":{"code":"UnknownError","message":"Internal error message."}}}}}}},"description":"get /api/v2/groups/{group}"},{"before":[{"tag":"group","operationId":"createGroup","parameters":[{"type":"raw","value":{"groupname":"sdktestgroup"}}],"response":{"statusCode":201,"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"contentType":"application/json"}}],"tests":[{"operation":{"tag":"group","operationId":"deleteGroup","parameters":[{"type":"raw","value":"sdktestgroup"}],"response":{"statusCode":201,"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"contentType":"application/json"}}}],"schemas":{"201":{"description":"Succeeded","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"example":{"message":"group is removed successfully"}}}},"401":{"description":"UnauthorizedUserError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"UnauthorizedUserError":{"value":{"code":"UnauthorizedUserError","message":"Guest is not allowed to do this operation."}}}}}},"403":{"description":"ForbiddenUserError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"ForbiddenUserError":{"value":{"code":"ForbiddenUserError","message":"Non-admin is not allow to do this operation."}},"ForbiddenTokenError":{"value":{"code":"ForbiddenUserError","message":"Applications are not allowed to do this operation."}}}}}},"500":{"description":"UnknownError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"UnknownError":{"value":{"code":"UnknownError","message":"Internal error message."}}}}}}},"description":"delete /api/v2/groups/{group}"},{"description":"get /api/v2/groups/{group}/userlist","tests":[{"operation":{"tag":"group","operationId":"getGroupMembers","parameters":[],"response":{"statusCode":200,"schema":{"description":"Array with all users in the group.","type":"array","items":{"type":"object","properties":{"username":{"type":"string","description":"user name"},"clusterAdmin":{"type":"boolean","description":"Cluster admin or not."}}}},"contentType":"application/json"}}}],"schemas":{"200":{"description":"Succeeded","content":{"application/json":{"schema":{"description":"Array with all users in the group.","type":"array","items":{"type":"object","properties":{"username":{"type":"string","description":"user name"},"clusterAdmin":{"type":"boolean","description":"Cluster admin or not."}}}},"example":[{"username":"username","clusterAdmin":false}]}}},"401":{"description":"UnauthorizedUserError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"UnauthorizedUserError":{"value":{"code":"UnauthorizedUserError","message":"Guest is not allowed to do this operation."}}}}}},"500":{"description":"UnknownError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"UnknownError":{"value":{"code":"UnknownError","message":"Internal error message."}}}}}}}},{"description":"get /api/v2/virtual-clusters","tests":[{"operation":{"tag":"virtual cluster","operationId":"listVirtualClusters","parameters":[],"response":{"statusCode":200,"schema":{"type":"object","additionalProperties":{"type":"object","properties":{"capacity":{"type":"number","description":"capacity percentage this virtual cluster can use of entire cluster"},"usedCapacity":{"type":"number","description":"used capacity percentage this virtual cluster can use of entire cluster"},"maxCapacity":{"type":"number","description":"max capacity percentage this virtual cluster can use of entire cluster"},"dedicated":{"type":"boolean","description":"dedicated virtual cluster or not"},"resourcesUsed":{"type":"object","description":"used resources","properties":{"cpu":{"type":"integer","description":"used cpu number"},"vCores":{"type":"integer","description":"same as cpu"},"memory":{"type":"integer","description":"used memory in MB"},"gpu":{"type":"integer","description":"used gpu number"},"GPUs":{"type":"integer","description":"same as gpu"}}},"resourcesGuaranteed":{"type":"object","description":"guaranteed resources, including used and free","properties":{"cpu":{"type":"integer","description":"guaranteed cpu number"},"vCores":{"type":"integer","description":"same as cpu"},"memory":{"type":"integer","description":"guaranteed memory in MB"},"gpu":{"type":"integer","description":"guaranteed gpu number"},"GPUs":{"type":"integer","description":"same as gpu"}}},"resourcesTotal":{"type":"object","description":"total resources, including guaranteed and bad","properties":{"cpu":{"type":"integer","description":"total cpu number"},"vCores":{"type":"integer","description":"same as cpu"},"memory":{"type":"integer","description":"total memory in MB"},"gpu":{"type":"integer","description":"total gpu number"},"GPUs":{"type":"integer","description":"same as gpu"}}}},"required":["capacity","usedCapacity","maxCapacity","resourcesUsed","resourcesGuaranteed","resourcesTotal"]}},"contentType":"application/json"}}}],"schemas":{"200":{"description":"Succeeded","content":{"application/json":{"schema":{"type":"object","additionalProperties":{"type":"object","properties":{"capacity":{"type":"number","description":"capacity percentage this virtual cluster can use of entire cluster"},"usedCapacity":{"type":"number","description":"used capacity percentage this virtual cluster can use of entire cluster"},"maxCapacity":{"type":"number","description":"max capacity percentage this virtual cluster can use of entire cluster"},"dedicated":{"type":"boolean","description":"dedicated virtual cluster or not"},"resourcesUsed":{"type":"object","description":"used resources","properties":{"cpu":{"type":"integer","description":"used cpu number"},"vCores":{"type":"integer","description":"same as cpu"},"memory":{"type":"integer","description":"used memory in MB"},"gpu":{"type":"integer","description":"used gpu number"},"GPUs":{"type":"integer","description":"same as gpu"}}},"resourcesGuaranteed":{"type":"object","description":"guaranteed resources, including used and free","properties":{"cpu":{"type":"integer","description":"guaranteed cpu number"},"vCores":{"type":"integer","description":"same as cpu"},"memory":{"type":"integer","description":"guaranteed memory in MB"},"gpu":{"type":"integer","description":"guaranteed gpu number"},"GPUs":{"type":"integer","description":"same as gpu"}}},"resourcesTotal":{"type":"object","description":"total resources, including guaranteed and bad","properties":{"cpu":{"type":"integer","description":"total cpu number"},"vCores":{"type":"integer","description":"same as cpu"},"memory":{"type":"integer","description":"total memory in MB"},"gpu":{"type":"integer","description":"total gpu number"},"GPUs":{"type":"integer","description":"same as gpu"}}}},"required":["capacity","usedCapacity","maxCapacity","resourcesUsed","resourcesGuaranteed","resourcesTotal"]}}}}},"500":{"description":"UnknownError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"UnknownError":{"value":{"code":"UnknownError","message":"Internal error message."}}}}}}}},{"tests":[{"operation":{"parameters":[{"type":"raw","value":"default"}],"tag":"virtual cluster","operationId":"getVirtualCluster","response":{"statusCode":200,"schema":{"type":"object","properties":{"capacity":{"type":"number","description":"capacity percentage this virtual cluster can use of entire cluster"},"usedCapacity":{"type":"number","description":"used capacity percentage this virtual cluster can use of entire cluster"},"maxCapacity":{"type":"number","description":"max capacity percentage this virtual cluster can use of entire cluster"},"dedicated":{"type":"boolean","description":"dedicated virtual cluster or not"},"resourcesUsed":{"type":"object","description":"used resources","properties":{"cpu":{"type":"integer","description":"used cpu number"},"vCores":{"type":"integer","description":"same as cpu"},"memory":{"type":"integer","description":"used memory in MB"},"gpu":{"type":"integer","description":"used gpu number"},"GPUs":{"type":"integer","description":"same as gpu"}}},"resourcesGuaranteed":{"type":"object","description":"guaranteed resources, including used and free","properties":{"cpu":{"type":"integer","description":"guaranteed cpu number"},"vCores":{"type":"integer","description":"same as cpu"},"memory":{"type":"integer","description":"guaranteed memory in MB"},"gpu":{"type":"integer","description":"guaranteed gpu number"},"GPUs":{"type":"integer","description":"same as gpu"}}},"resourcesTotal":{"type":"object","description":"total resources, including guaranteed and bad","properties":{"cpu":{"type":"integer","description":"total cpu number"},"vCores":{"type":"integer","description":"same as cpu"},"memory":{"type":"integer","description":"total memory in MB"},"gpu":{"type":"integer","description":"total gpu number"},"GPUs":{"type":"integer","description":"same as gpu"}}}},"required":["capacity","usedCapacity","maxCapacity","resourcesUsed","resourcesGuaranteed","resourcesTotal"]},"contentType":"application/json"}}}],"schemas":{"200":{"description":"Succeeded","content":{"application/json":{"schema":{"type":"object","properties":{"capacity":{"type":"number","description":"capacity percentage this virtual cluster can use of entire cluster"},"usedCapacity":{"type":"number","description":"used capacity percentage this virtual cluster can use of entire cluster"},"maxCapacity":{"type":"number","description":"max capacity percentage this virtual cluster can use of entire cluster"},"dedicated":{"type":"boolean","description":"dedicated virtual cluster or not"},"resourcesUsed":{"type":"object","description":"used resources","properties":{"cpu":{"type":"integer","description":"used cpu number"},"vCores":{"type":"integer","description":"same as cpu"},"memory":{"type":"integer","description":"used memory in MB"},"gpu":{"type":"integer","description":"used gpu number"},"GPUs":{"type":"integer","description":"same as gpu"}}},"resourcesGuaranteed":{"type":"object","description":"guaranteed resources, including used and free","properties":{"cpu":{"type":"integer","description":"guaranteed cpu number"},"vCores":{"type":"integer","description":"same as cpu"},"memory":{"type":"integer","description":"guaranteed memory in MB"},"gpu":{"type":"integer","description":"guaranteed gpu number"},"GPUs":{"type":"integer","description":"same as gpu"}}},"resourcesTotal":{"type":"object","description":"total resources, including guaranteed and bad","properties":{"cpu":{"type":"integer","description":"total cpu number"},"vCores":{"type":"integer","description":"same as cpu"},"memory":{"type":"integer","description":"total memory in MB"},"gpu":{"type":"integer","description":"total gpu number"},"GPUs":{"type":"integer","description":"same as gpu"}}}},"required":["capacity","usedCapacity","maxCapacity","resourcesUsed","resourcesGuaranteed","resourcesTotal"]},"example":{"capacity":70,"usedCapacity":30,"dedicated":false,"resourcesUsed":{"cpu":1,"memory":1024,"gpu":1,"vCores":1,"GPUs":1},"resourcesGuaranteed":{"cpu":2,"memory":2048,"gpu":2,"vCores":2,"GPUs":2},"resourcesTotal":{"cpu":2,"memory":2048,"gpu":2,"vCores":2,"GPUs":2},"maxCapacity":70}}}},"404":{"description":"NoVirtualClusterError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"NoVirtualClusterError":{"value":{"code":"NoVirtualClusterError","message":"Virtual cluster {vc} is not found."}}}}}},"500":{"description":"UnknownError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"UnknownError":{"value":{"code":"UnknownError","message":"Internal error message."}}}}}}},"description":"get /api/v2/virtual-clusters/{vc}"},{"description":"get /api/v2/storages","tests":[{"operation":{"tag":"storage","operationId":"getStorages","parameters":[],"response":{"statusCode":200,"schema":{"type":"object","description":"summary of configured PV storage","properties":{"storages":{"type":"array","items":{"type":"object","description":"summary of each storage","properties":{"name":{"type":"string"},"share":{"type":"boolean"},"volumeName":{"type":"string"}},"required":["name","share","volumeName"]}}},"required":["storages"]},"contentType":"application/json"}}}],"schemas":{"200":{"description":"Succeeded","content":{"application/json":{"schema":{"type":"object","description":"summary of configured PV storage","properties":{"storages":{"type":"array","items":{"type":"object","description":"summary of each storage","properties":{"name":{"type":"string"},"share":{"type":"boolean"},"volumeName":{"type":"string"}},"required":["name","share","volumeName"]}}},"required":["storages"]},"example":{"storages":[{"name":"name","share":true,"volumeName":"volumeName"}]}}}},"500":{"description":"UnknownError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"UnknownError":{"value":{"code":"UnknownError","message":"Internal error message."}}}}}}}},{"before":[{"tag":"storage","operationId":"getStorages"}],"tests":[{"operation":{"parameters":[{"type":"fromResult","resultType":"beforeResults","resultPath":["storages",0,"name"],"resultIndex":0}],"tag":"storage","operationId":"getStorage","response":{"statusCode":200,"schema":{"type":"object","description":"detail of configured PV storage","properties":{"name":{"type":"string"},"share":{"type":"boolean"},"volumeName":{"type":"string"},"type":{"type":"string","enum":["nfs","samba","azureFile","azureBlob","other","unknown"]},"data":{"anyOf":[{"type":"object","description":"nfs type","properties":{"server":{"type":"string"},"path":{"type":"string"}},"required":["server","path"]},{"type":"object","description":"samba type","properties":{"address":{"type":"string"},"username":{"type":"string"},"password":{"type":"string"}},"required":["address"]},{"type":"object","description":"azureFile type","properties":{"shareName":{"type":"string"},"accountName":{"type":"string"},"accountKey":{"type":"string"}},"required":["shareName"]},{"type":"object","description":"azureBlob type","properties":{"containerName":{"type":"string"},"accountName":{"type":"string"},"accountKey":{"type":"string"},"accountSASToken":{"type":"string"}},"required":["containerName"]},{"type":"object","description":"other/unknown type","properties":{}}]},"readOnly":{"type":"boolean"},"secretName":{"type":"string"},"mountOptions":{"type":"array","items":{"type":"string"}}},"required":["name","share","volumeName","type","data"]},"contentType":"application/json"}}}],"schemas":{"200":{"description":"Succeeded","content":{"application/json":{"schema":{"type":"object","description":"detail of configured PV storage","properties":{"name":{"type":"string"},"share":{"type":"boolean"},"volumeName":{"type":"string"},"type":{"type":"string","enum":["nfs","samba","azureFile","azureBlob","other","unknown"]},"data":{"anyOf":[{"type":"object","description":"nfs type","properties":{"server":{"type":"string"},"path":{"type":"string"}},"required":["server","path"]},{"type":"object","description":"samba type","properties":{"address":{"type":"string"},"username":{"type":"string"},"password":{"type":"string"}},"required":["address"]},{"type":"object","description":"azureFile type","properties":{"shareName":{"type":"string"},"accountName":{"type":"string"},"accountKey":{"type":"string"}},"required":["shareName"]},{"type":"object","description":"azureBlob type","properties":{"containerName":{"type":"string"},"accountName":{"type":"string"},"accountKey":{"type":"string"},"accountSASToken":{"type":"string"}},"required":["containerName"]},{"type":"object","description":"other/unknown type","properties":{}}]},"readOnly":{"type":"boolean"},"secretName":{"type":"string"},"mountOptions":{"type":"array","items":{"type":"string"}}},"required":["name","share","volumeName","type","data"]},"example":{"name":"nfs-storage-name","share":true,"volumeName":"nfs-volume-name","type":"nfs","data":{"server":"","path":"/data"}}}}},"403":{"description":"ForbiddenUserError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"ForbiddenUserError":{"value":{"code":"ForbiddenUserError","message":"User {user} is not allowed to access {storage}."}}}}}},"404":{"description":"NoStorageError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"NoVirtualClusterError":{"value":{"code":"NoStorageError","message":"Storage {storage} is not found."}}}}}},"500":{"description":"UnknownError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"UnknownError":{"value":{"code":"UnknownError","message":"Internal error message."}}}}}}},"description":"get /api/v2/storages/{storage}"},{"tests":[{"operation":{"tag":"job","operationId":"createJob","parameters":[{"type":"raw","value":{"contributor":"OpenPAI","description":"# Serving a TensorFlow MNIST Digit Recognition Model\nThis example shows you how to use TensorFlow Serving components to export a trained TensorFlow model\nand use the standard tensorflow_model_server to serve it on OpenPAI.\nThis example uses the simple Softmax Regression model introduced in the TensorFlow tutorial for handwritten image (MNIST data) classification.\nReference https://www.tensorflow.org/tfx/serving/serving_basic.\n","name":"sdk_test_job455c4fae","parameters":{"modelPath":"/tmp/mnist_model"},"prerequisites":[{"contributor":"OpenPAI","description":"This is an [example TensorFlow Serving Docker image on OpenPAI](https://github.com/Microsoft/pai/tree/master/examples/serving).\n","name":"tf_serving_example","protocolVersion":2,"type":"dockerimage","uri":"openpai/pai.example.tensorflow-serving","version":"1.0-r1.4"}],"protocolVersion":2,"taskRoles":{"worker":{"commands":["bazel-bin/tensorflow_serving/example/mnist_saved_model <% $parameters.modelPath %>","tensorflow_model_server --port=$PAI_CONTAINER_HOST_model_server_PORT_LIST --model_name=mnist --model_base_path=<% $parameters.modelPath %>"],"dockerImage":"tf_serving_example","instances":1,"resourcePerInstance":{"cpu":4,"gpu":1,"memoryMB":8192,"ports":{"model_server":1}}}},"type":"job","version":"1.0"}}],"response":{"statusCode":202,"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"contentType":"application/json"}}}],"after":[{"tag":"job","operationId":"updateJobExecutionType","parameters":[{"type":"raw","value":"sdk_test"},{"type":"raw","value":"sdk_test_job455c4fae"},{"type":"raw","value":"STOP"}]}],"schemas":{"202":{"description":"Succeeded","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"example":{"message":"update job {job} successfully"}}}},"400":{"description":"NoVirtualClusterError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"NoVirtualClusterError":{"value":{"code":"NoVirtualClusterError","message":"Virtual cluster {vc} is not found."}}}}}},"403":{"description":"ForbiddenUserError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"ForbiddenUserError":{"value":{"code":"ForbiddenUserError","message":"Non-admin is not allow to do this operation."}},"ForbiddenTokenError":{"value":{"code":"ForbiddenUserError","message":"Applications are not allowed to do this operation."}}}}}},"409":{"description":"ConflictJobError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"ConflictJobError":{"value":{"code":"ConflictJobError","message":"Job name {job} already exists."}}}}}},"500":{"description":"UnknownError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"UnknownError":{"value":{"code":"UnknownError","message":"Internal error message."}}}}}}},"description":"post /api/v2/jobs"},{"description":"get /api/v2/jobs","tests":[{"operation":{"tag":"job","operationId":"listJobs","parameters":[],"response":{"statusCode":200,"schema":{"type":"array","description":"job summary list","items":{"type":"object","properties":{"name":{"type":"string","description":"job name"},"username":{"type":"string","description":"user name or \"unknown\""},"state":{"type":"string","description":"general job state","enum":["WAITING","RUNNING","STOPPING","STOPPED","SUCCEEDED","FAILED","UNKNOWN"]},"subState":{"type":"string","description":"job state in framework controller","enum":["AttemptCreationPending","AttemptCreationRequested","AttemptPreparing","AttemptRunning","AttemptDeletionPending","AttemptDeletionRequested","AttemptDeleting","AttemptCompleted","Completed"]},"executionType":{"type":"string","description":"start or stop","enum":["START","STOP"]},"retries":{"type":"integer","description":"job retried times"},"retryDetails":{"type":"object","properties":{"user":{"type":"integer"},"platform":{"type":"integer"},"resource":{"type":"integer"}}},"retryDelayTime":{"type":"integer","nullable":true,"description":"retry delay time"},"createdTime":{"type":"integer","description":"job created time, in number of milliseconds since the Unix Epoch."},"completedTime":{"type":"integer","nullable":true,"description":"job completed time, in number of milliseconds since the Unix Epoch."},"appExitCode":{"type":"integer","nullable":true,"description":"job exit code"},"virtualCluster":{"type":"string","description":"virtual cluster to which the job submitted, or \"unknown\""},"totalGpuNumber":{"type":"integer","description":"total gpu number used in the job"},"totalTaskNumber":{"type":"integer","description":"total task number used in the job"},"totalTaskRoleNumber":{"type":"integer","description":"total task role number used in the job"},"debugId":{"type":"string","description":"md5 hash name for the job in framework controller, used for debug purpose"}},"required":["name","username","virtualCluster","state","subState","executionType","retries","createdTime","completedTime","appExitCode"]}},"contentType":"application/json"}}}],"schemas":{"200":{"description":"Succeeded","content":{"application/json":{"schema":{"type":"array","description":"job summary list","items":{"type":"object","properties":{"name":{"type":"string","description":"job name"},"username":{"type":"string","description":"user name or \"unknown\""},"state":{"type":"string","description":"general job state","enum":["WAITING","RUNNING","STOPPING","STOPPED","SUCCEEDED","FAILED","UNKNOWN"]},"subState":{"type":"string","description":"job state in framework controller","enum":["AttemptCreationPending","AttemptCreationRequested","AttemptPreparing","AttemptRunning","AttemptDeletionPending","AttemptDeletionRequested","AttemptDeleting","AttemptCompleted","Completed"]},"executionType":{"type":"string","description":"start or stop","enum":["START","STOP"]},"retries":{"type":"integer","description":"job retried times"},"retryDetails":{"type":"object","properties":{"user":{"type":"integer"},"platform":{"type":"integer"},"resource":{"type":"integer"}}},"retryDelayTime":{"type":"integer","nullable":true,"description":"retry delay time"},"createdTime":{"type":"integer","description":"job created time, in number of milliseconds since the Unix Epoch."},"completedTime":{"type":"integer","nullable":true,"description":"job completed time, in number of milliseconds since the Unix Epoch."},"appExitCode":{"type":"integer","nullable":true,"description":"job exit code"},"virtualCluster":{"type":"string","description":"virtual cluster to which the job submitted, or \"unknown\""},"totalGpuNumber":{"type":"integer","description":"total gpu number used in the job"},"totalTaskNumber":{"type":"integer","description":"total task number used in the job"},"totalTaskRoleNumber":{"type":"integer","description":"total task role number used in the job"},"debugId":{"type":"string","description":"md5 hash name for the job in framework controller, used for debug purpose"}},"required":["name","username","virtualCluster","state","subState","executionType","retries","createdTime","completedTime","appExitCode"]}},"example":[{"protocolVersion":"2","name":"job name","username":"user name","state":"SUCCEEDED","subState":"Completed","executionType":"STOP","retries":0,"createdTime":0,"completedTime":0,"appExitCode":0,"virtualCluster":"unknown"}]}}},"500":{"description":"UnknownError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"UnknownError":{"value":{"code":"UnknownError","message":"Internal error message."}}}}}}}},{"before":[{"tag":"job","operationId":"createJob","parameters":[{"type":"raw","value":{"contributor":"OpenPAI","description":"# Serving a TensorFlow MNIST Digit Recognition Model\nThis example shows you how to use TensorFlow Serving components to export a trained TensorFlow model\nand use the standard tensorflow_model_server to serve it on OpenPAI.\nThis example uses the simple Softmax Regression model introduced in the TensorFlow tutorial for handwritten image (MNIST data) classification.\nReference https://www.tensorflow.org/tfx/serving/serving_basic.\n","name":"sdk_test_jobd0c1a61c","parameters":{"modelPath":"/tmp/mnist_model"},"prerequisites":[{"contributor":"OpenPAI","description":"This is an [example TensorFlow Serving Docker image on OpenPAI](https://github.com/Microsoft/pai/tree/master/examples/serving).\n","name":"tf_serving_example","protocolVersion":2,"type":"dockerimage","uri":"openpai/pai.example.tensorflow-serving","version":"1.0-r1.4"}],"protocolVersion":2,"taskRoles":{"worker":{"commands":["bazel-bin/tensorflow_serving/example/mnist_saved_model <% $parameters.modelPath %>","tensorflow_model_server --port=$PAI_CONTAINER_HOST_model_server_PORT_LIST --model_name=mnist --model_base_path=<% $parameters.modelPath %>"],"dockerImage":"tf_serving_example","instances":1,"resourcePerInstance":{"cpu":4,"gpu":1,"memoryMB":8192,"ports":{"model_server":1}}}},"type":"job","version":"1.0"}}]}],"tests":[{"description":"Get a job detail","operation":{"parameters":[{"type":"raw","value":"sdk_test"},{"type":"raw","value":"sdk_test_jobd0c1a61c"}],"tag":"job","operationId":"getJob","response":{"statusCode":200,"schema":{"type":"object","description":"job details","properties":{"name":{"type":"string","description":"job name"},"jobStatus":{"type":"object","description":"job status","properties":{"username":{"type":"string","description":"user name or \"unknown\""},"state":{"type":"string","description":"general job state","enum":["WAITING","RUNNING","STOPPING","STOPPED","SUCCEEDED","FAILED","UNKNOWN"]},"subState":{"type":"string","description":"job state in framework controller","enum":["AttemptCreationPending","AttemptCreationRequested","AttemptPreparing","AttemptRunning","AttemptDeletionPending","AttemptDeletionRequested","AttemptDeleting","AttemptCompleted","Completed"]},"executionType":{"type":"string","description":"start or stop","enum":["START","STOP"]},"retries":{"type":"integer","description":"job retried times"},"retryDetails":{"type":"object","properties":{"user":{"type":"integer"},"platform":{"type":"integer"},"resource":{"type":"integer"}}},"retryDelayTime":{"type":"integer","nullable":true,"description":"retry delay time"},"createdTime":{"type":"integer","description":"job created time, in number of milliseconds since the Unix Epoch."},"completedTime":{"type":"integer","nullable":true,"description":"job completed time, in number of milliseconds since the Unix Epoch."},"appId":{"type":"string","description":"unique id for the job"},"appLaunchedTime":{"type":"integer","nullable":true,"description":"job launched time for last attempt, in number of milliseconds since the Unix Epoch."},"appCompletedTime":{"type":"integer","nullable":true,"description":"job completed time for last attempt, in number of milliseconds since the Unix Epoch. to get durations for last attempt:\n wholeDuration = completedTime - createdTime;\n runningDuration = appCompletedTime - appLaunchedTime;\n waitingDuration = wholeDuration - runningDuration.\nto get durations for all attempts:\n runningDuration = sum(appCompletedTime - appLaunchedTime) for all attempts.\n"},"appExitCode":{"type":"integer","nullable":true,"description":"job exit code"},"appExitSpec":{"type":"object","nullable":true,"description":"job exit spec","properties":{"code":{"type":"integer"},"phrase":{"type":"string"},"issuer":{"type":"string"},"causer":{"type":"string"},"type":{"type":"string"},"stage":{"type":"string"},"behavior":{"type":"string"},"reaction":{"type":"string"},"repro":{"type":"array","items":{"type":"string"}}}},"appExitDiagnostics":{"type":"string","nullable":true,"description":"job exit diagnostics"},"appExitMessages":{"type":"object","nullable":true,"properties":{"container":{"type":"string","nullable":true},"runtime":{"type":"string","nullable":true},"launcher":{"type":"string","nullable":true}}},"appExitTriggerMessage":{"type":"string","nullable":true,"description":"job completion message"},"appExitTriggerTaskRoleName":{"type":"string","nullable":true,"description":"task role name which triggered job completion"},"appExitTriggerTaskIndex":{"type":"integer","nullable":true,"description":"task index which triggered job completion"},"appExitType":{"type":"string","nullable":true,"description":"job completion type"},"virtualCluster":{"type":"string","description":"virtual cluster to which the job submitted, or \"unknown\""}},"required":["username","virtualCluster","state","subState","executionType","retries","createdTime","completedTime","appId","appLaunchedTime","appCompletedTime","appExitCode"]},"taskRoles":{"type":"object","additionalProperties":{"type":"object","description":"task role status","properties":{"taskRoleStatus":{"type":"object","properties":{"name":{"type":"string","description":"task role name"}},"required":["name"]},"taskStatuses":{"type":"array","description":"task statuses in the task role","items":{"type":"object","properties":{"taskIndex":{"type":"integer","description":"task index"},"taskState":{"type":"string","description":"task state","enum":["WAITING","RUNNING","STOPPING","STOPPED","SUCCEEDED","FAILED","UNKNOWN"]},"containerId":{"type":"string","description":"uid of the task container"},"containerIp":{"type":"string","description":"ip of the task container"},"containerPorts":{"type":"object","description":"ports of the task container"},"containerGpus":{"type":"string","nullable":true,"description":"gpu of the task container"},"containerLog":{"type":"string","description":"log url of the task container"},"containerExitCode":{"type":"integer","nullable":true,"description":"exit code the task container"}}}}},"required":["taskRoleStatus","taskStatuses"]}},"debugId":{"type":"string","description":"md5 hash name for the job in framework controller, used for debug purpose"}},"required":["name","jobStatus","taskRoles"]},"contentType":"application/json"}}},{"description":"Get nonexist job detail","operation":{"parameters":[{"type":"raw","value":"sdk_test"},{"type":"raw","value":"sdk_test_nonexist_job"}],"response":{"statusCode":404,"schema":{"description":"NoJobError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"NoJobError":{"value":{"code":"NoJobError","message":"Job {job} is not found."}}}}}}},"tag":"job","operationId":"getJob"}}],"after":[{"tag":"job","operationId":"updateJobExecutionType","parameters":[{"type":"raw","value":"sdk_test"},{"type":"raw","value":"sdk_test_jobd0c1a61c"},{"type":"raw","value":"STOP"}]}],"schemas":{"200":{"description":"Succeeded","content":{"application/json":{"schema":{"type":"object","description":"job details","properties":{"name":{"type":"string","description":"job name"},"jobStatus":{"type":"object","description":"job status","properties":{"username":{"type":"string","description":"user name or \"unknown\""},"state":{"type":"string","description":"general job state","enum":["WAITING","RUNNING","STOPPING","STOPPED","SUCCEEDED","FAILED","UNKNOWN"]},"subState":{"type":"string","description":"job state in framework controller","enum":["AttemptCreationPending","AttemptCreationRequested","AttemptPreparing","AttemptRunning","AttemptDeletionPending","AttemptDeletionRequested","AttemptDeleting","AttemptCompleted","Completed"]},"executionType":{"type":"string","description":"start or stop","enum":["START","STOP"]},"retries":{"type":"integer","description":"job retried times"},"retryDetails":{"type":"object","properties":{"user":{"type":"integer"},"platform":{"type":"integer"},"resource":{"type":"integer"}}},"retryDelayTime":{"type":"integer","nullable":true,"description":"retry delay time"},"createdTime":{"type":"integer","description":"job created time, in number of milliseconds since the Unix Epoch."},"completedTime":{"type":"integer","nullable":true,"description":"job completed time, in number of milliseconds since the Unix Epoch."},"appId":{"type":"string","description":"unique id for the job"},"appLaunchedTime":{"type":"integer","nullable":true,"description":"job launched time for last attempt, in number of milliseconds since the Unix Epoch."},"appCompletedTime":{"type":"integer","nullable":true,"description":"job completed time for last attempt, in number of milliseconds since the Unix Epoch. to get durations for last attempt:\n wholeDuration = completedTime - createdTime;\n runningDuration = appCompletedTime - appLaunchedTime;\n waitingDuration = wholeDuration - runningDuration.\nto get durations for all attempts:\n runningDuration = sum(appCompletedTime - appLaunchedTime) for all attempts.\n"},"appExitCode":{"type":"integer","nullable":true,"description":"job exit code"},"appExitSpec":{"type":"object","nullable":true,"description":"job exit spec","properties":{"code":{"type":"integer"},"phrase":{"type":"string"},"issuer":{"type":"string"},"causer":{"type":"string"},"type":{"type":"string"},"stage":{"type":"string"},"behavior":{"type":"string"},"reaction":{"type":"string"},"repro":{"type":"array","items":{"type":"string"}}}},"appExitDiagnostics":{"type":"string","nullable":true,"description":"job exit diagnostics"},"appExitMessages":{"type":"object","nullable":true,"properties":{"container":{"type":"string","nullable":true},"runtime":{"type":"string","nullable":true},"launcher":{"type":"string","nullable":true}}},"appExitTriggerMessage":{"type":"string","nullable":true,"description":"job completion message"},"appExitTriggerTaskRoleName":{"type":"string","nullable":true,"description":"task role name which triggered job completion"},"appExitTriggerTaskIndex":{"type":"integer","nullable":true,"description":"task index which triggered job completion"},"appExitType":{"type":"string","nullable":true,"description":"job completion type"},"virtualCluster":{"type":"string","description":"virtual cluster to which the job submitted, or \"unknown\""}},"required":["username","virtualCluster","state","subState","executionType","retries","createdTime","completedTime","appId","appLaunchedTime","appCompletedTime","appExitCode"]},"taskRoles":{"type":"object","additionalProperties":{"type":"object","description":"task role status","properties":{"taskRoleStatus":{"type":"object","properties":{"name":{"type":"string","description":"task role name"}},"required":["name"]},"taskStatuses":{"type":"array","description":"task statuses in the task role","items":{"type":"object","properties":{"taskIndex":{"type":"integer","description":"task index"},"taskState":{"type":"string","description":"task state","enum":["WAITING","RUNNING","STOPPING","STOPPED","SUCCEEDED","FAILED","UNKNOWN"]},"containerId":{"type":"string","description":"uid of the task container"},"containerIp":{"type":"string","description":"ip of the task container"},"containerPorts":{"type":"object","description":"ports of the task container"},"containerGpus":{"type":"string","nullable":true,"description":"gpu of the task container"},"containerLog":{"type":"string","description":"log url of the task container"},"containerExitCode":{"type":"integer","nullable":true,"description":"exit code the task container"}}}}},"required":["taskRoleStatus","taskStatuses"]}},"debugId":{"type":"string","description":"md5 hash name for the job in framework controller, used for debug purpose"}},"required":["name","jobStatus","taskRoles"]},"example":{"name":"job name","jobStatus":{"username":"user name","state":"SUCCEEDED","subState":"Completed","executionType":"STOP","retries":0,"createdTime":0,"completedTime":0,"appId":"id","appLaunchedTime":0,"appCompletedTime":0,"appExitCode":0,"virtualCluster":"unknown"},"taskRoles":{"taskrole":{"taskRoleStatus":{"name":"task role name"},"taskStatuses":[{"taskIndex":0,"taskState":"SUCCEEDED"}]}}}}}},"404":{"description":"NoJobError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"NoJobError":{"value":{"code":"NoJobError","message":"Job {job} is not found."}}}}}},"500":{"description":"UnknownError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"UnknownError":{"value":{"code":"UnknownError","message":"Internal error message."}}}}}}},"description":"get /api/v2/jobs/{user}~{job}"},{"before":[{"tag":"job","operationId":"createJob","parameters":[{"type":"raw","value":{"contributor":"OpenPAI","description":"# Serving a TensorFlow MNIST Digit Recognition Model\nThis example shows you how to use TensorFlow Serving components to export a trained TensorFlow model\nand use the standard tensorflow_model_server to serve it on OpenPAI.\nThis example uses the simple Softmax Regression model introduced in the TensorFlow tutorial for handwritten image (MNIST data) classification.\nReference https://www.tensorflow.org/tfx/serving/serving_basic.\n","name":"sdk_test_jobd3d3b60d","parameters":{"modelPath":"/tmp/mnist_model"},"prerequisites":[{"contributor":"OpenPAI","description":"This is an [example TensorFlow Serving Docker image on OpenPAI](https://github.com/Microsoft/pai/tree/master/examples/serving).\n","name":"tf_serving_example","protocolVersion":2,"type":"dockerimage","uri":"openpai/pai.example.tensorflow-serving","version":"1.0-r1.4"}],"protocolVersion":2,"taskRoles":{"worker":{"commands":["bazel-bin/tensorflow_serving/example/mnist_saved_model <% $parameters.modelPath %>","tensorflow_model_server --port=$PAI_CONTAINER_HOST_model_server_PORT_LIST --model_name=mnist --model_base_path=<% $parameters.modelPath %>"],"dockerImage":"tf_serving_example","instances":1,"resourcePerInstance":{"cpu":4,"gpu":1,"memoryMB":8192,"ports":{"model_server":1}}}},"type":"job","version":"1.0"}}]}],"tests":[{"description":"Get a job config","operation":{"parameters":[{"type":"raw","value":"sdk_test"},{"type":"raw","value":"sdk_test_jobd3d3b60d"}],"tag":"job","operationId":"getJobConfig","response":{"statusCode":200,"schema":{"type":"object","description":"openpai job protocol","properties":{"protocolVersion":{"oneOf":[{"type":"number"},{"type":"string"}],"description":"Protocol version, current version is 2."},"name":{"type":"string","maxLength":255,"description":"String in ^[a-zA-Z0-9_-]+$ format, no longer than 255 characters."},"type":{"type":"string","description":"Component type, should be \"job\" here."},"version":{"type":"string","description":"Component version, default is latest."},"contributor":{"type":"string"},"description":{"type":"string"},"prerequisites":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"type":{"type":"string","enum":["data","script","dockerimage","output"]},"version":{"type":"string"},"contributor":{"type":"string"},"description":{"type":"string"},"auth":{"type":"object","properties":{"username":{"type":"string"},"password":{"type":"string"},"registryuri":{"type":"string"}}},"uri":{"oneOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}]}}}},"parameters":{"type":"object","additionalProperties":true},"secrets":{"type":"object","additionalProperties":true},"jobRetryCount":{"type":"integer","description":"Default is 0."},"taskRoles":{"type":"object","additionalProperties":{"type":"object","properties":{"instances":{"type":"integer","description":"Default is 1, instances of a taskRole, no less than 1."},"completion":{"type":"object","description":"Completion poclicy for the job.","properties":{"minFailedInstances":{"type":"integer"},"minSucceededInstances":{"type":"integer"}}},"taskRetryCount":{"type":"integer","description":"Default is 0."},"dockerImage":{"type":"string","description":"Should reference to a dockerimage defined in prerequisites."},"data":{"type":"string"},"output":{"type":"string"},"script":{"type":"string"},"extraContainerOptions":{"type":"object","properties":{"shmMB":{"type":"integer","description":"Config the /dev/shm in a docker container."},"infiniband":{"type":"boolean","description":"Use InfiniBand devices or not in a docker container."}}},"resourcePerInstance":{"type":"object","properties":{"cpu":{"type":"integer","description":"CPU number, unit is CPU vcore."},"memoryMB":{"type":"integer","description":"Memory number, unit is MB."},"gpu":{"type":"integer","description":"GPU number, unit is GPU card."},"ports":{"type":"object","additionalProperties":{"type":"integer","description":"Port number for the port label."}}}},"commands":{"type":"array","items":{"type":"string"}}},"required":["dockerImage","resourcePerInstance","commands"]}},"deployments":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"taskRoles":{"type":"object","additionalProperties":{"type":"object","properties":{"preCommands":{"type":"array","items":{"type":"string"}},"postCommands":{"type":"array","items":{"type":"string"}}}}}}}},"defaults":{"type":"object","description":"Default cluster specific settings.","properties":{"virtualCluster":{"type":"string"},"deployment":{"type":"string"}}},"extras":{"type":"object","description":"Extra field, save any information that plugin may use.","properties":{"submitFrom":{"type":"string"},"hivedScheduler":{"type":"object","properties":{"jobPriorityClass":{"type":"string"},"taskRoles":{"type":"object","additionalProperties":{"type":"object","properties":{"skuType":{"type":"string"},"affinityGroupName":{"type":"string"}}}}}}}}},"required":["protocolVersion","name","type","taskRoles"]},"contentType":"text/yaml"}}},{"description":"Get nonexist job config","operation":{"parameters":[{"type":"raw","value":"sdk_test"},{"type":"raw","value":"sdk_test_nonexist_job"}],"response":{"statusCode":404,"schema":{"description":"NoJobError or NoJobConfigError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"NoJobError":{"value":{"code":"NoJobError","message":"Job {job} is not found."}},"NoJobConfigError":{"value":{"code":"NoJobConfigError","message":"Config of job {job} is not found."}}}}}}},"tag":"job","operationId":"getJobConfig"}}],"after":[{"tag":"job","operationId":"updateJobExecutionType","parameters":[{"type":"raw","value":"sdk_test"},{"type":"raw","value":"sdk_test_jobd3d3b60d"},{"type":"raw","value":"STOP"}]}],"schemas":{"200":{"description":"Succeeded","content":{"text/yaml":{"schema":{"type":"object","description":"openpai job protocol","properties":{"protocolVersion":{"oneOf":[{"type":"number"},{"type":"string"}],"description":"Protocol version, current version is 2."},"name":{"type":"string","maxLength":255,"description":"String in ^[a-zA-Z0-9_-]+$ format, no longer than 255 characters."},"type":{"type":"string","description":"Component type, should be \"job\" here."},"version":{"type":"string","description":"Component version, default is latest."},"contributor":{"type":"string"},"description":{"type":"string"},"prerequisites":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"type":{"type":"string","enum":["data","script","dockerimage","output"]},"version":{"type":"string"},"contributor":{"type":"string"},"description":{"type":"string"},"auth":{"type":"object","properties":{"username":{"type":"string"},"password":{"type":"string"},"registryuri":{"type":"string"}}},"uri":{"oneOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}]}}}},"parameters":{"type":"object","additionalProperties":true},"secrets":{"type":"object","additionalProperties":true},"jobRetryCount":{"type":"integer","description":"Default is 0."},"taskRoles":{"type":"object","additionalProperties":{"type":"object","properties":{"instances":{"type":"integer","description":"Default is 1, instances of a taskRole, no less than 1."},"completion":{"type":"object","description":"Completion poclicy for the job.","properties":{"minFailedInstances":{"type":"integer"},"minSucceededInstances":{"type":"integer"}}},"taskRetryCount":{"type":"integer","description":"Default is 0."},"dockerImage":{"type":"string","description":"Should reference to a dockerimage defined in prerequisites."},"data":{"type":"string"},"output":{"type":"string"},"script":{"type":"string"},"extraContainerOptions":{"type":"object","properties":{"shmMB":{"type":"integer","description":"Config the /dev/shm in a docker container."},"infiniband":{"type":"boolean","description":"Use InfiniBand devices or not in a docker container."}}},"resourcePerInstance":{"type":"object","properties":{"cpu":{"type":"integer","description":"CPU number, unit is CPU vcore."},"memoryMB":{"type":"integer","description":"Memory number, unit is MB."},"gpu":{"type":"integer","description":"GPU number, unit is GPU card."},"ports":{"type":"object","additionalProperties":{"type":"integer","description":"Port number for the port label."}}}},"commands":{"type":"array","items":{"type":"string"}}},"required":["dockerImage","resourcePerInstance","commands"]}},"deployments":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"taskRoles":{"type":"object","additionalProperties":{"type":"object","properties":{"preCommands":{"type":"array","items":{"type":"string"}},"postCommands":{"type":"array","items":{"type":"string"}}}}}}}},"defaults":{"type":"object","description":"Default cluster specific settings.","properties":{"virtualCluster":{"type":"string"},"deployment":{"type":"string"}}},"extras":{"type":"object","description":"Extra field, save any information that plugin may use.","properties":{"submitFrom":{"type":"string"},"hivedScheduler":{"type":"object","properties":{"jobPriorityClass":{"type":"string"},"taskRoles":{"type":"object","additionalProperties":{"type":"object","properties":{"skuType":{"type":"string"},"affinityGroupName":{"type":"string"}}}}}}}}},"required":["protocolVersion","name","type","taskRoles"]},"example":{"protocolVersion":"2","name":"","type":"job","prerequisites":[{"name":"","type":"dockerimage","uri":"image_url"}],"taskRoles":{"train":{"instances":1,"dockerImage":"","resourcePerInstance":{"cpu":1,"memoryMB":16384,"gpu":1},"commands":["python "]}}}}}},"404":{"description":"NoJobError or NoJobConfigError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"NoJobError":{"value":{"code":"NoJobError","message":"Job {job} is not found."}},"NoJobConfigError":{"value":{"code":"NoJobConfigError","message":"Config of job {job} is not found."}}}}}},"500":{"description":"UnknownError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"UnknownError":{"value":{"code":"UnknownError","message":"Internal error message."}}}}}}},"description":"get /api/v2/jobs/{user}~{job}/config"},{"description":"put /api/v2/jobs/{user}~{job}/executionType","tests":[{"operation":{"tag":"job","operationId":"updateJobExecutionType","parameters":[],"response":{"statusCode":202,"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"contentType":"application/json"}}}],"schemas":{"202":{"description":"Succeeded","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"example":{"message":"execute job {job} successfully"}}}},"404":{"description":"NoJobError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"NoJobError":{"value":{"code":"NoJobError","message":"Job {job} is not found."}}}}}},"500":{"description":"UnknownError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"UnknownError":{"value":{"code":"UnknownError","message":"Internal error message."}}}}}}}},{"description":"get /api/v2/jobs/{user}~{job}/job-attempts/healthz","tests":[{"operation":{"tag":"job history","operationId":"getJobAttemptsHealthz","parameters":[],"response":{"statusCode":200}}}],"schemas":{"200":{"description":"OK"},"501":{"description":"Not healthy"}}},{"before":[{"tag":"job","operationId":"createJob","parameters":[{"type":"raw","value":{"contributor":"OpenPAI","description":"# Serving a TensorFlow MNIST Digit Recognition Model\nThis example shows you how to use TensorFlow Serving components to export a trained TensorFlow model\nand use the standard tensorflow_model_server to serve it on OpenPAI.\nThis example uses the simple Softmax Regression model introduced in the TensorFlow tutorial for handwritten image (MNIST data) classification.\nReference https://www.tensorflow.org/tfx/serving/serving_basic.\n","name":"sdk_test_jobb59f8bf3","parameters":{"modelPath":"/tmp/mnist_model"},"prerequisites":[{"contributor":"OpenPAI","description":"This is an [example TensorFlow Serving Docker image on OpenPAI](https://github.com/Microsoft/pai/tree/master/examples/serving).\n","name":"tf_serving_example","protocolVersion":2,"type":"dockerimage","uri":"openpai/pai.example.tensorflow-serving","version":"1.0-r1.4"}],"protocolVersion":2,"taskRoles":{"worker":{"commands":["bazel-bin/tensorflow_serving/example/mnist_saved_model <% $parameters.modelPath %>","tensorflow_model_server --port=$PAI_CONTAINER_HOST_model_server_PORT_LIST --model_name=mnist --model_base_path=<% $parameters.modelPath %>"],"dockerImage":"tf_serving_example","instances":1,"resourcePerInstance":{"cpu":4,"gpu":1,"memoryMB":8192,"ports":{"model_server":1}}}},"type":"job","version":"1.0"}}]}],"tests":[{"operation":{"parameters":[{"type":"raw","value":"sdk_test"},{"type":"raw","value":"sdk_test_jobb59f8bf3"}],"tag":"job history","operationId":"getJobAttempts","response":{"statusCode":200,"schema":{"type":"array","items":{"type":"object","description":"job attempt","properties":{"jobName":{"type":"string"},"frameworkName":{"type":"string"},"uid":{"type":"string"},"userName":{"type":"string"},"state":{"type":"string"},"originState":{"type":"string"},"maxAttemptCount":{"type":"integer"},"attemptIndex":{"type":"integer"},"jobStartedTime":{"type":"integer"},"attemptStartedTime":{"type":"integer"},"attemptCompletedTime":{"type":"integer","nullable":true},"exitCode":{"type":"integer","nullable":true},"exitPhrase":{"type":"string","nullable":true},"exitType":{"type":"string","nullable":true},"exitDiagnostics":{"type":"object","nullable":true,"properties":{"diagnosticsSummary":{"type":"string"},"runtime":{"type":"object","nullable":true,"properties":{"exitCode":{"type":"integer","nullable":true},"originUserExitCode":{"type":"integer","nullable":true},"errorLogs":{"type":"object","nullable":true,"properties":{"user":{"type":"string"},"platform":{"type":"string"}}},"name":{"type":"string"}}},"launcher":{"type":"string"}}},"appExitTriggerMessage":{"type":"string","nullable":true},"appExitTriggerTaskRoleName":{"type":"string","nullable":true},"appExitTriggerTaskIndex":{"type":"integer","nullable":true},"appExitSpec":{"type":"object","nullable":true,"properties":{"code":{"type":"integer"},"phrase":{"type":"string"},"issuer":{"type":"string"},"causer":{"type":"string"},"type":{"type":"string"},"stage":{"type":"string"},"behavior":{"type":"string"},"reaction":{"type":"string"},"reason":{"type":"string"},"repro":{"type":"array","items":{"type":"string"}},"solution":{"type":"array","items":{"type":"string"}}}},"appExitDiagnostics":{"type":"string","nullable":true},"appExitMessages":{"type":"object","nullable":true,"properties":{"container":{"type":"string","nullable":true},"runtime":{"type":"object","nullable":true,"properties":{"exitCode":{"type":"integer","nullable":true},"originUserExitCode":{"type":"integer","nullable":true},"errorLogs":{"type":"object","nullable":true,"properties":{"user":{"type":"string"},"platform":{"type":"string"}}},"name":{"type":"string"}}},"launcher":{"type":"string","nullable":true}}},"totalGpuNumber":{"type":"integer"},"totalTasknumber":{"type":"integer"},"totalTaskRoleNumber":{"type":"integer"},"taskRoles":{"type":"object","properties":{"taskrole":{"type":"object","properties":{"taskRoleStatus":{"type":"object","properties":{"name":{"type":"string"}},"required":["name"]},"taskStatuses":{"type":"array","items":{"type":"object","properties":{"taskIndex":{"type":"integer"},"taskState":{"type":"string","enum":["WAITING","RUNNING","STOPPING","STOPPED","SUCCEEDED","FAILED","UNKNOWN"]},"containerId":{"type":"string"},"containerIp":{"type":"string"},"containerGpus":{"type":"string","nullable":true},"containerLog":{"type":"string"},"containerExitCode":{"type":"integer","nullable":true}}}}},"required":["taskRoleStatus","taskStatuses"]}}},"isLatest":{"type":"boolean"}}},"description":"job attempts"},"contentType":"application/json"}}}],"after":[{"tag":"job","operationId":"updateJobExecutionType","parameters":[{"type":"raw","value":"sdk_test"},{"type":"raw","value":"sdk_test_jobb59f8bf3"},{"type":"raw","value":"STOP"}]}],"schemas":{"200":{"description":"Succeeded","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","description":"job attempt","properties":{"jobName":{"type":"string"},"frameworkName":{"type":"string"},"uid":{"type":"string"},"userName":{"type":"string"},"state":{"type":"string"},"originState":{"type":"string"},"maxAttemptCount":{"type":"integer"},"attemptIndex":{"type":"integer"},"jobStartedTime":{"type":"integer"},"attemptStartedTime":{"type":"integer"},"attemptCompletedTime":{"type":"integer","nullable":true},"exitCode":{"type":"integer","nullable":true},"exitPhrase":{"type":"string","nullable":true},"exitType":{"type":"string","nullable":true},"exitDiagnostics":{"type":"object","nullable":true,"properties":{"diagnosticsSummary":{"type":"string"},"runtime":{"type":"object","nullable":true,"properties":{"exitCode":{"type":"integer","nullable":true},"originUserExitCode":{"type":"integer","nullable":true},"errorLogs":{"type":"object","nullable":true,"properties":{"user":{"type":"string"},"platform":{"type":"string"}}},"name":{"type":"string"}}},"launcher":{"type":"string"}}},"appExitTriggerMessage":{"type":"string","nullable":true},"appExitTriggerTaskRoleName":{"type":"string","nullable":true},"appExitTriggerTaskIndex":{"type":"integer","nullable":true},"appExitSpec":{"type":"object","nullable":true,"properties":{"code":{"type":"integer"},"phrase":{"type":"string"},"issuer":{"type":"string"},"causer":{"type":"string"},"type":{"type":"string"},"stage":{"type":"string"},"behavior":{"type":"string"},"reaction":{"type":"string"},"reason":{"type":"string"},"repro":{"type":"array","items":{"type":"string"}},"solution":{"type":"array","items":{"type":"string"}}}},"appExitDiagnostics":{"type":"string","nullable":true},"appExitMessages":{"type":"object","nullable":true,"properties":{"container":{"type":"string","nullable":true},"runtime":{"type":"object","nullable":true,"properties":{"exitCode":{"type":"integer","nullable":true},"originUserExitCode":{"type":"integer","nullable":true},"errorLogs":{"type":"object","nullable":true,"properties":{"user":{"type":"string"},"platform":{"type":"string"}}},"name":{"type":"string"}}},"launcher":{"type":"string","nullable":true}}},"totalGpuNumber":{"type":"integer"},"totalTasknumber":{"type":"integer"},"totalTaskRoleNumber":{"type":"integer"},"taskRoles":{"type":"object","properties":{"taskrole":{"type":"object","properties":{"taskRoleStatus":{"type":"object","properties":{"name":{"type":"string"}},"required":["name"]},"taskStatuses":{"type":"array","items":{"type":"object","properties":{"taskIndex":{"type":"integer"},"taskState":{"type":"string","enum":["WAITING","RUNNING","STOPPING","STOPPED","SUCCEEDED","FAILED","UNKNOWN"]},"containerId":{"type":"string"},"containerIp":{"type":"string"},"containerGpus":{"type":"string","nullable":true},"containerLog":{"type":"string"},"containerExitCode":{"type":"integer","nullable":true}}}}},"required":["taskRoleStatus","taskStatuses"]}}},"isLatest":{"type":"boolean"}}},"description":"job attempts"},"example":[{"jobName":"jobName","frameworkName":"frameworkName","uid":"uid","userName":"userName","state":"SUCCEEDED","originState":"Completed","maxAttemptCount":1,"attemptIndex":0,"jobStartedTime":0,"attemptStartedTime":0,"attemptCompletedTime":0,"exitCode":0,"exitPhrase":"Succeeded","exitType":"Succeeded","exitDiagnostics":{"diagnosticsSummary":"Pod succeeded","runtime":null,"launcher":"Pod succeeded"},"appExitTriggerMessage":"All Tasks are completed","appExitTriggerTaskRoleName":"taskrole","appExitTriggerTaskIndex":0,"appExitSpec":{"code":0,"phrase":"Succeeded","issuer":"USER_CONTAINER","causer":"USER_CONTAINER","type":"USER_SUCCESS","stage":"COMPLETING","behavior":"UNKNOWN","reaction":"NEVER_RETRY","repro":["User program exits with exitcode 0"]},"appExitDiagnostics":"Pod succeeded","appExitMessages":{"container":null,"runtime":null,"launcher":"Pod succeeded"},"totalGpuNumber":1,"totalTaskNumber":1,"totalTaskRoleNumber":1,"taskRoles":{"taskrole":{"taskRoleStatus":{"name":"taskrole"},"taskStatuses":[{"taskIndex":0,"taskState":"SUCCEEDED","containerId":"","containerIp":"","containerExitCode":0}]}},"isLatest":true}]}}},"404":{"description":"NoJobError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"NoJobError":{"value":{"code":"NoJobError","message":"Job {job} is not found."}}}}}},"501":{"description":"UnknownError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"UnknownError":{"value":{"code":"UnknownError","message":"Internal error message."}}}}}}},"description":"get /api/v2/jobs/{user}~{job}/job-attempts"},{"before":[{"tag":"job","operationId":"createJob","parameters":[{"type":"raw","value":{"contributor":"OpenPAI","description":"# Serving a TensorFlow MNIST Digit Recognition Model\nThis example shows you how to use TensorFlow Serving components to export a trained TensorFlow model\nand use the standard tensorflow_model_server to serve it on OpenPAI.\nThis example uses the simple Softmax Regression model introduced in the TensorFlow tutorial for handwritten image (MNIST data) classification.\nReference https://www.tensorflow.org/tfx/serving/serving_basic.\n","name":"sdk_test_job62bec939","parameters":{"modelPath":"/tmp/mnist_model"},"prerequisites":[{"contributor":"OpenPAI","description":"This is an [example TensorFlow Serving Docker image on OpenPAI](https://github.com/Microsoft/pai/tree/master/examples/serving).\n","name":"tf_serving_example","protocolVersion":2,"type":"dockerimage","uri":"openpai/pai.example.tensorflow-serving","version":"1.0-r1.4"}],"protocolVersion":2,"taskRoles":{"worker":{"commands":["bazel-bin/tensorflow_serving/example/mnist_saved_model <% $parameters.modelPath %>","tensorflow_model_server --port=$PAI_CONTAINER_HOST_model_server_PORT_LIST --model_name=mnist --model_base_path=<% $parameters.modelPath %>"],"dockerImage":"tf_serving_example","instances":1,"resourcePerInstance":{"cpu":4,"gpu":1,"memoryMB":8192,"ports":{"model_server":1}}}},"type":"job","version":"1.0"}}]}],"tests":[{"operation":{"parameters":[{"type":"raw","value":"sdk_test"},{"type":"raw","value":"sdk_test_job62bec939"},{"type":"raw","value":0}],"tag":"job history","operationId":"getJobAttempt","response":{"statusCode":200,"schema":{"type":"object","description":"job attempt","properties":{"jobName":{"type":"string"},"frameworkName":{"type":"string"},"uid":{"type":"string"},"userName":{"type":"string"},"state":{"type":"string"},"originState":{"type":"string"},"maxAttemptCount":{"type":"integer"},"attemptIndex":{"type":"integer"},"jobStartedTime":{"type":"integer"},"attemptStartedTime":{"type":"integer"},"attemptCompletedTime":{"type":"integer","nullable":true},"exitCode":{"type":"integer","nullable":true},"exitPhrase":{"type":"string","nullable":true},"exitType":{"type":"string","nullable":true},"exitDiagnostics":{"type":"object","nullable":true,"properties":{"diagnosticsSummary":{"type":"string"},"runtime":{"type":"object","nullable":true,"properties":{"exitCode":{"type":"integer","nullable":true},"originUserExitCode":{"type":"integer","nullable":true},"errorLogs":{"type":"object","nullable":true,"properties":{"user":{"type":"string"},"platform":{"type":"string"}}},"name":{"type":"string"}}},"launcher":{"type":"string"}}},"appExitTriggerMessage":{"type":"string","nullable":true},"appExitTriggerTaskRoleName":{"type":"string","nullable":true},"appExitTriggerTaskIndex":{"type":"integer","nullable":true},"appExitSpec":{"type":"object","nullable":true,"properties":{"code":{"type":"integer"},"phrase":{"type":"string"},"issuer":{"type":"string"},"causer":{"type":"string"},"type":{"type":"string"},"stage":{"type":"string"},"behavior":{"type":"string"},"reaction":{"type":"string"},"reason":{"type":"string"},"repro":{"type":"array","items":{"type":"string"}},"solution":{"type":"array","items":{"type":"string"}}}},"appExitDiagnostics":{"type":"string","nullable":true},"appExitMessages":{"type":"object","nullable":true,"properties":{"container":{"type":"string","nullable":true},"runtime":{"type":"object","nullable":true,"properties":{"exitCode":{"type":"integer","nullable":true},"originUserExitCode":{"type":"integer","nullable":true},"errorLogs":{"type":"object","nullable":true,"properties":{"user":{"type":"string"},"platform":{"type":"string"}}},"name":{"type":"string"}}},"launcher":{"type":"string","nullable":true}}},"totalGpuNumber":{"type":"integer"},"totalTasknumber":{"type":"integer"},"totalTaskRoleNumber":{"type":"integer"},"taskRoles":{"type":"object","properties":{"taskrole":{"type":"object","properties":{"taskRoleStatus":{"type":"object","properties":{"name":{"type":"string"}},"required":["name"]},"taskStatuses":{"type":"array","items":{"type":"object","properties":{"taskIndex":{"type":"integer"},"taskState":{"type":"string","enum":["WAITING","RUNNING","STOPPING","STOPPED","SUCCEEDED","FAILED","UNKNOWN"]},"containerId":{"type":"string"},"containerIp":{"type":"string"},"containerGpus":{"type":"string","nullable":true},"containerLog":{"type":"string"},"containerExitCode":{"type":"integer","nullable":true}}}}},"required":["taskRoleStatus","taskStatuses"]}}},"isLatest":{"type":"boolean"}}},"contentType":"application/json"}}}],"after":[{"tag":"job","operationId":"updateJobExecutionType","parameters":[{"type":"raw","value":"sdk_test"},{"type":"raw","value":"sdk_test_job62bec939"},{"type":"raw","value":"STOP"}]}],"schemas":{"200":{"description":"Succeeded","content":{"application/json":{"schema":{"type":"object","description":"job attempt","properties":{"jobName":{"type":"string"},"frameworkName":{"type":"string"},"uid":{"type":"string"},"userName":{"type":"string"},"state":{"type":"string"},"originState":{"type":"string"},"maxAttemptCount":{"type":"integer"},"attemptIndex":{"type":"integer"},"jobStartedTime":{"type":"integer"},"attemptStartedTime":{"type":"integer"},"attemptCompletedTime":{"type":"integer","nullable":true},"exitCode":{"type":"integer","nullable":true},"exitPhrase":{"type":"string","nullable":true},"exitType":{"type":"string","nullable":true},"exitDiagnostics":{"type":"object","nullable":true,"properties":{"diagnosticsSummary":{"type":"string"},"runtime":{"type":"object","nullable":true,"properties":{"exitCode":{"type":"integer","nullable":true},"originUserExitCode":{"type":"integer","nullable":true},"errorLogs":{"type":"object","nullable":true,"properties":{"user":{"type":"string"},"platform":{"type":"string"}}},"name":{"type":"string"}}},"launcher":{"type":"string"}}},"appExitTriggerMessage":{"type":"string","nullable":true},"appExitTriggerTaskRoleName":{"type":"string","nullable":true},"appExitTriggerTaskIndex":{"type":"integer","nullable":true},"appExitSpec":{"type":"object","nullable":true,"properties":{"code":{"type":"integer"},"phrase":{"type":"string"},"issuer":{"type":"string"},"causer":{"type":"string"},"type":{"type":"string"},"stage":{"type":"string"},"behavior":{"type":"string"},"reaction":{"type":"string"},"reason":{"type":"string"},"repro":{"type":"array","items":{"type":"string"}},"solution":{"type":"array","items":{"type":"string"}}}},"appExitDiagnostics":{"type":"string","nullable":true},"appExitMessages":{"type":"object","nullable":true,"properties":{"container":{"type":"string","nullable":true},"runtime":{"type":"object","nullable":true,"properties":{"exitCode":{"type":"integer","nullable":true},"originUserExitCode":{"type":"integer","nullable":true},"errorLogs":{"type":"object","nullable":true,"properties":{"user":{"type":"string"},"platform":{"type":"string"}}},"name":{"type":"string"}}},"launcher":{"type":"string","nullable":true}}},"totalGpuNumber":{"type":"integer"},"totalTasknumber":{"type":"integer"},"totalTaskRoleNumber":{"type":"integer"},"taskRoles":{"type":"object","properties":{"taskrole":{"type":"object","properties":{"taskRoleStatus":{"type":"object","properties":{"name":{"type":"string"}},"required":["name"]},"taskStatuses":{"type":"array","items":{"type":"object","properties":{"taskIndex":{"type":"integer"},"taskState":{"type":"string","enum":["WAITING","RUNNING","STOPPING","STOPPED","SUCCEEDED","FAILED","UNKNOWN"]},"containerId":{"type":"string"},"containerIp":{"type":"string"},"containerGpus":{"type":"string","nullable":true},"containerLog":{"type":"string"},"containerExitCode":{"type":"integer","nullable":true}}}}},"required":["taskRoleStatus","taskStatuses"]}}},"isLatest":{"type":"boolean"}}},"example":{"jobName":"jobName","frameworkName":"frameworkName","uid":"uid","userName":"userName","state":"SUCCEEDED","originState":"Completed","maxAttemptCount":1,"attemptIndex":0,"jobStartedTime":0,"attemptStartedTime":0,"attemptCompletedTime":0,"exitCode":0,"exitPhrase":"Succeeded","exitType":"Succeeded","exitDiagnostics":{"diagnosticsSummary":"Pod succeeded","runtime":null,"launcher":"Pod succeeded"},"appExitTriggerMessage":"All Tasks are completed","appExitTriggerTaskRoleName":"taskrole","appExitTriggerTaskIndex":0,"appExitSpec":{"code":0,"phrase":"Succeeded","issuer":"USER_CONTAINER","causer":"USER_CONTAINER","type":"USER_SUCCESS","stage":"COMPLETING","behavior":"UNKNOWN","reaction":"NEVER_RETRY","repro":["User program exits with exitcode 0"]},"appExitDiagnostics":"Pod succeeded","appExitMessages":{"container":null,"runtime":null,"launcher":"Pod succeeded"},"totalGpuNumber":1,"totalTaskNumber":1,"totalTaskRoleNumber":1,"taskRoles":{"taskrole":{"taskRoleStatus":{"name":"taskrole"},"taskStatuses":[{"taskIndex":0,"taskState":"SUCCEEDED","containerId":"","containerIp":"","containerExitCode":0}]}},"isLatest":true}}}},"404":{"description":"NoJobError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"NoJobError":{"value":{"code":"NoJobError","message":"Job {job} is not found."}}}}}},"501":{"description":"UnknownError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"UnknownError":{"value":{"code":"UnknownError","message":"Internal error message."}}}}}}},"description":"get /api/v2/jobs/{user}~{job}/job-attempts/{attemptIndex}"},{"description":"get /api/v2/kubernetes/nodes","tests":[{"operation":{"tag":"kubernetes","operationId":"getK8sNodes","parameters":[],"response":{"statusCode":200}}}],"schemas":{"200":{"description":"Succeeded","content":{"application/json":{"example":["Please refer to Kubernetes API doc","https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.17/#list-node-v1-core"]}}},"401":{"description":"UnauthorizedUserError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"UnauthorizedUserError":{"value":{"code":"UnauthorizedUserError","message":"Guest is not allowed to do this operation."}}}}}},"403":{"description":"ForbiddenUserError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"ForbiddenUserError":{"value":{"code":"ForbiddenUserError","message":"Non-admin is not allow to do this operation."}},"ForbiddenTokenError":{"value":{"code":"ForbiddenUserError","message":"Applications are not allowed to do this operation."}}}}}}}},{"description":"get /api/v2/kubernetes/pods","tests":[{"operation":{"tag":"kubernetes","operationId":"getK8sPods","parameters":[],"response":{"statusCode":200}}}],"schemas":{"200":{"description":"Succeeded","content":{"application/json":{"example":["Please refer to Kubernetes API doc","https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.17/#list-all-namespaces-pod-v1-core"]}}},"401":{"description":"UnauthorizedUserError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"UnauthorizedUserError":{"value":{"code":"UnauthorizedUserError","message":"Guest is not allowed to do this operation."}}}}}},"403":{"description":"ForbiddenUserError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"ForbiddenUserError":{"value":{"code":"ForbiddenUserError","message":"Non-admin is not allow to do this operation."}},"ForbiddenTokenError":{"value":{"code":"ForbiddenUserError","message":"Applications are not allowed to do this operation."}}}}}}}}],"map":{"getClusterInfo":{"path":"/api/v2/info","method":"get","examples":{"200":{"name":"PAI RESTful API","version":"v1.0.1","launcherType":"k8s","authnMethod":"basic"}}},"getTokens":{"path":"/api/v2/tokens","method":"get","examples":{"200":{"tokens":["JWT Token Example"]},"401":{"value":{"code":"UnauthorizedUserError","message":"Guest is not allowed to do this operation."}}}},"deleteToken":{"path":"/api/v2/tokens/{token}","method":"delete","examples":{"200":{"message":"revoke successfully"},"401":{"value":{"code":"UnauthorizedUserError","message":"Guest is not allowed to do this operation."}},"403":{"value":{"code":"ForbiddenUserError","message":"Non-admin is not allow to do this operation."}}}},"createApplicationToken":{"path":"/api/v2/tokens/application","method":"post","examples":{"200":{"token":"JWT Token Example","application":true},"401":{"value":{"code":"UnauthorizedUserError","message":"Guest is not allowed to do this operation."}}}},"oidcLogin":{"path":"/api/v2/authn/oidc/login","method":"get","examples":{}},"oidcLogout":{"path":"/api/v2/authn/oidc/logout","method":"get","examples":{}},"basicLogin":{"path":"/api/v2/authn/basic/login","method":"post","examples":{"200":{"token":"JWT Token Example","user":"user","admin":true},"404":{"value":{"code":"NoUserError","message":"User {user} is not found."}}}},"basicLogout":{"path":"/api/v2/authn/basic/logout","method":"delete","examples":{"200":{"message":"Logout successfully"},"401":{"value":{"code":"UnauthorizedUserError","message":"Guest is not allowed to do this operation."}},"403":{"value":{"code":"ForbiddenUserError","message":"Non-admin is not allow to do this operation."}}}},"createUser":{"path":"/api/v2/users","method":"post","examples":{"201":{"message":"User is created successfully"},"401":{"value":{"code":"UnauthorizedUserError","message":"Guest is not allowed to do this operation."}},"403":{"value":{"code":"ForbiddenUserError","message":"Non-admin is not allow to do this operation."}},"409":{"value":{"code":"ConflictUserError","message":"User name {user} already exists."}},"500":{"value":{"code":"UnknownError","message":"Internal error message."}}}},"getAllUser":{"path":"/api/v2/users","method":"get","examples":{"200":[{"username":"username","admin":true,"virtualCluster":[],"storageConfig":[],"email":"email@test.com","extension":{}}],"500":{"value":{"code":"UnknownError","message":"Internal error message."}}}},"updateUser":{"path":"/api/v2/users","method":"put","examples":{"201":{"message":"update group {username} successfully."},"401":{"value":{"code":"UnauthorizedUserError","message":"Guest is not allowed to do this operation."}},"403":{"value":{"code":"ForbiddenUserError","message":"Non-admin is not allow to do this operation."}},"404":{"value":{"code":"NoUserError","message":"User {user} is not found."}},"500":{"value":{"code":"UnknownError","message":"Internal error message."}}}},"updateUserSelf":{"path":"/api/v2/users/me","method":"put","examples":{"201":{"message":"update group {username} successfully."},"401":{"value":{"code":"UnauthorizedUserError","message":"Guest is not allowed to do this operation."}},"403":{"value":{"code":"ForbiddenUserError","message":"Non-admin is not allow to do this operation."}},"404":{"value":{"code":"NoUserError","message":"User {user} is not found."}},"500":{"value":{"code":"UnknownError","message":"Internal error message."}}}},"getUser":{"path":"/api/v2/users/{user}","method":"get","examples":{"200":{"username":"username","admin":true,"virtualCluster":[],"storageConfig":[],"email":"email@test.com","extension":{}},"401":{"value":{"code":"UnauthorizedUserError","message":"Guest is not allowed to do this operation."}},"404":{"value":{"code":"NoUserError","message":"User {user} is not found."}},"500":{"value":{"code":"UnknownError","message":"Internal error message."}}}},"deleteUser":{"path":"/api/v2/users/{user}","method":"delete","examples":{"200":{"message":"user is removed successfully"},"401":{"value":{"code":"UnauthorizedUserError","message":"Guest is not allowed to do this operation."}},"403":{"value":{"code":"ForbiddenUserError","message":"Non-admin is not allow to do this operation."}},"404":{"value":{"code":"NoUserError","message":"User {user} is not found."}},"500":{"value":{"code":"UnknownError","message":"Internal error message."}}}},"updateUserGroup":{"path":"/api/v2/users/{user}/group/","method":"put","examples":{"201":{"message":"User {username} is added into group {groupname}"},"401":{"value":{"code":"UnauthorizedUserError","message":"Guest is not allowed to do this operation."}},"403":{"value":{"code":"ForbiddenUserError","message":"Non-admin is not allow to do this operation."}},"404":{"value":{"code":"NoUserError","message":"User {user} is not found."}},"500":{"value":{"code":"UnknownError","message":"Internal error message."}}}},"deleteUserGroup":{"path":"/api/v2/users/{user}/group/","method":"delete","examples":{"201":{"message":"User {username} is removed from group {groupname}"},"401":{"value":{"code":"UnauthorizedUserError","message":"Guest is not allowed to do this operation."}},"403":{"value":{"code":"ForbiddenUserError","message":"Non-admin is not allow to do this operation."}},"404":{"value":{"code":"NoUserError","message":"User {user} is not found."}},"500":{"value":{"code":"UnknownError","message":"Internal error message."}}}},"updateUserGrouplist":{"path":"/api/v2/users/{user}/grouplist/","method":"put","examples":{"201":{"message":"update user grouplist successfully."},"401":{"value":{"code":"UnauthorizedUserError","message":"Guest is not allowed to do this operation."}},"403":{"value":{"code":"ForbiddenUserError","message":"Non-admin is not allow to do this operation."}},"404":{"value":{"code":"NoUserError","message":"User {user} is not found."}},"500":{"value":{"code":"UnknownError","message":"Internal error message."}}}},"getAllGroup":{"path":"/api/v2/groups","method":"get","examples":{"200":[{"groupname":"groupName","description":"description","externalName":"externalName","extension":{}}],"500":{"value":{"code":"UnknownError","message":"Internal error message."}}}},"createGroup":{"path":"/api/v2/groups","method":"post","examples":{"201":{"message":"group is created successfully"},"401":{"value":{"code":"UnauthorizedUserError","message":"Guest is not allowed to do this operation."}},"403":{"value":{"code":"ForbiddenUserError","message":"Non-admin is not allow to do this operation."}},"500":{"value":{"code":"UnknownError","message":"Internal error message."}}}},"updateGroup":{"path":"/api/v2/groups","method":"put","examples":{"201":{"message":"update group {groupname} successfully."},"401":{"value":{"code":"UnauthorizedUserError","message":"Guest is not allowed to do this operation."}},"403":{"value":{"code":"ForbiddenUserError","message":"Non-admin is not allow to do this operation."}},"404":{"value":{"code":"NoGroupError","message":"Group {groupname} is not found."}},"500":{"value":{"code":"UnknownError","message":"Internal error message."}}}},"getGroup":{"path":"/api/v2/groups/{group}","method":"get","examples":{"200":{"groupname":"groupName","description":"description","externalName":"externalName","extension":{}},"401":{"value":{"code":"UnauthorizedUserError","message":"Guest is not allowed to do this operation."}},"404":{"value":{"code":"NoGroupError","message":"Group {groupname} is not found."}},"500":{"value":{"code":"UnknownError","message":"Internal error message."}}}},"deleteGroup":{"path":"/api/v2/groups/{group}","method":"delete","examples":{"201":{"message":"group is removed successfully"},"401":{"value":{"code":"UnauthorizedUserError","message":"Guest is not allowed to do this operation."}},"403":{"value":{"code":"ForbiddenUserError","message":"Non-admin is not allow to do this operation."}},"500":{"value":{"code":"UnknownError","message":"Internal error message."}}}},"getGroupMembers":{"path":"/api/v2/groups/{group}/userlist","method":"get","examples":{"200":[{"username":"username","clusterAdmin":false}],"401":{"value":{"code":"UnauthorizedUserError","message":"Guest is not allowed to do this operation."}},"500":{"value":{"code":"UnknownError","message":"Internal error message."}}}},"listVirtualClusters":{"path":"/api/v2/virtual-clusters","method":"get","examples":{"500":{"value":{"code":"UnknownError","message":"Internal error message."}}}},"getVirtualCluster":{"path":"/api/v2/virtual-clusters/{vc}","method":"get","examples":{"200":{"capacity":70,"usedCapacity":30,"dedicated":false,"resourcesUsed":{"cpu":1,"memory":1024,"gpu":1,"vCores":1,"GPUs":1},"resourcesGuaranteed":{"cpu":2,"memory":2048,"gpu":2,"vCores":2,"GPUs":2},"resourcesTotal":{"cpu":2,"memory":2048,"gpu":2,"vCores":2,"GPUs":2},"maxCapacity":70},"404":{"value":{"code":"NoVirtualClusterError","message":"Virtual cluster {vc} is not found."}},"500":{"value":{"code":"UnknownError","message":"Internal error message."}}}},"getStorages":{"path":"/api/v2/storages","method":"get","examples":{"200":{"storages":[{"name":"name","share":true,"volumeName":"volumeName"}]},"500":{"value":{"code":"UnknownError","message":"Internal error message."}}}},"getStorage":{"path":"/api/v2/storages/{storage}","method":"get","examples":{"200":{"name":"nfs-storage-name","share":true,"volumeName":"nfs-volume-name","type":"nfs","data":{"server":"","path":"/data"}},"403":{"value":{"code":"ForbiddenUserError","message":"User {user} is not allowed to access {storage}."}},"404":{"value":{"code":"NoStorageError","message":"Storage {storage} is not found."}},"500":{"value":{"code":"UnknownError","message":"Internal error message."}}}},"createJob":{"path":"/api/v2/jobs","method":"post","examples":{"202":{"message":"update job {job} successfully"},"400":{"value":{"code":"NoVirtualClusterError","message":"Virtual cluster {vc} is not found."}},"403":{"value":{"code":"ForbiddenUserError","message":"Non-admin is not allow to do this operation."}},"409":{"value":{"code":"ConflictJobError","message":"Job name {job} already exists."}},"500":{"value":{"code":"UnknownError","message":"Internal error message."}}}},"listJobs":{"path":"/api/v2/jobs","method":"get","examples":{"200":[{"protocolVersion":"2","name":"job name","username":"user name","state":"SUCCEEDED","subState":"Completed","executionType":"STOP","retries":0,"createdTime":0,"completedTime":0,"appExitCode":0,"virtualCluster":"unknown"}],"500":{"value":{"code":"UnknownError","message":"Internal error message."}}}},"getJob":{"path":"/api/v2/jobs/{user}~{job}","method":"get","examples":{"200":{"name":"job name","jobStatus":{"username":"user name","state":"SUCCEEDED","subState":"Completed","executionType":"STOP","retries":0,"createdTime":0,"completedTime":0,"appId":"id","appLaunchedTime":0,"appCompletedTime":0,"appExitCode":0,"virtualCluster":"unknown"},"taskRoles":{"taskrole":{"taskRoleStatus":{"name":"task role name"},"taskStatuses":[{"taskIndex":0,"taskState":"SUCCEEDED"}]}}},"404":{"value":{"code":"NoJobError","message":"Job {job} is not found."}},"500":{"value":{"code":"UnknownError","message":"Internal error message."}}}},"getJobConfig":{"path":"/api/v2/jobs/{user}~{job}/config","method":"get","examples":{"200":{"protocolVersion":"2","name":"","type":"job","prerequisites":[{"name":"","type":"dockerimage","uri":"image_url"}],"taskRoles":{"train":{"instances":1,"dockerImage":"","resourcePerInstance":{"cpu":1,"memoryMB":16384,"gpu":1},"commands":["python "]}}},"404":{"value":{"code":"NoJobError","message":"Job {job} is not found."}},"500":{"value":{"code":"UnknownError","message":"Internal error message."}}}},"updateJobExecutionType":{"path":"/api/v2/jobs/{user}~{job}/executionType","method":"put","examples":{"202":{"message":"execute job {job} successfully"},"404":{"value":{"code":"NoJobError","message":"Job {job} is not found."}},"500":{"value":{"code":"UnknownError","message":"Internal error message."}}}},"getJobAttemptsHealthz":{"path":"/api/v2/jobs/{user}~{job}/job-attempts/healthz","method":"get","examples":{}},"getJobAttempts":{"path":"/api/v2/jobs/{user}~{job}/job-attempts","method":"get","examples":{"200":[{"jobName":"jobName","frameworkName":"frameworkName","uid":"uid","userName":"userName","state":"SUCCEEDED","originState":"Completed","maxAttemptCount":1,"attemptIndex":0,"jobStartedTime":0,"attemptStartedTime":0,"attemptCompletedTime":0,"exitCode":0,"exitPhrase":"Succeeded","exitType":"Succeeded","exitDiagnostics":{"diagnosticsSummary":"Pod succeeded","runtime":null,"launcher":"Pod succeeded"},"appExitTriggerMessage":"All Tasks are completed","appExitTriggerTaskRoleName":"taskrole","appExitTriggerTaskIndex":0,"appExitSpec":{"code":0,"phrase":"Succeeded","issuer":"USER_CONTAINER","causer":"USER_CONTAINER","type":"USER_SUCCESS","stage":"COMPLETING","behavior":"UNKNOWN","reaction":"NEVER_RETRY","repro":["User program exits with exitcode 0"]},"appExitDiagnostics":"Pod succeeded","appExitMessages":{"container":null,"runtime":null,"launcher":"Pod succeeded"},"totalGpuNumber":1,"totalTaskNumber":1,"totalTaskRoleNumber":1,"taskRoles":{"taskrole":{"taskRoleStatus":{"name":"taskrole"},"taskStatuses":[{"taskIndex":0,"taskState":"SUCCEEDED","containerId":"","containerIp":"","containerExitCode":0}]}},"isLatest":true}],"404":{"value":{"code":"NoJobError","message":"Job {job} is not found."}},"501":{"value":{"code":"UnknownError","message":"Internal error message."}}}},"getJobAttempt":{"path":"/api/v2/jobs/{user}~{job}/job-attempts/{attemptIndex}","method":"get","examples":{"200":{"jobName":"jobName","frameworkName":"frameworkName","uid":"uid","userName":"userName","state":"SUCCEEDED","originState":"Completed","maxAttemptCount":1,"attemptIndex":0,"jobStartedTime":0,"attemptStartedTime":0,"attemptCompletedTime":0,"exitCode":0,"exitPhrase":"Succeeded","exitType":"Succeeded","exitDiagnostics":{"diagnosticsSummary":"Pod succeeded","runtime":null,"launcher":"Pod succeeded"},"appExitTriggerMessage":"All Tasks are completed","appExitTriggerTaskRoleName":"taskrole","appExitTriggerTaskIndex":0,"appExitSpec":{"code":0,"phrase":"Succeeded","issuer":"USER_CONTAINER","causer":"USER_CONTAINER","type":"USER_SUCCESS","stage":"COMPLETING","behavior":"UNKNOWN","reaction":"NEVER_RETRY","repro":["User program exits with exitcode 0"]},"appExitDiagnostics":"Pod succeeded","appExitMessages":{"container":null,"runtime":null,"launcher":"Pod succeeded"},"totalGpuNumber":1,"totalTaskNumber":1,"totalTaskRoleNumber":1,"taskRoles":{"taskrole":{"taskRoleStatus":{"name":"taskrole"},"taskStatuses":[{"taskIndex":0,"taskState":"SUCCEEDED","containerId":"","containerIp":"","containerExitCode":0}]}},"isLatest":true},"404":{"value":{"code":"NoJobError","message":"Job {job} is not found."}},"501":{"value":{"code":"UnknownError","message":"Internal error message."}}}},"getK8sNodes":{"path":"/api/v2/kubernetes/nodes","method":"get","examples":{"200":["Please refer to Kubernetes API doc","https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.17/#list-node-v1-core"],"401":{"value":{"code":"UnauthorizedUserError","message":"Guest is not allowed to do this operation."}},"403":{"value":{"code":"ForbiddenUserError","message":"Non-admin is not allow to do this operation."}}}},"getK8sPods":{"path":"/api/v2/kubernetes/pods","method":"get","examples":{"200":["Please refer to Kubernetes API doc","https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.17/#list-all-namespaces-pod-v1-core"],"401":{"value":{"code":"UnauthorizedUserError","message":"Guest is not allowed to do this operation."}},"403":{"value":{"code":"ForbiddenUserError","message":"Non-admin is not allow to do this operation."}}}}}} \ No newline at end of file diff --git a/package.json b/package.json index c7e71fd..6054db0 100644 --- a/package.json +++ b/package.json @@ -20,7 +20,7 @@ "build": "ttsc -p tsconfig.json && npm run copy-swagger", "copy-swagger": "node copy_swagger.js", "precode-coverage": "npm run build && npm run pretest", - "code-coverage": "nyc mocha -r ts-node/register -r tsconfig-paths/register -r source-map-support/register \"tests/unit_tests/**/*.spec.ts\" --exit", + "code-coverage": "nyc mocha -r ts-node/register -r tsconfig-paths/register -r source-map-support/register \"tests/unit_tests/v2/*.spec.ts\" --exit", "coveralls": "nyc report --reporter=text-lcov > coverage/lcov.info" }, "homepage": "https://github.com/Microsoft/openpaisdk", From 317853965b8ff89d32c32c6d403015fd7591306c Mon Sep 17 00:00:00 2001 From: Yi Yi Date: Mon, 15 Jun 2020 12:35:05 +0800 Subject: [PATCH 22/24] update mocha version --- .tests/apiTestCase.json | 2 +- package-lock.json | 482 ++++++++++++++++++++++++++++++---------- package.json | 8 +- 3 files changed, 367 insertions(+), 125 deletions(-) diff --git a/.tests/apiTestCase.json b/.tests/apiTestCase.json index e58fd07..6c85f6b 100644 --- a/.tests/apiTestCase.json +++ b/.tests/apiTestCase.json @@ -1 +1 @@ -{"tests":[{"description":"get /api/v2/info","tests":[{"operation":{"tag":"api","operationId":"getClusterInfo","parameters":[],"response":{"statusCode":200,"schema":{"type":"object","properties":{"name":{"type":"string","description":"PAI RESTfulAPI"},"version":{"type":"string","description":"cluster version in v0.X.0 format"},"launcherType":{"type":"string","enum":["yarn","k8s"]},"authnMethod":{"type":"string","enum":["basic","OIDC"]}},"required":["name","version","launcherType","authnMethod"]},"contentType":"application/json"}}}],"schemas":{"200":{"description":"Succeeded","content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","description":"PAI RESTfulAPI"},"version":{"type":"string","description":"cluster version in v0.X.0 format"},"launcherType":{"type":"string","enum":["yarn","k8s"]},"authnMethod":{"type":"string","enum":["basic","OIDC"]}},"required":["name","version","launcherType","authnMethod"]},"example":{"name":"PAI RESTful API","version":"v1.0.1","launcherType":"k8s","authnMethod":"basic"}}}}}},{"before":[{"tag":"token","operationId":"createApplicationToken"}],"tests":[{"description":"Get tokens with user token","operation":{"tag":"token","operationId":"getTokens","parameters":[],"response":{"statusCode":200,"schema":{"type":"object","properties":{"tokens":{"type":"array","items":{"type":"string"},"description":"JWT string list"}},"required":["tokens"]},"contentType":"application/json"}}},{"description":"Get tokens with unauthorized token","customizedTest":"getTokensWithUnauthorizedUser","operation":{"tag":"token","operationId":"getTokens","parameters":[],"response":{"statusCode":200,"schema":{"type":"object","properties":{"tokens":{"type":"array","items":{"type":"string"},"description":"JWT string list"}},"required":["tokens"]},"contentType":"application/json"}}}],"after":[{"tag":"token","operationId":"deleteToken","parameters":[{"type":"fromResult","resultType":"beforeResults","resultPath":["token"],"resultIndex":0}]}],"schemas":{"200":{"description":"Succeeded","content":{"application/json":{"schema":{"type":"object","properties":{"tokens":{"type":"array","items":{"type":"string"},"description":"JWT string list"}},"required":["tokens"]},"example":{"tokens":["JWT Token Example"]}}}},"401":{"description":"UnauthorizedUserError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"UnauthorizedUserError":{"value":{"code":"UnauthorizedUserError","message":"Guest is not allowed to do this operation."}}}}}}},"description":"get /api/v2/tokens"},{"before":[{"tag":"token","operationId":"createApplicationToken"}],"tests":[{"operation":{"parameters":[{"type":"fromResult","resultType":"beforeResults","resultPath":["token"],"resultIndex":0}],"tag":"token","operationId":"deleteToken","response":{"statusCode":200,"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"contentType":"application/json"}}}],"schemas":{"200":{"description":"Succeeded","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"example":{"message":"revoke successfully"}}}},"401":{"description":"UnauthorizedUserError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"UnauthorizedUserError":{"value":{"code":"UnauthorizedUserError","message":"Guest is not allowed to do this operation."}}}}}},"403":{"description":"ForbiddenUserError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"ForbiddenUserError":{"value":{"code":"ForbiddenUserError","message":"Non-admin is not allow to do this operation."}},"ForbiddenTokenError":{"value":{"code":"ForbiddenUserError","message":"Applications are not allowed to do this operation."}}}}}}},"description":"delete /api/v2/tokens/{token}"},{"tests":[{"operation":{"tag":"token","operationId":"createApplicationToken","parameters":[],"response":{"statusCode":200,"schema":{"type":"object","properties":{"token":{"type":"string","description":"your access token"},"application":{"type":"boolean","description":"true"}}},"contentType":"application/json"}}}],"after":[{"tag":"token","operationId":"deleteToken","parameters":[{"type":"fromResult","resultType":"testResults","resultPath":["token"],"resultIndex":0}]}],"schemas":{"200":{"description":"Succeeded","content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string","description":"your access token"},"application":{"type":"boolean","description":"true"}}},"example":{"token":"JWT Token Example","application":true}}}},"401":{"description":"UnauthorizedUserError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"UnauthorizedUserError":{"value":{"code":"UnauthorizedUserError","message":"Guest is not allowed to do this operation."}}}}}}},"description":"post /api/v2/tokens/application"},{"description":"get /api/v2/authn/oidc/login","tests":[{"operation":{"tag":"authn","operationId":"oidcLogin","parameters":[]}}],"schemas":{"302":{"description":"Redirect"}}},{"description":"get /api/v2/authn/oidc/logout","tests":[{"operation":{"tag":"authn","operationId":"oidcLogout","parameters":[]}}],"schemas":{"302":{"description":"Redirect"}}},{"tests":[{"description":"login with correct username and password","operation":{"parameters":[{"type":"raw","value":"sdk_test"},{"type":"raw","value":"pwd"}],"tag":"authn","operationId":"basicLogin","response":{"statusCode":200,"schema":{"type":"object","properties":{"token":{"type":"string","description":"your access token"},"user":{"type":"string","description":"username"},"admin":{"type":"boolean","description":"true if user is admin"}},"required":["token","user","admin"]},"contentType":"application/json"}}},{"description":"login with non-existent username","operation":{"parameters":[{"type":"raw","value":"nonexistentuser"},{"type":"raw","value":"password"}],"response":{"statusCode":400,"expectResult":{"code":"NoUserError","message":"User nonexistentuser is not found."},"schema":{"description":"NoUserError or IncorrectPasswordError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]}}}}},"tag":"authn","operationId":"basicLogin"}},{"description":"login with incorrect password","operation":{"parameters":[{"type":"raw","value":"sdk_test"},{"type":"raw","value":"incorrectpassword"}],"response":{"statusCode":400,"expectResult":{"code":"IncorrectPasswordError","message":"Password is incorrect."},"schema":{"description":"NoUserError or IncorrectPasswordError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]}}}}},"tag":"authn","operationId":"basicLogin"}}],"after":[{"tag":"token","operationId":"deleteToken","parameters":[{"type":"fromResult","resultType":"testResults","resultPath":["token"],"resultIndex":0}]}],"schemas":{"200":{"description":"Succeeded","content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string","description":"your access token"},"user":{"type":"string","description":"username"},"admin":{"type":"boolean","description":"true if user is admin"}},"required":["token","user","admin"]},"example":{"token":"JWT Token Example","user":"user","admin":true}}}},"400":{"description":"NoUserError or IncorrectPasswordError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]}}}},"404":{"description":"NoUserError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"NoUserError":{"value":{"code":"NoUserError","message":"User {user} is not found."}}}}}}},"description":"post /api/v2/authn/basic/login"},{"before":[{"tag":"authn","operationId":"basicLogin","parameters":[{"type":"raw","value":"sdk_test"},{"type":"raw","value":"pwd"}]}],"tests":[{"description":"Logout with correct token","customizedTest":"logoutWithCorrectToken","operation":{"tag":"authn","operationId":"basicLogout","parameters":[],"response":{"statusCode":200,"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"contentType":"application/json"}}},{"description":"Logout with incorrect token","customizedTest":"logoutWithIncorrectToken","operation":{"tag":"authn","operationId":"basicLogout","parameters":[],"response":{"statusCode":200,"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"contentType":"application/json"}}}],"schemas":{"200":{"description":"Succeeded","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"example":{"message":"Logout successfully"}}}},"401":{"description":"UnauthorizedUserError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"UnauthorizedUserError":{"value":{"code":"UnauthorizedUserError","message":"Guest is not allowed to do this operation."}}}}}},"403":{"description":"ForbiddenUserError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"ForbiddenUserError":{"value":{"code":"ForbiddenUserError","message":"Non-admin is not allow to do this operation."}},"ForbiddenTokenError":{"value":{"code":"ForbiddenUserError","message":"Applications are not allowed to do this operation."}}}}}}},"description":"delete /api/v2/authn/basic/logout"},{"before":[{"tag":"token","operationId":"createApplicationToken"}],"tests":[{"description":"Create a user","operation":{"tag":"user","operationId":"createUser","parameters":[{"type":"raw","value":{"username":"sdk_test_user","password":"test_password"}}],"response":{"statusCode":201,"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"contentType":"application/json"}}},{"description":"Create a conflict user","operation":{"tag":"user","operationId":"createUser","parameters":[{"type":"raw","value":{"username":"sdk_test_user","password":"test_password"}}],"response":{"statusCode":409,"schema":{"description":"ConflictUserError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"ConflictUserError":{"value":{"code":"ConflictUserError","message":"User name {user} already exists."}}}}}}}}},{"description":"Create a user by application token","customizedTest":"createUserByApplicationToken","operation":{"tag":"user","operationId":"createUser","parameters":[],"response":{"statusCode":201,"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"contentType":"application/json"}}},{"description":"Create a user by non-admin user token","customizedTest":"createUserByNonadminToken","operation":{"tag":"user","operationId":"createUser","parameters":[],"response":{"statusCode":201,"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"contentType":"application/json"}}}],"after":[{"tag":"user","operationId":"deleteUser","parameters":[{"type":"raw","value":"sdk_test_user"}],"response":{"statusCode":200,"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"contentType":"application/json"}},{"tag":"token","operationId":"deleteToken","parameters":[{"type":"fromResult","resultType":"beforeResults","resultPath":["token"],"resultIndex":0}]}],"schemas":{"201":{"description":"Succeeded","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"example":{"message":"User is created successfully"}}}},"401":{"description":"UnauthorizedUserError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"UnauthorizedUserError":{"value":{"code":"UnauthorizedUserError","message":"Guest is not allowed to do this operation."}}}}}},"403":{"description":"ForbiddenUserError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"ForbiddenUserError":{"value":{"code":"ForbiddenUserError","message":"Non-admin is not allow to do this operation."}},"ForbiddenTokenError":{"value":{"code":"ForbiddenUserError","message":"Applications are not allowed to do this operation."}}}}}},"409":{"description":"ConflictUserError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"ConflictUserError":{"value":{"code":"ConflictUserError","message":"User name {user} already exists."}}}}}},"500":{"description":"UnknownError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"UnknownError":{"value":{"code":"UnknownError","message":"Internal error message."}}}}}}},"description":"post /api/v2/users"},{"description":"get /api/v2/users","tests":[{"operation":{"tag":"user","operationId":"getAllUser","parameters":[],"response":{"statusCode":200,"schema":{"description":"Array with all users in the system.","type":"array","items":{"type":"object","properties":{"username":{"type":"string","description":"user name"},"admin":{"type":"boolean","description":"Admin or not."},"virtualCluster":{"type":"array","description":"The list of virtualCluster which the user can access.","items":{"type":"string","description":"virtual cluster name."}},"storageConfig":{"type":"array","description":"storageconfig string arry","items":{"type":"string"}},"email":{"type":"string","description":"email address"},"extension":{"type":"object","description":"extension field."}},"required":["username","admin","virtualCluster","storageConfig","email","extension"]}},"contentType":"application/json"}}}],"schemas":{"200":{"description":"Succeeded","content":{"application/json":{"schema":{"description":"Array with all users in the system.","type":"array","items":{"type":"object","properties":{"username":{"type":"string","description":"user name"},"admin":{"type":"boolean","description":"Admin or not."},"virtualCluster":{"type":"array","description":"The list of virtualCluster which the user can access.","items":{"type":"string","description":"virtual cluster name."}},"storageConfig":{"type":"array","description":"storageconfig string arry","items":{"type":"string"}},"email":{"type":"string","description":"email address"},"extension":{"type":"object","description":"extension field."}},"required":["username","admin","virtualCluster","storageConfig","email","extension"]}},"example":[{"username":"username","admin":true,"virtualCluster":[],"storageConfig":[],"email":"email@test.com","extension":{}}]}}},"500":{"description":"UnknownError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"UnknownError":{"value":{"code":"UnknownError","message":"Internal error message."}}}}}}}},{"before":[{"tag":"user","operationId":"createUser","parameters":[{"type":"raw","value":{"username":"sdk_test_user","password":"test_password"}}],"response":{"statusCode":201,"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"contentType":"application/json"}},{"tag":"token","operationId":"createApplicationToken"}],"tests":[{"description":"Update a user, patch: true","operation":{"parameters":[{"type":"raw","value":{"username":"sdk_test_user","email":"new_email@test1.com"}}],"tag":"user","operationId":"updateUser","response":{"statusCode":201,"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"contentType":"application/json"}}},{"description":"Update a user, patch: false","operation":{"parameters":[{"type":"raw","value":{"username":"sdk_test_user","email":"new_email@test2.com","virtualCluster":["default"],"admin":false,"password":"new_test_password","extension":{}}},{"type":"raw","value":false}],"tag":"user","operationId":"updateUser","response":{"statusCode":201,"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"contentType":"application/json"}}},{"description":"Update a non-existent user","operation":{"parameters":[{"type":"raw","value":{"username":"non_exist_user","email":"new_email@test1.com"}}],"response":{"statusCode":404,"schema":{"description":"NoUserError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"NoUserError":{"value":{"code":"NoUserError","message":"User {user} is not found."}}}}}}},"tag":"user","operationId":"updateUser"}},{"description":"Update a user by application token","customizedTest":"updateUserByApplicationToken","operation":{"tag":"user","operationId":"updateUser","parameters":[],"response":{"statusCode":201,"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"contentType":"application/json"}}},{"description":"Update a user by non-admin user token","customizedTest":"updateUserByNonadminToken","operation":{"tag":"user","operationId":"updateUser","parameters":[],"response":{"statusCode":201,"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"contentType":"application/json"}}}],"after":[{"tag":"user","operationId":"deleteUser","parameters":[{"type":"raw","value":"sdk_test_user"}],"response":{"statusCode":200,"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"contentType":"application/json"}},{"tag":"token","operationId":"deleteToken","parameters":[{"type":"fromResult","resultType":"beforeResults","resultPath":["token"],"resultIndex":1}]}],"schemas":{"201":{"description":"Succeeded","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"example":{"message":"update group {username} successfully."}}}},"401":{"description":"UnauthorizedUserError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"UnauthorizedUserError":{"value":{"code":"UnauthorizedUserError","message":"Guest is not allowed to do this operation."}}}}}},"403":{"description":"ForbiddenUserError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"ForbiddenUserError":{"value":{"code":"ForbiddenUserError","message":"Non-admin is not allow to do this operation."}},"ForbiddenTokenError":{"value":{"code":"ForbiddenUserError","message":"Applications are not allowed to do this operation."}}}}}},"404":{"description":"NoUserError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"NoUserError":{"value":{"code":"NoUserError","message":"User {user} is not found."}}}}}},"500":{"description":"UnknownError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"UnknownError":{"value":{"code":"UnknownError","message":"Internal error message."}}}}}}},"description":"put /api/v2/users"},{"tests":[{"description":"Update user self, patch: true","operation":{"parameters":[{"type":"raw","value":{"username":"sdk_test","email":"new_email@test1.com"}}],"tag":"user","operationId":"updateUserSelf","response":{"statusCode":201,"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"contentType":"application/json"}}},{"description":"Update user self, patch: false","operation":{"parameters":[{"type":"raw","value":{"username":"sdk_test","email":"new_email@test2.com","oldPassword":"pwd","newPassword":"pwd"}},{"type":"raw","value":false}],"tag":"user","operationId":"updateUserSelf","response":{"statusCode":201,"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"contentType":"application/json"}}},{"description":"Update user self with incorrect username","operation":{"parameters":[{"type":"raw","value":{"username":"incorrect_username","email":"new_email@test1.com"}}],"response":{"statusCode":403,"schema":{"description":"ForbiddenUserError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"ForbiddenUserError":{"value":{"code":"ForbiddenUserError","message":"Non-admin is not allow to do this operation."}},"ForbiddenTokenError":{"value":{"code":"ForbiddenUserError","message":"Applications are not allowed to do this operation."}}}}}}},"tag":"user","operationId":"updateUserSelf"}}],"schemas":{"201":{"description":"Succeeded","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"example":{"message":"update group {username} successfully."}}}},"401":{"description":"UnauthorizedUserError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"UnauthorizedUserError":{"value":{"code":"UnauthorizedUserError","message":"Guest is not allowed to do this operation."}}}}}},"403":{"description":"ForbiddenUserError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"ForbiddenUserError":{"value":{"code":"ForbiddenUserError","message":"Non-admin is not allow to do this operation."}},"ForbiddenTokenError":{"value":{"code":"ForbiddenUserError","message":"Applications are not allowed to do this operation."}}}}}},"404":{"description":"NoUserError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"NoUserError":{"value":{"code":"NoUserError","message":"User {user} is not found."}}}}}},"500":{"description":"UnknownError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"UnknownError":{"value":{"code":"UnknownError","message":"Internal error message."}}}}}}},"description":"put /api/v2/users/me"},{"tests":[{"operation":{"parameters":[{"type":"raw","value":"sdk_test"}],"tag":"user","operationId":"getUser","response":{"statusCode":200,"schema":{"type":"object","properties":{"username":{"type":"string","description":"user name"},"admin":{"type":"boolean","description":"Admin or not."},"virtualCluster":{"type":"array","description":"The list of virtualCluster which the user can access.","items":{"type":"string","description":"virtual cluster name."}},"storageConfig":{"type":"array","description":"storageconfig string arry","items":{"type":"string"}},"email":{"type":"string","description":"email address"},"extension":{"type":"object","description":"extension field."}},"required":["username","admin","virtualCluster","storageConfig","email","extension"]},"contentType":"application/json"}}}],"schemas":{"200":{"description":"Succeeded","content":{"application/json":{"schema":{"type":"object","properties":{"username":{"type":"string","description":"user name"},"admin":{"type":"boolean","description":"Admin or not."},"virtualCluster":{"type":"array","description":"The list of virtualCluster which the user can access.","items":{"type":"string","description":"virtual cluster name."}},"storageConfig":{"type":"array","description":"storageconfig string arry","items":{"type":"string"}},"email":{"type":"string","description":"email address"},"extension":{"type":"object","description":"extension field."}},"required":["username","admin","virtualCluster","storageConfig","email","extension"]},"example":{"username":"username","admin":true,"virtualCluster":[],"storageConfig":[],"email":"email@test.com","extension":{}}}}},"401":{"description":"UnauthorizedUserError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"UnauthorizedUserError":{"value":{"code":"UnauthorizedUserError","message":"Guest is not allowed to do this operation."}}}}}},"404":{"description":"NoUserError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"NoUserError":{"value":{"code":"NoUserError","message":"User {user} is not found."}}}}}},"500":{"description":"UnknownError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"UnknownError":{"value":{"code":"UnknownError","message":"Internal error message."}}}}}}},"description":"get /api/v2/users/{user}"},{"before":[{"tag":"user","operationId":"createUser","parameters":[{"type":"raw","value":{"username":"sdk_test_user","password":"test_password"}}],"response":{"statusCode":201,"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"contentType":"application/json"}},{"tag":"token","operationId":"createApplicationToken"}],"tests":[{"description":"Delete a user","operation":{"tag":"user","operationId":"deleteUser","parameters":[{"type":"raw","value":"sdk_test_user"}],"response":{"statusCode":200,"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"contentType":"application/json"}}},{"description":"Delete a non-existent user","operation":{"parameters":[{"type":"raw","value":"non_exist_user"}],"response":{"statusCode":404,"schema":{"description":"NoUserError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"NoUserError":{"value":{"code":"NoUserError","message":"User {user} is not found."}}}}}}},"tag":"user","operationId":"deleteUser"}},{"description":"Delete a user by application token","customizedTest":"deleteUserByApplicationToken","operation":{"tag":"user","operationId":"deleteUser","parameters":[],"response":{"statusCode":200,"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"contentType":"application/json"}}},{"description":"Delete a user by non-admin user token","customizedTest":"deleteUserByNonadminToken","operation":{"tag":"user","operationId":"deleteUser","parameters":[],"response":{"statusCode":200,"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"contentType":"application/json"}}}],"after":[{"tag":"token","operationId":"deleteToken","parameters":[{"type":"fromResult","resultType":"beforeResults","resultPath":["token"],"resultIndex":1}]}],"schemas":{"200":{"description":"Succeeded","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"example":{"message":"user is removed successfully"}}}},"401":{"description":"UnauthorizedUserError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"UnauthorizedUserError":{"value":{"code":"UnauthorizedUserError","message":"Guest is not allowed to do this operation."}}}}}},"403":{"description":"ForbiddenUserError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"ForbiddenUserError":{"value":{"code":"ForbiddenUserError","message":"Non-admin is not allow to do this operation."}},"ForbiddenTokenError":{"value":{"code":"ForbiddenUserError","message":"Applications are not allowed to do this operation."}}}}}},"404":{"description":"NoUserError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"NoUserError":{"value":{"code":"NoUserError","message":"User {user} is not found."}}}}}},"500":{"description":"UnknownError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"UnknownError":{"value":{"code":"UnknownError","message":"Internal error message."}}}}}}},"description":"delete /api/v2/users/{user}"},{"before":[{"tag":"token","operationId":"createApplicationToken"},{"tag":"user","operationId":"createUser","parameters":[{"type":"raw","value":{"username":"sdk_test_user","password":"test_password"}}],"response":{"statusCode":201,"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"contentType":"application/json"}},{"tag":"group","operationId":"createGroup","parameters":[{"type":"raw","value":{"groupname":"sdktestgroup"}}],"response":{"statusCode":201,"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"contentType":"application/json"}}],"tests":[{"description":"Add a group to a user's grouplist","operation":{"parameters":[{"type":"raw","value":"sdk_test_user"},{"type":"raw","value":"sdktestgroup"}],"tag":"user","operationId":"updateUserGroup","response":{"statusCode":201,"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"contentType":"application/json"}}},{"description":"Add a group to a non-existent user's grouplist","operation":{"parameters":[{"type":"raw","value":"non_exist_user"},{"type":"raw","value":"sdktestgroup"}],"response":{"statusCode":404,"schema":{"description":"NoUserError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"NoUserError":{"value":{"code":"NoUserError","message":"User {user} is not found."}}}}}}},"tag":"user","operationId":"updateUserGroup"}},{"description":"Add a group to a user's grouplist by application token","customizedTest":"updateUserGroupByApplicationToken","operation":{"tag":"user","operationId":"updateUserGroup","parameters":[],"response":{"statusCode":201,"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"contentType":"application/json"}}},{"description":"Add a group to a user's grouplist by non-admin user token","customizedTest":"updateUserGroupByNonadminToken","operation":{"tag":"user","operationId":"updateUserGroup","parameters":[],"response":{"statusCode":201,"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"contentType":"application/json"}}}],"after":[{"tag":"token","operationId":"deleteToken","parameters":[{"type":"fromResult","resultType":"beforeResults","resultPath":["token"],"resultIndex":0}]},{"tag":"user","operationId":"deleteUser","parameters":[{"type":"raw","value":"sdk_test_user"}],"response":{"statusCode":200,"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"contentType":"application/json"}},{"tag":"group","operationId":"deleteGroup","parameters":[{"type":"raw","value":"sdktestgroup"}],"response":{"statusCode":201,"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"contentType":"application/json"}}],"schemas":{"201":{"description":"Succeeded","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"example":{"message":"User {username} is added into group {groupname}"}}}},"401":{"description":"UnauthorizedUserError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"UnauthorizedUserError":{"value":{"code":"UnauthorizedUserError","message":"Guest is not allowed to do this operation."}}}}}},"403":{"description":"ForbiddenUserError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"ForbiddenUserError":{"value":{"code":"ForbiddenUserError","message":"Non-admin is not allow to do this operation."}},"ForbiddenTokenError":{"value":{"code":"ForbiddenUserError","message":"Applications are not allowed to do this operation."}}}}}},"404":{"description":"NoUserError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"NoUserError":{"value":{"code":"NoUserError","message":"User {user} is not found."}}}}}},"500":{"description":"UnknownError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"UnknownError":{"value":{"code":"UnknownError","message":"Internal error message."}}}}}}},"description":"put /api/v2/users/{user}/group/"},{"before":[{"tag":"token","operationId":"createApplicationToken"},{"tag":"user","operationId":"createUser","parameters":[{"type":"raw","value":{"username":"sdk_test_user","password":"test_password"}}],"response":{"statusCode":201,"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"contentType":"application/json"}},{"tag":"group","operationId":"createGroup","parameters":[{"type":"raw","value":{"groupname":"sdktestgroup"}}],"response":{"statusCode":201,"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"contentType":"application/json"}},{"tag":"user","operationId":"updateUserGroup","parameters":[{"type":"raw","value":"sdk_test_user"},{"type":"raw","value":"sdktestgroup"}]}],"tests":[{"description":"Remove a group to a user's grouplist","operation":{"parameters":[{"type":"raw","value":"sdk_test_user"},{"type":"raw","value":"sdktestgroup"}],"tag":"user","operationId":"deleteUserGroup","response":{"statusCode":201,"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"contentType":"application/json"}}},{"description":"Remove a group to a non-existent user's grouplist","operation":{"parameters":[{"type":"raw","value":"non_exist_user"},{"type":"raw","value":"sdktestgroup"}],"response":{"statusCode":404,"schema":{"description":"NoUserError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"NoUserError":{"value":{"code":"NoUserError","message":"User {user} is not found."}}}}}}},"tag":"user","operationId":"deleteUserGroup"}},{"description":"Remove a group to a user's grouplist by application token","customizedTest":"deleteUserGroupByApplicationToken","operation":{"tag":"user","operationId":"deleteUserGroup","parameters":[],"response":{"statusCode":201,"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"contentType":"application/json"}}},{"description":"Remove a group to a user's grouplist by non-admin user token","customizedTest":"deleteUserGroupByNonadminToken","operation":{"tag":"user","operationId":"deleteUserGroup","parameters":[],"response":{"statusCode":201,"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"contentType":"application/json"}}}],"after":[{"tag":"token","operationId":"deleteToken","parameters":[{"type":"fromResult","resultType":"beforeResults","resultPath":["token"],"resultIndex":0}]},{"tag":"user","operationId":"deleteUser","parameters":[{"type":"raw","value":"sdk_test_user"}],"response":{"statusCode":200,"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"contentType":"application/json"}},{"tag":"group","operationId":"deleteGroup","parameters":[{"type":"raw","value":"sdktestgroup"}],"response":{"statusCode":201,"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"contentType":"application/json"}}],"schemas":{"201":{"description":"Succeeded","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"example":{"message":"User {username} is removed from group {groupname}"}}}},"401":{"description":"UnauthorizedUserError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"UnauthorizedUserError":{"value":{"code":"UnauthorizedUserError","message":"Guest is not allowed to do this operation."}}}}}},"403":{"description":"ForbiddenUserError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"ForbiddenUserError":{"value":{"code":"ForbiddenUserError","message":"Non-admin is not allow to do this operation."}},"ForbiddenTokenError":{"value":{"code":"ForbiddenUserError","message":"Applications are not allowed to do this operation."}}}}}},"404":{"description":"NoUserError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"NoUserError":{"value":{"code":"NoUserError","message":"User {user} is not found."}}}}}},"500":{"description":"UnknownError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"UnknownError":{"value":{"code":"UnknownError","message":"Internal error message."}}}}}}},"description":"delete /api/v2/users/{user}/group/"},{"before":[{"tag":"token","operationId":"createApplicationToken"},{"tag":"user","operationId":"createUser","parameters":[{"type":"raw","value":{"username":"sdk_test_user","password":"test_password"}}],"response":{"statusCode":201,"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"contentType":"application/json"}}],"tests":[{"description":"Replace a user's grouplist","operation":{"parameters":[{"type":"raw","value":"sdk_test_user"},{"type":"raw","value":["default"]}],"tag":"user","operationId":"updateUserGrouplist","response":{"statusCode":201,"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"contentType":"application/json"}}},{"description":"Replace a non-existent user's grouplist","operation":{"parameters":[{"type":"raw","value":"non_exist_user"},{"type":"raw","value":["default"]}],"response":{"statusCode":404,"schema":{"description":"NoUserError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"NoUserError":{"value":{"code":"NoUserError","message":"User {user} is not found."}}}}}}},"tag":"user","operationId":"updateUserGrouplist"}},{"description":"Replace a user's grouplist by application token","customizedTest":"updateUserGrouplistByApplicationToken","operation":{"tag":"user","operationId":"updateUserGrouplist","parameters":[],"response":{"statusCode":201,"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"contentType":"application/json"}}},{"description":"Replace a user's grouplist by non-admin user token","customizedTest":"updateUserGrouplistByNonadminToken","operation":{"tag":"user","operationId":"updateUserGrouplist","parameters":[],"response":{"statusCode":201,"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"contentType":"application/json"}}}],"after":[{"tag":"token","operationId":"deleteToken","parameters":[{"type":"fromResult","resultType":"beforeResults","resultPath":["token"],"resultIndex":0}]},{"tag":"user","operationId":"deleteUser","parameters":[{"type":"raw","value":"sdk_test_user"}],"response":{"statusCode":200,"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"contentType":"application/json"}}],"schemas":{"201":{"description":"Succeeded","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"example":{"message":"update user grouplist successfully."}}}},"401":{"description":"UnauthorizedUserError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"UnauthorizedUserError":{"value":{"code":"UnauthorizedUserError","message":"Guest is not allowed to do this operation."}}}}}},"403":{"description":"ForbiddenUserError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"ForbiddenUserError":{"value":{"code":"ForbiddenUserError","message":"Non-admin is not allow to do this operation."}},"ForbiddenTokenError":{"value":{"code":"ForbiddenUserError","message":"Applications are not allowed to do this operation."}}}}}},"404":{"description":"NoUserError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"NoUserError":{"value":{"code":"NoUserError","message":"User {user} is not found."}}}}}},"500":{"description":"UnknownError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"UnknownError":{"value":{"code":"UnknownError","message":"Internal error message."}}}}}}},"description":"put /api/v2/users/{user}/grouplist/"},{"description":"get /api/v2/groups","tests":[{"operation":{"tag":"group","operationId":"getAllGroup","parameters":[],"response":{"statusCode":200,"schema":{"description":"Array with all groups in the system.","type":"array","items":{"type":"object","properties":{"groupname":{"type":"string","description":"group name"},"description":{"type":"string","description":"description for the group"},"externalName":{"type":"string","description":"the external group name binding with the group in OpenPAI"},"extension":{"type":"object"}}}},"contentType":"application/json"}}}],"schemas":{"200":{"description":"Succeeded","content":{"application/json":{"schema":{"description":"Array with all groups in the system.","type":"array","items":{"type":"object","properties":{"groupname":{"type":"string","description":"group name"},"description":{"type":"string","description":"description for the group"},"externalName":{"type":"string","description":"the external group name binding with the group in OpenPAI"},"extension":{"type":"object"}}}},"example":[{"groupname":"groupName","description":"description","externalName":"externalName","extension":{}}]}}},"500":{"description":"UnknownError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"UnknownError":{"value":{"code":"UnknownError","message":"Internal error message."}}}}}}}},{"tests":[{"operation":{"tag":"group","operationId":"createGroup","parameters":[{"type":"raw","value":{"groupname":"sdktestgroup"}}],"response":{"statusCode":201,"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"contentType":"application/json"}}}],"after":[{"tag":"group","operationId":"deleteGroup","parameters":[{"type":"raw","value":"sdktestgroup"}],"response":{"statusCode":201,"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"contentType":"application/json"}}],"schemas":{"201":{"description":"Succeeded","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"example":{"message":"group is created successfully"}}}},"401":{"description":"UnauthorizedUserError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"UnauthorizedUserError":{"value":{"code":"UnauthorizedUserError","message":"Guest is not allowed to do this operation."}}}}}},"403":{"description":"ForbiddenUserError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"ForbiddenUserError":{"value":{"code":"ForbiddenUserError","message":"Non-admin is not allow to do this operation."}},"ForbiddenTokenError":{"value":{"code":"ForbiddenUserError","message":"Applications are not allowed to do this operation."}}}}}},"500":{"description":"UnknownError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"UnknownError":{"value":{"code":"UnknownError","message":"Internal error message."}}}}}}},"description":"post /api/v2/groups"},{"before":[{"tag":"group","operationId":"createGroup","parameters":[{"type":"raw","value":{"groupname":"sdktestgroup"}}],"response":{"statusCode":201,"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"contentType":"application/json"}}],"tests":[{"operation":{"parameters":[{"type":"raw","value":{"data":{"groupname":"sdktestgroup","description":"test update group"},"patch":true}}],"tag":"group","operationId":"updateGroup","response":{"statusCode":201,"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"contentType":"application/json"}}}],"after":[{"tag":"group","operationId":"deleteGroup","parameters":[{"type":"raw","value":"sdktestgroup"}],"response":{"statusCode":201,"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"contentType":"application/json"}}],"schemas":{"201":{"description":"Succeeded","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"example":{"message":"update group {groupname} successfully."}}}},"401":{"description":"UnauthorizedUserError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"UnauthorizedUserError":{"value":{"code":"UnauthorizedUserError","message":"Guest is not allowed to do this operation."}}}}}},"403":{"description":"ForbiddenUserError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"ForbiddenUserError":{"value":{"code":"ForbiddenUserError","message":"Non-admin is not allow to do this operation."}},"ForbiddenTokenError":{"value":{"code":"ForbiddenUserError","message":"Applications are not allowed to do this operation."}}}}}},"404":{"description":"NoGroupError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"NoGroupError":{"value":{"code":"NoGroupError","message":"Group {groupname} is not found."}}}}}},"500":{"description":"UnknownError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"UnknownError":{"value":{"code":"UnknownError","message":"Internal error message."}}}}}}},"description":"put /api/v2/groups"},{"before":[{"tag":"group","operationId":"createGroup","parameters":[{"type":"raw","value":{"groupname":"sdktestgroup"}}],"response":{"statusCode":201,"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"contentType":"application/json"}}],"tests":[{"operation":{"parameters":[{"type":"raw","value":"sdktestgroup"}],"tag":"group","operationId":"getGroup","response":{"statusCode":200,"schema":{"type":"object","properties":{"groupname":{"type":"string","description":"group name"},"description":{"type":"string","description":"description for the group"},"externalName":{"type":"string","description":"the external group name binding with the group in OpenPAI"},"extension":{"type":"object"}},"required":["groupname","description","externalName","extension"]},"contentType":"application/json"}}}],"after":[{"tag":"group","operationId":"deleteGroup","parameters":[{"type":"raw","value":"sdktestgroup"}],"response":{"statusCode":201,"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"contentType":"application/json"}}],"schemas":{"200":{"description":"Succeeded","content":{"application/json":{"schema":{"type":"object","properties":{"groupname":{"type":"string","description":"group name"},"description":{"type":"string","description":"description for the group"},"externalName":{"type":"string","description":"the external group name binding with the group in OpenPAI"},"extension":{"type":"object"}},"required":["groupname","description","externalName","extension"]},"example":{"groupname":"groupName","description":"description","externalName":"externalName","extension":{}}}}},"401":{"description":"UnauthorizedUserError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"UnauthorizedUserError":{"value":{"code":"UnauthorizedUserError","message":"Guest is not allowed to do this operation."}}}}}},"404":{"description":"NoGroupError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"NoGroupError":{"value":{"code":"NoGroupError","message":"Group {groupname} is not found."}}}}}},"500":{"description":"UnknownError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"UnknownError":{"value":{"code":"UnknownError","message":"Internal error message."}}}}}}},"description":"get /api/v2/groups/{group}"},{"before":[{"tag":"group","operationId":"createGroup","parameters":[{"type":"raw","value":{"groupname":"sdktestgroup"}}],"response":{"statusCode":201,"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"contentType":"application/json"}}],"tests":[{"operation":{"tag":"group","operationId":"deleteGroup","parameters":[{"type":"raw","value":"sdktestgroup"}],"response":{"statusCode":201,"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"contentType":"application/json"}}}],"schemas":{"201":{"description":"Succeeded","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"example":{"message":"group is removed successfully"}}}},"401":{"description":"UnauthorizedUserError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"UnauthorizedUserError":{"value":{"code":"UnauthorizedUserError","message":"Guest is not allowed to do this operation."}}}}}},"403":{"description":"ForbiddenUserError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"ForbiddenUserError":{"value":{"code":"ForbiddenUserError","message":"Non-admin is not allow to do this operation."}},"ForbiddenTokenError":{"value":{"code":"ForbiddenUserError","message":"Applications are not allowed to do this operation."}}}}}},"500":{"description":"UnknownError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"UnknownError":{"value":{"code":"UnknownError","message":"Internal error message."}}}}}}},"description":"delete /api/v2/groups/{group}"},{"description":"get /api/v2/groups/{group}/userlist","tests":[{"operation":{"tag":"group","operationId":"getGroupMembers","parameters":[],"response":{"statusCode":200,"schema":{"description":"Array with all users in the group.","type":"array","items":{"type":"object","properties":{"username":{"type":"string","description":"user name"},"clusterAdmin":{"type":"boolean","description":"Cluster admin or not."}}}},"contentType":"application/json"}}}],"schemas":{"200":{"description":"Succeeded","content":{"application/json":{"schema":{"description":"Array with all users in the group.","type":"array","items":{"type":"object","properties":{"username":{"type":"string","description":"user name"},"clusterAdmin":{"type":"boolean","description":"Cluster admin or not."}}}},"example":[{"username":"username","clusterAdmin":false}]}}},"401":{"description":"UnauthorizedUserError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"UnauthorizedUserError":{"value":{"code":"UnauthorizedUserError","message":"Guest is not allowed to do this operation."}}}}}},"500":{"description":"UnknownError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"UnknownError":{"value":{"code":"UnknownError","message":"Internal error message."}}}}}}}},{"description":"get /api/v2/virtual-clusters","tests":[{"operation":{"tag":"virtual cluster","operationId":"listVirtualClusters","parameters":[],"response":{"statusCode":200,"schema":{"type":"object","additionalProperties":{"type":"object","properties":{"capacity":{"type":"number","description":"capacity percentage this virtual cluster can use of entire cluster"},"usedCapacity":{"type":"number","description":"used capacity percentage this virtual cluster can use of entire cluster"},"maxCapacity":{"type":"number","description":"max capacity percentage this virtual cluster can use of entire cluster"},"dedicated":{"type":"boolean","description":"dedicated virtual cluster or not"},"resourcesUsed":{"type":"object","description":"used resources","properties":{"cpu":{"type":"integer","description":"used cpu number"},"vCores":{"type":"integer","description":"same as cpu"},"memory":{"type":"integer","description":"used memory in MB"},"gpu":{"type":"integer","description":"used gpu number"},"GPUs":{"type":"integer","description":"same as gpu"}}},"resourcesGuaranteed":{"type":"object","description":"guaranteed resources, including used and free","properties":{"cpu":{"type":"integer","description":"guaranteed cpu number"},"vCores":{"type":"integer","description":"same as cpu"},"memory":{"type":"integer","description":"guaranteed memory in MB"},"gpu":{"type":"integer","description":"guaranteed gpu number"},"GPUs":{"type":"integer","description":"same as gpu"}}},"resourcesTotal":{"type":"object","description":"total resources, including guaranteed and bad","properties":{"cpu":{"type":"integer","description":"total cpu number"},"vCores":{"type":"integer","description":"same as cpu"},"memory":{"type":"integer","description":"total memory in MB"},"gpu":{"type":"integer","description":"total gpu number"},"GPUs":{"type":"integer","description":"same as gpu"}}}},"required":["capacity","usedCapacity","maxCapacity","resourcesUsed","resourcesGuaranteed","resourcesTotal"]}},"contentType":"application/json"}}}],"schemas":{"200":{"description":"Succeeded","content":{"application/json":{"schema":{"type":"object","additionalProperties":{"type":"object","properties":{"capacity":{"type":"number","description":"capacity percentage this virtual cluster can use of entire cluster"},"usedCapacity":{"type":"number","description":"used capacity percentage this virtual cluster can use of entire cluster"},"maxCapacity":{"type":"number","description":"max capacity percentage this virtual cluster can use of entire cluster"},"dedicated":{"type":"boolean","description":"dedicated virtual cluster or not"},"resourcesUsed":{"type":"object","description":"used resources","properties":{"cpu":{"type":"integer","description":"used cpu number"},"vCores":{"type":"integer","description":"same as cpu"},"memory":{"type":"integer","description":"used memory in MB"},"gpu":{"type":"integer","description":"used gpu number"},"GPUs":{"type":"integer","description":"same as gpu"}}},"resourcesGuaranteed":{"type":"object","description":"guaranteed resources, including used and free","properties":{"cpu":{"type":"integer","description":"guaranteed cpu number"},"vCores":{"type":"integer","description":"same as cpu"},"memory":{"type":"integer","description":"guaranteed memory in MB"},"gpu":{"type":"integer","description":"guaranteed gpu number"},"GPUs":{"type":"integer","description":"same as gpu"}}},"resourcesTotal":{"type":"object","description":"total resources, including guaranteed and bad","properties":{"cpu":{"type":"integer","description":"total cpu number"},"vCores":{"type":"integer","description":"same as cpu"},"memory":{"type":"integer","description":"total memory in MB"},"gpu":{"type":"integer","description":"total gpu number"},"GPUs":{"type":"integer","description":"same as gpu"}}}},"required":["capacity","usedCapacity","maxCapacity","resourcesUsed","resourcesGuaranteed","resourcesTotal"]}}}}},"500":{"description":"UnknownError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"UnknownError":{"value":{"code":"UnknownError","message":"Internal error message."}}}}}}}},{"tests":[{"operation":{"parameters":[{"type":"raw","value":"default"}],"tag":"virtual cluster","operationId":"getVirtualCluster","response":{"statusCode":200,"schema":{"type":"object","properties":{"capacity":{"type":"number","description":"capacity percentage this virtual cluster can use of entire cluster"},"usedCapacity":{"type":"number","description":"used capacity percentage this virtual cluster can use of entire cluster"},"maxCapacity":{"type":"number","description":"max capacity percentage this virtual cluster can use of entire cluster"},"dedicated":{"type":"boolean","description":"dedicated virtual cluster or not"},"resourcesUsed":{"type":"object","description":"used resources","properties":{"cpu":{"type":"integer","description":"used cpu number"},"vCores":{"type":"integer","description":"same as cpu"},"memory":{"type":"integer","description":"used memory in MB"},"gpu":{"type":"integer","description":"used gpu number"},"GPUs":{"type":"integer","description":"same as gpu"}}},"resourcesGuaranteed":{"type":"object","description":"guaranteed resources, including used and free","properties":{"cpu":{"type":"integer","description":"guaranteed cpu number"},"vCores":{"type":"integer","description":"same as cpu"},"memory":{"type":"integer","description":"guaranteed memory in MB"},"gpu":{"type":"integer","description":"guaranteed gpu number"},"GPUs":{"type":"integer","description":"same as gpu"}}},"resourcesTotal":{"type":"object","description":"total resources, including guaranteed and bad","properties":{"cpu":{"type":"integer","description":"total cpu number"},"vCores":{"type":"integer","description":"same as cpu"},"memory":{"type":"integer","description":"total memory in MB"},"gpu":{"type":"integer","description":"total gpu number"},"GPUs":{"type":"integer","description":"same as gpu"}}}},"required":["capacity","usedCapacity","maxCapacity","resourcesUsed","resourcesGuaranteed","resourcesTotal"]},"contentType":"application/json"}}}],"schemas":{"200":{"description":"Succeeded","content":{"application/json":{"schema":{"type":"object","properties":{"capacity":{"type":"number","description":"capacity percentage this virtual cluster can use of entire cluster"},"usedCapacity":{"type":"number","description":"used capacity percentage this virtual cluster can use of entire cluster"},"maxCapacity":{"type":"number","description":"max capacity percentage this virtual cluster can use of entire cluster"},"dedicated":{"type":"boolean","description":"dedicated virtual cluster or not"},"resourcesUsed":{"type":"object","description":"used resources","properties":{"cpu":{"type":"integer","description":"used cpu number"},"vCores":{"type":"integer","description":"same as cpu"},"memory":{"type":"integer","description":"used memory in MB"},"gpu":{"type":"integer","description":"used gpu number"},"GPUs":{"type":"integer","description":"same as gpu"}}},"resourcesGuaranteed":{"type":"object","description":"guaranteed resources, including used and free","properties":{"cpu":{"type":"integer","description":"guaranteed cpu number"},"vCores":{"type":"integer","description":"same as cpu"},"memory":{"type":"integer","description":"guaranteed memory in MB"},"gpu":{"type":"integer","description":"guaranteed gpu number"},"GPUs":{"type":"integer","description":"same as gpu"}}},"resourcesTotal":{"type":"object","description":"total resources, including guaranteed and bad","properties":{"cpu":{"type":"integer","description":"total cpu number"},"vCores":{"type":"integer","description":"same as cpu"},"memory":{"type":"integer","description":"total memory in MB"},"gpu":{"type":"integer","description":"total gpu number"},"GPUs":{"type":"integer","description":"same as gpu"}}}},"required":["capacity","usedCapacity","maxCapacity","resourcesUsed","resourcesGuaranteed","resourcesTotal"]},"example":{"capacity":70,"usedCapacity":30,"dedicated":false,"resourcesUsed":{"cpu":1,"memory":1024,"gpu":1,"vCores":1,"GPUs":1},"resourcesGuaranteed":{"cpu":2,"memory":2048,"gpu":2,"vCores":2,"GPUs":2},"resourcesTotal":{"cpu":2,"memory":2048,"gpu":2,"vCores":2,"GPUs":2},"maxCapacity":70}}}},"404":{"description":"NoVirtualClusterError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"NoVirtualClusterError":{"value":{"code":"NoVirtualClusterError","message":"Virtual cluster {vc} is not found."}}}}}},"500":{"description":"UnknownError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"UnknownError":{"value":{"code":"UnknownError","message":"Internal error message."}}}}}}},"description":"get /api/v2/virtual-clusters/{vc}"},{"description":"get /api/v2/storages","tests":[{"operation":{"tag":"storage","operationId":"getStorages","parameters":[],"response":{"statusCode":200,"schema":{"type":"object","description":"summary of configured PV storage","properties":{"storages":{"type":"array","items":{"type":"object","description":"summary of each storage","properties":{"name":{"type":"string"},"share":{"type":"boolean"},"volumeName":{"type":"string"}},"required":["name","share","volumeName"]}}},"required":["storages"]},"contentType":"application/json"}}}],"schemas":{"200":{"description":"Succeeded","content":{"application/json":{"schema":{"type":"object","description":"summary of configured PV storage","properties":{"storages":{"type":"array","items":{"type":"object","description":"summary of each storage","properties":{"name":{"type":"string"},"share":{"type":"boolean"},"volumeName":{"type":"string"}},"required":["name","share","volumeName"]}}},"required":["storages"]},"example":{"storages":[{"name":"name","share":true,"volumeName":"volumeName"}]}}}},"500":{"description":"UnknownError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"UnknownError":{"value":{"code":"UnknownError","message":"Internal error message."}}}}}}}},{"before":[{"tag":"storage","operationId":"getStorages"}],"tests":[{"operation":{"parameters":[{"type":"fromResult","resultType":"beforeResults","resultPath":["storages",0,"name"],"resultIndex":0}],"tag":"storage","operationId":"getStorage","response":{"statusCode":200,"schema":{"type":"object","description":"detail of configured PV storage","properties":{"name":{"type":"string"},"share":{"type":"boolean"},"volumeName":{"type":"string"},"type":{"type":"string","enum":["nfs","samba","azureFile","azureBlob","other","unknown"]},"data":{"anyOf":[{"type":"object","description":"nfs type","properties":{"server":{"type":"string"},"path":{"type":"string"}},"required":["server","path"]},{"type":"object","description":"samba type","properties":{"address":{"type":"string"},"username":{"type":"string"},"password":{"type":"string"}},"required":["address"]},{"type":"object","description":"azureFile type","properties":{"shareName":{"type":"string"},"accountName":{"type":"string"},"accountKey":{"type":"string"}},"required":["shareName"]},{"type":"object","description":"azureBlob type","properties":{"containerName":{"type":"string"},"accountName":{"type":"string"},"accountKey":{"type":"string"},"accountSASToken":{"type":"string"}},"required":["containerName"]},{"type":"object","description":"other/unknown type","properties":{}}]},"readOnly":{"type":"boolean"},"secretName":{"type":"string"},"mountOptions":{"type":"array","items":{"type":"string"}}},"required":["name","share","volumeName","type","data"]},"contentType":"application/json"}}}],"schemas":{"200":{"description":"Succeeded","content":{"application/json":{"schema":{"type":"object","description":"detail of configured PV storage","properties":{"name":{"type":"string"},"share":{"type":"boolean"},"volumeName":{"type":"string"},"type":{"type":"string","enum":["nfs","samba","azureFile","azureBlob","other","unknown"]},"data":{"anyOf":[{"type":"object","description":"nfs type","properties":{"server":{"type":"string"},"path":{"type":"string"}},"required":["server","path"]},{"type":"object","description":"samba type","properties":{"address":{"type":"string"},"username":{"type":"string"},"password":{"type":"string"}},"required":["address"]},{"type":"object","description":"azureFile type","properties":{"shareName":{"type":"string"},"accountName":{"type":"string"},"accountKey":{"type":"string"}},"required":["shareName"]},{"type":"object","description":"azureBlob type","properties":{"containerName":{"type":"string"},"accountName":{"type":"string"},"accountKey":{"type":"string"},"accountSASToken":{"type":"string"}},"required":["containerName"]},{"type":"object","description":"other/unknown type","properties":{}}]},"readOnly":{"type":"boolean"},"secretName":{"type":"string"},"mountOptions":{"type":"array","items":{"type":"string"}}},"required":["name","share","volumeName","type","data"]},"example":{"name":"nfs-storage-name","share":true,"volumeName":"nfs-volume-name","type":"nfs","data":{"server":"","path":"/data"}}}}},"403":{"description":"ForbiddenUserError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"ForbiddenUserError":{"value":{"code":"ForbiddenUserError","message":"User {user} is not allowed to access {storage}."}}}}}},"404":{"description":"NoStorageError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"NoVirtualClusterError":{"value":{"code":"NoStorageError","message":"Storage {storage} is not found."}}}}}},"500":{"description":"UnknownError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"UnknownError":{"value":{"code":"UnknownError","message":"Internal error message."}}}}}}},"description":"get /api/v2/storages/{storage}"},{"tests":[{"operation":{"tag":"job","operationId":"createJob","parameters":[{"type":"raw","value":{"contributor":"OpenPAI","description":"# Serving a TensorFlow MNIST Digit Recognition Model\nThis example shows you how to use TensorFlow Serving components to export a trained TensorFlow model\nand use the standard tensorflow_model_server to serve it on OpenPAI.\nThis example uses the simple Softmax Regression model introduced in the TensorFlow tutorial for handwritten image (MNIST data) classification.\nReference https://www.tensorflow.org/tfx/serving/serving_basic.\n","name":"sdk_test_job455c4fae","parameters":{"modelPath":"/tmp/mnist_model"},"prerequisites":[{"contributor":"OpenPAI","description":"This is an [example TensorFlow Serving Docker image on OpenPAI](https://github.com/Microsoft/pai/tree/master/examples/serving).\n","name":"tf_serving_example","protocolVersion":2,"type":"dockerimage","uri":"openpai/pai.example.tensorflow-serving","version":"1.0-r1.4"}],"protocolVersion":2,"taskRoles":{"worker":{"commands":["bazel-bin/tensorflow_serving/example/mnist_saved_model <% $parameters.modelPath %>","tensorflow_model_server --port=$PAI_CONTAINER_HOST_model_server_PORT_LIST --model_name=mnist --model_base_path=<% $parameters.modelPath %>"],"dockerImage":"tf_serving_example","instances":1,"resourcePerInstance":{"cpu":4,"gpu":1,"memoryMB":8192,"ports":{"model_server":1}}}},"type":"job","version":"1.0"}}],"response":{"statusCode":202,"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"contentType":"application/json"}}}],"after":[{"tag":"job","operationId":"updateJobExecutionType","parameters":[{"type":"raw","value":"sdk_test"},{"type":"raw","value":"sdk_test_job455c4fae"},{"type":"raw","value":"STOP"}]}],"schemas":{"202":{"description":"Succeeded","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"example":{"message":"update job {job} successfully"}}}},"400":{"description":"NoVirtualClusterError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"NoVirtualClusterError":{"value":{"code":"NoVirtualClusterError","message":"Virtual cluster {vc} is not found."}}}}}},"403":{"description":"ForbiddenUserError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"ForbiddenUserError":{"value":{"code":"ForbiddenUserError","message":"Non-admin is not allow to do this operation."}},"ForbiddenTokenError":{"value":{"code":"ForbiddenUserError","message":"Applications are not allowed to do this operation."}}}}}},"409":{"description":"ConflictJobError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"ConflictJobError":{"value":{"code":"ConflictJobError","message":"Job name {job} already exists."}}}}}},"500":{"description":"UnknownError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"UnknownError":{"value":{"code":"UnknownError","message":"Internal error message."}}}}}}},"description":"post /api/v2/jobs"},{"description":"get /api/v2/jobs","tests":[{"operation":{"tag":"job","operationId":"listJobs","parameters":[],"response":{"statusCode":200,"schema":{"type":"array","description":"job summary list","items":{"type":"object","properties":{"name":{"type":"string","description":"job name"},"username":{"type":"string","description":"user name or \"unknown\""},"state":{"type":"string","description":"general job state","enum":["WAITING","RUNNING","STOPPING","STOPPED","SUCCEEDED","FAILED","UNKNOWN"]},"subState":{"type":"string","description":"job state in framework controller","enum":["AttemptCreationPending","AttemptCreationRequested","AttemptPreparing","AttemptRunning","AttemptDeletionPending","AttemptDeletionRequested","AttemptDeleting","AttemptCompleted","Completed"]},"executionType":{"type":"string","description":"start or stop","enum":["START","STOP"]},"retries":{"type":"integer","description":"job retried times"},"retryDetails":{"type":"object","properties":{"user":{"type":"integer"},"platform":{"type":"integer"},"resource":{"type":"integer"}}},"retryDelayTime":{"type":"integer","nullable":true,"description":"retry delay time"},"createdTime":{"type":"integer","description":"job created time, in number of milliseconds since the Unix Epoch."},"completedTime":{"type":"integer","nullable":true,"description":"job completed time, in number of milliseconds since the Unix Epoch."},"appExitCode":{"type":"integer","nullable":true,"description":"job exit code"},"virtualCluster":{"type":"string","description":"virtual cluster to which the job submitted, or \"unknown\""},"totalGpuNumber":{"type":"integer","description":"total gpu number used in the job"},"totalTaskNumber":{"type":"integer","description":"total task number used in the job"},"totalTaskRoleNumber":{"type":"integer","description":"total task role number used in the job"},"debugId":{"type":"string","description":"md5 hash name for the job in framework controller, used for debug purpose"}},"required":["name","username","virtualCluster","state","subState","executionType","retries","createdTime","completedTime","appExitCode"]}},"contentType":"application/json"}}}],"schemas":{"200":{"description":"Succeeded","content":{"application/json":{"schema":{"type":"array","description":"job summary list","items":{"type":"object","properties":{"name":{"type":"string","description":"job name"},"username":{"type":"string","description":"user name or \"unknown\""},"state":{"type":"string","description":"general job state","enum":["WAITING","RUNNING","STOPPING","STOPPED","SUCCEEDED","FAILED","UNKNOWN"]},"subState":{"type":"string","description":"job state in framework controller","enum":["AttemptCreationPending","AttemptCreationRequested","AttemptPreparing","AttemptRunning","AttemptDeletionPending","AttemptDeletionRequested","AttemptDeleting","AttemptCompleted","Completed"]},"executionType":{"type":"string","description":"start or stop","enum":["START","STOP"]},"retries":{"type":"integer","description":"job retried times"},"retryDetails":{"type":"object","properties":{"user":{"type":"integer"},"platform":{"type":"integer"},"resource":{"type":"integer"}}},"retryDelayTime":{"type":"integer","nullable":true,"description":"retry delay time"},"createdTime":{"type":"integer","description":"job created time, in number of milliseconds since the Unix Epoch."},"completedTime":{"type":"integer","nullable":true,"description":"job completed time, in number of milliseconds since the Unix Epoch."},"appExitCode":{"type":"integer","nullable":true,"description":"job exit code"},"virtualCluster":{"type":"string","description":"virtual cluster to which the job submitted, or \"unknown\""},"totalGpuNumber":{"type":"integer","description":"total gpu number used in the job"},"totalTaskNumber":{"type":"integer","description":"total task number used in the job"},"totalTaskRoleNumber":{"type":"integer","description":"total task role number used in the job"},"debugId":{"type":"string","description":"md5 hash name for the job in framework controller, used for debug purpose"}},"required":["name","username","virtualCluster","state","subState","executionType","retries","createdTime","completedTime","appExitCode"]}},"example":[{"protocolVersion":"2","name":"job name","username":"user name","state":"SUCCEEDED","subState":"Completed","executionType":"STOP","retries":0,"createdTime":0,"completedTime":0,"appExitCode":0,"virtualCluster":"unknown"}]}}},"500":{"description":"UnknownError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"UnknownError":{"value":{"code":"UnknownError","message":"Internal error message."}}}}}}}},{"before":[{"tag":"job","operationId":"createJob","parameters":[{"type":"raw","value":{"contributor":"OpenPAI","description":"# Serving a TensorFlow MNIST Digit Recognition Model\nThis example shows you how to use TensorFlow Serving components to export a trained TensorFlow model\nand use the standard tensorflow_model_server to serve it on OpenPAI.\nThis example uses the simple Softmax Regression model introduced in the TensorFlow tutorial for handwritten image (MNIST data) classification.\nReference https://www.tensorflow.org/tfx/serving/serving_basic.\n","name":"sdk_test_jobd0c1a61c","parameters":{"modelPath":"/tmp/mnist_model"},"prerequisites":[{"contributor":"OpenPAI","description":"This is an [example TensorFlow Serving Docker image on OpenPAI](https://github.com/Microsoft/pai/tree/master/examples/serving).\n","name":"tf_serving_example","protocolVersion":2,"type":"dockerimage","uri":"openpai/pai.example.tensorflow-serving","version":"1.0-r1.4"}],"protocolVersion":2,"taskRoles":{"worker":{"commands":["bazel-bin/tensorflow_serving/example/mnist_saved_model <% $parameters.modelPath %>","tensorflow_model_server --port=$PAI_CONTAINER_HOST_model_server_PORT_LIST --model_name=mnist --model_base_path=<% $parameters.modelPath %>"],"dockerImage":"tf_serving_example","instances":1,"resourcePerInstance":{"cpu":4,"gpu":1,"memoryMB":8192,"ports":{"model_server":1}}}},"type":"job","version":"1.0"}}]}],"tests":[{"description":"Get a job detail","operation":{"parameters":[{"type":"raw","value":"sdk_test"},{"type":"raw","value":"sdk_test_jobd0c1a61c"}],"tag":"job","operationId":"getJob","response":{"statusCode":200,"schema":{"type":"object","description":"job details","properties":{"name":{"type":"string","description":"job name"},"jobStatus":{"type":"object","description":"job status","properties":{"username":{"type":"string","description":"user name or \"unknown\""},"state":{"type":"string","description":"general job state","enum":["WAITING","RUNNING","STOPPING","STOPPED","SUCCEEDED","FAILED","UNKNOWN"]},"subState":{"type":"string","description":"job state in framework controller","enum":["AttemptCreationPending","AttemptCreationRequested","AttemptPreparing","AttemptRunning","AttemptDeletionPending","AttemptDeletionRequested","AttemptDeleting","AttemptCompleted","Completed"]},"executionType":{"type":"string","description":"start or stop","enum":["START","STOP"]},"retries":{"type":"integer","description":"job retried times"},"retryDetails":{"type":"object","properties":{"user":{"type":"integer"},"platform":{"type":"integer"},"resource":{"type":"integer"}}},"retryDelayTime":{"type":"integer","nullable":true,"description":"retry delay time"},"createdTime":{"type":"integer","description":"job created time, in number of milliseconds since the Unix Epoch."},"completedTime":{"type":"integer","nullable":true,"description":"job completed time, in number of milliseconds since the Unix Epoch."},"appId":{"type":"string","description":"unique id for the job"},"appLaunchedTime":{"type":"integer","nullable":true,"description":"job launched time for last attempt, in number of milliseconds since the Unix Epoch."},"appCompletedTime":{"type":"integer","nullable":true,"description":"job completed time for last attempt, in number of milliseconds since the Unix Epoch. to get durations for last attempt:\n wholeDuration = completedTime - createdTime;\n runningDuration = appCompletedTime - appLaunchedTime;\n waitingDuration = wholeDuration - runningDuration.\nto get durations for all attempts:\n runningDuration = sum(appCompletedTime - appLaunchedTime) for all attempts.\n"},"appExitCode":{"type":"integer","nullable":true,"description":"job exit code"},"appExitSpec":{"type":"object","nullable":true,"description":"job exit spec","properties":{"code":{"type":"integer"},"phrase":{"type":"string"},"issuer":{"type":"string"},"causer":{"type":"string"},"type":{"type":"string"},"stage":{"type":"string"},"behavior":{"type":"string"},"reaction":{"type":"string"},"repro":{"type":"array","items":{"type":"string"}}}},"appExitDiagnostics":{"type":"string","nullable":true,"description":"job exit diagnostics"},"appExitMessages":{"type":"object","nullable":true,"properties":{"container":{"type":"string","nullable":true},"runtime":{"type":"string","nullable":true},"launcher":{"type":"string","nullable":true}}},"appExitTriggerMessage":{"type":"string","nullable":true,"description":"job completion message"},"appExitTriggerTaskRoleName":{"type":"string","nullable":true,"description":"task role name which triggered job completion"},"appExitTriggerTaskIndex":{"type":"integer","nullable":true,"description":"task index which triggered job completion"},"appExitType":{"type":"string","nullable":true,"description":"job completion type"},"virtualCluster":{"type":"string","description":"virtual cluster to which the job submitted, or \"unknown\""}},"required":["username","virtualCluster","state","subState","executionType","retries","createdTime","completedTime","appId","appLaunchedTime","appCompletedTime","appExitCode"]},"taskRoles":{"type":"object","additionalProperties":{"type":"object","description":"task role status","properties":{"taskRoleStatus":{"type":"object","properties":{"name":{"type":"string","description":"task role name"}},"required":["name"]},"taskStatuses":{"type":"array","description":"task statuses in the task role","items":{"type":"object","properties":{"taskIndex":{"type":"integer","description":"task index"},"taskState":{"type":"string","description":"task state","enum":["WAITING","RUNNING","STOPPING","STOPPED","SUCCEEDED","FAILED","UNKNOWN"]},"containerId":{"type":"string","description":"uid of the task container"},"containerIp":{"type":"string","description":"ip of the task container"},"containerPorts":{"type":"object","description":"ports of the task container"},"containerGpus":{"type":"string","nullable":true,"description":"gpu of the task container"},"containerLog":{"type":"string","description":"log url of the task container"},"containerExitCode":{"type":"integer","nullable":true,"description":"exit code the task container"}}}}},"required":["taskRoleStatus","taskStatuses"]}},"debugId":{"type":"string","description":"md5 hash name for the job in framework controller, used for debug purpose"}},"required":["name","jobStatus","taskRoles"]},"contentType":"application/json"}}},{"description":"Get nonexist job detail","operation":{"parameters":[{"type":"raw","value":"sdk_test"},{"type":"raw","value":"sdk_test_nonexist_job"}],"response":{"statusCode":404,"schema":{"description":"NoJobError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"NoJobError":{"value":{"code":"NoJobError","message":"Job {job} is not found."}}}}}}},"tag":"job","operationId":"getJob"}}],"after":[{"tag":"job","operationId":"updateJobExecutionType","parameters":[{"type":"raw","value":"sdk_test"},{"type":"raw","value":"sdk_test_jobd0c1a61c"},{"type":"raw","value":"STOP"}]}],"schemas":{"200":{"description":"Succeeded","content":{"application/json":{"schema":{"type":"object","description":"job details","properties":{"name":{"type":"string","description":"job name"},"jobStatus":{"type":"object","description":"job status","properties":{"username":{"type":"string","description":"user name or \"unknown\""},"state":{"type":"string","description":"general job state","enum":["WAITING","RUNNING","STOPPING","STOPPED","SUCCEEDED","FAILED","UNKNOWN"]},"subState":{"type":"string","description":"job state in framework controller","enum":["AttemptCreationPending","AttemptCreationRequested","AttemptPreparing","AttemptRunning","AttemptDeletionPending","AttemptDeletionRequested","AttemptDeleting","AttemptCompleted","Completed"]},"executionType":{"type":"string","description":"start or stop","enum":["START","STOP"]},"retries":{"type":"integer","description":"job retried times"},"retryDetails":{"type":"object","properties":{"user":{"type":"integer"},"platform":{"type":"integer"},"resource":{"type":"integer"}}},"retryDelayTime":{"type":"integer","nullable":true,"description":"retry delay time"},"createdTime":{"type":"integer","description":"job created time, in number of milliseconds since the Unix Epoch."},"completedTime":{"type":"integer","nullable":true,"description":"job completed time, in number of milliseconds since the Unix Epoch."},"appId":{"type":"string","description":"unique id for the job"},"appLaunchedTime":{"type":"integer","nullable":true,"description":"job launched time for last attempt, in number of milliseconds since the Unix Epoch."},"appCompletedTime":{"type":"integer","nullable":true,"description":"job completed time for last attempt, in number of milliseconds since the Unix Epoch. to get durations for last attempt:\n wholeDuration = completedTime - createdTime;\n runningDuration = appCompletedTime - appLaunchedTime;\n waitingDuration = wholeDuration - runningDuration.\nto get durations for all attempts:\n runningDuration = sum(appCompletedTime - appLaunchedTime) for all attempts.\n"},"appExitCode":{"type":"integer","nullable":true,"description":"job exit code"},"appExitSpec":{"type":"object","nullable":true,"description":"job exit spec","properties":{"code":{"type":"integer"},"phrase":{"type":"string"},"issuer":{"type":"string"},"causer":{"type":"string"},"type":{"type":"string"},"stage":{"type":"string"},"behavior":{"type":"string"},"reaction":{"type":"string"},"repro":{"type":"array","items":{"type":"string"}}}},"appExitDiagnostics":{"type":"string","nullable":true,"description":"job exit diagnostics"},"appExitMessages":{"type":"object","nullable":true,"properties":{"container":{"type":"string","nullable":true},"runtime":{"type":"string","nullable":true},"launcher":{"type":"string","nullable":true}}},"appExitTriggerMessage":{"type":"string","nullable":true,"description":"job completion message"},"appExitTriggerTaskRoleName":{"type":"string","nullable":true,"description":"task role name which triggered job completion"},"appExitTriggerTaskIndex":{"type":"integer","nullable":true,"description":"task index which triggered job completion"},"appExitType":{"type":"string","nullable":true,"description":"job completion type"},"virtualCluster":{"type":"string","description":"virtual cluster to which the job submitted, or \"unknown\""}},"required":["username","virtualCluster","state","subState","executionType","retries","createdTime","completedTime","appId","appLaunchedTime","appCompletedTime","appExitCode"]},"taskRoles":{"type":"object","additionalProperties":{"type":"object","description":"task role status","properties":{"taskRoleStatus":{"type":"object","properties":{"name":{"type":"string","description":"task role name"}},"required":["name"]},"taskStatuses":{"type":"array","description":"task statuses in the task role","items":{"type":"object","properties":{"taskIndex":{"type":"integer","description":"task index"},"taskState":{"type":"string","description":"task state","enum":["WAITING","RUNNING","STOPPING","STOPPED","SUCCEEDED","FAILED","UNKNOWN"]},"containerId":{"type":"string","description":"uid of the task container"},"containerIp":{"type":"string","description":"ip of the task container"},"containerPorts":{"type":"object","description":"ports of the task container"},"containerGpus":{"type":"string","nullable":true,"description":"gpu of the task container"},"containerLog":{"type":"string","description":"log url of the task container"},"containerExitCode":{"type":"integer","nullable":true,"description":"exit code the task container"}}}}},"required":["taskRoleStatus","taskStatuses"]}},"debugId":{"type":"string","description":"md5 hash name for the job in framework controller, used for debug purpose"}},"required":["name","jobStatus","taskRoles"]},"example":{"name":"job name","jobStatus":{"username":"user name","state":"SUCCEEDED","subState":"Completed","executionType":"STOP","retries":0,"createdTime":0,"completedTime":0,"appId":"id","appLaunchedTime":0,"appCompletedTime":0,"appExitCode":0,"virtualCluster":"unknown"},"taskRoles":{"taskrole":{"taskRoleStatus":{"name":"task role name"},"taskStatuses":[{"taskIndex":0,"taskState":"SUCCEEDED"}]}}}}}},"404":{"description":"NoJobError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"NoJobError":{"value":{"code":"NoJobError","message":"Job {job} is not found."}}}}}},"500":{"description":"UnknownError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"UnknownError":{"value":{"code":"UnknownError","message":"Internal error message."}}}}}}},"description":"get /api/v2/jobs/{user}~{job}"},{"before":[{"tag":"job","operationId":"createJob","parameters":[{"type":"raw","value":{"contributor":"OpenPAI","description":"# Serving a TensorFlow MNIST Digit Recognition Model\nThis example shows you how to use TensorFlow Serving components to export a trained TensorFlow model\nand use the standard tensorflow_model_server to serve it on OpenPAI.\nThis example uses the simple Softmax Regression model introduced in the TensorFlow tutorial for handwritten image (MNIST data) classification.\nReference https://www.tensorflow.org/tfx/serving/serving_basic.\n","name":"sdk_test_jobd3d3b60d","parameters":{"modelPath":"/tmp/mnist_model"},"prerequisites":[{"contributor":"OpenPAI","description":"This is an [example TensorFlow Serving Docker image on OpenPAI](https://github.com/Microsoft/pai/tree/master/examples/serving).\n","name":"tf_serving_example","protocolVersion":2,"type":"dockerimage","uri":"openpai/pai.example.tensorflow-serving","version":"1.0-r1.4"}],"protocolVersion":2,"taskRoles":{"worker":{"commands":["bazel-bin/tensorflow_serving/example/mnist_saved_model <% $parameters.modelPath %>","tensorflow_model_server --port=$PAI_CONTAINER_HOST_model_server_PORT_LIST --model_name=mnist --model_base_path=<% $parameters.modelPath %>"],"dockerImage":"tf_serving_example","instances":1,"resourcePerInstance":{"cpu":4,"gpu":1,"memoryMB":8192,"ports":{"model_server":1}}}},"type":"job","version":"1.0"}}]}],"tests":[{"description":"Get a job config","operation":{"parameters":[{"type":"raw","value":"sdk_test"},{"type":"raw","value":"sdk_test_jobd3d3b60d"}],"tag":"job","operationId":"getJobConfig","response":{"statusCode":200,"schema":{"type":"object","description":"openpai job protocol","properties":{"protocolVersion":{"oneOf":[{"type":"number"},{"type":"string"}],"description":"Protocol version, current version is 2."},"name":{"type":"string","maxLength":255,"description":"String in ^[a-zA-Z0-9_-]+$ format, no longer than 255 characters."},"type":{"type":"string","description":"Component type, should be \"job\" here."},"version":{"type":"string","description":"Component version, default is latest."},"contributor":{"type":"string"},"description":{"type":"string"},"prerequisites":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"type":{"type":"string","enum":["data","script","dockerimage","output"]},"version":{"type":"string"},"contributor":{"type":"string"},"description":{"type":"string"},"auth":{"type":"object","properties":{"username":{"type":"string"},"password":{"type":"string"},"registryuri":{"type":"string"}}},"uri":{"oneOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}]}}}},"parameters":{"type":"object","additionalProperties":true},"secrets":{"type":"object","additionalProperties":true},"jobRetryCount":{"type":"integer","description":"Default is 0."},"taskRoles":{"type":"object","additionalProperties":{"type":"object","properties":{"instances":{"type":"integer","description":"Default is 1, instances of a taskRole, no less than 1."},"completion":{"type":"object","description":"Completion poclicy for the job.","properties":{"minFailedInstances":{"type":"integer"},"minSucceededInstances":{"type":"integer"}}},"taskRetryCount":{"type":"integer","description":"Default is 0."},"dockerImage":{"type":"string","description":"Should reference to a dockerimage defined in prerequisites."},"data":{"type":"string"},"output":{"type":"string"},"script":{"type":"string"},"extraContainerOptions":{"type":"object","properties":{"shmMB":{"type":"integer","description":"Config the /dev/shm in a docker container."},"infiniband":{"type":"boolean","description":"Use InfiniBand devices or not in a docker container."}}},"resourcePerInstance":{"type":"object","properties":{"cpu":{"type":"integer","description":"CPU number, unit is CPU vcore."},"memoryMB":{"type":"integer","description":"Memory number, unit is MB."},"gpu":{"type":"integer","description":"GPU number, unit is GPU card."},"ports":{"type":"object","additionalProperties":{"type":"integer","description":"Port number for the port label."}}}},"commands":{"type":"array","items":{"type":"string"}}},"required":["dockerImage","resourcePerInstance","commands"]}},"deployments":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"taskRoles":{"type":"object","additionalProperties":{"type":"object","properties":{"preCommands":{"type":"array","items":{"type":"string"}},"postCommands":{"type":"array","items":{"type":"string"}}}}}}}},"defaults":{"type":"object","description":"Default cluster specific settings.","properties":{"virtualCluster":{"type":"string"},"deployment":{"type":"string"}}},"extras":{"type":"object","description":"Extra field, save any information that plugin may use.","properties":{"submitFrom":{"type":"string"},"hivedScheduler":{"type":"object","properties":{"jobPriorityClass":{"type":"string"},"taskRoles":{"type":"object","additionalProperties":{"type":"object","properties":{"skuType":{"type":"string"},"affinityGroupName":{"type":"string"}}}}}}}}},"required":["protocolVersion","name","type","taskRoles"]},"contentType":"text/yaml"}}},{"description":"Get nonexist job config","operation":{"parameters":[{"type":"raw","value":"sdk_test"},{"type":"raw","value":"sdk_test_nonexist_job"}],"response":{"statusCode":404,"schema":{"description":"NoJobError or NoJobConfigError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"NoJobError":{"value":{"code":"NoJobError","message":"Job {job} is not found."}},"NoJobConfigError":{"value":{"code":"NoJobConfigError","message":"Config of job {job} is not found."}}}}}}},"tag":"job","operationId":"getJobConfig"}}],"after":[{"tag":"job","operationId":"updateJobExecutionType","parameters":[{"type":"raw","value":"sdk_test"},{"type":"raw","value":"sdk_test_jobd3d3b60d"},{"type":"raw","value":"STOP"}]}],"schemas":{"200":{"description":"Succeeded","content":{"text/yaml":{"schema":{"type":"object","description":"openpai job protocol","properties":{"protocolVersion":{"oneOf":[{"type":"number"},{"type":"string"}],"description":"Protocol version, current version is 2."},"name":{"type":"string","maxLength":255,"description":"String in ^[a-zA-Z0-9_-]+$ format, no longer than 255 characters."},"type":{"type":"string","description":"Component type, should be \"job\" here."},"version":{"type":"string","description":"Component version, default is latest."},"contributor":{"type":"string"},"description":{"type":"string"},"prerequisites":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"type":{"type":"string","enum":["data","script","dockerimage","output"]},"version":{"type":"string"},"contributor":{"type":"string"},"description":{"type":"string"},"auth":{"type":"object","properties":{"username":{"type":"string"},"password":{"type":"string"},"registryuri":{"type":"string"}}},"uri":{"oneOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}]}}}},"parameters":{"type":"object","additionalProperties":true},"secrets":{"type":"object","additionalProperties":true},"jobRetryCount":{"type":"integer","description":"Default is 0."},"taskRoles":{"type":"object","additionalProperties":{"type":"object","properties":{"instances":{"type":"integer","description":"Default is 1, instances of a taskRole, no less than 1."},"completion":{"type":"object","description":"Completion poclicy for the job.","properties":{"minFailedInstances":{"type":"integer"},"minSucceededInstances":{"type":"integer"}}},"taskRetryCount":{"type":"integer","description":"Default is 0."},"dockerImage":{"type":"string","description":"Should reference to a dockerimage defined in prerequisites."},"data":{"type":"string"},"output":{"type":"string"},"script":{"type":"string"},"extraContainerOptions":{"type":"object","properties":{"shmMB":{"type":"integer","description":"Config the /dev/shm in a docker container."},"infiniband":{"type":"boolean","description":"Use InfiniBand devices or not in a docker container."}}},"resourcePerInstance":{"type":"object","properties":{"cpu":{"type":"integer","description":"CPU number, unit is CPU vcore."},"memoryMB":{"type":"integer","description":"Memory number, unit is MB."},"gpu":{"type":"integer","description":"GPU number, unit is GPU card."},"ports":{"type":"object","additionalProperties":{"type":"integer","description":"Port number for the port label."}}}},"commands":{"type":"array","items":{"type":"string"}}},"required":["dockerImage","resourcePerInstance","commands"]}},"deployments":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"taskRoles":{"type":"object","additionalProperties":{"type":"object","properties":{"preCommands":{"type":"array","items":{"type":"string"}},"postCommands":{"type":"array","items":{"type":"string"}}}}}}}},"defaults":{"type":"object","description":"Default cluster specific settings.","properties":{"virtualCluster":{"type":"string"},"deployment":{"type":"string"}}},"extras":{"type":"object","description":"Extra field, save any information that plugin may use.","properties":{"submitFrom":{"type":"string"},"hivedScheduler":{"type":"object","properties":{"jobPriorityClass":{"type":"string"},"taskRoles":{"type":"object","additionalProperties":{"type":"object","properties":{"skuType":{"type":"string"},"affinityGroupName":{"type":"string"}}}}}}}}},"required":["protocolVersion","name","type","taskRoles"]},"example":{"protocolVersion":"2","name":"","type":"job","prerequisites":[{"name":"","type":"dockerimage","uri":"image_url"}],"taskRoles":{"train":{"instances":1,"dockerImage":"","resourcePerInstance":{"cpu":1,"memoryMB":16384,"gpu":1},"commands":["python "]}}}}}},"404":{"description":"NoJobError or NoJobConfigError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"NoJobError":{"value":{"code":"NoJobError","message":"Job {job} is not found."}},"NoJobConfigError":{"value":{"code":"NoJobConfigError","message":"Config of job {job} is not found."}}}}}},"500":{"description":"UnknownError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"UnknownError":{"value":{"code":"UnknownError","message":"Internal error message."}}}}}}},"description":"get /api/v2/jobs/{user}~{job}/config"},{"description":"put /api/v2/jobs/{user}~{job}/executionType","tests":[{"operation":{"tag":"job","operationId":"updateJobExecutionType","parameters":[],"response":{"statusCode":202,"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"contentType":"application/json"}}}],"schemas":{"202":{"description":"Succeeded","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"example":{"message":"execute job {job} successfully"}}}},"404":{"description":"NoJobError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"NoJobError":{"value":{"code":"NoJobError","message":"Job {job} is not found."}}}}}},"500":{"description":"UnknownError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"UnknownError":{"value":{"code":"UnknownError","message":"Internal error message."}}}}}}}},{"description":"get /api/v2/jobs/{user}~{job}/job-attempts/healthz","tests":[{"operation":{"tag":"job history","operationId":"getJobAttemptsHealthz","parameters":[],"response":{"statusCode":200}}}],"schemas":{"200":{"description":"OK"},"501":{"description":"Not healthy"}}},{"before":[{"tag":"job","operationId":"createJob","parameters":[{"type":"raw","value":{"contributor":"OpenPAI","description":"# Serving a TensorFlow MNIST Digit Recognition Model\nThis example shows you how to use TensorFlow Serving components to export a trained TensorFlow model\nand use the standard tensorflow_model_server to serve it on OpenPAI.\nThis example uses the simple Softmax Regression model introduced in the TensorFlow tutorial for handwritten image (MNIST data) classification.\nReference https://www.tensorflow.org/tfx/serving/serving_basic.\n","name":"sdk_test_jobb59f8bf3","parameters":{"modelPath":"/tmp/mnist_model"},"prerequisites":[{"contributor":"OpenPAI","description":"This is an [example TensorFlow Serving Docker image on OpenPAI](https://github.com/Microsoft/pai/tree/master/examples/serving).\n","name":"tf_serving_example","protocolVersion":2,"type":"dockerimage","uri":"openpai/pai.example.tensorflow-serving","version":"1.0-r1.4"}],"protocolVersion":2,"taskRoles":{"worker":{"commands":["bazel-bin/tensorflow_serving/example/mnist_saved_model <% $parameters.modelPath %>","tensorflow_model_server --port=$PAI_CONTAINER_HOST_model_server_PORT_LIST --model_name=mnist --model_base_path=<% $parameters.modelPath %>"],"dockerImage":"tf_serving_example","instances":1,"resourcePerInstance":{"cpu":4,"gpu":1,"memoryMB":8192,"ports":{"model_server":1}}}},"type":"job","version":"1.0"}}]}],"tests":[{"operation":{"parameters":[{"type":"raw","value":"sdk_test"},{"type":"raw","value":"sdk_test_jobb59f8bf3"}],"tag":"job history","operationId":"getJobAttempts","response":{"statusCode":200,"schema":{"type":"array","items":{"type":"object","description":"job attempt","properties":{"jobName":{"type":"string"},"frameworkName":{"type":"string"},"uid":{"type":"string"},"userName":{"type":"string"},"state":{"type":"string"},"originState":{"type":"string"},"maxAttemptCount":{"type":"integer"},"attemptIndex":{"type":"integer"},"jobStartedTime":{"type":"integer"},"attemptStartedTime":{"type":"integer"},"attemptCompletedTime":{"type":"integer","nullable":true},"exitCode":{"type":"integer","nullable":true},"exitPhrase":{"type":"string","nullable":true},"exitType":{"type":"string","nullable":true},"exitDiagnostics":{"type":"object","nullable":true,"properties":{"diagnosticsSummary":{"type":"string"},"runtime":{"type":"object","nullable":true,"properties":{"exitCode":{"type":"integer","nullable":true},"originUserExitCode":{"type":"integer","nullable":true},"errorLogs":{"type":"object","nullable":true,"properties":{"user":{"type":"string"},"platform":{"type":"string"}}},"name":{"type":"string"}}},"launcher":{"type":"string"}}},"appExitTriggerMessage":{"type":"string","nullable":true},"appExitTriggerTaskRoleName":{"type":"string","nullable":true},"appExitTriggerTaskIndex":{"type":"integer","nullable":true},"appExitSpec":{"type":"object","nullable":true,"properties":{"code":{"type":"integer"},"phrase":{"type":"string"},"issuer":{"type":"string"},"causer":{"type":"string"},"type":{"type":"string"},"stage":{"type":"string"},"behavior":{"type":"string"},"reaction":{"type":"string"},"reason":{"type":"string"},"repro":{"type":"array","items":{"type":"string"}},"solution":{"type":"array","items":{"type":"string"}}}},"appExitDiagnostics":{"type":"string","nullable":true},"appExitMessages":{"type":"object","nullable":true,"properties":{"container":{"type":"string","nullable":true},"runtime":{"type":"object","nullable":true,"properties":{"exitCode":{"type":"integer","nullable":true},"originUserExitCode":{"type":"integer","nullable":true},"errorLogs":{"type":"object","nullable":true,"properties":{"user":{"type":"string"},"platform":{"type":"string"}}},"name":{"type":"string"}}},"launcher":{"type":"string","nullable":true}}},"totalGpuNumber":{"type":"integer"},"totalTasknumber":{"type":"integer"},"totalTaskRoleNumber":{"type":"integer"},"taskRoles":{"type":"object","properties":{"taskrole":{"type":"object","properties":{"taskRoleStatus":{"type":"object","properties":{"name":{"type":"string"}},"required":["name"]},"taskStatuses":{"type":"array","items":{"type":"object","properties":{"taskIndex":{"type":"integer"},"taskState":{"type":"string","enum":["WAITING","RUNNING","STOPPING","STOPPED","SUCCEEDED","FAILED","UNKNOWN"]},"containerId":{"type":"string"},"containerIp":{"type":"string"},"containerGpus":{"type":"string","nullable":true},"containerLog":{"type":"string"},"containerExitCode":{"type":"integer","nullable":true}}}}},"required":["taskRoleStatus","taskStatuses"]}}},"isLatest":{"type":"boolean"}}},"description":"job attempts"},"contentType":"application/json"}}}],"after":[{"tag":"job","operationId":"updateJobExecutionType","parameters":[{"type":"raw","value":"sdk_test"},{"type":"raw","value":"sdk_test_jobb59f8bf3"},{"type":"raw","value":"STOP"}]}],"schemas":{"200":{"description":"Succeeded","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","description":"job attempt","properties":{"jobName":{"type":"string"},"frameworkName":{"type":"string"},"uid":{"type":"string"},"userName":{"type":"string"},"state":{"type":"string"},"originState":{"type":"string"},"maxAttemptCount":{"type":"integer"},"attemptIndex":{"type":"integer"},"jobStartedTime":{"type":"integer"},"attemptStartedTime":{"type":"integer"},"attemptCompletedTime":{"type":"integer","nullable":true},"exitCode":{"type":"integer","nullable":true},"exitPhrase":{"type":"string","nullable":true},"exitType":{"type":"string","nullable":true},"exitDiagnostics":{"type":"object","nullable":true,"properties":{"diagnosticsSummary":{"type":"string"},"runtime":{"type":"object","nullable":true,"properties":{"exitCode":{"type":"integer","nullable":true},"originUserExitCode":{"type":"integer","nullable":true},"errorLogs":{"type":"object","nullable":true,"properties":{"user":{"type":"string"},"platform":{"type":"string"}}},"name":{"type":"string"}}},"launcher":{"type":"string"}}},"appExitTriggerMessage":{"type":"string","nullable":true},"appExitTriggerTaskRoleName":{"type":"string","nullable":true},"appExitTriggerTaskIndex":{"type":"integer","nullable":true},"appExitSpec":{"type":"object","nullable":true,"properties":{"code":{"type":"integer"},"phrase":{"type":"string"},"issuer":{"type":"string"},"causer":{"type":"string"},"type":{"type":"string"},"stage":{"type":"string"},"behavior":{"type":"string"},"reaction":{"type":"string"},"reason":{"type":"string"},"repro":{"type":"array","items":{"type":"string"}},"solution":{"type":"array","items":{"type":"string"}}}},"appExitDiagnostics":{"type":"string","nullable":true},"appExitMessages":{"type":"object","nullable":true,"properties":{"container":{"type":"string","nullable":true},"runtime":{"type":"object","nullable":true,"properties":{"exitCode":{"type":"integer","nullable":true},"originUserExitCode":{"type":"integer","nullable":true},"errorLogs":{"type":"object","nullable":true,"properties":{"user":{"type":"string"},"platform":{"type":"string"}}},"name":{"type":"string"}}},"launcher":{"type":"string","nullable":true}}},"totalGpuNumber":{"type":"integer"},"totalTasknumber":{"type":"integer"},"totalTaskRoleNumber":{"type":"integer"},"taskRoles":{"type":"object","properties":{"taskrole":{"type":"object","properties":{"taskRoleStatus":{"type":"object","properties":{"name":{"type":"string"}},"required":["name"]},"taskStatuses":{"type":"array","items":{"type":"object","properties":{"taskIndex":{"type":"integer"},"taskState":{"type":"string","enum":["WAITING","RUNNING","STOPPING","STOPPED","SUCCEEDED","FAILED","UNKNOWN"]},"containerId":{"type":"string"},"containerIp":{"type":"string"},"containerGpus":{"type":"string","nullable":true},"containerLog":{"type":"string"},"containerExitCode":{"type":"integer","nullable":true}}}}},"required":["taskRoleStatus","taskStatuses"]}}},"isLatest":{"type":"boolean"}}},"description":"job attempts"},"example":[{"jobName":"jobName","frameworkName":"frameworkName","uid":"uid","userName":"userName","state":"SUCCEEDED","originState":"Completed","maxAttemptCount":1,"attemptIndex":0,"jobStartedTime":0,"attemptStartedTime":0,"attemptCompletedTime":0,"exitCode":0,"exitPhrase":"Succeeded","exitType":"Succeeded","exitDiagnostics":{"diagnosticsSummary":"Pod succeeded","runtime":null,"launcher":"Pod succeeded"},"appExitTriggerMessage":"All Tasks are completed","appExitTriggerTaskRoleName":"taskrole","appExitTriggerTaskIndex":0,"appExitSpec":{"code":0,"phrase":"Succeeded","issuer":"USER_CONTAINER","causer":"USER_CONTAINER","type":"USER_SUCCESS","stage":"COMPLETING","behavior":"UNKNOWN","reaction":"NEVER_RETRY","repro":["User program exits with exitcode 0"]},"appExitDiagnostics":"Pod succeeded","appExitMessages":{"container":null,"runtime":null,"launcher":"Pod succeeded"},"totalGpuNumber":1,"totalTaskNumber":1,"totalTaskRoleNumber":1,"taskRoles":{"taskrole":{"taskRoleStatus":{"name":"taskrole"},"taskStatuses":[{"taskIndex":0,"taskState":"SUCCEEDED","containerId":"","containerIp":"","containerExitCode":0}]}},"isLatest":true}]}}},"404":{"description":"NoJobError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"NoJobError":{"value":{"code":"NoJobError","message":"Job {job} is not found."}}}}}},"501":{"description":"UnknownError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"UnknownError":{"value":{"code":"UnknownError","message":"Internal error message."}}}}}}},"description":"get /api/v2/jobs/{user}~{job}/job-attempts"},{"before":[{"tag":"job","operationId":"createJob","parameters":[{"type":"raw","value":{"contributor":"OpenPAI","description":"# Serving a TensorFlow MNIST Digit Recognition Model\nThis example shows you how to use TensorFlow Serving components to export a trained TensorFlow model\nand use the standard tensorflow_model_server to serve it on OpenPAI.\nThis example uses the simple Softmax Regression model introduced in the TensorFlow tutorial for handwritten image (MNIST data) classification.\nReference https://www.tensorflow.org/tfx/serving/serving_basic.\n","name":"sdk_test_job62bec939","parameters":{"modelPath":"/tmp/mnist_model"},"prerequisites":[{"contributor":"OpenPAI","description":"This is an [example TensorFlow Serving Docker image on OpenPAI](https://github.com/Microsoft/pai/tree/master/examples/serving).\n","name":"tf_serving_example","protocolVersion":2,"type":"dockerimage","uri":"openpai/pai.example.tensorflow-serving","version":"1.0-r1.4"}],"protocolVersion":2,"taskRoles":{"worker":{"commands":["bazel-bin/tensorflow_serving/example/mnist_saved_model <% $parameters.modelPath %>","tensorflow_model_server --port=$PAI_CONTAINER_HOST_model_server_PORT_LIST --model_name=mnist --model_base_path=<% $parameters.modelPath %>"],"dockerImage":"tf_serving_example","instances":1,"resourcePerInstance":{"cpu":4,"gpu":1,"memoryMB":8192,"ports":{"model_server":1}}}},"type":"job","version":"1.0"}}]}],"tests":[{"operation":{"parameters":[{"type":"raw","value":"sdk_test"},{"type":"raw","value":"sdk_test_job62bec939"},{"type":"raw","value":0}],"tag":"job history","operationId":"getJobAttempt","response":{"statusCode":200,"schema":{"type":"object","description":"job attempt","properties":{"jobName":{"type":"string"},"frameworkName":{"type":"string"},"uid":{"type":"string"},"userName":{"type":"string"},"state":{"type":"string"},"originState":{"type":"string"},"maxAttemptCount":{"type":"integer"},"attemptIndex":{"type":"integer"},"jobStartedTime":{"type":"integer"},"attemptStartedTime":{"type":"integer"},"attemptCompletedTime":{"type":"integer","nullable":true},"exitCode":{"type":"integer","nullable":true},"exitPhrase":{"type":"string","nullable":true},"exitType":{"type":"string","nullable":true},"exitDiagnostics":{"type":"object","nullable":true,"properties":{"diagnosticsSummary":{"type":"string"},"runtime":{"type":"object","nullable":true,"properties":{"exitCode":{"type":"integer","nullable":true},"originUserExitCode":{"type":"integer","nullable":true},"errorLogs":{"type":"object","nullable":true,"properties":{"user":{"type":"string"},"platform":{"type":"string"}}},"name":{"type":"string"}}},"launcher":{"type":"string"}}},"appExitTriggerMessage":{"type":"string","nullable":true},"appExitTriggerTaskRoleName":{"type":"string","nullable":true},"appExitTriggerTaskIndex":{"type":"integer","nullable":true},"appExitSpec":{"type":"object","nullable":true,"properties":{"code":{"type":"integer"},"phrase":{"type":"string"},"issuer":{"type":"string"},"causer":{"type":"string"},"type":{"type":"string"},"stage":{"type":"string"},"behavior":{"type":"string"},"reaction":{"type":"string"},"reason":{"type":"string"},"repro":{"type":"array","items":{"type":"string"}},"solution":{"type":"array","items":{"type":"string"}}}},"appExitDiagnostics":{"type":"string","nullable":true},"appExitMessages":{"type":"object","nullable":true,"properties":{"container":{"type":"string","nullable":true},"runtime":{"type":"object","nullable":true,"properties":{"exitCode":{"type":"integer","nullable":true},"originUserExitCode":{"type":"integer","nullable":true},"errorLogs":{"type":"object","nullable":true,"properties":{"user":{"type":"string"},"platform":{"type":"string"}}},"name":{"type":"string"}}},"launcher":{"type":"string","nullable":true}}},"totalGpuNumber":{"type":"integer"},"totalTasknumber":{"type":"integer"},"totalTaskRoleNumber":{"type":"integer"},"taskRoles":{"type":"object","properties":{"taskrole":{"type":"object","properties":{"taskRoleStatus":{"type":"object","properties":{"name":{"type":"string"}},"required":["name"]},"taskStatuses":{"type":"array","items":{"type":"object","properties":{"taskIndex":{"type":"integer"},"taskState":{"type":"string","enum":["WAITING","RUNNING","STOPPING","STOPPED","SUCCEEDED","FAILED","UNKNOWN"]},"containerId":{"type":"string"},"containerIp":{"type":"string"},"containerGpus":{"type":"string","nullable":true},"containerLog":{"type":"string"},"containerExitCode":{"type":"integer","nullable":true}}}}},"required":["taskRoleStatus","taskStatuses"]}}},"isLatest":{"type":"boolean"}}},"contentType":"application/json"}}}],"after":[{"tag":"job","operationId":"updateJobExecutionType","parameters":[{"type":"raw","value":"sdk_test"},{"type":"raw","value":"sdk_test_job62bec939"},{"type":"raw","value":"STOP"}]}],"schemas":{"200":{"description":"Succeeded","content":{"application/json":{"schema":{"type":"object","description":"job attempt","properties":{"jobName":{"type":"string"},"frameworkName":{"type":"string"},"uid":{"type":"string"},"userName":{"type":"string"},"state":{"type":"string"},"originState":{"type":"string"},"maxAttemptCount":{"type":"integer"},"attemptIndex":{"type":"integer"},"jobStartedTime":{"type":"integer"},"attemptStartedTime":{"type":"integer"},"attemptCompletedTime":{"type":"integer","nullable":true},"exitCode":{"type":"integer","nullable":true},"exitPhrase":{"type":"string","nullable":true},"exitType":{"type":"string","nullable":true},"exitDiagnostics":{"type":"object","nullable":true,"properties":{"diagnosticsSummary":{"type":"string"},"runtime":{"type":"object","nullable":true,"properties":{"exitCode":{"type":"integer","nullable":true},"originUserExitCode":{"type":"integer","nullable":true},"errorLogs":{"type":"object","nullable":true,"properties":{"user":{"type":"string"},"platform":{"type":"string"}}},"name":{"type":"string"}}},"launcher":{"type":"string"}}},"appExitTriggerMessage":{"type":"string","nullable":true},"appExitTriggerTaskRoleName":{"type":"string","nullable":true},"appExitTriggerTaskIndex":{"type":"integer","nullable":true},"appExitSpec":{"type":"object","nullable":true,"properties":{"code":{"type":"integer"},"phrase":{"type":"string"},"issuer":{"type":"string"},"causer":{"type":"string"},"type":{"type":"string"},"stage":{"type":"string"},"behavior":{"type":"string"},"reaction":{"type":"string"},"reason":{"type":"string"},"repro":{"type":"array","items":{"type":"string"}},"solution":{"type":"array","items":{"type":"string"}}}},"appExitDiagnostics":{"type":"string","nullable":true},"appExitMessages":{"type":"object","nullable":true,"properties":{"container":{"type":"string","nullable":true},"runtime":{"type":"object","nullable":true,"properties":{"exitCode":{"type":"integer","nullable":true},"originUserExitCode":{"type":"integer","nullable":true},"errorLogs":{"type":"object","nullable":true,"properties":{"user":{"type":"string"},"platform":{"type":"string"}}},"name":{"type":"string"}}},"launcher":{"type":"string","nullable":true}}},"totalGpuNumber":{"type":"integer"},"totalTasknumber":{"type":"integer"},"totalTaskRoleNumber":{"type":"integer"},"taskRoles":{"type":"object","properties":{"taskrole":{"type":"object","properties":{"taskRoleStatus":{"type":"object","properties":{"name":{"type":"string"}},"required":["name"]},"taskStatuses":{"type":"array","items":{"type":"object","properties":{"taskIndex":{"type":"integer"},"taskState":{"type":"string","enum":["WAITING","RUNNING","STOPPING","STOPPED","SUCCEEDED","FAILED","UNKNOWN"]},"containerId":{"type":"string"},"containerIp":{"type":"string"},"containerGpus":{"type":"string","nullable":true},"containerLog":{"type":"string"},"containerExitCode":{"type":"integer","nullable":true}}}}},"required":["taskRoleStatus","taskStatuses"]}}},"isLatest":{"type":"boolean"}}},"example":{"jobName":"jobName","frameworkName":"frameworkName","uid":"uid","userName":"userName","state":"SUCCEEDED","originState":"Completed","maxAttemptCount":1,"attemptIndex":0,"jobStartedTime":0,"attemptStartedTime":0,"attemptCompletedTime":0,"exitCode":0,"exitPhrase":"Succeeded","exitType":"Succeeded","exitDiagnostics":{"diagnosticsSummary":"Pod succeeded","runtime":null,"launcher":"Pod succeeded"},"appExitTriggerMessage":"All Tasks are completed","appExitTriggerTaskRoleName":"taskrole","appExitTriggerTaskIndex":0,"appExitSpec":{"code":0,"phrase":"Succeeded","issuer":"USER_CONTAINER","causer":"USER_CONTAINER","type":"USER_SUCCESS","stage":"COMPLETING","behavior":"UNKNOWN","reaction":"NEVER_RETRY","repro":["User program exits with exitcode 0"]},"appExitDiagnostics":"Pod succeeded","appExitMessages":{"container":null,"runtime":null,"launcher":"Pod succeeded"},"totalGpuNumber":1,"totalTaskNumber":1,"totalTaskRoleNumber":1,"taskRoles":{"taskrole":{"taskRoleStatus":{"name":"taskrole"},"taskStatuses":[{"taskIndex":0,"taskState":"SUCCEEDED","containerId":"","containerIp":"","containerExitCode":0}]}},"isLatest":true}}}},"404":{"description":"NoJobError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"NoJobError":{"value":{"code":"NoJobError","message":"Job {job} is not found."}}}}}},"501":{"description":"UnknownError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"UnknownError":{"value":{"code":"UnknownError","message":"Internal error message."}}}}}}},"description":"get /api/v2/jobs/{user}~{job}/job-attempts/{attemptIndex}"},{"description":"get /api/v2/kubernetes/nodes","tests":[{"operation":{"tag":"kubernetes","operationId":"getK8sNodes","parameters":[],"response":{"statusCode":200}}}],"schemas":{"200":{"description":"Succeeded","content":{"application/json":{"example":["Please refer to Kubernetes API doc","https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.17/#list-node-v1-core"]}}},"401":{"description":"UnauthorizedUserError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"UnauthorizedUserError":{"value":{"code":"UnauthorizedUserError","message":"Guest is not allowed to do this operation."}}}}}},"403":{"description":"ForbiddenUserError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"ForbiddenUserError":{"value":{"code":"ForbiddenUserError","message":"Non-admin is not allow to do this operation."}},"ForbiddenTokenError":{"value":{"code":"ForbiddenUserError","message":"Applications are not allowed to do this operation."}}}}}}}},{"description":"get /api/v2/kubernetes/pods","tests":[{"operation":{"tag":"kubernetes","operationId":"getK8sPods","parameters":[],"response":{"statusCode":200}}}],"schemas":{"200":{"description":"Succeeded","content":{"application/json":{"example":["Please refer to Kubernetes API doc","https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.17/#list-all-namespaces-pod-v1-core"]}}},"401":{"description":"UnauthorizedUserError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"UnauthorizedUserError":{"value":{"code":"UnauthorizedUserError","message":"Guest is not allowed to do this operation."}}}}}},"403":{"description":"ForbiddenUserError","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","enum":["BadConfigurationError","ConflictJobError","ConflictUserError","ConflictVcError","ForbiddenUserError","ForbiddenKeyError","IncorrectPasswordError","InvalidParametersError","NoApiError","NoJobError","NoJobConfigError","NoJobSshInfoError","NoUserError","NoGroupError","NoVirtualClusterError","ReadOnlyJobError","RemoveAdminError","ReadOnlyVcError","RemoveRunningVcError","UnauthorizedUserError","NoEnoughQuotaError","NotImplementedError","UnknownError"]},"message":{"type":"string"}},"required":["message"]},"examples":{"ForbiddenUserError":{"value":{"code":"ForbiddenUserError","message":"Non-admin is not allow to do this operation."}},"ForbiddenTokenError":{"value":{"code":"ForbiddenUserError","message":"Applications are not allowed to do this operation."}}}}}}}}],"map":{"getClusterInfo":{"path":"/api/v2/info","method":"get","examples":{"200":{"name":"PAI RESTful API","version":"v1.0.1","launcherType":"k8s","authnMethod":"basic"}}},"getTokens":{"path":"/api/v2/tokens","method":"get","examples":{"200":{"tokens":["JWT Token Example"]},"401":{"value":{"code":"UnauthorizedUserError","message":"Guest is not allowed to do this operation."}}}},"deleteToken":{"path":"/api/v2/tokens/{token}","method":"delete","examples":{"200":{"message":"revoke successfully"},"401":{"value":{"code":"UnauthorizedUserError","message":"Guest is not allowed to do this operation."}},"403":{"value":{"code":"ForbiddenUserError","message":"Non-admin is not allow to do this operation."}}}},"createApplicationToken":{"path":"/api/v2/tokens/application","method":"post","examples":{"200":{"token":"JWT Token Example","application":true},"401":{"value":{"code":"UnauthorizedUserError","message":"Guest is not allowed to do this operation."}}}},"oidcLogin":{"path":"/api/v2/authn/oidc/login","method":"get","examples":{}},"oidcLogout":{"path":"/api/v2/authn/oidc/logout","method":"get","examples":{}},"basicLogin":{"path":"/api/v2/authn/basic/login","method":"post","examples":{"200":{"token":"JWT Token Example","user":"user","admin":true},"404":{"value":{"code":"NoUserError","message":"User {user} is not found."}}}},"basicLogout":{"path":"/api/v2/authn/basic/logout","method":"delete","examples":{"200":{"message":"Logout successfully"},"401":{"value":{"code":"UnauthorizedUserError","message":"Guest is not allowed to do this operation."}},"403":{"value":{"code":"ForbiddenUserError","message":"Non-admin is not allow to do this operation."}}}},"createUser":{"path":"/api/v2/users","method":"post","examples":{"201":{"message":"User is created successfully"},"401":{"value":{"code":"UnauthorizedUserError","message":"Guest is not allowed to do this operation."}},"403":{"value":{"code":"ForbiddenUserError","message":"Non-admin is not allow to do this operation."}},"409":{"value":{"code":"ConflictUserError","message":"User name {user} already exists."}},"500":{"value":{"code":"UnknownError","message":"Internal error message."}}}},"getAllUser":{"path":"/api/v2/users","method":"get","examples":{"200":[{"username":"username","admin":true,"virtualCluster":[],"storageConfig":[],"email":"email@test.com","extension":{}}],"500":{"value":{"code":"UnknownError","message":"Internal error message."}}}},"updateUser":{"path":"/api/v2/users","method":"put","examples":{"201":{"message":"update group {username} successfully."},"401":{"value":{"code":"UnauthorizedUserError","message":"Guest is not allowed to do this operation."}},"403":{"value":{"code":"ForbiddenUserError","message":"Non-admin is not allow to do this operation."}},"404":{"value":{"code":"NoUserError","message":"User {user} is not found."}},"500":{"value":{"code":"UnknownError","message":"Internal error message."}}}},"updateUserSelf":{"path":"/api/v2/users/me","method":"put","examples":{"201":{"message":"update group {username} successfully."},"401":{"value":{"code":"UnauthorizedUserError","message":"Guest is not allowed to do this operation."}},"403":{"value":{"code":"ForbiddenUserError","message":"Non-admin is not allow to do this operation."}},"404":{"value":{"code":"NoUserError","message":"User {user} is not found."}},"500":{"value":{"code":"UnknownError","message":"Internal error message."}}}},"getUser":{"path":"/api/v2/users/{user}","method":"get","examples":{"200":{"username":"username","admin":true,"virtualCluster":[],"storageConfig":[],"email":"email@test.com","extension":{}},"401":{"value":{"code":"UnauthorizedUserError","message":"Guest is not allowed to do this operation."}},"404":{"value":{"code":"NoUserError","message":"User {user} is not found."}},"500":{"value":{"code":"UnknownError","message":"Internal error message."}}}},"deleteUser":{"path":"/api/v2/users/{user}","method":"delete","examples":{"200":{"message":"user is removed successfully"},"401":{"value":{"code":"UnauthorizedUserError","message":"Guest is not allowed to do this operation."}},"403":{"value":{"code":"ForbiddenUserError","message":"Non-admin is not allow to do this operation."}},"404":{"value":{"code":"NoUserError","message":"User {user} is not found."}},"500":{"value":{"code":"UnknownError","message":"Internal error message."}}}},"updateUserGroup":{"path":"/api/v2/users/{user}/group/","method":"put","examples":{"201":{"message":"User {username} is added into group {groupname}"},"401":{"value":{"code":"UnauthorizedUserError","message":"Guest is not allowed to do this operation."}},"403":{"value":{"code":"ForbiddenUserError","message":"Non-admin is not allow to do this operation."}},"404":{"value":{"code":"NoUserError","message":"User {user} is not found."}},"500":{"value":{"code":"UnknownError","message":"Internal error message."}}}},"deleteUserGroup":{"path":"/api/v2/users/{user}/group/","method":"delete","examples":{"201":{"message":"User {username} is removed from group {groupname}"},"401":{"value":{"code":"UnauthorizedUserError","message":"Guest is not allowed to do this operation."}},"403":{"value":{"code":"ForbiddenUserError","message":"Non-admin is not allow to do this operation."}},"404":{"value":{"code":"NoUserError","message":"User {user} is not found."}},"500":{"value":{"code":"UnknownError","message":"Internal error message."}}}},"updateUserGrouplist":{"path":"/api/v2/users/{user}/grouplist/","method":"put","examples":{"201":{"message":"update user grouplist successfully."},"401":{"value":{"code":"UnauthorizedUserError","message":"Guest is not allowed to do this operation."}},"403":{"value":{"code":"ForbiddenUserError","message":"Non-admin is not allow to do this operation."}},"404":{"value":{"code":"NoUserError","message":"User {user} is not found."}},"500":{"value":{"code":"UnknownError","message":"Internal error message."}}}},"getAllGroup":{"path":"/api/v2/groups","method":"get","examples":{"200":[{"groupname":"groupName","description":"description","externalName":"externalName","extension":{}}],"500":{"value":{"code":"UnknownError","message":"Internal error message."}}}},"createGroup":{"path":"/api/v2/groups","method":"post","examples":{"201":{"message":"group is created successfully"},"401":{"value":{"code":"UnauthorizedUserError","message":"Guest is not allowed to do this operation."}},"403":{"value":{"code":"ForbiddenUserError","message":"Non-admin is not allow to do this operation."}},"500":{"value":{"code":"UnknownError","message":"Internal error message."}}}},"updateGroup":{"path":"/api/v2/groups","method":"put","examples":{"201":{"message":"update group {groupname} successfully."},"401":{"value":{"code":"UnauthorizedUserError","message":"Guest is not allowed to do this operation."}},"403":{"value":{"code":"ForbiddenUserError","message":"Non-admin is not allow to do this operation."}},"404":{"value":{"code":"NoGroupError","message":"Group {groupname} is not found."}},"500":{"value":{"code":"UnknownError","message":"Internal error message."}}}},"getGroup":{"path":"/api/v2/groups/{group}","method":"get","examples":{"200":{"groupname":"groupName","description":"description","externalName":"externalName","extension":{}},"401":{"value":{"code":"UnauthorizedUserError","message":"Guest is not allowed to do this operation."}},"404":{"value":{"code":"NoGroupError","message":"Group {groupname} is not found."}},"500":{"value":{"code":"UnknownError","message":"Internal error message."}}}},"deleteGroup":{"path":"/api/v2/groups/{group}","method":"delete","examples":{"201":{"message":"group is removed successfully"},"401":{"value":{"code":"UnauthorizedUserError","message":"Guest is not allowed to do this operation."}},"403":{"value":{"code":"ForbiddenUserError","message":"Non-admin is not allow to do this operation."}},"500":{"value":{"code":"UnknownError","message":"Internal error message."}}}},"getGroupMembers":{"path":"/api/v2/groups/{group}/userlist","method":"get","examples":{"200":[{"username":"username","clusterAdmin":false}],"401":{"value":{"code":"UnauthorizedUserError","message":"Guest is not allowed to do this operation."}},"500":{"value":{"code":"UnknownError","message":"Internal error message."}}}},"listVirtualClusters":{"path":"/api/v2/virtual-clusters","method":"get","examples":{"500":{"value":{"code":"UnknownError","message":"Internal error message."}}}},"getVirtualCluster":{"path":"/api/v2/virtual-clusters/{vc}","method":"get","examples":{"200":{"capacity":70,"usedCapacity":30,"dedicated":false,"resourcesUsed":{"cpu":1,"memory":1024,"gpu":1,"vCores":1,"GPUs":1},"resourcesGuaranteed":{"cpu":2,"memory":2048,"gpu":2,"vCores":2,"GPUs":2},"resourcesTotal":{"cpu":2,"memory":2048,"gpu":2,"vCores":2,"GPUs":2},"maxCapacity":70},"404":{"value":{"code":"NoVirtualClusterError","message":"Virtual cluster {vc} is not found."}},"500":{"value":{"code":"UnknownError","message":"Internal error message."}}}},"getStorages":{"path":"/api/v2/storages","method":"get","examples":{"200":{"storages":[{"name":"name","share":true,"volumeName":"volumeName"}]},"500":{"value":{"code":"UnknownError","message":"Internal error message."}}}},"getStorage":{"path":"/api/v2/storages/{storage}","method":"get","examples":{"200":{"name":"nfs-storage-name","share":true,"volumeName":"nfs-volume-name","type":"nfs","data":{"server":"","path":"/data"}},"403":{"value":{"code":"ForbiddenUserError","message":"User {user} is not allowed to access {storage}."}},"404":{"value":{"code":"NoStorageError","message":"Storage {storage} is not found."}},"500":{"value":{"code":"UnknownError","message":"Internal error message."}}}},"createJob":{"path":"/api/v2/jobs","method":"post","examples":{"202":{"message":"update job {job} successfully"},"400":{"value":{"code":"NoVirtualClusterError","message":"Virtual cluster {vc} is not found."}},"403":{"value":{"code":"ForbiddenUserError","message":"Non-admin is not allow to do this operation."}},"409":{"value":{"code":"ConflictJobError","message":"Job name {job} already exists."}},"500":{"value":{"code":"UnknownError","message":"Internal error message."}}}},"listJobs":{"path":"/api/v2/jobs","method":"get","examples":{"200":[{"protocolVersion":"2","name":"job name","username":"user name","state":"SUCCEEDED","subState":"Completed","executionType":"STOP","retries":0,"createdTime":0,"completedTime":0,"appExitCode":0,"virtualCluster":"unknown"}],"500":{"value":{"code":"UnknownError","message":"Internal error message."}}}},"getJob":{"path":"/api/v2/jobs/{user}~{job}","method":"get","examples":{"200":{"name":"job name","jobStatus":{"username":"user name","state":"SUCCEEDED","subState":"Completed","executionType":"STOP","retries":0,"createdTime":0,"completedTime":0,"appId":"id","appLaunchedTime":0,"appCompletedTime":0,"appExitCode":0,"virtualCluster":"unknown"},"taskRoles":{"taskrole":{"taskRoleStatus":{"name":"task role name"},"taskStatuses":[{"taskIndex":0,"taskState":"SUCCEEDED"}]}}},"404":{"value":{"code":"NoJobError","message":"Job {job} is not found."}},"500":{"value":{"code":"UnknownError","message":"Internal error message."}}}},"getJobConfig":{"path":"/api/v2/jobs/{user}~{job}/config","method":"get","examples":{"200":{"protocolVersion":"2","name":"","type":"job","prerequisites":[{"name":"","type":"dockerimage","uri":"image_url"}],"taskRoles":{"train":{"instances":1,"dockerImage":"","resourcePerInstance":{"cpu":1,"memoryMB":16384,"gpu":1},"commands":["python "]}}},"404":{"value":{"code":"NoJobError","message":"Job {job} is not found."}},"500":{"value":{"code":"UnknownError","message":"Internal error message."}}}},"updateJobExecutionType":{"path":"/api/v2/jobs/{user}~{job}/executionType","method":"put","examples":{"202":{"message":"execute job {job} successfully"},"404":{"value":{"code":"NoJobError","message":"Job {job} is not found."}},"500":{"value":{"code":"UnknownError","message":"Internal error message."}}}},"getJobAttemptsHealthz":{"path":"/api/v2/jobs/{user}~{job}/job-attempts/healthz","method":"get","examples":{}},"getJobAttempts":{"path":"/api/v2/jobs/{user}~{job}/job-attempts","method":"get","examples":{"200":[{"jobName":"jobName","frameworkName":"frameworkName","uid":"uid","userName":"userName","state":"SUCCEEDED","originState":"Completed","maxAttemptCount":1,"attemptIndex":0,"jobStartedTime":0,"attemptStartedTime":0,"attemptCompletedTime":0,"exitCode":0,"exitPhrase":"Succeeded","exitType":"Succeeded","exitDiagnostics":{"diagnosticsSummary":"Pod succeeded","runtime":null,"launcher":"Pod succeeded"},"appExitTriggerMessage":"All Tasks are completed","appExitTriggerTaskRoleName":"taskrole","appExitTriggerTaskIndex":0,"appExitSpec":{"code":0,"phrase":"Succeeded","issuer":"USER_CONTAINER","causer":"USER_CONTAINER","type":"USER_SUCCESS","stage":"COMPLETING","behavior":"UNKNOWN","reaction":"NEVER_RETRY","repro":["User program exits with exitcode 0"]},"appExitDiagnostics":"Pod succeeded","appExitMessages":{"container":null,"runtime":null,"launcher":"Pod succeeded"},"totalGpuNumber":1,"totalTaskNumber":1,"totalTaskRoleNumber":1,"taskRoles":{"taskrole":{"taskRoleStatus":{"name":"taskrole"},"taskStatuses":[{"taskIndex":0,"taskState":"SUCCEEDED","containerId":"","containerIp":"","containerExitCode":0}]}},"isLatest":true}],"404":{"value":{"code":"NoJobError","message":"Job {job} is not found."}},"501":{"value":{"code":"UnknownError","message":"Internal error message."}}}},"getJobAttempt":{"path":"/api/v2/jobs/{user}~{job}/job-attempts/{attemptIndex}","method":"get","examples":{"200":{"jobName":"jobName","frameworkName":"frameworkName","uid":"uid","userName":"userName","state":"SUCCEEDED","originState":"Completed","maxAttemptCount":1,"attemptIndex":0,"jobStartedTime":0,"attemptStartedTime":0,"attemptCompletedTime":0,"exitCode":0,"exitPhrase":"Succeeded","exitType":"Succeeded","exitDiagnostics":{"diagnosticsSummary":"Pod succeeded","runtime":null,"launcher":"Pod succeeded"},"appExitTriggerMessage":"All Tasks are completed","appExitTriggerTaskRoleName":"taskrole","appExitTriggerTaskIndex":0,"appExitSpec":{"code":0,"phrase":"Succeeded","issuer":"USER_CONTAINER","causer":"USER_CONTAINER","type":"USER_SUCCESS","stage":"COMPLETING","behavior":"UNKNOWN","reaction":"NEVER_RETRY","repro":["User program exits with exitcode 0"]},"appExitDiagnostics":"Pod succeeded","appExitMessages":{"container":null,"runtime":null,"launcher":"Pod succeeded"},"totalGpuNumber":1,"totalTaskNumber":1,"totalTaskRoleNumber":1,"taskRoles":{"taskrole":{"taskRoleStatus":{"name":"taskrole"},"taskStatuses":[{"taskIndex":0,"taskState":"SUCCEEDED","containerId":"","containerIp":"","containerExitCode":0}]}},"isLatest":true},"404":{"value":{"code":"NoJobError","message":"Job {job} is not found."}},"501":{"value":{"code":"UnknownError","message":"Internal error message."}}}},"getK8sNodes":{"path":"/api/v2/kubernetes/nodes","method":"get","examples":{"200":["Please refer to Kubernetes API doc","https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.17/#list-node-v1-core"],"401":{"value":{"code":"UnauthorizedUserError","message":"Guest is not allowed to do this operation."}},"403":{"value":{"code":"ForbiddenUserError","message":"Non-admin is not allow to do this operation."}}}},"getK8sPods":{"path":"/api/v2/kubernetes/pods","method":"get","examples":{"200":["Please refer to Kubernetes API doc","https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.17/#list-all-namespaces-pod-v1-core"],"401":{"value":{"code":"UnauthorizedUserError","message":"Guest is not allowed to do this operation."}},"403":{"value":{"code":"ForbiddenUserError","message":"Non-admin is not allow to do this operation."}}}}}} \ No newline at end of file +{"tests":[], "map":{}} diff --git a/package-lock.json b/package-lock.json index 4ee4f61..41ac5d2 100644 --- a/package-lock.json +++ b/package-lock.json @@ -571,9 +571,9 @@ "dev": true }, "@types/chai": { - "version": "4.2.9", - "resolved": "https://registry.npmjs.org/@types/chai/-/chai-4.2.9.tgz", - "integrity": "sha512-NeXgZj+MFL4izGqA4sapdYzkzQG+MtGra9vhQ58dnmDY++VgJaRUws+aLVV5zRJCYJl/8s9IjMmhiUw1WsKSmw==", + "version": "4.2.11", + "resolved": "https://registry.npmjs.org/@types/chai/-/chai-4.2.11.tgz", + "integrity": "sha512-t7uW6eFafjO+qJ3BIV2gGUyZs27egcNRkUdalkud+Qa3+kg//f129iuOFivHDXQ+vnU3fDXuwgv0cqMCbcE8sw==", "dev": true }, "@types/chai-as-promised": { @@ -629,9 +629,9 @@ "dev": true }, "@types/mocha": { - "version": "5.2.7", - "resolved": "https://registry.npmjs.org/@types/mocha/-/mocha-5.2.7.tgz", - "integrity": "sha512-NYrtPht0wGzhwe9+/idPaBB+TqkY9AhTvOLMkThm0IoEfLaiVQZwBwyJ5puCkO3AUCWrmcoePjp2mbFocKy4SQ==", + "version": "7.0.2", + "resolved": "https://registry.npmjs.org/@types/mocha/-/mocha-7.0.2.tgz", + "integrity": "sha512-ZvO2tAcjmMi8V/5Z3JsyofMe3hasRcaw88cto5etSVMwVQfeivGAlEYmaQgceUSVYFofVjT+ioHsATjdWcFt1w==", "dev": true }, "@types/mock-fs": { @@ -742,9 +742,9 @@ } }, "ansi-colors": { - "version": "3.2.3", - "resolved": "https://registry.npmjs.org/ansi-colors/-/ansi-colors-3.2.3.tgz", - "integrity": "sha512-LEHHyuhlPY3TmuUYMh2oz89lTShfvgbmzaBcxve9t/9Wuy7Dwf4yoAKcND7KFT1HAQfqZ12qtc+DUrBMeKF9nw==", + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/ansi-colors/-/ansi-colors-4.1.1.tgz", + "integrity": "sha512-JoX0apGbHaUJBNl6yF+p6JAFYZ666/hhCGKN5t9QFjbJQKUU/g8MNbFDbvfrgKXvI1QpZplPOnwIo99lX/AAmA==", "dev": true }, "ansi-regex": { @@ -761,6 +761,16 @@ "color-convert": "^1.9.0" } }, + "anymatch": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-3.1.1.tgz", + "integrity": "sha512-mM8522psRCqzV+6LhomX5wgp25YVibjh8Wj23I5RPkPppSVSjyKD2A2mBJmWGa+KN7f2D6LNh9jkBCeyLktzjg==", + "dev": true, + "requires": { + "normalize-path": "^3.0.0", + "picomatch": "^2.0.4" + } + }, "append-transform": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/append-transform/-/append-transform-2.0.0.tgz", @@ -790,6 +800,18 @@ "sprintf-js": "~1.0.2" } }, + "array.prototype.map": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/array.prototype.map/-/array.prototype.map-1.0.2.tgz", + "integrity": "sha512-Az3OYxgsa1g7xDYp86l0nnN4bcmuEITGe1rbdEBVkrqkzMgDcbdQ2R7r41pNzti+4NMces3H8gMmuioZUilLgw==", + "dev": true, + "requires": { + "define-properties": "^1.1.3", + "es-abstract": "^1.17.0-next.1", + "es-array-method-boxes-properly": "^1.0.0", + "is-string": "^1.0.4" + } + }, "asn1": { "version": "0.2.4", "resolved": "https://registry.npmjs.org/asn1/-/asn1-0.2.4.tgz", @@ -851,6 +873,12 @@ "tweetnacl": "^0.14.3" } }, + "binary-extensions": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.0.0.tgz", + "integrity": "sha512-Phlt0plgpIIBOGTT/ehfFnbNlfsDEiqmzE2KRXoX1bLIlir4X/MR+zSyBEkL05ffWgnRSf/DXv+WrUAVr93/ow==", + "dev": true + }, "brace-expansion": { "version": "1.1.11", "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", @@ -861,6 +889,15 @@ "concat-map": "0.0.1" } }, + "braces": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", + "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", + "dev": true, + "requires": { + "fill-range": "^7.0.1" + } + }, "browser-stdout": { "version": "1.3.1", "resolved": "https://registry.npmjs.org/browser-stdout/-/browser-stdout-1.3.1.tgz", @@ -949,6 +986,22 @@ "integrity": "sha1-V00xLt2Iu13YkS6Sht1sCu1KrII=", "dev": true }, + "chokidar": { + "version": "3.3.1", + "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.3.1.tgz", + "integrity": "sha512-4QYCEWOcK3OJrxwvyyAOxFuhpvOVCYkr33LPfFNBjAD/w3sEzWsp2BUOkI4l9bHvWioAd0rc6NlHUOEaWkTeqg==", + "dev": true, + "requires": { + "anymatch": "~3.1.1", + "braces": "~3.0.2", + "fsevents": "~2.1.2", + "glob-parent": "~5.1.0", + "is-binary-path": "~2.1.0", + "is-glob": "~4.0.1", + "normalize-path": "~3.0.0", + "readdirp": "~3.3.0" + } + }, "clean-stack": { "version": "2.2.0", "resolved": "https://registry.npmjs.org/clean-stack/-/clean-stack-2.2.0.tgz", @@ -1152,9 +1205,9 @@ "integrity": "sha1-3zrhmayt+31ECqrgsp4icrJOxhk=" }, "diff": { - "version": "3.5.0", - "resolved": "https://registry.npmjs.org/diff/-/diff-3.5.0.tgz", - "integrity": "sha512-A46qtFgd+g7pDZinpnwiRJtxbC1hpgf0uzP3iG89scHk0AUC7A1TGxf5OiiOUv/JMZR8GOt8hL900hV0bOy5xA==", + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/diff/-/diff-4.0.2.tgz", + "integrity": "sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A==", "dev": true }, "dirty-chai": { @@ -1178,22 +1231,43 @@ "integrity": "sha512-CwBLREIQ7LvYFB0WyRvwhq5N5qPhc6PMjD6bYggFlI5YyDgl+0vxq5VHbMOFqLg7hfWzmu8T5Z1QofhmTIhItA==" }, "es-abstract": { - "version": "1.17.5", - "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.17.5.tgz", - "integrity": "sha512-BR9auzDbySxOcfog0tLECW8l28eRGpDpU3Dm3Hp4q/N+VtLTmyj4EUN088XZWQDW/hzj6sYRDXeOFsaAODKvpg==", + "version": "1.17.6", + "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.17.6.tgz", + "integrity": "sha512-Fr89bON3WFyUi5EvAeI48QTWX0AyekGgLA8H+c+7fbfCkJwRWRMLd8CQedNEyJuoYYhmtEqY92pgte1FAhBlhw==", "dev": true, "requires": { "es-to-primitive": "^1.2.1", "function-bind": "^1.1.1", "has": "^1.0.3", "has-symbols": "^1.0.1", - "is-callable": "^1.1.5", - "is-regex": "^1.0.5", + "is-callable": "^1.2.0", + "is-regex": "^1.1.0", "object-inspect": "^1.7.0", "object-keys": "^1.1.1", "object.assign": "^4.1.0", - "string.prototype.trimleft": "^2.1.1", - "string.prototype.trimright": "^2.1.1" + "string.prototype.trimend": "^1.0.1", + "string.prototype.trimstart": "^1.0.1" + } + }, + "es-array-method-boxes-properly": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/es-array-method-boxes-properly/-/es-array-method-boxes-properly-1.0.0.tgz", + "integrity": "sha512-wd6JXUmyHmt8T5a2xreUwKcGPq6f1f+WwIJkijUqiGcJz1qqnZgP6XIK+QyIWU5lT7imeNxUll48bziG+TSYcA==", + "dev": true + }, + "es-get-iterator": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/es-get-iterator/-/es-get-iterator-1.1.0.tgz", + "integrity": "sha512-UfrmHuWQlNMTs35e1ypnvikg6jCz3SK8v8ImvmDsh36fCVUR1MqoFDiyn0/k52C8NqO3YsO8Oe0azeesNuqSsQ==", + "dev": true, + "requires": { + "es-abstract": "^1.17.4", + "has-symbols": "^1.0.1", + "is-arguments": "^1.0.4", + "is-map": "^2.0.1", + "is-set": "^2.0.1", + "is-string": "^1.0.5", + "isarray": "^2.0.5" } }, "es-to-primitive": { @@ -1249,6 +1323,15 @@ "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz", "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==" }, + "fill-range": { + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", + "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", + "dev": true, + "requires": { + "to-regex-range": "^5.0.1" + } + }, "find-cache-dir": { "version": "3.3.1", "resolved": "https://registry.npmjs.org/find-cache-dir/-/find-cache-dir-3.3.1.tgz", @@ -1261,12 +1344,13 @@ } }, "find-up": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/find-up/-/find-up-3.0.0.tgz", - "integrity": "sha512-1yD6RmLI1XBfxugvORwlck6f75tYL+iR0jqwsOrOxMZyGYqUuDhJ0l4AXdO1iX/FTs9cBAMEk1gWSEx1kSbylg==", + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", + "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==", "dev": true, "requires": { - "locate-path": "^3.0.0" + "locate-path": "^5.0.0", + "path-exists": "^4.0.0" } }, "flat": { @@ -1333,6 +1417,13 @@ "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=", "dev": true }, + "fsevents": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.1.3.tgz", + "integrity": "sha512-Auw9a4AxqWpa9GUfj370BMPzzyncfBABW8Mab7BGWBYDj4Isgq+cDKtx0i6u9jcX9pQDnswsaaOTgTmA5pEjuQ==", + "dev": true, + "optional": true + }, "function-bind": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", @@ -1385,6 +1476,15 @@ "path-is-absolute": "^1.0.0" } }, + "glob-parent": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.1.tgz", + "integrity": "sha512-FnI+VGOpnlGHWZxthPGR+QhR78fuiK0sNLkHQv+bL9fQi57lNNdquIbna/WrfROrolq8GK5Ek6BiMwqL/voRYQ==", + "dev": true, + "requires": { + "is-glob": "^4.0.1" + } + }, "globals": { "version": "11.12.0", "resolved": "https://registry.npmjs.org/globals/-/globals-11.12.0.tgz", @@ -1502,6 +1602,21 @@ "resolved": "https://registry.npmjs.org/ip-regex/-/ip-regex-2.1.0.tgz", "integrity": "sha1-+ni/XS5pE8kRzp+BnuUUa7bYROk=" }, + "is-arguments": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/is-arguments/-/is-arguments-1.0.4.tgz", + "integrity": "sha512-xPh0Rmt8NE65sNzvyUmWgI1tz3mKq74lGA0mL8LYZcoIzKOzDh6HmrYm3d18k60nHerC8A9Km8kYu87zfSFnLA==", + "dev": true + }, + "is-binary-path": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-2.1.0.tgz", + "integrity": "sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw==", + "dev": true, + "requires": { + "binary-extensions": "^2.0.0" + } + }, "is-buffer": { "version": "2.0.4", "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-2.0.4.tgz", @@ -1509,9 +1624,9 @@ "dev": true }, "is-callable": { - "version": "1.1.5", - "resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.1.5.tgz", - "integrity": "sha512-ESKv5sMCJB2jnHTWZ3O5itG+O128Hsus4K4Qh1h2/cgn2vbgnLSVqfV46AeJA9D5EeeLa9w81KUXMtn34zhX+Q==", + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.2.0.tgz", + "integrity": "sha512-pyVD9AaGLxtg6srb2Ng6ynWJqkHU9bEM087AKck0w8QwDarTfNcpIYoU8x8Hv2Icm8u6kFJM18Dag8lyqGkviw==", "dev": true }, "is-date-object": { @@ -1520,26 +1635,65 @@ "integrity": "sha512-USlDT524woQ08aoZFzh3/Z6ch9Y/EWXEHQ/AaRN0SkKq4t2Jw2R2339tSXmwuVoY7LLlBCbOIlx2myP/L5zk0g==", "dev": true }, + "is-extglob": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", + "integrity": "sha1-qIwCU1eR8C7TfHahueqXc8gz+MI=", + "dev": true + }, "is-fullwidth-code-point": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=" }, + "is-glob": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.1.tgz", + "integrity": "sha512-5G0tKtBTFImOqDnLB2hG6Bp2qcKEFduo4tZu9MT/H6NQv/ghhy30o55ufafxJ/LdH79LLs2Kfrn85TLKyA7BUg==", + "dev": true, + "requires": { + "is-extglob": "^2.1.1" + } + }, + "is-map": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/is-map/-/is-map-2.0.1.tgz", + "integrity": "sha512-T/S49scO8plUiAOA2DBTBG3JHpn1yiw0kRp6dgiZ0v2/6twi5eiB0rHtHFH9ZIrvlWc6+4O+m4zg5+Z833aXgw==", + "dev": true + }, + "is-number": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", + "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", + "dev": true + }, "is-regex": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.0.5.tgz", - "integrity": "sha512-vlKW17SNq44owv5AQR3Cq0bQPEb8+kF3UKZ2fiZNOWtztYE5i0CzCZxFDwO58qAOWtxdBRVO/V5Qin1wjCqFYQ==", + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.1.0.tgz", + "integrity": "sha512-iI97M8KTWID2la5uYXlkbSDQIg4F6o1sYboZKKTDpnDQMLtUL86zxhgDet3Q2SriaYsyGqZ6Mn2SjbRKeLHdqw==", "dev": true, "requires": { - "has": "^1.0.3" + "has-symbols": "^1.0.1" } }, + "is-set": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/is-set/-/is-set-2.0.1.tgz", + "integrity": "sha512-eJEzOtVyenDs1TMzSQ3kU3K+E0GUS9sno+F0OBT97xsgcJsF9nXMBtkT9/kut5JEpM7oL7X/0qxR17K3mcwIAA==", + "dev": true + }, "is-stream": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-2.0.0.tgz", "integrity": "sha512-XCoy+WlUr7d1+Z8GgSuXmpuUFC9fOhRXglJMx+dwLKTkL44Cjd4W1Z5P+BQZpr+cR93aGP4S/s7Ftw6Nd/kiEw==", "dev": true }, + "is-string": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/is-string/-/is-string-1.0.5.tgz", + "integrity": "sha512-buY6VNRjhQMiF1qWDouloZlQbRhDPCebwxSjxMjxgemYT46YMd2NR0/H+fBhEfWX4A/w9TBJ+ol+okqJKFE6vQ==", + "dev": true + }, "is-symbol": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/is-symbol/-/is-symbol-1.0.3.tgz", @@ -1560,6 +1714,12 @@ "integrity": "sha512-eXK1UInq2bPmjyX6e3VHIzMLobc4J94i4AWn+Hpq3OU5KkrRC96OAcR3PRJ/pGu6m8TRnBHP9dkXQVsT/COVIA==", "dev": true }, + "isarray": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-2.0.5.tgz", + "integrity": "sha512-xHjhDr3cNBK0BzdUJSPXZntQUx/mwMS5Rw4A7lPJ90XGAO6ISP/ePDNuo0vhqOZU+UD5JoodwCAAoZQd3FeAKw==", + "dev": true + }, "isexe": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", @@ -1693,6 +1853,22 @@ "istanbul-lib-report": "^3.0.0" } }, + "iterate-iterator": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/iterate-iterator/-/iterate-iterator-1.0.1.tgz", + "integrity": "sha512-3Q6tudGN05kbkDQDI4CqjaBf4qf85w6W6GnuZDtUVYwKgtC1q8yxYX7CZed7N+tLzQqS6roujWvszf13T+n9aw==", + "dev": true + }, + "iterate-value": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/iterate-value/-/iterate-value-1.0.2.tgz", + "integrity": "sha512-A6fMAio4D2ot2r/TYzr4yUWrmwNdsN5xL7+HUiyACE4DXm+q8HtPcnFTp+NnW3k4N05tZ7FVYFFb2CR13NxyHQ==", + "dev": true, + "requires": { + "es-get-iterator": "^1.0.2", + "iterate-iterator": "^1.0.1" + } + }, "js-tokens": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", @@ -1769,13 +1945,12 @@ "dev": true }, "locate-path": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-3.0.0.tgz", - "integrity": "sha512-7AO748wWnIhNqAuaty2ZWHkQHRSNfPVIsPIfwEOWO22AmaoVrWavlOcMR5nzTLNYvp36X220/maaRsrec1G65A==", + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", + "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==", "dev": true, "requires": { - "p-locate": "^3.0.0", - "path-exists": "^3.0.0" + "p-locate": "^4.1.0" } }, "lodash": { @@ -1806,12 +1981,12 @@ "dev": true }, "log-symbols": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/log-symbols/-/log-symbols-2.2.0.tgz", - "integrity": "sha512-VeIAFslyIerEJLXHziedo2basKbMKtTw3vfn5IzG0XTjhAVEJyNHnL2p7vc+wBDSdQuUpNw3M2u6xb9QsAY5Eg==", + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/log-symbols/-/log-symbols-3.0.0.tgz", + "integrity": "sha512-dSkNGuI7iG3mfvDzUuYZyvk5dD9ocYCYzNU6CYDE6+Xqd+gwme6Z00NS3dUh8mq/73HaEtT7m6W+yUPtU6BZnQ==", "dev": true, "requires": { - "chalk": "^2.0.1" + "chalk": "^2.4.2" } }, "make-dir": { @@ -1866,31 +2041,33 @@ "dev": true }, "mocha": { - "version": "6.2.3", - "resolved": "https://registry.npmjs.org/mocha/-/mocha-6.2.3.tgz", - "integrity": "sha512-0R/3FvjIGH3eEuG17ccFPk117XL2rWxatr81a57D+r/x2uTYZRbdZ4oVidEUMh2W2TJDa7MdAb12Lm2/qrKajg==", + "version": "8.0.1", + "resolved": "https://registry.npmjs.org/mocha/-/mocha-8.0.1.tgz", + "integrity": "sha512-vefaXfdYI8+Yo8nPZQQi0QO2o+5q9UIMX1jZ1XMmK3+4+CQjc7+B0hPdUeglXiTlr8IHMVRo63IhO9Mzt6fxOg==", "dev": true, "requires": { - "ansi-colors": "3.2.3", + "ansi-colors": "4.1.1", "browser-stdout": "1.3.1", + "chokidar": "3.3.1", "debug": "3.2.6", - "diff": "3.5.0", + "diff": "4.0.2", "escape-string-regexp": "1.0.5", - "find-up": "3.0.0", - "glob": "7.1.3", + "find-up": "4.1.0", + "glob": "7.1.6", "growl": "1.10.5", "he": "1.2.0", "js-yaml": "3.13.1", - "log-symbols": "2.2.0", + "log-symbols": "3.0.0", "minimatch": "3.0.4", - "mkdirp": "0.5.4", - "ms": "2.1.1", - "node-environment-flags": "1.0.5", + "ms": "2.1.2", "object.assign": "4.1.0", - "strip-json-comments": "2.0.1", - "supports-color": "6.0.0", - "which": "1.3.1", + "promise.allsettled": "1.0.2", + "serialize-javascript": "3.0.0", + "strip-json-comments": "3.0.1", + "supports-color": "7.1.0", + "which": "2.0.2", "wide-align": "1.1.3", + "workerpool": "6.0.0", "yargs": "13.3.2", "yargs-parser": "13.1.2", "yargs-unparser": "1.6.0" @@ -1905,19 +2082,24 @@ "ms": "^2.1.1" } }, - "mkdirp": { - "version": "0.5.4", - "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.4.tgz", - "integrity": "sha512-iG9AK/dJLtJ0XNgTuDbSyNS3zECqDlAhnQW4CsNxBG3LQJBbHmRX1egw39DmtOdCAqY+dKXV+sgPgilNWUKMVw==", + "glob": { + "version": "7.1.6", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.6.tgz", + "integrity": "sha512-LwaxwyZ72Lk7vZINtNNrywX0ZuLyStrdDtabefZKAY5ZGJhVtgdznluResxNmPitE0SAO+O26sWTHeKSI2wMBA==", "dev": true, "requires": { - "minimist": "^1.2.5" + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.0.4", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" } }, "ms": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.1.tgz", - "integrity": "sha512-tgp+dl5cGk28utYktBsrFqA7HKgrhgPsg6Z/EfhWI4gl1Hwq8B/GmY/0oXZ6nF8hDVesS/FpnYaD/kOWhYQvyg==", + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", "dev": true } } @@ -1928,6 +2110,11 @@ "integrity": "sha512-Yp4o3/ZA15wsXqJTT+R+9w2AYIkD1i80Lds47wDbuUhOvQvm+O2EfjFZSz0pMgZZSPHRhGxgcd2+GL4+jZMtdw==", "dev": true }, + "module-alias": { + "version": "2.2.2", + "resolved": "https://registry.npmjs.org/module-alias/-/module-alias-2.2.2.tgz", + "integrity": "sha512-A/78XjoX2EmNvppVWEhM2oGk3x4lLxnkEA4jTbaK97QKSDjkIoOsKQlfylt/d3kKKi596Qy3NP5XrXJ6fZIC9Q==" + }, "ms": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", @@ -1962,16 +2149,6 @@ } } }, - "node-environment-flags": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/node-environment-flags/-/node-environment-flags-1.0.5.tgz", - "integrity": "sha512-VNYPRfGfmZLx0Ye20jWzHUjyTW/c+6Wq+iLhDzUI4XmhrDd9l/FozXV3F2xOaXjvp0co0+v1YSR3CMP6g+VvLQ==", - "dev": true, - "requires": { - "object.getownpropertydescriptors": "^2.0.3", - "semver": "^5.7.0" - } - }, "node-fetch": { "version": "2.6.0", "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.0.tgz", @@ -1986,6 +2163,12 @@ "process-on-spawn": "^1.0.0" } }, + "normalize-path": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz", + "integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==", + "dev": true + }, "nyc": { "version": "15.1.0", "resolved": "https://registry.npmjs.org/nyc/-/nyc-15.1.0.tgz", @@ -2214,16 +2397,6 @@ "object-keys": "^1.0.11" } }, - "object.getownpropertydescriptors": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/object.getownpropertydescriptors/-/object.getownpropertydescriptors-2.1.0.tgz", - "integrity": "sha512-Z53Oah9A3TdLoblT7VKJaTDdXdT+lQO+cNpKVnya5JDe9uLvzu1YyY1yFDFrcxrlRgWrEFH0jJtD/IbuwjcEVg==", - "dev": true, - "requires": { - "define-properties": "^1.1.3", - "es-abstract": "^1.17.0-next.1" - } - }, "once": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", @@ -2248,12 +2421,12 @@ } }, "p-locate": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-3.0.0.tgz", - "integrity": "sha512-x+12w/To+4GFfgJhBEpiDcLozRJGegY+Ei7/z0tSLkMmxGZNybVMSfWj9aJn8Z5Fc7dBUNJOOVgPv2H7IwulSQ==", + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz", + "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==", "dev": true, "requires": { - "p-limit": "^2.0.0" + "p-limit": "^2.2.0" } }, "p-map": { @@ -2284,9 +2457,9 @@ } }, "path-exists": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-3.0.0.tgz", - "integrity": "sha1-zg6+ql94yxiSXqfYENe1mwEP1RU=", + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", + "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", "dev": true }, "path-is-absolute": { @@ -2318,6 +2491,12 @@ "resolved": "https://registry.npmjs.org/performance-now/-/performance-now-2.1.0.tgz", "integrity": "sha1-Ywn04OX6kT7BxpMHrjZLSzd8nns=" }, + "picomatch": { + "version": "2.2.2", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.2.2.tgz", + "integrity": "sha512-q0M/9eZHzmr0AulXyPwNfZjtwZ/RBZlbN3K3CErVrk50T2ASYI7Bye0EvekFY3IP1Nt2DHu0re+V2ZHIpMkuWg==", + "dev": true + }, "pkg-dir": { "version": "4.2.0", "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-4.2.0.tgz", @@ -2383,6 +2562,19 @@ "fromentries": "^1.2.0" } }, + "promise.allsettled": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/promise.allsettled/-/promise.allsettled-1.0.2.tgz", + "integrity": "sha512-UpcYW5S1RaNKT6pd+s9jp9K9rlQge1UXKskec0j6Mmuq7UJCvlS2J2/s/yuPN8ehftf9HXMxWlKiPbGGUzpoRg==", + "dev": true, + "requires": { + "array.prototype.map": "^1.0.1", + "define-properties": "^1.1.3", + "es-abstract": "^1.17.0-next.1", + "function-bind": "^1.1.1", + "iterate-value": "^1.0.0" + } + }, "propagate": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/propagate/-/propagate-2.0.1.tgz", @@ -2404,6 +2596,15 @@ "resolved": "https://registry.npmjs.org/qs/-/qs-6.5.2.tgz", "integrity": "sha512-N5ZAX4/LxJmF+7wN74pUD6qAh9/wnvdQcjq9TZjevvXzSUo7bfmw91saqMjzGS2xq91/odN2dW/WOl7qQHNDGA==" }, + "readdirp": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-3.3.0.tgz", + "integrity": "sha512-zz0pAkSPOXXm1viEwygWIPSPkcBYjW1xU5j/JBh5t9bGCJwa6f9+BJa6VaB2g+b55yVrmXzqkyLf4xaWYM0IkQ==", + "dev": true, + "requires": { + "picomatch": "^2.0.7" + } + }, "release-zalgo": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/release-zalgo/-/release-zalgo-1.0.0.tgz", @@ -2547,6 +2748,12 @@ "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", "dev": true }, + "serialize-javascript": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-3.0.0.tgz", + "integrity": "sha512-skZcHYw2vEX4bw90nAr2iTTsz6x2SrHEnfxgKYmZlvJYBEZrvbKtobJWlQ20zczKb3bsHHXXTYt48zBA7ni9cw==", + "dev": true + }, "set-blocking": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz", @@ -2685,28 +2892,6 @@ "es-abstract": "^1.17.5" } }, - "string.prototype.trimleft": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/string.prototype.trimleft/-/string.prototype.trimleft-2.1.2.tgz", - "integrity": "sha512-gCA0tza1JBvqr3bfAIFJGqfdRTyPae82+KTnm3coDXkZN9wnuW3HjGgN386D7hfv5CHQYCI022/rJPVlqXyHSw==", - "dev": true, - "requires": { - "define-properties": "^1.1.3", - "es-abstract": "^1.17.5", - "string.prototype.trimstart": "^1.0.0" - } - }, - "string.prototype.trimright": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/string.prototype.trimright/-/string.prototype.trimright-2.1.2.tgz", - "integrity": "sha512-ZNRQ7sY3KroTaYjRS6EbNiiHrOkjihL9aQE/8gfQ4DtAC/aEBRHFJa44OmoWxGGqXuJlfKkZW4WcXErGr+9ZFg==", - "dev": true, - "requires": { - "define-properties": "^1.1.3", - "es-abstract": "^1.17.5", - "string.prototype.trimend": "^1.0.0" - } - }, "string.prototype.trimstart": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/string.prototype.trimstart/-/string.prototype.trimstart-1.0.1.tgz", @@ -2733,18 +2918,26 @@ "dev": true }, "strip-json-comments": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-2.0.1.tgz", - "integrity": "sha1-PFMZQukIwml8DsNEhYwobHygpgo=", + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.0.1.tgz", + "integrity": "sha512-VTyMAUfdm047mwKl+u79WIdrZxtFtn+nBxHeb844XBQ9uMNTuTHdx2hc5RiAJYqwTj3wc/xe5HLSdJSkJ+WfZw==", "dev": true }, "supports-color": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-6.0.0.tgz", - "integrity": "sha512-on9Kwidc1IUQo+bQdhi8+Tijpo0e1SS6RoGo2guUwn5vdaxw8RXOF9Vb2ws+ihWOmh4JnCJOvaziZWP1VABaLg==", + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.1.0.tgz", + "integrity": "sha512-oRSIpR8pxT1Wr2FquTNnGet79b3BWljqOuoW/h4oBhxJ/HUbX5nX6JSruTkvXDCFMwDPvsaTTbvMLKZWSy0R5g==", "dev": true, "requires": { - "has-flag": "^3.0.0" + "has-flag": "^4.0.0" + }, + "dependencies": { + "has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true + } } }, "table": { @@ -2816,6 +3009,15 @@ "integrity": "sha1-3F5pjL0HkmW8c+A3doGk5Og/YW4=", "dev": true }, + "to-regex-range": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", + "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", + "dev": true, + "requires": { + "is-number": "^7.0.0" + } + }, "tough-cookie": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-3.0.1.tgz", @@ -3034,9 +3236,9 @@ } }, "which": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz", - "integrity": "sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==", + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", + "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", "dev": true, "requires": { "isexe": "^2.0.0" @@ -3057,6 +3259,12 @@ "string-width": "^1.0.2 || 2" } }, + "workerpool": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/workerpool/-/workerpool-6.0.0.tgz", + "integrity": "sha512-fU2OcNA/GVAJLLyKUoHkAgIhKb0JoCpSjLC/G2vYKxUjVmQwGbRVeoPJ1a8U4pnVofz4AQV5Y/NEw8oKqxEBtA==", + "dev": true + }, "wrap-ansi": { "version": "5.1.0", "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-5.1.0.tgz", @@ -3158,6 +3366,40 @@ "integrity": "sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==", "dev": true }, + "find-up": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-3.0.0.tgz", + "integrity": "sha512-1yD6RmLI1XBfxugvORwlck6f75tYL+iR0jqwsOrOxMZyGYqUuDhJ0l4AXdO1iX/FTs9cBAMEk1gWSEx1kSbylg==", + "dev": true, + "requires": { + "locate-path": "^3.0.0" + } + }, + "locate-path": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-3.0.0.tgz", + "integrity": "sha512-7AO748wWnIhNqAuaty2ZWHkQHRSNfPVIsPIfwEOWO22AmaoVrWavlOcMR5nzTLNYvp36X220/maaRsrec1G65A==", + "dev": true, + "requires": { + "p-locate": "^3.0.0", + "path-exists": "^3.0.0" + } + }, + "p-locate": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-3.0.0.tgz", + "integrity": "sha512-x+12w/To+4GFfgJhBEpiDcLozRJGegY+Ei7/z0tSLkMmxGZNybVMSfWj9aJn8Z5Fc7dBUNJOOVgPv2H7IwulSQ==", + "dev": true, + "requires": { + "p-limit": "^2.0.0" + } + }, + "path-exists": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-3.0.0.tgz", + "integrity": "sha1-zg6+ql94yxiSXqfYENe1mwEP1RU=", + "dev": true + }, "string-width": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/string-width/-/string-width-3.1.0.tgz", diff --git a/package.json b/package.json index 6054db0..200053b 100644 --- a/package.json +++ b/package.json @@ -20,7 +20,7 @@ "build": "ttsc -p tsconfig.json && npm run copy-swagger", "copy-swagger": "node copy_swagger.js", "precode-coverage": "npm run build && npm run pretest", - "code-coverage": "nyc mocha -r ts-node/register -r tsconfig-paths/register -r source-map-support/register \"tests/unit_tests/v2/*.spec.ts\" --exit", + "code-coverage": "nyc mocha -r ts-node/register -r tsconfig-paths/register -r source-map-support/register \"tests/unit_tests/**/*.spec.ts\" --exit", "coveralls": "nyc report --reporter=text-lcov > coverage/lcov.info" }, "homepage": "https://github.com/Microsoft/openpaisdk", @@ -37,12 +37,12 @@ "devDependencies": { "@istanbuljs/nyc-config-typescript": "^1.0.1", "@types/argparse": "^1.0.38", - "@types/chai": "^4.2.0", + "@types/chai": "^4.2.11", "@types/dirty-chai": "^2.0.1", "@types/fs-extra": "^8.1.0", "@types/js-yaml": "^3.12.1", "@types/lodash": "^4.14.150", - "@types/mocha": "^5.2.7", + "@types/mocha": "^7.0.2", "@types/mock-fs": "^4.10.0", "@types/nock": "^10.0.3", "@types/request-promise-native": "^1.0.16", @@ -52,7 +52,7 @@ "coveralls": "^3.1.0", "dirty-chai": "^2.0.1", "minimist": ">=1.2.2", - "mocha": "^6.2.3", + "mocha": "^8.0.1", "mock-fs": "^4.11.0", "nock": "^12.0.3", "nyc": "^15.1.0", From 32ac74ce26cc311031e4c395b5a451b1858ce56d Mon Sep 17 00:00:00 2001 From: Yi Yi Date: Mon, 15 Jun 2020 18:53:28 +0800 Subject: [PATCH 23/24] add all unit tests to coverage --- package-lock.json | 176 ++++------------------------------- package.json | 4 +- tests/unit_tests/cli.spec.ts | 4 +- 3 files changed, 24 insertions(+), 160 deletions(-) diff --git a/package-lock.json b/package-lock.json index 41ac5d2..8a5a6ee 100644 --- a/package-lock.json +++ b/package-lock.json @@ -490,42 +490,6 @@ "get-package-type": "^0.1.0", "js-yaml": "^3.13.1", "resolve-from": "^5.0.0" - }, - "dependencies": { - "find-up": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", - "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==", - "dev": true, - "requires": { - "locate-path": "^5.0.0", - "path-exists": "^4.0.0" - } - }, - "locate-path": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", - "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==", - "dev": true, - "requires": { - "p-locate": "^4.1.0" - } - }, - "p-locate": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz", - "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==", - "dev": true, - "requires": { - "p-limit": "^2.2.0" - } - }, - "path-exists": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", - "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", - "dev": true - } } }, "@istanbuljs/nyc-config-typescript": { @@ -841,6 +805,11 @@ "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", "integrity": "sha1-x57Zf380y48robyXkLzDZkdLS3k=" }, + "at-least-node": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/at-least-node/-/at-least-node-1.0.0.tgz", + "integrity": "sha512-+q/t7Ekv1EDY2l6Gda6LLiX14rU9TV20Wa3ofeQmwPFZbOMo9DXrLbOjFaaclkXKWidIaopwAObQDqwWtGUjqg==" + }, "aws-sign2": { "version": "0.7.0", "resolved": "https://registry.npmjs.org/aws-sign2/-/aws-sign2-0.7.0.tgz", @@ -1129,17 +1098,6 @@ "path-key": "^3.1.0", "shebang-command": "^2.0.0", "which": "^2.0.1" - }, - "dependencies": { - "which": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", - "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", - "dev": true, - "requires": { - "isexe": "^2.0.0" - } - } } }, "dashdash": { @@ -1402,13 +1360,14 @@ "dev": true }, "fs-extra": { - "version": "8.1.0", - "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-8.1.0.tgz", - "integrity": "sha512-yhlQgA6mnOJUKOsRUFsgJdQCvkKhcz8tlZG5HBQfReYZy46OwLcY+Zia0mtdHsOo9y/hP+CxMN0TU9QxoOtG4g==", + "version": "9.0.1", + "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-9.0.1.tgz", + "integrity": "sha512-h2iAoN838FqAFJY2/qVpzFXy+EBxfVE220PalAqQLDVsFOHLJrZvut5puAbCdNv6WJk+B8ihI+k0c7JK5erwqQ==", "requires": { + "at-least-node": "^1.0.0", "graceful-fs": "^4.2.0", - "jsonfile": "^4.0.0", - "universalify": "^0.1.0" + "jsonfile": "^6.0.1", + "universalify": "^1.0.0" } }, "fs.realpath": { @@ -1790,23 +1749,6 @@ "istanbul-lib-coverage": "^3.0.0", "make-dir": "^3.0.0", "supports-color": "^7.1.0" - }, - "dependencies": { - "has-flag": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", - "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", - "dev": true - }, - "supports-color": { - "version": "7.1.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.1.0.tgz", - "integrity": "sha512-oRSIpR8pxT1Wr2FquTNnGet79b3BWljqOuoW/h4oBhxJ/HUbX5nX6JSruTkvXDCFMwDPvsaTTbvMLKZWSy0R5g==", - "dev": true, - "requires": { - "has-flag": "^4.0.0" - } - } } }, "istanbul-lib-source-maps": { @@ -1920,11 +1862,12 @@ } }, "jsonfile": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-4.0.0.tgz", - "integrity": "sha1-h3Gq4HmbZAdrdmQPygWPnBDjPss=", + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-6.0.1.tgz", + "integrity": "sha512-jR2b5v7d2vIOust+w3wtFKZIfpC2pnRmFAhAC/BuweZFQR8qZzxH1OyrQ10HmdVYiXWkYUqPVsz91cG7EL2FBg==", "requires": { - "graceful-fs": "^4.1.6" + "graceful-fs": "^4.1.6", + "universalify": "^1.0.0" } }, "jsprim": { @@ -2252,16 +2195,6 @@ "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", "dev": true }, - "find-up": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", - "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==", - "dev": true, - "requires": { - "locate-path": "^5.0.0", - "path-exists": "^4.0.0" - } - }, "glob": { "version": "7.1.6", "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.6.tgz", @@ -2282,30 +2215,6 @@ "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", "dev": true }, - "locate-path": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", - "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==", - "dev": true, - "requires": { - "p-locate": "^4.1.0" - } - }, - "p-locate": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz", - "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==", - "dev": true, - "requires": { - "p-limit": "^2.2.0" - } - }, - "path-exists": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", - "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", - "dev": true - }, "string-width": { "version": "4.2.0", "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.0.tgz", @@ -2504,42 +2413,6 @@ "dev": true, "requires": { "find-up": "^4.0.0" - }, - "dependencies": { - "find-up": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", - "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==", - "dev": true, - "requires": { - "locate-path": "^5.0.0", - "path-exists": "^4.0.0" - } - }, - "locate-path": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", - "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==", - "dev": true, - "requires": { - "p-locate": "^4.1.0" - } - }, - "p-locate": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz", - "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==", - "dev": true, - "requires": { - "p-limit": "^2.2.0" - } - }, - "path-exists": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", - "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", - "dev": true - } } }, "prettier": { @@ -2833,17 +2706,6 @@ "rimraf": "^3.0.0", "signal-exit": "^3.0.2", "which": "^2.0.1" - }, - "dependencies": { - "which": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", - "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", - "dev": true, - "requires": { - "isexe": "^2.0.0" - } - } } }, "sprintf-js": { @@ -3203,9 +3065,9 @@ } }, "universalify": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/universalify/-/universalify-0.1.2.tgz", - "integrity": "sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg==" + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/universalify/-/universalify-1.0.0.tgz", + "integrity": "sha512-rb6X1W158d7pRQBg5gkR8uPaSfiids68LTJQYOtEUhoJUWBdaQHsuT/EUduxXYxcrt4r5PJ4fuHW1MHT6p0qug==" }, "uri-js": { "version": "4.2.2", diff --git a/package.json b/package.json index 200053b..e56f0c1 100644 --- a/package.json +++ b/package.json @@ -20,7 +20,7 @@ "build": "ttsc -p tsconfig.json && npm run copy-swagger", "copy-swagger": "node copy_swagger.js", "precode-coverage": "npm run build && npm run pretest", - "code-coverage": "nyc mocha -r ts-node/register -r tsconfig-paths/register -r source-map-support/register \"tests/unit_tests/**/*.spec.ts\" --exit", + "code-coverage": "nyc mocha --reporter dot -r ts-node/register -r tsconfig-paths/register -r source-map-support/register \"tests/unit_tests/**/*.spec.ts\" --exit", "coveralls": "nyc report --reporter=text-lcov > coverage/lcov.info" }, "homepage": "https://github.com/Microsoft/openpaisdk", @@ -72,7 +72,7 @@ "@azure/storage-blob": "^12.1.0", "argparse": "^1.0.10", "axios": "^0.19.2", - "fs-extra": "^8.1.0", + "fs-extra": "^9.0.1", "js-yaml": "^3.13.1", "lodash": "^4.17.15", "module-alias": "^2.2.2", diff --git a/tests/unit_tests/cli.spec.ts b/tests/unit_tests/cli.spec.ts index fba8431..2834ee4 100644 --- a/tests/unit_tests/cli.spec.ts +++ b/tests/unit_tests/cli.spec.ts @@ -27,6 +27,8 @@ beforeEach(async () => { mockFs(mockDirectory); }); +afterEach(mockFs.restore); + interface ITestCase { name: string; command: string[]; @@ -72,7 +74,7 @@ const testCases: ITestCase[] = [ ]; for (const tc of testCases) { - describe(tc.name, async () => { + describe(tc.name, () => { for (const d of tc.dependencies || []) { before(d); } From aea9228286778443c2c21b573811f4e6043d0238 Mon Sep 17 00:00:00 2001 From: yiyione Date: Mon, 22 Jun 2020 14:49:11 +0800 Subject: [PATCH 24/24] update swagger version --- src/api/v2/swagger.yaml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/api/v2/swagger.yaml b/src/api/v2/swagger.yaml index caf9802..2585ca8 100644 --- a/src/api/v2/swagger.yaml +++ b/src/api/v2/swagger.yaml @@ -1,11 +1,13 @@ openapi: 3.0.1 info: title: OpenPAI RESTful API - description: Open Platform for AI RESTful API docs. + description: > + Open Platform for AI RESTful API docs. + Version 2.0.1: add more examples and fix typos license: name: MIT License url: 'https://github.com/microsoft/pai/blob/master/LICENSE' - version: 2.0.0 + version: 2.0.1 externalDocs: description: Find out more about OpenPAI url: 'https://github.com/microsoft/pai'