Version: 17
restore

Contents

Entity - Instructions (Questions and Actions) - Interrogates the Instruction table

Please note you cannot get all instructions

VerbURLNotesPermissions Required
GET - single

http://<myserver>/Consumer/Instructions /{instructionId}

or

http://<myserver>/Consumer/Instructions /?id={instructionId}

 

 

Gets an individual question or action by an Id.

Example successful JSON

Instructions Get
{
   "Id": 54,
   "Name": "AgentDiagnostics",
   "Description": "Get live diagnostic information from Tachyon Agents",
   "ProductPackId": 7,
   "InstructionType":0,
   "Payload": "Agent.GetDiagnostics();",
   "ReadablePayload": "Tachyon agent diagnostic information.",
   "Parameters":null,
   "Schema":
   [
      {
         "Name": "CrashDumpsCollected",
         "Type": "int32",
         "Length": 0
      },
      {
         "Name": "BytesReceived",
         "Type": "int64",
         "Length": 0
      },
      {
         "Name": "BytesSent",
         "Type": "int64",
         "Length": 0
      },
      {
         "Name": "ConnectionsSuccessful",
         "Type": "int32",
         "Length": 0
      },
      {
         "Name": "ConnectionsFailed",
         "Type": "int32",
         "Length": 0
      },
      {
         "Name": "ExecutionsSuccessful",
         "Type": "int32",
         "Length": 0
      },
      {

         "Name": "ExecutionsErrored",
         "Type": "int32",
         "Length": 0
      },
      {
         "Name": "ExecutionsNotImplemented",
         "Type": "int32",
         "Length": 0
      },
      {
         "Name": "ExecutionsPayloadTooLarge",
         "Type": "int32",
         "Length": 0
      },
      {
         "Name": "StartupTimeUtc",
         "Type": "datetime",
         "Length": 0
      }
   ],
   "Aggregation":null,
   "Category": "Agent",
   "InstructionTtlMinutes": 60,
   "ResponseTtlMinutes": 120,
   "MinimumInstructionTtlMinutes": 10,
   "MaximumInstructionTtlMinutes": 1440,
   "MinimumResponseTtlMinutes": 10,
   "MaximumResponseTtlMinutes": 10080,
   "PreviousResultsFilter": null,
   "ResultsFilter": {
      "Attribute": "CrashDumpsCollected",
      "Operator": ">",
      "Value": "0"
   }
}

response:

 

  • Viewer
  • Questioner
  • Actioner
  • Approver

Returns Unauthorized (401) if user does not have the required permissions at global level or on the parent InstructionDefinition's product pack.

POSThttp://<myserver>/Consumer/Instructions /search

To search instructions based on criteria along with sorting and pagination. The payload should be like the following.

Request Payload
{  
   "filter":{  
      "Operator":"AND",
      "Operands":[  
        {  
            "Attribute":"Status",
            "Operator":"==",
            "Value":"5"
        },
        {  
            "Attribute":"CreatedTime",
            "Operator":">=",
            "Value":"2016-04-21T06:30:00Z"
        },
        {  
            "Attribute":"CreatedTime",
            "Operator":"<=",
            "Value":"2016-04-30T19:55:00"
        }
    ]
   },
   "start":1,
   "pageSize":10,
   "sort":[
       {
           "Column":"payload",
            "Direction":"ASC"
       },
       {
            "Column":"CreatedTime",
            "Direction":"DESC"
       }
   ]
}
  • filter - filter expression.To learn about how to define filter check Using scope and filter expressions page.
  • sort - sort expression. To learn about how to define sort criteria check Sort Defintion page.
  • start - starting index to support pagination. Begins from 1.
  • pagesize - number of results to fetch

Allowed filter columns:

  • Payload
  • Description
  • CreatedTime
  • Status

Allowed sortable columns

  • Payload
  • Description
  • CreatedTime
  • Status
  • Viewer
  • Questioner
  • Actioner
  • Approver

It does not return Unauthorized (401) rather filters out instructions based on permissions.

POST

http://<myserver>/Consumer/Instructions

 

 

Creates a question, action or event 

Instruction post
{
	"DefinitionId": 9,
    "DefinitionName": null,
    "Scope": {
		"Attribute": "OsType",
		"Operator" : "=",
		"Value": "Windows"
	},
    "Parameters": null,
	"InstructionTtlMinutes": 60,
	"ResponseTtlMinutes": 120,
    "ParentInstructionId": null,
    "KeepRaw": false,
    "Export": false,
    "ExportLocation": null,
    "ResultsFilter": {
		"Attribute": "NumberOfCores",
		"Operator": ">",
		"Value": "2"
	},
	"PreviousResultsFilter": null
}

will return:

Response
{
	"Id": 199,
	"Name": "System Processor Details",
	"Description": "Represents a device capable of interpreting a 
sequence of machine instructions on a computer system running Windows",
	"InstructionType": 0,
	"Payload": "NativeServices.RunWmiQuery(Namespace:"root\\cimv2", 
Query:"SELECT Caption, Description, Manufacturer, NumberOfCores 
FROM Win32_Processor");",
	"ReadablePayload": "Get Processor Details",
	"Cmd": "SendAll",
	"Schema": [{
		"Name": "Caption",
		"Type": "string",
		"Length": 256
	},
	{
		"Name": "Description",
		"Type": "string",
		"Length": 256
	},
	{
		"Name": "Manufacturer",
		"Type": "string",
		"Length": 256
	},
	{
		"Name": "NumberOfCores",
		"Type": "int32",
		"Length": 0
	}],
	"Aggregation": null,
	"KeepRaw": false,
	"Scope": null,
	"QuestionTtlMinutes": 60,
	"AnswerTtlMinutes": 120,
	"CreatedTimestampUtc": "2015-10-01T08:36:38.663",
	"Status": 0,
	"AnswerCount": 0,
	"SentCount": 0,
	"ParentQuestionId": null,
	"QuestionDefinitionId": 9,
	"CreatedBy": "",
	"ResultsFilter": {
		"Attribute": "NumberOfCores",
		"Operator": ">",
		"Value": "2"
	},
	"PreviousResultsFilter": null
}

For questions

  • Questioner
  • Actioner

 

For actions

  • Actioner

Returns Unauthorized (401) if user does not have the required permissions at global level or on the parent InstructionDefinition's product pack.

 

 

POST

 http://<myserver>/Consumer/Instructions /Targeted

 

Creates a question or action, supplying a targeted list of endpoints by Fqdn

As above with the added "Endpoints" Json property e.g.

Instruction post
{
	"DefinitionId": 9,
    "DefinitionName": null,
    "Scope": {
		"Attribute": "OsType",
		"Operator" : "=",
		"Value": "Windows"
	},
    "Parameters": null,
	"InstructionTtlMinutes": 60,
	"ResponseTtlMinutes": 120,
    "ParentInstructionId": null,
    "KeepRaw": false,
    "Export": false,
    "ExportLocation": null,
    "ResultsFilter": {
		"Attribute": "NumberOfCores",
		"Operator": ">",
		"Value": "2"
	},
	"PreviousResultsFilter": null,
	"Endpoints":["pedvwks127.pe.local", "pedvwks126.pe.local", "pedvwks240.pe.local"]
}

 As above

Note: Fqdn list is limited by MaxRequestLength which defaults to 4MB

POSThttp://<myserver>/Consumer/Instructions /{instructionId}/cancel/{keepData}

Cancels an instruction.

  • id - question to stop
  • keepData - flag to indicate if result should be deleted

 

For questions

  • Questioner
  • Actioner

 

For actions

  • Actioner

Returns Unauthorized (401) if user does not have the required permissions at global level or on the parent InstructionDefinition's product pack. Instruction's owner can also cancel.

POSThttp://<myserver>/Consumer/Instructions /{instructionId}/rerunReruns a question. Action rerunning is not allowed as it can be risky.

For questions

  • Questioner
  • Actioner

Returns Unauthorized (401) if user does not have the required permissions at global level or on the parent InstructionDefinition's product pack.