lotus/documentation/en/api-methods-worker.md
Łukasz Magiera c41777dcd2
API proxy struct codegen (#5854)
* mostly working api proxy gen

* api: Consistent api names

* fix docsgen

* regenerate api struct

* api: expand external interfaces

* Add missing gen files

* apigen: fix perm detection

* api: Move perm tags to the interface

* gofmt

* worker perms

* docsgen

* docsgen: ignore tag comments

* apigen: add codegen warning

* gofmt

* missing actor type

* docsgen

* make linter happy

* fix lint

* apigen: use directives for tags

* docsgen

* regen openrpc docs
2021-03-23 13:42:56 +01:00

6.0 KiB

Groups

Enabled

Perms: admin

Inputs: null

Response: true

Fetch

Perms: admin

Inputs:

[
  {
    "ID": {
      "Miner": 1000,
      "Number": 9
    },
    "ProofType": 8
  },
  1,
  "sealing",
  "move"
]

Response:

{
  "Sector": {
    "Miner": 1000,
    "Number": 9
  },
  "ID": "07070707-0707-0707-0707-070707070707"
}

Info

Perms: admin

Inputs: null

Response:

{
  "Hostname": "string value",
  "Resources": {
    "MemPhysical": 42,
    "MemSwap": 42,
    "MemReserved": 42,
    "CPUs": 42,
    "GPUs": null
  }
}

Paths

Perms: admin

Inputs: null

Response: null

Remove

Storage / Other

Perms: admin

Inputs:

[
  {
    "Miner": 1000,
    "Number": 9
  }
]

Response: {}

Session

Like ProcessSession, but returns an error when worker is disabled

Perms: admin

Inputs: null

Response: "07070707-0707-0707-0707-070707070707"

Version

Perms: admin

Inputs: null

Response: 65792

Add

AddPiece

storiface.WorkerCalls

Perms: admin

Inputs:

[
  {
    "ID": {
      "Miner": 1000,
      "Number": 9
    },
    "ProofType": 8
  },
  null,
  1024,
  {}
]

Response:

{
  "Sector": {
    "Miner": 1000,
    "Number": 9
  },
  "ID": "07070707-0707-0707-0707-070707070707"
}

Finalize

FinalizeSector

Perms: admin

Inputs:

[
  {
    "ID": {
      "Miner": 1000,
      "Number": 9
    },
    "ProofType": 8
  },
  null
]

Response:

{
  "Sector": {
    "Miner": 1000,
    "Number": 9
  },
  "ID": "07070707-0707-0707-0707-070707070707"
}

Move

MoveStorage

Perms: admin

Inputs:

[
  {
    "ID": {
      "Miner": 1000,
      "Number": 9
    },
    "ProofType": 8
  },
  1
]

Response:

{
  "Sector": {
    "Miner": 1000,
    "Number": 9
  },
  "ID": "07070707-0707-0707-0707-070707070707"
}

Process

ProcessSession

returns a random UUID of worker session, generated randomly when worker process starts

Perms: admin

Inputs: null

Response: "07070707-0707-0707-0707-070707070707"

Read

ReadPiece

Perms: admin

Inputs:

[
  {},
  {
    "ID": {
      "Miner": 1000,
      "Number": 9
    },
    "ProofType": 8
  },
  1040384,
  1024
]

Response:

{
  "Sector": {
    "Miner": 1000,
    "Number": 9
  },
  "ID": "07070707-0707-0707-0707-070707070707"
}

Release

ReleaseUnsealed

Perms: admin

Inputs:

[
  {
    "ID": {
      "Miner": 1000,
      "Number": 9
    },
    "ProofType": 8
  },
  null
]

Response:

{
  "Sector": {
    "Miner": 1000,
    "Number": 9
  },
  "ID": "07070707-0707-0707-0707-070707070707"
}

Seal

SealCommit1

Perms: admin

Inputs:

[
  {
    "ID": {
      "Miner": 1000,
      "Number": 9
    },
    "ProofType": 8
  },
  null,
  null,
  null,
  {
    "Unsealed": {
      "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4"
    },
    "Sealed": {
      "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4"
    }
  }
]

Response:

{
  "Sector": {
    "Miner": 1000,
    "Number": 9
  },
  "ID": "07070707-0707-0707-0707-070707070707"
}

SealCommit2

Perms: admin

Inputs:

[
  {
    "ID": {
      "Miner": 1000,
      "Number": 9
    },
    "ProofType": 8
  },
  null
]

Response:

{
  "Sector": {
    "Miner": 1000,
    "Number": 9
  },
  "ID": "07070707-0707-0707-0707-070707070707"
}

SealPreCommit1

Perms: admin

Inputs:

[
  {
    "ID": {
      "Miner": 1000,
      "Number": 9
    },
    "ProofType": 8
  },
  null,
  null
]

Response:

{
  "Sector": {
    "Miner": 1000,
    "Number": 9
  },
  "ID": "07070707-0707-0707-0707-070707070707"
}

SealPreCommit2

Perms: admin

Inputs:

[
  {
    "ID": {
      "Miner": 1000,
      "Number": 9
    },
    "ProofType": 8
  },
  null
]

Response:

{
  "Sector": {
    "Miner": 1000,
    "Number": 9
  },
  "ID": "07070707-0707-0707-0707-070707070707"
}

Set

SetEnabled

SetEnabled marks the worker as enabled/disabled. Not that this setting may take a few seconds to propagate to task scheduler

Perms: admin

Inputs:

[
  true
]

Response: {}

Storage

StorageAddLocal

Perms: admin

Inputs:

[
  "string value"
]

Response: {}

Task

TaskDisable

Perms: admin

Inputs:

[
  "seal/v0/commit/2"
]

Response: {}

TaskEnable

Perms: admin

Inputs:

[
  "seal/v0/commit/2"
]

Response: {}

TaskTypes

TaskType -> Weight

Perms: admin

Inputs: null

Response:

{
  "seal/v0/precommit/2": {}
}

Unseal

UnsealPiece

Perms: admin

Inputs:

[
  {
    "ID": {
      "Miner": 1000,
      "Number": 9
    },
    "ProofType": 8
  },
  1040384,
  1024,
  null,
  {
    "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4"
  }
]

Response:

{
  "Sector": {
    "Miner": 1000,
    "Number": 9
  },
  "ID": "07070707-0707-0707-0707-070707070707"
}

Wait

WaitQuiet

WaitQuiet blocks until there are no tasks running

Perms: admin

Inputs: null

Response: {}