Mining/docs/swagger.yaml

427 lines
9.9 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
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
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}/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"