Module custom-role | Tarantool

Module custom-role

User-defined role API.

If you want to implement your own role it must conform this API.

Role initialization callback. Called when role is enabled on an instance. Caused either by editing topology or instance restart.

Parameters:

  • opts:
    • is_master: (boolean)

Role shutdown callback. Called when role is disabled on an instance.

Parameters:

  • opts:
    • is_master: (boolean)

Validate clusterwide configuration callback. Called when role is enabled on an instance.

Parameters:

Apply clusterwide configuration callback.

Parameters:

  • conf: (table) Clusterwide configuration
  • opts:
    • is_master: (boolean)

Announce issues to be shown in the Cartridge WebUI.

The callback should return an array of issues, where every issue is a table with fields level , topic , and message . Like the following:

-- myrole.lua

local function get_issues()
    return {{
        level = 'warning',
        topic = 'myrole',
        message = 'custom issue description',
    }}
end

All fields are optional. Extra fields are ignored.

Displayed role name. When absent, module name is used instead.

Hidden role flag. Aren’t listed in cartridge.admin_get_replicasets().roles and therefore in WebUI. Hidden roled are supposed to be a dependency for another role.

  • hidden: (boolean)

Permanent role flag. Permanent roles will be enabled on every instance in cluster. Implies hidden = true .

  • permanent: (boolean)
Found what you were looking for?
Feedback