2024-12-14 19:48:24 +00:00
|
|
|
openapi: 3.1.0
|
|
|
|
info:
|
|
|
|
title: StrafesNET Internal - OpenAPI 3.1
|
|
|
|
description: Internal operations inaccessible from the public internet.
|
|
|
|
version: 0.1.0
|
|
|
|
tags:
|
|
|
|
- name: Submissions
|
|
|
|
description: Submission operations
|
|
|
|
paths:
|
2024-12-18 02:10:53 +00:00
|
|
|
/submissions/{SubmissionID}/model:
|
|
|
|
post:
|
|
|
|
summary: Update model following role restrictions
|
|
|
|
operationId: updateSubmissionModel
|
|
|
|
tags:
|
|
|
|
- Submissions
|
|
|
|
parameters:
|
|
|
|
- $ref: '#/components/parameters/SubmissionID'
|
|
|
|
- name: ModelID
|
|
|
|
in: query
|
|
|
|
required: true
|
|
|
|
schema:
|
|
|
|
type: integer
|
|
|
|
format: int64
|
|
|
|
- name: VersionID
|
|
|
|
in: query
|
|
|
|
required: true
|
|
|
|
schema:
|
|
|
|
type: integer
|
|
|
|
format: int64
|
|
|
|
responses:
|
|
|
|
"204":
|
|
|
|
description: Successful response
|
|
|
|
default:
|
|
|
|
description: General Error
|
|
|
|
content:
|
|
|
|
application/json:
|
|
|
|
schema:
|
|
|
|
$ref: "#/components/schemas/Error"
|
2024-12-14 19:48:24 +00:00
|
|
|
/submissions/{SubmissionID}/status/validator-validated:
|
|
|
|
post:
|
|
|
|
summary: (Internal endpoint) Role Validator changes status from Validating -> Validated
|
|
|
|
operationId: actionSubmissionValidated
|
|
|
|
tags:
|
|
|
|
- Submissions
|
|
|
|
parameters:
|
|
|
|
- $ref: '#/components/parameters/SubmissionID'
|
|
|
|
responses:
|
|
|
|
"204":
|
|
|
|
description: Successful response
|
|
|
|
default:
|
|
|
|
description: General Error
|
|
|
|
content:
|
|
|
|
application/json:
|
|
|
|
schema:
|
|
|
|
$ref: "#/components/schemas/Error"
|
2024-12-18 02:10:53 +00:00
|
|
|
/submissions/{SubmissionID}/status/validator-failed:
|
|
|
|
post:
|
|
|
|
summary: (Internal endpoint) Role Validator changes status from Validating -> Accepted
|
|
|
|
operationId: actionSubmissionAccepted
|
|
|
|
tags:
|
|
|
|
- Submissions
|
|
|
|
parameters:
|
|
|
|
- $ref: '#/components/parameters/SubmissionID'
|
|
|
|
responses:
|
|
|
|
"204":
|
|
|
|
description: Successful response
|
|
|
|
default:
|
|
|
|
description: General Error
|
|
|
|
content:
|
|
|
|
application/json:
|
|
|
|
schema:
|
|
|
|
$ref: "#/components/schemas/Error"
|
2024-12-14 19:48:24 +00:00
|
|
|
/submissions/{SubmissionID}/status/validator-uploaded:
|
|
|
|
post:
|
|
|
|
summary: (Internal endpoint) Role Validator changes status from Uploading -> Uploaded
|
|
|
|
operationId: actionSubmissionUploaded
|
|
|
|
tags:
|
|
|
|
- Submissions
|
|
|
|
parameters:
|
|
|
|
- $ref: '#/components/parameters/SubmissionID'
|
2024-12-15 08:09:19 +00:00
|
|
|
- name: TargetAssetID
|
|
|
|
in: query
|
|
|
|
schema:
|
|
|
|
type: integer
|
|
|
|
format: int64
|
2024-12-14 19:48:24 +00:00
|
|
|
responses:
|
|
|
|
"204":
|
|
|
|
description: Successful response
|
|
|
|
default:
|
|
|
|
description: General Error
|
|
|
|
content:
|
|
|
|
application/json:
|
|
|
|
schema:
|
|
|
|
$ref: "#/components/schemas/Error"
|
|
|
|
/submissions/{SubmissionID}/status/releaser-released:
|
|
|
|
post:
|
|
|
|
summary: (Internal endpoint) Role Releaser changes status from releasing -> released
|
|
|
|
operationId: actionSubmissionReleased
|
|
|
|
tags:
|
|
|
|
- Submissions
|
|
|
|
parameters:
|
|
|
|
- $ref: '#/components/parameters/SubmissionID'
|
|
|
|
responses:
|
|
|
|
"204":
|
|
|
|
description: Successful response
|
|
|
|
default:
|
|
|
|
description: General Error
|
|
|
|
content:
|
|
|
|
application/json:
|
|
|
|
schema:
|
|
|
|
$ref: "#/components/schemas/Error"
|
2024-12-18 02:10:53 +00:00
|
|
|
/script-policy:
|
2024-12-18 23:04:45 +00:00
|
|
|
get:
|
|
|
|
summary: Get list of script policies
|
|
|
|
operationId: listScriptPolicy
|
|
|
|
tags:
|
|
|
|
- ScriptPolicy
|
|
|
|
parameters:
|
|
|
|
- $ref: "#/components/parameters/Page"
|
|
|
|
- $ref: "#/components/parameters/Limit"
|
|
|
|
- name: FromScriptHash
|
|
|
|
in: query
|
|
|
|
schema:
|
|
|
|
type: string
|
|
|
|
minLength: 16
|
|
|
|
maxLength: 16
|
|
|
|
- name: ToScriptID
|
|
|
|
in: query
|
|
|
|
schema:
|
|
|
|
type: integer
|
|
|
|
format: int64
|
|
|
|
- name: Policy
|
|
|
|
in: query
|
|
|
|
schema:
|
|
|
|
type: integer
|
|
|
|
format: int32
|
|
|
|
responses:
|
|
|
|
"200":
|
|
|
|
description: Successful response
|
|
|
|
content:
|
|
|
|
application/json:
|
|
|
|
schema:
|
|
|
|
type: array
|
|
|
|
items:
|
|
|
|
$ref: "#/components/schemas/ScriptPolicy"
|
|
|
|
default:
|
|
|
|
description: General Error
|
|
|
|
content:
|
|
|
|
application/json:
|
|
|
|
schema:
|
|
|
|
$ref: "#/components/schemas/Error"
|
2024-12-18 02:10:53 +00:00
|
|
|
post:
|
|
|
|
summary: Create a new script policy
|
|
|
|
operationId: createScriptPolicy
|
|
|
|
tags:
|
|
|
|
- ScriptPolicy
|
|
|
|
requestBody:
|
|
|
|
required: true
|
|
|
|
content:
|
|
|
|
application/json:
|
|
|
|
schema:
|
|
|
|
$ref: '#/components/schemas/ScriptPolicyCreate'
|
|
|
|
responses:
|
|
|
|
"201":
|
|
|
|
description: Successful response
|
|
|
|
content:
|
|
|
|
application/json:
|
|
|
|
schema:
|
|
|
|
$ref: "#/components/schemas/Id"
|
|
|
|
default:
|
|
|
|
description: General Error
|
|
|
|
content:
|
|
|
|
application/json:
|
|
|
|
schema:
|
|
|
|
$ref: "#/components/schemas/Error"
|
2024-12-18 23:04:45 +00:00
|
|
|
/scripts:
|
2024-12-18 02:10:53 +00:00
|
|
|
get:
|
2024-12-18 23:04:45 +00:00
|
|
|
summary: Get list of scripts
|
|
|
|
operationId: listScripts
|
2024-12-18 02:10:53 +00:00
|
|
|
tags:
|
2024-12-18 23:04:45 +00:00
|
|
|
- Script
|
2024-12-18 02:10:53 +00:00
|
|
|
parameters:
|
2024-12-18 23:04:45 +00:00
|
|
|
- $ref: "#/components/parameters/Page"
|
|
|
|
- $ref: "#/components/parameters/Limit"
|
|
|
|
- name: Hash
|
|
|
|
in: query
|
|
|
|
schema:
|
|
|
|
type: string
|
|
|
|
minLength: 16
|
|
|
|
maxLength: 16
|
|
|
|
- name: Name
|
|
|
|
in: query
|
|
|
|
schema:
|
|
|
|
type: string
|
|
|
|
maxLength: 128
|
|
|
|
- name: Source
|
|
|
|
in: query
|
|
|
|
schema:
|
|
|
|
type: string
|
|
|
|
maxLength: 1048576
|
|
|
|
- name: SubmissionID
|
|
|
|
in: query
|
|
|
|
schema:
|
|
|
|
type: integer
|
|
|
|
format: int64
|
2024-12-18 02:10:53 +00:00
|
|
|
responses:
|
|
|
|
"200":
|
|
|
|
description: Successful response
|
|
|
|
content:
|
|
|
|
application/json:
|
|
|
|
schema:
|
2024-12-18 23:04:45 +00:00
|
|
|
type: array
|
|
|
|
items:
|
|
|
|
$ref: "#/components/schemas/Script"
|
2024-12-18 02:10:53 +00:00
|
|
|
default:
|
|
|
|
description: General Error
|
|
|
|
content:
|
|
|
|
application/json:
|
|
|
|
schema:
|
|
|
|
$ref: "#/components/schemas/Error"
|
|
|
|
post:
|
|
|
|
summary: Create a new script
|
|
|
|
operationId: createScript
|
|
|
|
tags:
|
|
|
|
- Scripts
|
|
|
|
requestBody:
|
|
|
|
required: true
|
|
|
|
content:
|
|
|
|
application/json:
|
|
|
|
schema:
|
|
|
|
$ref: '#/components/schemas/ScriptCreate'
|
|
|
|
responses:
|
|
|
|
"201":
|
|
|
|
description: Successful response
|
|
|
|
content:
|
|
|
|
application/json:
|
|
|
|
schema:
|
|
|
|
$ref: "#/components/schemas/Id"
|
|
|
|
default:
|
|
|
|
description: General Error
|
|
|
|
content:
|
|
|
|
application/json:
|
|
|
|
schema:
|
|
|
|
$ref: "#/components/schemas/Error"
|
|
|
|
/scripts/{ScriptID}:
|
|
|
|
get:
|
|
|
|
summary: Get the specified script by ID
|
|
|
|
operationId: getScript
|
|
|
|
tags:
|
|
|
|
- Scripts
|
|
|
|
parameters:
|
|
|
|
- $ref: '#/components/parameters/ScriptID'
|
|
|
|
responses:
|
|
|
|
"200":
|
|
|
|
description: Successful response
|
|
|
|
content:
|
|
|
|
application/json:
|
|
|
|
schema:
|
|
|
|
$ref: "#/components/schemas/Script"
|
|
|
|
default:
|
|
|
|
description: General Error
|
|
|
|
content:
|
|
|
|
application/json:
|
|
|
|
schema:
|
|
|
|
$ref: "#/components/schemas/Error"
|
2024-12-14 19:48:24 +00:00
|
|
|
components:
|
|
|
|
parameters:
|
|
|
|
SubmissionID:
|
|
|
|
name: SubmissionID
|
|
|
|
in: path
|
|
|
|
required: true
|
|
|
|
description: The unique identifier for a submission.
|
|
|
|
schema:
|
|
|
|
type: integer
|
|
|
|
format: int64
|
2024-12-18 02:10:53 +00:00
|
|
|
ScriptID:
|
|
|
|
name: ScriptID
|
|
|
|
in: path
|
|
|
|
required: true
|
|
|
|
description: The unique identifier for a script.
|
|
|
|
schema:
|
|
|
|
type: integer
|
|
|
|
format: int64
|
2024-12-18 23:04:45 +00:00
|
|
|
Page:
|
|
|
|
name: Page
|
|
|
|
in: query
|
|
|
|
required: true
|
|
|
|
schema:
|
|
|
|
type: integer
|
|
|
|
format: int32
|
|
|
|
minimum: 1
|
|
|
|
Limit:
|
|
|
|
name: Limit
|
|
|
|
in: query
|
|
|
|
required: true
|
|
|
|
schema:
|
|
|
|
type: integer
|
|
|
|
format: int32
|
|
|
|
minimum: 1
|
|
|
|
maximum: 100
|
2024-12-14 19:48:24 +00:00
|
|
|
schemas:
|
2024-12-18 02:10:53 +00:00
|
|
|
Id:
|
|
|
|
required:
|
|
|
|
- ID
|
|
|
|
type: object
|
|
|
|
properties:
|
|
|
|
ID:
|
|
|
|
type: integer
|
|
|
|
format: int64
|
|
|
|
Script:
|
|
|
|
required:
|
|
|
|
- ID
|
|
|
|
- Name
|
|
|
|
- Hash
|
|
|
|
- Source
|
|
|
|
- SubmissionID
|
|
|
|
type: object
|
|
|
|
properties:
|
|
|
|
ID:
|
|
|
|
type: integer
|
|
|
|
format: int64
|
|
|
|
Name:
|
|
|
|
type: string
|
2024-12-18 03:21:11 +00:00
|
|
|
maxLength: 128
|
2024-12-18 02:10:53 +00:00
|
|
|
Hash:
|
|
|
|
type: string
|
|
|
|
minLength: 16
|
|
|
|
maxLength: 16
|
|
|
|
Source:
|
|
|
|
type: string
|
|
|
|
maxLength: 1048576
|
|
|
|
SubmissionID:
|
|
|
|
type: integer
|
|
|
|
format: int64
|
|
|
|
ScriptCreate:
|
|
|
|
required:
|
|
|
|
- Name
|
|
|
|
- Source
|
|
|
|
# - SubmissionID
|
|
|
|
type: object
|
|
|
|
properties:
|
|
|
|
Name:
|
|
|
|
type: string
|
2024-12-18 03:21:11 +00:00
|
|
|
maxLength: 128
|
2024-12-18 02:10:53 +00:00
|
|
|
Source:
|
|
|
|
type: string
|
|
|
|
maxLength: 1048576
|
|
|
|
SubmissionID:
|
|
|
|
type: integer
|
|
|
|
format: int64
|
|
|
|
ScriptPolicy:
|
|
|
|
required:
|
|
|
|
- ID
|
|
|
|
- FromScriptHash
|
|
|
|
- ToScriptID
|
|
|
|
- Policy
|
|
|
|
type: object
|
|
|
|
properties:
|
|
|
|
ID:
|
|
|
|
type: integer
|
|
|
|
format: int64
|
|
|
|
FromScriptHash:
|
|
|
|
type: string
|
|
|
|
minLength: 16
|
|
|
|
maxLength: 16
|
|
|
|
ToScriptID:
|
|
|
|
type: integer
|
|
|
|
format: int64
|
|
|
|
Policy:
|
|
|
|
type: integer
|
|
|
|
format: int32
|
|
|
|
ScriptPolicyCreate:
|
|
|
|
required:
|
|
|
|
- FromScriptID
|
|
|
|
- ToScriptID
|
|
|
|
- Policy
|
|
|
|
type: object
|
|
|
|
properties:
|
|
|
|
FromScriptID:
|
|
|
|
type: integer
|
|
|
|
format: int64
|
|
|
|
ToScriptID:
|
|
|
|
type: integer
|
|
|
|
format: int64
|
|
|
|
Policy:
|
|
|
|
type: integer
|
|
|
|
format: int32
|
2024-12-14 19:48:24 +00:00
|
|
|
Error:
|
|
|
|
description: Represents error object
|
|
|
|
type: object
|
|
|
|
properties:
|
|
|
|
code:
|
|
|
|
type: integer
|
|
|
|
format: int64
|
|
|
|
message:
|
|
|
|
type: string
|
|
|
|
required:
|
|
|
|
- code
|
|
|
|
- message
|