github.com/choria-io/go-choria@v0.28.1-0.20240416190746-b3bf9c7d5a45/internal/fs/ddl/cache/agent/rpcutil.ddl (about)

     1  --  Copyright (c) 2024, R.I. Pienaar and the Choria Project contributors
     2  --
     3  --  SPDX-License-Identifier: Apache-2.0
     4  
     5  metadata :name        => "rpcutil",
     6           :description => "Utility actions that expose information about the state of the running Server",
     7           :author      => "R.I.Pienaar <rip@devco.net>",
     8           :license     => "Apache-2.0",
     9           :version     => "0.28.0",
    10           :url         => "https://choria.io/",
    11           :timeout     => 2
    12  
    13  
    14  action "agent_inventory", :description => "Inventory of all agents on the server including versions, licenses and more" do
    15    display :always
    16  
    17  
    18  
    19    output :agents,
    20           :description => "List of agents on the server",
    21           :type        => "array",
    22           :display_as  => "Agents"
    23  
    24  end
    25  
    26  action "collective_info", :description => "Info about the main and sub collectives that the server belongs to" do
    27    display :always
    28  
    29  
    30  
    31    output :collectives,
    32           :description => "All Collectives",
    33           :type        => "array",
    34           :display_as  => "All Collectives"
    35  
    36    output :main_collective,
    37           :description => "The main Collective",
    38           :type        => "string",
    39           :display_as  => "Main Collective"
    40  
    41    summarize do
    42      aggregate summary(:collectives)
    43    end
    44  end
    45  
    46  action "daemon_stats", :description => "Get statistics from the running daemon" do
    47    display :always
    48  
    49  
    50  
    51    output :agents,
    52           :description => "List of agents loaded",
    53           :type        => "array",
    54           :display_as  => "Agents"
    55  
    56    output :configfile,
    57           :description => "Config file used to start the daemon",
    58           :type        => "string",
    59           :display_as  => "Config File"
    60  
    61    output :events,
    62           :description => "The number of lifecycle events that was published",
    63           :type        => "integer",
    64           :display_as  => "Events"
    65  
    66    output :filtered,
    67           :description => "Count of message that didn't pass filter checks",
    68           :type        => "integer",
    69           :display_as  => "Failed Filter"
    70  
    71    output :passed,
    72           :description => "Count of messages that passed filter checks",
    73           :type        => "integer",
    74           :display_as  => "Passed Filter"
    75  
    76    output :pid,
    77           :description => "Process ID of the Choria Server",
    78           :type        => "integer",
    79           :display_as  => "PID"
    80  
    81    output :replies,
    82           :description => "Count of replies sent back to clients",
    83           :type        => "integer",
    84           :display_as  => "Replies"
    85  
    86    output :starttime,
    87           :description => "Time the Choria Server started in unix seconds",
    88           :type        => "integer",
    89           :display_as  => "Start Time"
    90  
    91    output :threads,
    92           :description => "List of threads active in the Choria Server",
    93           :type        => "array",
    94           :display_as  => "Threads"
    95  
    96    output :times,
    97           :description => "Processor time consumed by the Choria Server",
    98           :type        => "hash",
    99           :display_as  => "Times"
   100  
   101    output :total,
   102           :description => "Count of messages received by the Choria Server",
   103           :type        => "integer",
   104           :display_as  => "Total Messages"
   105  
   106    output :ttlexpired,
   107           :description => "Count of messages that did pass TTL checks",
   108           :type        => "integer",
   109           :display_as  => "TTL Expired"
   110  
   111    output :unvalidated,
   112           :description => "Count of messages that failed security validation",
   113           :type        => "integer",
   114           :display_as  => "Failed Security"
   115  
   116    output :validated,
   117           :description => "Count of messages that passed security validation",
   118           :type        => "integer",
   119           :display_as  => "Security Validated"
   120  
   121    output :version,
   122           :description => "Choria Server Version",
   123           :type        => "string",
   124           :display_as  => "Version"
   125  
   126    summarize do
   127      aggregate summary(:version)
   128      aggregate summary(:agents)
   129    end
   130  end
   131  
   132  action "get_config_item", :description => "Get the active value of a specific config property" do
   133    display :always
   134  
   135    input :item,
   136          :prompt      => "Configuration Item",
   137          :description => "The item to retrieve from the server",
   138          :type        => :string,
   139          :validation  => '^.+$',
   140          :maxlength   => 120,
   141          :optional    => false
   142  
   143  
   144  
   145  
   146    output :item,
   147           :description => "The config property being retrieved",
   148           :type        => "string",
   149           :display_as  => "Property"
   150  
   151    output :value,
   152           :description => "The value that is in use",
   153           :display_as  => "Value"
   154  
   155    summarize do
   156      aggregate summary(:value)
   157    end
   158  end
   159  
   160  action "get_data", :description => "Get data from a data plugin" do
   161    display :always
   162  
   163    input :query,
   164          :prompt      => "Query",
   165          :description => "The query argument to supply to the data plugin",
   166          :type        => :string,
   167          :validation  => '^.+$',
   168          :maxlength   => 200,
   169          :optional    => true
   170  
   171  
   172    input :source,
   173          :prompt      => "Data Source",
   174          :description => "The data plugin to retrieve information from",
   175          :type        => :string,
   176          :validation  => '^\w+$',
   177          :maxlength   => 50,
   178          :optional    => false
   179  
   180  
   181  
   182  
   183  end
   184  
   185  action "get_fact", :description => "Retrieve a single fact from the fact store" do
   186    display :always
   187  
   188    input :fact,
   189          :prompt      => "The name of the fact",
   190          :description => "The fact to retrieve",
   191          :type        => :string,
   192          :validation  => '.+',
   193          :maxlength   => 512,
   194          :optional    => false
   195  
   196  
   197  
   198  
   199    output :fact,
   200           :description => "The name of the fact being returned",
   201           :type        => "string",
   202           :display_as  => "Fact"
   203  
   204    output :value,
   205           :description => "The value of the fact",
   206           :display_as  => "Value"
   207  
   208    summarize do
   209      aggregate summary(:value)
   210    end
   211  end
   212  
   213  action "get_facts", :description => "Retrieve multiple facts from the fact store" do
   214    display :always
   215  
   216    input :facts,
   217          :prompt      => "Comma-separated list of facts to retrieve",
   218          :description => "Facts to retrieve",
   219          :type        => :string,
   220          :validation  => '^\s*[\w\.\-]+(\s*,\s*[\w\.\-]+)*$',
   221          :maxlength   => 200,
   222          :optional    => false
   223  
   224  
   225  
   226  
   227    output :values,
   228           :description => "List of values of the facts",
   229           :type        => "hash",
   230           :display_as  => "Values"
   231  
   232  end
   233  
   234  action "inventory", :description => "System Inventory" do
   235    display :always
   236  
   237  
   238  
   239    output :agents,
   240           :description => "List of agent names",
   241           :type        => "array",
   242           :display_as  => "Agents"
   243  
   244    output :classes,
   245           :description => "List of classes on the system",
   246           :type        => "array",
   247           :display_as  => "Classes"
   248  
   249    output :collectives,
   250           :description => "All Collectives",
   251           :type        => "array",
   252           :display_as  => "All Collectives"
   253  
   254    output :data_plugins,
   255           :description => "List of data plugin names",
   256           :type        => "array",
   257           :display_as  => "Data Plugins"
   258  
   259    output :facts,
   260           :description => "List of facts and values",
   261           :type        => "hash",
   262           :display_as  => "Facts"
   263  
   264    output :machines,
   265           :description => "Autonomous Agents",
   266           :type        => "hash",
   267           :display_as  => "Machines"
   268  
   269    output :main_collective,
   270           :description => "The main Collective",
   271           :type        => "string",
   272           :display_as  => "Main Collective"
   273  
   274    output :upgradable,
   275           :description => "Indicates if the server supports upgrades",
   276           :type        => "boolean",
   277           :display_as  => "Upgradable"
   278  
   279    output :version,
   280           :description => "Choria Server Version",
   281           :type        => "string",
   282           :display_as  => "Version"
   283  
   284  end
   285  
   286  action "ping", :description => "Responds to requests for PING with PONG" do
   287    display :always
   288  
   289  
   290  
   291    output :pong,
   292           :description => "The local Unix timestamp",
   293           :type        => "number",
   294           :display_as  => "Timestamp"
   295  
   296  end
   297