Mining/docs/swagger.yaml

609 lines
14 KiB
YAML

basePath: /api/v1/mining
definitions:
mining.API:
properties:
enabled:
type: boolean
listenHost:
type: string
listenPort:
type: integer
type: object
mining.AvailableMiner:
properties:
description:
type: string
name:
type: string
type: object
mining.HashratePoint:
properties:
hashrate:
type: integer
timestamp:
type: string
type: object
mining.InstallationDetails:
properties:
config_path:
description: Add path to the miner-specific config
type: string
is_installed:
type: boolean
miner_binary:
type: string
path:
type: string
version:
type: string
type: object
mining.MiningProfile:
properties:
config:
description: The raw JSON config for the specific miner
type: object
id:
type: string
minerType:
description: e.g., "xmrig", "ttminer"
type: string
name:
type: string
type: object
mining.PerformanceMetrics:
properties:
algorithm:
type: string
extraData:
additionalProperties: true
type: object
hashrate:
type: integer
lastShare:
type: integer
rejected:
type: integer
shares:
type: integer
uptime:
type: integer
type: object
mining.SystemInfo:
properties:
architecture:
type: string
available_cpu_cores:
type: integer
go_version:
type: string
installed_miners_info:
items:
$ref: '#/definitions/mining.InstallationDetails'
type: array
os:
type: string
timestamp:
type: string
total_system_ram_gb:
type: number
type: object
mining.XMRigMiner:
properties:
api:
$ref: '#/definitions/mining.API'
configPath:
type: string
full_stats:
$ref: '#/definitions/mining.XMRigSummary'
hashrateHistory:
items:
$ref: '#/definitions/mining.HashratePoint'
type: array
lowResHashrateHistory:
items:
$ref: '#/definitions/mining.HashratePoint'
type: array
miner_binary:
type: string
name:
type: string
path:
type: string
running:
type: boolean
url:
type: string
version:
type: string
type: object
mining.XMRigSummary:
properties:
algo:
type: string
algorithms:
items:
type: string
type: array
connection:
properties:
accepted:
type: integer
algo:
type: string
avg_time:
type: integer
avg_time_ms:
type: integer
diff:
type: integer
failures:
type: integer
hashes_total:
type: integer
ip:
type: string
ping:
type: integer
pool:
type: string
rejected:
type: integer
tls:
type: string
tls-fingerprint:
type: string
uptime:
type: integer
uptime_ms:
type: integer
type: object
cpu:
properties:
64_bit:
type: boolean
aes:
type: boolean
arch:
type: string
assembly:
type: string
avx2:
type: boolean
backend:
type: string
brand:
type: string
cores:
type: integer
family:
type: integer
flags:
items:
type: string
type: array
l2:
type: integer
l3:
type: integer
model:
type: integer
msr:
type: string
nodes:
type: integer
packages:
type: integer
proc_info:
type: integer
stepping:
type: integer
threads:
type: integer
x64:
type: boolean
type: object
donate_level:
type: integer
features:
items:
type: string
type: array
hashrate:
properties:
highest:
type: number
total:
items:
type: number
type: array
type: object
hugepages:
items:
type: integer
type: array
id:
type: string
kind:
type: string
paused:
type: boolean
resources:
properties:
hardware_concurrency:
type: integer
load_average:
items:
type: number
type: array
memory:
properties:
free:
type: integer
resident_set_memory:
type: integer
total:
type: integer
type: object
type: object
restricted:
type: boolean
results:
properties:
avg_time:
type: integer
avg_time_ms:
type: integer
best:
items:
type: integer
type: array
diff_current:
type: integer
hashes_total:
type: integer
shares_good:
type: integer
shares_total:
type: integer
type: object
ua:
type: string
uptime:
type: integer
version:
type: string
worker_id:
type: string
type: object
host: localhost:8080
info:
contact: {}
description: This is a sample server for a mining application.
title: Mining API
version: "1.0"
paths:
/doctor:
post:
description: Performs a live check on all available miners to verify their installation
status, version, and path.
produces:
- application/json
responses:
"200":
description: OK
schema:
$ref: '#/definitions/mining.SystemInfo'
summary: Check miner installations
tags:
- system
/info:
get:
description: Retrieves live installation details for all miners, along with
system information.
produces:
- application/json
responses:
"200":
description: OK
schema:
$ref: '#/definitions/mining.SystemInfo'
"500":
description: Internal server error
schema:
additionalProperties:
type: string
type: object
summary: Get live miner installation information
tags:
- system
/miners:
get:
description: Get a list of all running miners
produces:
- application/json
responses:
"200":
description: OK
schema:
items:
$ref: '#/definitions/mining.XMRigMiner'
type: array
summary: List all running miners
tags:
- miners
/miners/{miner_name}:
delete:
description: Stop a running miner by its name
parameters:
- description: Miner Name
in: path
name: miner_name
required: true
type: string
produces:
- application/json
responses:
"200":
description: OK
schema:
additionalProperties:
type: string
type: object
summary: Stop a running miner
tags:
- miners
/miners/{miner_name}/hashrate-history:
get:
description: Get historical hashrate data for a running miner
parameters:
- description: Miner Name
in: path
name: miner_name
required: true
type: string
produces:
- application/json
responses:
"200":
description: OK
schema:
items:
$ref: '#/definitions/mining.HashratePoint'
type: array
summary: Get miner hashrate history
tags:
- miners
/miners/{miner_name}/logs:
get:
description: Get the captured stdout/stderr output from a running miner
parameters:
- description: Miner Name
in: path
name: miner_name
required: true
type: string
produces:
- application/json
responses:
"200":
description: OK
schema:
items:
type: string
type: array
summary: Get miner log output
tags:
- miners
/miners/{miner_name}/stats:
get:
description: Get statistics for a running miner
parameters:
- description: Miner Name
in: path
name: miner_name
required: true
type: string
produces:
- application/json
responses:
"200":
description: OK
schema:
$ref: '#/definitions/mining.PerformanceMetrics'
summary: Get miner stats
tags:
- miners
/miners/{miner_type}/install:
post:
description: Install a new miner or update an existing one.
parameters:
- description: Miner Type to install/update
in: path
name: miner_type
required: true
type: string
produces:
- application/json
responses:
"200":
description: OK
schema:
additionalProperties:
type: string
type: object
summary: Install or update a miner
tags:
- miners
/miners/{miner_type}/uninstall:
delete:
description: Removes all files for a specific miner.
parameters:
- description: Miner Type to uninstall
in: path
name: miner_type
required: true
type: string
produces:
- application/json
responses:
"200":
description: OK
schema:
additionalProperties:
type: string
type: object
summary: Uninstall a miner
tags:
- miners
/miners/available:
get:
description: Get a list of all available miners
produces:
- application/json
responses:
"200":
description: OK
schema:
items:
$ref: '#/definitions/mining.AvailableMiner'
type: array
summary: List all available miners
tags:
- miners
/profiles:
get:
description: Get a list of all saved mining profiles
produces:
- application/json
responses:
"200":
description: OK
schema:
items:
$ref: '#/definitions/mining.MiningProfile'
type: array
summary: List all mining profiles
tags:
- profiles
post:
consumes:
- application/json
description: Create and save a new mining profile
parameters:
- description: Mining Profile
in: body
name: profile
required: true
schema:
$ref: '#/definitions/mining.MiningProfile'
produces:
- application/json
responses:
"201":
description: Created
schema:
$ref: '#/definitions/mining.MiningProfile'
summary: Create a new mining profile
tags:
- profiles
/profiles/{id}:
delete:
description: Delete a mining profile by its ID
parameters:
- description: Profile ID
in: path
name: id
required: true
type: string
produces:
- application/json
responses:
"200":
description: OK
schema:
additionalProperties:
type: string
type: object
summary: Delete a mining profile
tags:
- profiles
get:
description: Get a mining profile by its ID
parameters:
- description: Profile ID
in: path
name: id
required: true
type: string
produces:
- application/json
responses:
"200":
description: OK
schema:
$ref: '#/definitions/mining.MiningProfile'
summary: Get a specific mining profile
tags:
- profiles
put:
consumes:
- application/json
description: Update an existing mining profile
parameters:
- description: Profile ID
in: path
name: id
required: true
type: string
- description: Updated Mining Profile
in: body
name: profile
required: true
schema:
$ref: '#/definitions/mining.MiningProfile'
produces:
- application/json
responses:
"200":
description: OK
schema:
$ref: '#/definitions/mining.MiningProfile'
summary: Update a mining profile
tags:
- profiles
/profiles/{id}/start:
post:
description: Start a new miner with the configuration from a saved profile
parameters:
- description: Profile ID
in: path
name: id
required: true
type: string
produces:
- application/json
responses:
"200":
description: OK
schema:
$ref: '#/definitions/mining.XMRigMiner'
summary: Start a new miner using a profile
tags:
- profiles
/update:
post:
description: Checks if any installed miners have a new version available for
download.
produces:
- application/json
responses:
"200":
description: OK
schema:
additionalProperties:
type: string
type: object
summary: Check for miner updates
tags:
- system
swagger: "2.0"