Перейти к содержанию

JSON-RPC API sdc-plgn-checker

Module description

Plugin for defining and running custom procedures

Operations

Define a new procedure for use in the cluster.

Request data

{
    "context": {
        "op": "procedure_add"
    },
    "data": {
        "name": "<name>",
        "definition": "<definition>",
        "json": "<json>",
        "validate": "<validate>"
    }
}

Description

name [ str required ] - Name of the procedure. Must be unique within the cluster.

definition [ str required ] - Yaml definition of the procedure.

json [ str ] - Should the output of this command be returned as json? ['yes', 'no']

validate [ str ] - Should this command just validate the passed definition instead of adding it? ['yes', 'no']

Update definition of an existing procedure.

Request data

{
    "context": {
        "op": "procedure_update"
    },
    "data": {
        "name": "<name>",
        "definition": "<definition>",
        "json": "<json>",
        "validate": "<validate>"
    }
}

Description

name [ str required ] - Name of the procedure. Must be unique within the cluster.

definition [ str required ] - Yaml definition of the procedure.

json [ str ] - Should the output of this command be returned as json? ['yes', 'no']

validate [ str ] - Should this command just validate the passed definition instead of adding it? ['yes', 'no']

Remove a procedure from cluster. Also undelegates and unschedules it from all namespaces.

Request data

{
    "context": {
        "op": "procedure_del"
    },
    "data": {
        "name": "<name>"
    }
}

Description

name [ str required ] - Name of the procedure to be undefined.

List all registered procedures.

Request data

{
    "context": {
        "op": "procedure_list_all"
    },
    "data": {
        "ns": "<ns>"
    }
}

Description

ns [ str * ] - Filter namespaces to show

List procedures delegated to this namespace.

Request data

{
    "context": {
        "op": "procedure_list_ns"
    }
}

Show detailed description of the procedure.

Request data

{
    "context": {
        "op": "procedure_show"
    },
    "data": {
        "name": "<name>",
        "json": "<json>"
    }
}

Description

name [ str required ] - Name of the procedure to show.

json [ str ] - Should the output of this command be returned as json? ['yes', 'no']

Delegate a procedure to namespaces, making it possible to schedule it.

Request data

{
    "context": {
        "op": "procedure_delegate"
    },
    "data": {
        "name": "<name>",
        "ns": "<ns>"
    }
}

Description

name [ str required ] - Name of the procedure to be (un)delegated.

ns [ str * required ] - Namespace(s) this procedure should be (un)delegated to(from).

Undelegate a procedure from namespaces, making it inaccessible to schedule.

Request data

{
    "context": {
        "op": "procedure_undelegate"
    },
    "data": {
        "name": "<name>",
        "ns": "<ns>"
    }
}

Description

name [ str required ] - Name of the procedure to be (un)delegated.

ns [ str * required ] - Namespace(s) this procedure should be (un)delegated to(from).

Schedule a procedure to run within this namespace.

Request data

{
    "context": {
        "op": "procedure_schedule_add"
    },
    "data": {
        "name": "<name>",
        "vars": "<vars>",
        "cron": "<cron>"
    }
}

Description

name [ str required ] - Name of the procedure to be scheduled.

vars [ jsonstr ] - Default variables to be set.

cron [ str required ] - Cron schedule to run at.

Unschedule a procedure.

Request data

{
    "context": {
        "op": "procedure_schedule_del"
    },
    "data": {
        "uuid": "<uuid>"
    }
}

Description

uuid [ str required ] - UUID of a scheduled procedure to remove

Show all procedures scheduled to run in this namespace.

Request data

{
    "context": {
        "op": "procedure_schedule_list"
    }
}

Show all procedures scheduled to run in this namespace.

Request data

{
    "context": {
        "op": "procedure_schedule_update"
    },
    "data": {
        "uuid": "<uuid>",
        "vars": "<vars>",
        "cron": "<cron>"
    }
}

Description

uuid [ str required ] - UUID of a scheduled procedure to remove

vars [ jsonstr ] - Default variables to be set.

cron [ str required ] - Cron schedule to run at.

Manually execute a procedure.

Request data

{
    "context": {
        "op": "procedure_execute"
    },
    "data": {
        "name": "<name>",
        "vars": "<vars>",
        "json": "<json>"
    }
}

Description

name [ str required ] - Name of the procedure to be executed.

vars [ jsonstr ] - Default variables to be set.

json [ str ] - Should the output of this command be returned as json? ['yes', 'no']

Stop a procedure from execution

Request data

{
    "context": {
        "op": "procedure_interrupt"
    },
    "data": {
        "uuid": "<uuid>"
    }
}

Description

uuid [ str required ] - UUID of running procedure to interrupt

Show status of a completed or in-progress procedure.

Request data

{
    "context": {
        "op": "procedure_status_show"
    },
    "data": {
        "uuid": "<uuid>",
        "json": "<json>"
    }
}

Description

uuid [ str required ] - Task UUID of a procedure.

json [ str ] - Should the output of this command be returned as json? ['yes', 'no']

List statuses of all executed procedures

Request data

{
    "context": {
        "op": "procedure_status_list"
    }
}

Delete status of a procedure from a list. This is only possible for completed procedures.

Request data

{
    "context": {
        "op": "procedure_status_del"
    },
    "data": {
        "uuid": "<uuid>",
        "json": "<json>"
    }
}

Description

uuid [ str required ] - Task UUID of a procedure.

json [ str ] - Should the output of this command be returned as json? ['yes', 'no']

Clears the status log by deleting all statuses of already completed procedures.

Request data

{
    "context": {
        "op": "procedure_status_clear"
    }
}