1
0
mirror of https://github.com/sasjs/adapter.git synced 2026-01-05 11:40:06 +00:00

chore(*): remove console log, add comments

This commit is contained in:
Krishna Acondy
2020-09-09 07:36:27 +01:00
parent f86d20b723
commit f6b1eecb42
2 changed files with 14 additions and 2 deletions

View File

@@ -251,8 +251,6 @@ export class SASViyaApiClient {
requestBody.environment = { autoExecLines } requestBody.environment = { autoExecLines }
} }
console.log('Body', requestBody)
const createContextRequest: RequestInit = { const createContextRequest: RequestInit = {
method: 'POST', method: 'POST',
headers, headers,

View File

@@ -107,6 +107,15 @@ export default class SASjs {
return await this.sasViyaApiClient!.getExecutableContexts(accessToken) return await this.sasViyaApiClient!.getExecutableContexts(accessToken)
} }
/**
* Creates a compute context on the given server.
* @param contextName - the name of the context to be created.
* @param launchContextName - the name of the launcher context used by the compute service.
* @param sharedAccountId - the ID of the account to run the servers for this context as.
* @param autoExecLines - the lines of code to execute during session initialization.
* @param authorizedUsers - an optional list of authorized user IDs.
* @param accessToken - an access token for an authorized user.
*/
public async createContext( public async createContext(
contextName: string, contextName: string,
launchContextName: string, launchContextName: string,
@@ -128,6 +137,11 @@ export default class SASjs {
) )
} }
/**
* Deletes a compute context on the given server.
* @param contextId - the ID of the context to be deleted.
* @param accessToken - an access token for an authorized user.
*/
public async deleteContext(contextId: string, accessToken?: string) { public async deleteContext(contextId: string, accessToken?: string) {
if (this.sasjsConfig.serverType !== ServerType.SASViya) { if (this.sasjsConfig.serverType !== ServerType.SASViya) {
throw new Error('This operation is only supported on SAS Viya servers.') throw new Error('This operation is only supported on SAS Viya servers.')