mirror of
https://github.com/sasjs/server.git
synced 2025-12-10 11:24:35 +00:00
1201 lines
43 KiB
YAML
1201 lines
43 KiB
YAML
components:
|
|
examples: {}
|
|
headers: {}
|
|
parameters: {}
|
|
requestBodies: {}
|
|
responses: {}
|
|
schemas:
|
|
AuthorizeResponse:
|
|
properties:
|
|
code:
|
|
type: string
|
|
description: 'Authorization code'
|
|
example: someRandomCryptoString
|
|
required:
|
|
- code
|
|
type: object
|
|
additionalProperties: false
|
|
AuthorizePayload:
|
|
properties:
|
|
username:
|
|
type: string
|
|
description: 'Username for user'
|
|
example: secretuser
|
|
password:
|
|
type: string
|
|
description: 'Password for user'
|
|
example: secretpassword
|
|
clientId:
|
|
type: string
|
|
description: 'Client ID'
|
|
example: clientID1
|
|
required:
|
|
- username
|
|
- password
|
|
- clientId
|
|
type: object
|
|
additionalProperties: false
|
|
TokenResponse:
|
|
properties:
|
|
accessToken:
|
|
type: string
|
|
description: 'Access Token'
|
|
example: someRandomCryptoString
|
|
refreshToken:
|
|
type: string
|
|
description: 'Refresh Token'
|
|
example: someRandomCryptoString
|
|
required:
|
|
- accessToken
|
|
- refreshToken
|
|
type: object
|
|
additionalProperties: false
|
|
TokenPayload:
|
|
properties:
|
|
clientId:
|
|
type: string
|
|
description: 'Client ID'
|
|
example: clientID1
|
|
code:
|
|
type: string
|
|
description: 'Authorization code'
|
|
example: someRandomCryptoString
|
|
required:
|
|
- clientId
|
|
- code
|
|
type: object
|
|
additionalProperties: false
|
|
InfoJWT:
|
|
properties:
|
|
clientId:
|
|
type: string
|
|
userId:
|
|
type: number
|
|
format: double
|
|
required:
|
|
- clientId
|
|
- userId
|
|
type: object
|
|
additionalProperties: false
|
|
ClientPayload:
|
|
properties:
|
|
clientId:
|
|
type: string
|
|
description: 'Client ID'
|
|
example: someFormattedClientID1234
|
|
clientSecret:
|
|
type: string
|
|
description: 'Client Secret'
|
|
example: someRandomCryptoString
|
|
required:
|
|
- clientId
|
|
- clientSecret
|
|
type: object
|
|
additionalProperties: false
|
|
IRecordOfAny:
|
|
properties: {}
|
|
type: object
|
|
additionalProperties: {}
|
|
LogLine:
|
|
properties:
|
|
line:
|
|
type: string
|
|
required:
|
|
- line
|
|
type: object
|
|
additionalProperties: false
|
|
HTTPHeaders:
|
|
properties: {}
|
|
type: object
|
|
additionalProperties:
|
|
type: string
|
|
ExecuteReturnJsonResponse:
|
|
properties:
|
|
status:
|
|
type: string
|
|
_webout:
|
|
anyOf:
|
|
-
|
|
type: string
|
|
-
|
|
$ref: '#/components/schemas/IRecordOfAny'
|
|
log:
|
|
items:
|
|
$ref: '#/components/schemas/LogLine'
|
|
type: array
|
|
message:
|
|
type: string
|
|
httpHeaders:
|
|
$ref: '#/components/schemas/HTTPHeaders'
|
|
required:
|
|
- status
|
|
- _webout
|
|
- log
|
|
- httpHeaders
|
|
type: object
|
|
additionalProperties: false
|
|
ExecuteSASCodePayload:
|
|
properties:
|
|
code:
|
|
type: string
|
|
description: 'Code of SAS program'
|
|
example: '* SAS Code HERE;'
|
|
required:
|
|
- code
|
|
type: object
|
|
additionalProperties: false
|
|
MemberType.folder:
|
|
enum:
|
|
- folder
|
|
type: string
|
|
FolderMember:
|
|
properties:
|
|
name:
|
|
type: string
|
|
type:
|
|
$ref: '#/components/schemas/MemberType.folder'
|
|
members:
|
|
items:
|
|
anyOf:
|
|
-
|
|
$ref: '#/components/schemas/FolderMember'
|
|
-
|
|
$ref: '#/components/schemas/ServiceMember'
|
|
-
|
|
$ref: '#/components/schemas/FileMember'
|
|
type: array
|
|
required:
|
|
- name
|
|
- type
|
|
- members
|
|
type: object
|
|
additionalProperties: false
|
|
MemberType.service:
|
|
enum:
|
|
- service
|
|
type: string
|
|
ServiceMember:
|
|
properties:
|
|
name:
|
|
type: string
|
|
type:
|
|
$ref: '#/components/schemas/MemberType.service'
|
|
code:
|
|
type: string
|
|
required:
|
|
- name
|
|
- type
|
|
- code
|
|
type: object
|
|
additionalProperties: false
|
|
MemberType.file:
|
|
enum:
|
|
- file
|
|
type: string
|
|
FileMember:
|
|
properties:
|
|
name:
|
|
type: string
|
|
type:
|
|
$ref: '#/components/schemas/MemberType.file'
|
|
code:
|
|
type: string
|
|
required:
|
|
- name
|
|
- type
|
|
- code
|
|
type: object
|
|
additionalProperties: false
|
|
FileTree:
|
|
properties:
|
|
members:
|
|
items:
|
|
anyOf:
|
|
-
|
|
$ref: '#/components/schemas/FolderMember'
|
|
-
|
|
$ref: '#/components/schemas/ServiceMember'
|
|
-
|
|
$ref: '#/components/schemas/FileMember'
|
|
type: array
|
|
required:
|
|
- members
|
|
type: object
|
|
additionalProperties: false
|
|
DeployResponse:
|
|
properties:
|
|
status:
|
|
type: string
|
|
message:
|
|
type: string
|
|
streamServiceName:
|
|
type: string
|
|
example:
|
|
$ref: '#/components/schemas/FileTree'
|
|
required:
|
|
- status
|
|
- message
|
|
type: object
|
|
additionalProperties: false
|
|
DeployPayload:
|
|
properties:
|
|
appLoc:
|
|
type: string
|
|
streamWebFolder:
|
|
type: string
|
|
fileTree:
|
|
$ref: '#/components/schemas/FileTree'
|
|
required:
|
|
- appLoc
|
|
- fileTree
|
|
type: object
|
|
additionalProperties: false
|
|
UpdateFileResponse:
|
|
properties:
|
|
status:
|
|
type: string
|
|
message:
|
|
type: string
|
|
required:
|
|
- status
|
|
type: object
|
|
additionalProperties: false
|
|
TreeNode:
|
|
properties:
|
|
name:
|
|
type: string
|
|
relativePath:
|
|
type: string
|
|
absolutePath:
|
|
type: string
|
|
children:
|
|
items:
|
|
$ref: '#/components/schemas/TreeNode'
|
|
type: array
|
|
required:
|
|
- name
|
|
- relativePath
|
|
- absolutePath
|
|
- children
|
|
type: object
|
|
additionalProperties: false
|
|
GetFileTreeResponse:
|
|
properties:
|
|
status:
|
|
type: string
|
|
tree:
|
|
$ref: '#/components/schemas/TreeNode'
|
|
required:
|
|
- status
|
|
- tree
|
|
type: object
|
|
additionalProperties: false
|
|
UserResponse:
|
|
properties:
|
|
id:
|
|
type: number
|
|
format: double
|
|
username:
|
|
type: string
|
|
displayName:
|
|
type: string
|
|
required:
|
|
- id
|
|
- username
|
|
- displayName
|
|
type: object
|
|
additionalProperties: false
|
|
UserDetailsResponse:
|
|
properties:
|
|
id:
|
|
type: number
|
|
format: double
|
|
displayName:
|
|
type: string
|
|
username:
|
|
type: string
|
|
isActive:
|
|
type: boolean
|
|
isAdmin:
|
|
type: boolean
|
|
required:
|
|
- id
|
|
- displayName
|
|
- username
|
|
- isActive
|
|
- isAdmin
|
|
type: object
|
|
additionalProperties: false
|
|
UserPayload:
|
|
properties:
|
|
displayName:
|
|
type: string
|
|
description: 'Display name for user'
|
|
example: 'John Snow'
|
|
username:
|
|
type: string
|
|
description: 'Username for user'
|
|
example: johnSnow01
|
|
password:
|
|
type: string
|
|
description: 'Password for user'
|
|
isAdmin:
|
|
type: boolean
|
|
description: 'Account should be admin or not, defaults to false'
|
|
example: 'false'
|
|
isActive:
|
|
type: boolean
|
|
description: 'Account should be active or not, defaults to true'
|
|
example: 'true'
|
|
required:
|
|
- displayName
|
|
- username
|
|
- password
|
|
type: object
|
|
additionalProperties: false
|
|
GroupResponse:
|
|
properties:
|
|
groupId:
|
|
type: number
|
|
format: double
|
|
name:
|
|
type: string
|
|
description:
|
|
type: string
|
|
required:
|
|
- groupId
|
|
- name
|
|
- description
|
|
type: object
|
|
additionalProperties: false
|
|
GroupDetailsResponse:
|
|
properties:
|
|
groupId:
|
|
type: number
|
|
format: double
|
|
name:
|
|
type: string
|
|
description:
|
|
type: string
|
|
isActive:
|
|
type: boolean
|
|
users:
|
|
items:
|
|
$ref: '#/components/schemas/UserResponse'
|
|
type: array
|
|
required:
|
|
- groupId
|
|
- name
|
|
- description
|
|
- isActive
|
|
- users
|
|
type: object
|
|
additionalProperties: false
|
|
GroupPayload:
|
|
properties:
|
|
name:
|
|
type: string
|
|
description: 'Name of the group'
|
|
example: DCGroup
|
|
description:
|
|
type: string
|
|
description: 'Description of the group'
|
|
example: 'This group represents Data Controller Users'
|
|
isActive:
|
|
type: boolean
|
|
description: 'Group should be active or not, defaults to true'
|
|
example: 'true'
|
|
required:
|
|
- name
|
|
- description
|
|
type: object
|
|
additionalProperties: false
|
|
ExecuteReturnJsonPayload:
|
|
properties:
|
|
_program:
|
|
type: string
|
|
description: 'Location of SAS program'
|
|
example: /Public/somefolder/some.file
|
|
type: object
|
|
additionalProperties: false
|
|
securitySchemes:
|
|
bearerAuth:
|
|
type: http
|
|
scheme: bearer
|
|
bearerFormat: JWT
|
|
info:
|
|
title: api
|
|
version: 0.0.2
|
|
description: 'Api of SASjs server'
|
|
contact:
|
|
name: '4GL Ltd'
|
|
openapi: 3.0.0
|
|
paths:
|
|
/SASjsApi/auth/authorize:
|
|
post:
|
|
operationId: Authorize
|
|
responses:
|
|
'200':
|
|
description: Ok
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '#/components/schemas/AuthorizeResponse'
|
|
examples:
|
|
'Example 1':
|
|
value: {code: someRandomCryptoString}
|
|
summary: 'Accept a valid username/password, plus a CLIENT_ID, and return an AUTH_CODE'
|
|
tags:
|
|
- Auth
|
|
security: []
|
|
parameters: []
|
|
requestBody:
|
|
required: true
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '#/components/schemas/AuthorizePayload'
|
|
/SASjsApi/auth/token:
|
|
post:
|
|
operationId: Token
|
|
responses:
|
|
'200':
|
|
description: Ok
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '#/components/schemas/TokenResponse'
|
|
examples:
|
|
'Example 1':
|
|
value: {accessToken: someRandomCryptoString, refreshToken: someRandomCryptoString}
|
|
summary: 'Accepts client/auth code and returns access/refresh tokens'
|
|
tags:
|
|
- Auth
|
|
security: []
|
|
parameters: []
|
|
requestBody:
|
|
required: true
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '#/components/schemas/TokenPayload'
|
|
/SASjsApi/auth/refresh:
|
|
post:
|
|
operationId: Refresh
|
|
responses:
|
|
'200':
|
|
description: Ok
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '#/components/schemas/TokenResponse'
|
|
examples:
|
|
'Example 1':
|
|
value: {accessToken: someRandomCryptoString, refreshToken: someRandomCryptoString}
|
|
summary: 'Returns new access/refresh tokens'
|
|
tags:
|
|
- Auth
|
|
security:
|
|
-
|
|
bearerAuth: []
|
|
parameters: []
|
|
/SASjsApi/auth/logout:
|
|
post:
|
|
operationId: Logout
|
|
responses:
|
|
'204':
|
|
description: 'No content'
|
|
summary: 'Logout terminate access/refresh tokens and returns nothing'
|
|
tags:
|
|
- Auth
|
|
security:
|
|
-
|
|
bearerAuth: []
|
|
parameters: []
|
|
/SASjsApi/client:
|
|
post:
|
|
operationId: CreateClient
|
|
responses:
|
|
'200':
|
|
description: Ok
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '#/components/schemas/ClientPayload'
|
|
examples:
|
|
'Example 1':
|
|
value: {clientId: someFormattedClientID1234, clientSecret: someRandomCryptoString}
|
|
summary: 'Create client with the following attributes: ClientId, ClientSecret. Admin only task.'
|
|
tags:
|
|
- Client
|
|
security:
|
|
-
|
|
bearerAuth: []
|
|
parameters: []
|
|
requestBody:
|
|
required: true
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '#/components/schemas/ClientPayload'
|
|
/SASjsApi/code/execute:
|
|
post:
|
|
operationId: ExecuteSASCode
|
|
responses:
|
|
'200':
|
|
description: Ok
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '#/components/schemas/ExecuteReturnJsonResponse'
|
|
description: 'Execute SAS code.'
|
|
summary: 'Run SAS Code and returns log'
|
|
tags:
|
|
- CODE
|
|
security:
|
|
-
|
|
bearerAuth: []
|
|
parameters: []
|
|
requestBody:
|
|
required: true
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '#/components/schemas/ExecuteSASCodePayload'
|
|
/SASjsApi/drive/deploy:
|
|
post:
|
|
operationId: Deploy
|
|
responses:
|
|
'200':
|
|
description: Ok
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '#/components/schemas/DeployResponse'
|
|
examples:
|
|
'Example 1':
|
|
value: {status: success, message: 'Files deployed successfully to @sasjs/server.'}
|
|
'400':
|
|
description: 'Invalid Format'
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '#/components/schemas/DeployResponse'
|
|
examples:
|
|
'Example 1':
|
|
value: {status: failure, message: 'Provided not supported data format.'}
|
|
'500':
|
|
description: 'Execution Error'
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '#/components/schemas/DeployResponse'
|
|
examples:
|
|
'Example 1':
|
|
value: {status: failure, message: 'Deployment failed!'}
|
|
summary: 'Creates/updates files within SASjs Drive using provided payload.'
|
|
tags:
|
|
- Drive
|
|
security:
|
|
-
|
|
bearerAuth: []
|
|
parameters: []
|
|
requestBody:
|
|
required: true
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '#/components/schemas/DeployPayload'
|
|
/SASjsApi/drive/file:
|
|
get:
|
|
operationId: GetFile
|
|
responses:
|
|
'204':
|
|
description: 'No content'
|
|
description: "It's optional to either provide `_filePath` in url as query parameter\nOr provide `filePath` in body as form field.\nBut it's required to provide else API will respond with Bad Request."
|
|
summary: 'Get file from SASjs Drive'
|
|
tags:
|
|
- Drive
|
|
security:
|
|
-
|
|
bearerAuth: []
|
|
parameters:
|
|
-
|
|
in: query
|
|
name: _filePath
|
|
required: false
|
|
schema:
|
|
type: string
|
|
example: /Public/somefolder/some.file
|
|
requestBody:
|
|
required: false
|
|
content:
|
|
multipart/form-data:
|
|
schema:
|
|
type: object
|
|
properties:
|
|
filePath:
|
|
type: string
|
|
delete:
|
|
operationId: DeleteFile
|
|
responses:
|
|
'200':
|
|
description: Ok
|
|
content:
|
|
application/json:
|
|
schema:
|
|
properties:
|
|
status: {type: string}
|
|
required:
|
|
- status
|
|
type: object
|
|
summary: 'Delete file from SASjs Drive'
|
|
tags:
|
|
- Drive
|
|
security:
|
|
-
|
|
bearerAuth: []
|
|
parameters:
|
|
-
|
|
in: query
|
|
name: _filePath
|
|
required: true
|
|
schema:
|
|
type: string
|
|
example: /Public/somefolder/some.file
|
|
post:
|
|
operationId: SaveFile
|
|
responses:
|
|
'200':
|
|
description: Ok
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '#/components/schemas/UpdateFileResponse'
|
|
examples:
|
|
'Example 1':
|
|
value: {status: success}
|
|
'403':
|
|
description: 'File already exists'
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '#/components/schemas/UpdateFileResponse'
|
|
examples:
|
|
'Example 1':
|
|
value: {status: failure, message: 'File request failed.'}
|
|
description: "It's optional to either provide `_filePath` in url as query parameter\nOr provide `filePath` in body as form field.\nBut it's required to provide else API will respond with Bad Request."
|
|
summary: 'Create a file in SASjs Drive'
|
|
tags:
|
|
- Drive
|
|
security:
|
|
-
|
|
bearerAuth: []
|
|
parameters:
|
|
-
|
|
description: 'Location of SAS program'
|
|
in: query
|
|
name: _filePath
|
|
required: false
|
|
schema:
|
|
type: string
|
|
example: /Public/somefolder/some.file.sas
|
|
requestBody:
|
|
required: true
|
|
content:
|
|
multipart/form-data:
|
|
schema:
|
|
type: object
|
|
properties:
|
|
file:
|
|
type: string
|
|
format: binary
|
|
filePath:
|
|
type: string
|
|
required:
|
|
- file
|
|
patch:
|
|
operationId: UpdateFile
|
|
responses:
|
|
'200':
|
|
description: Ok
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '#/components/schemas/UpdateFileResponse'
|
|
examples:
|
|
'Example 1':
|
|
value: {status: success}
|
|
'403':
|
|
description: ""
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '#/components/schemas/UpdateFileResponse'
|
|
examples:
|
|
'Example 1':
|
|
value: {status: failure, message: 'File request failed.'}
|
|
description: "It's optional to either provide `_filePath` in url as query parameter\nOr provide `filePath` in body as form field.\nBut it's required to provide else API will respond with Bad Request."
|
|
summary: 'Modify a file in SASjs Drive'
|
|
tags:
|
|
- Drive
|
|
security:
|
|
-
|
|
bearerAuth: []
|
|
parameters:
|
|
-
|
|
description: 'Location of SAS program'
|
|
in: query
|
|
name: _filePath
|
|
required: false
|
|
schema:
|
|
type: string
|
|
example: /Public/somefolder/some.file.sas
|
|
requestBody:
|
|
required: true
|
|
content:
|
|
multipart/form-data:
|
|
schema:
|
|
type: object
|
|
properties:
|
|
file:
|
|
type: string
|
|
format: binary
|
|
filePath:
|
|
type: string
|
|
required:
|
|
- file
|
|
/SASjsApi/drive/filetree:
|
|
get:
|
|
operationId: GetFileTree
|
|
responses:
|
|
'200':
|
|
description: Ok
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '#/components/schemas/GetFileTreeResponse'
|
|
summary: 'Fetch file tree within SASjs Drive.'
|
|
tags:
|
|
- Drive
|
|
security:
|
|
-
|
|
bearerAuth: []
|
|
parameters: []
|
|
/SASjsApi/user:
|
|
get:
|
|
operationId: GetAllUsers
|
|
responses:
|
|
'200':
|
|
description: Ok
|
|
content:
|
|
application/json:
|
|
schema:
|
|
items:
|
|
$ref: '#/components/schemas/UserResponse'
|
|
type: array
|
|
examples:
|
|
'Example 1':
|
|
value: [{id: 123, username: johnusername, displayName: John}, {id: 456, username: starkusername, displayName: Stark}]
|
|
summary: 'Get list of all users (username, displayname). All users can request this.'
|
|
tags:
|
|
- User
|
|
security:
|
|
-
|
|
bearerAuth: []
|
|
parameters: []
|
|
post:
|
|
operationId: CreateUser
|
|
responses:
|
|
'200':
|
|
description: Ok
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '#/components/schemas/UserDetailsResponse'
|
|
examples:
|
|
'Example 1':
|
|
value: {id: 1234, displayName: 'John Snow', username: johnSnow01, isAdmin: false, isActive: true}
|
|
summary: 'Create user with the following attributes: UserId, UserName, Password, isAdmin, isActive. Admin only task.'
|
|
tags:
|
|
- User
|
|
security:
|
|
-
|
|
bearerAuth: []
|
|
parameters: []
|
|
requestBody:
|
|
required: true
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '#/components/schemas/UserPayload'
|
|
'/SASjsApi/user/{userId}':
|
|
get:
|
|
operationId: GetUser
|
|
responses:
|
|
'200':
|
|
description: Ok
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '#/components/schemas/UserDetailsResponse'
|
|
summary: 'Get user properties - such as group memberships, userName, displayName.'
|
|
tags:
|
|
- User
|
|
security:
|
|
-
|
|
bearerAuth: []
|
|
parameters:
|
|
-
|
|
description: 'The user''s identifier'
|
|
in: path
|
|
name: userId
|
|
required: true
|
|
schema:
|
|
format: double
|
|
type: number
|
|
example: 1234
|
|
patch:
|
|
operationId: UpdateUser
|
|
responses:
|
|
'200':
|
|
description: Ok
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '#/components/schemas/UserDetailsResponse'
|
|
examples:
|
|
'Example 1':
|
|
value: {id: 1234, displayName: 'John Snow', username: johnSnow01, isAdmin: false, isActive: true}
|
|
summary: 'Update user properties - such as displayName. Can be performed either by admins, or the user in question.'
|
|
tags:
|
|
- User
|
|
security:
|
|
-
|
|
bearerAuth: []
|
|
parameters:
|
|
-
|
|
description: 'The user''s identifier'
|
|
in: path
|
|
name: userId
|
|
required: true
|
|
schema:
|
|
format: double
|
|
type: number
|
|
example: '1234'
|
|
requestBody:
|
|
required: true
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '#/components/schemas/UserPayload'
|
|
delete:
|
|
operationId: DeleteUser
|
|
responses:
|
|
'204':
|
|
description: 'No content'
|
|
summary: 'Delete a user. Can be performed either by admins, or the user in question.'
|
|
tags:
|
|
- User
|
|
security:
|
|
-
|
|
bearerAuth: []
|
|
parameters:
|
|
-
|
|
description: 'The user''s identifier'
|
|
in: path
|
|
name: userId
|
|
required: true
|
|
schema:
|
|
format: double
|
|
type: number
|
|
example: 1234
|
|
requestBody:
|
|
required: true
|
|
content:
|
|
application/json:
|
|
schema:
|
|
properties:
|
|
password:
|
|
type: string
|
|
type: object
|
|
/SASjsApi/group:
|
|
get:
|
|
operationId: GetAllGroups
|
|
responses:
|
|
'200':
|
|
description: Ok
|
|
content:
|
|
application/json:
|
|
schema:
|
|
items:
|
|
$ref: '#/components/schemas/GroupResponse'
|
|
type: array
|
|
examples:
|
|
'Example 1':
|
|
value: [{groupId: 123, name: DCGroup, description: 'This group represents Data Controller Users'}]
|
|
summary: 'Get list of all groups (groupName and groupDescription). All users can request this.'
|
|
tags:
|
|
- Group
|
|
security:
|
|
-
|
|
bearerAuth: []
|
|
parameters: []
|
|
post:
|
|
operationId: CreateGroup
|
|
responses:
|
|
'200':
|
|
description: Ok
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '#/components/schemas/GroupDetailsResponse'
|
|
examples:
|
|
'Example 1':
|
|
value: {groupId: 123, name: DCGroup, description: 'This group represents Data Controller Users', isActive: true, users: []}
|
|
summary: 'Create a new group. Admin only.'
|
|
tags:
|
|
- Group
|
|
security:
|
|
-
|
|
bearerAuth: []
|
|
parameters: []
|
|
requestBody:
|
|
required: true
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '#/components/schemas/GroupPayload'
|
|
'/SASjsApi/group/{groupId}':
|
|
get:
|
|
operationId: GetGroup
|
|
responses:
|
|
'200':
|
|
description: Ok
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '#/components/schemas/GroupDetailsResponse'
|
|
summary: 'Get list of members of a group (userName). All users can request this.'
|
|
tags:
|
|
- Group
|
|
security:
|
|
-
|
|
bearerAuth: []
|
|
parameters:
|
|
-
|
|
description: 'The group''s identifier'
|
|
in: path
|
|
name: groupId
|
|
required: true
|
|
schema:
|
|
format: double
|
|
type: number
|
|
example: 1234
|
|
delete:
|
|
operationId: DeleteGroup
|
|
responses:
|
|
'204':
|
|
description: 'No content'
|
|
summary: 'Delete a group. Admin task only.'
|
|
tags:
|
|
- Group
|
|
security:
|
|
-
|
|
bearerAuth: []
|
|
parameters:
|
|
-
|
|
description: 'The group''s identifier'
|
|
in: path
|
|
name: groupId
|
|
required: true
|
|
schema:
|
|
format: double
|
|
type: number
|
|
example: 1234
|
|
'/SASjsApi/group/{groupId}/{userId}':
|
|
post:
|
|
operationId: AddUserToGroup
|
|
responses:
|
|
'200':
|
|
description: Ok
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '#/components/schemas/GroupDetailsResponse'
|
|
examples:
|
|
'Example 1':
|
|
value: {groupId: 123, name: DCGroup, description: 'This group represents Data Controller Users', isActive: true, users: []}
|
|
summary: 'Add a user to a group. Admin task only.'
|
|
tags:
|
|
- Group
|
|
security:
|
|
-
|
|
bearerAuth: []
|
|
parameters:
|
|
-
|
|
description: 'The group''s identifier'
|
|
in: path
|
|
name: groupId
|
|
required: true
|
|
schema:
|
|
format: double
|
|
type: number
|
|
example: '1234'
|
|
-
|
|
description: 'The user''s identifier'
|
|
in: path
|
|
name: userId
|
|
required: true
|
|
schema:
|
|
format: double
|
|
type: number
|
|
example: '6789'
|
|
delete:
|
|
operationId: RemoveUserFromGroup
|
|
responses:
|
|
'200':
|
|
description: Ok
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '#/components/schemas/GroupDetailsResponse'
|
|
examples:
|
|
'Example 1':
|
|
value: {groupId: 123, name: DCGroup, description: 'This group represents Data Controller Users', isActive: true, users: []}
|
|
summary: 'Remove a user to a group. Admin task only.'
|
|
tags:
|
|
- Group
|
|
security:
|
|
-
|
|
bearerAuth: []
|
|
parameters:
|
|
-
|
|
description: 'The group''s identifier'
|
|
in: path
|
|
name: groupId
|
|
required: true
|
|
schema:
|
|
format: double
|
|
type: number
|
|
example: '1234'
|
|
-
|
|
description: 'The user''s identifier'
|
|
in: path
|
|
name: userId
|
|
required: true
|
|
schema:
|
|
format: double
|
|
type: number
|
|
example: '6789'
|
|
/SASjsApi/session:
|
|
get:
|
|
operationId: Session
|
|
responses:
|
|
'200':
|
|
description: Ok
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '#/components/schemas/UserResponse'
|
|
examples:
|
|
'Example 1':
|
|
value: {id: 123, username: johnusername, displayName: John}
|
|
summary: 'Get session info (username).'
|
|
tags:
|
|
- Session
|
|
security:
|
|
-
|
|
bearerAuth: []
|
|
parameters: []
|
|
/SASjsApi/stp/execute:
|
|
get:
|
|
operationId: ExecuteReturnRaw
|
|
responses:
|
|
'200':
|
|
description: Ok
|
|
content:
|
|
application/json:
|
|
schema:
|
|
anyOf:
|
|
- {type: string}
|
|
- {type: string, format: byte}
|
|
description: "Trigger a SAS program using it's location in the _program URL parameter.\nEnable debugging using the _debug URL parameter. Setting _debug=131 will\ncause the log to be streamed in the output.\n\nAdditional URL parameters are turned into SAS macro variables.\n\nAny files provided in the request body are placed into the SAS session with\ncorresponding _WEBIN_XXX variables created.\n\nThe response headers can be adjusted using the mfs_httpheader() macro. Any\nfile type can be returned, including binary files such as zip or xls.\n\nIf _debug is >= 131, response headers will contain Content-Type: 'text/plain'\n\nThis behaviour differs for POST requests, in which case the response is\nalways JSON."
|
|
summary: 'Execute Stored Program, return raw _webout content.'
|
|
tags:
|
|
- STP
|
|
security:
|
|
-
|
|
bearerAuth: []
|
|
parameters:
|
|
-
|
|
description: 'Location of SAS program'
|
|
in: query
|
|
name: _program
|
|
required: true
|
|
schema:
|
|
type: string
|
|
example: /Public/somefolder/some.file
|
|
post:
|
|
operationId: ExecuteReturnJson
|
|
responses:
|
|
'200':
|
|
description: Ok
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '#/components/schemas/ExecuteReturnJsonResponse'
|
|
examples:
|
|
'Example 1':
|
|
value: {status: success, _webout: 'webout content', log: [], httpHeaders: {Content-type: application/zip, Cache-Control: 'public, max-age=1000'}}
|
|
description: "Trigger a SAS program using it's location in the _program URL parameter.\nEnable debugging using the _debug URL parameter. In any case, the log is\nalways returned in the log object.\n\nAdditional URL parameters are turned into SAS macro variables.\n\nAny files provided in the request body are placed into the SAS session with\ncorresponding _WEBIN_XXX variables created.\n\nThe response will be a JSON object with the following root attributes: log,\nwebout, headers.\n\nThe webout will be a nested JSON object ONLY if the response-header\ncontains a content-type of application/json AND it is valid JSON.\nOtherwise it will be a stringified version of the webout content.\n\nResponse headers from the mfs_httpheader macro are simply listed in the\nheaders object, for POST requests they have no effect on the actual\nresponse header."
|
|
summary: 'Execute Stored Program, return JSON'
|
|
tags:
|
|
- STP
|
|
security:
|
|
-
|
|
bearerAuth: []
|
|
parameters:
|
|
-
|
|
description: 'Location of SAS program'
|
|
in: query
|
|
name: _program
|
|
required: false
|
|
schema:
|
|
type: string
|
|
example: /Public/somefolder/some.file
|
|
requestBody:
|
|
required: false
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '#/components/schemas/ExecuteReturnJsonPayload'
|
|
servers:
|
|
-
|
|
url: /
|
|
tags:
|
|
-
|
|
name: Session
|
|
description: 'Get Session information'
|
|
-
|
|
name: User
|
|
description: 'Operations about users'
|
|
-
|
|
name: Client
|
|
description: 'Operations about clients'
|
|
-
|
|
name: Auth
|
|
description: 'Operations about auth'
|
|
-
|
|
name: Drive
|
|
description: 'Operations about drive'
|
|
-
|
|
name: Group
|
|
description: 'Operations about group'
|
|
-
|
|
name: STP
|
|
description: 'Operations about STP'
|
|
-
|
|
name: CODE
|
|
description: 'Operations on SAS code'
|