Entity - ScheduledInstructions - Interrogates the ScheduledInstruction table

Page version: , last updated:



VerbRequestNotesPermissions required
 GET Consumer/ScheduledInstructions/

Gets all scheduled instructions

Note: For an explanation of the possible values of the ScheduleXxx parameters, see https://docs.microsoft.com/en-us/sql/relational-databases/system-tables/dbo-sysschedules-transact-sql

Not every possible combination of values for these parameters will be initially implemented in Tachyon.

[
  {
    "Id": 4,
    "Name": "Stable-CountEventLogErrorsInLastX",
    "Cmd": "SendAll",
    "KeepRaw": false,
    "Scope": null,
    "ReadableScope": null,
    "InstructionTtlMinutes": 10,
    "ResponseTtlMinutes": 10,
    "Export": false,
    "ExportLocation": null,
    "ParentInstructionId": null,
    "InstructionDefinitionId": 42347,
    "CreatedBy": "1E\\Alberto.Poblacion",
    "ResultsFilter": null,
    "PreviousResultsFilter": null,
    "ConsumerId": 1,
    "ConsumerName": "Explorer",
    "ConsumerCustomData": null,
    "ParameterJson": "[{\"Name\":\"type\",\"Pattern\":\"%type%\",\"DataType\": ... }]",
    "OffloadResponses": false,
    "RequestedFor": null,
    "Comments": "Just testing from PostMan",
    "ActionedBy": null,
    "ActionReason": null,
    "ScheduleEnabled": true,
    "ScheduleFreqType": 4,
    "ScheduleFreqInterval": 1,
    "ScheduleFreqSubdayType": 1,
    "ScheduleFreqSubdayInterval": 1,
    "ScheduleFreqRelativeInterval": 0,
    "ScheduleFreqRecurrenceFactor": 0,
    "ScheduleActiveStartDate": null,
    "ScheduleActiveEndDate": null,
    "ScheduleActiveStartTime": null,
    "ScheduleActiveEndTime": null,
    "ScheduleDateCreated": "2017-05-09T14:53:51.19Z",
    "ScheduleDateModified": "2017-05-09T14:53:51.157Z",
    "ScheduleLastExecuted": null,
    "ScheduleNextExecution": "2017-05-10T14:53:51.163Z"
  }
]


None

GET - single

/Consumer/ScheduledInstructions/{id}

 

 

Gets an individual row from the ScheduledInstruction table by its Id.

{
  "Id": 4,
  "Name": "Stable-CountEventLogErrorsInLastX",
  "Cmd": "SendAll",
  "KeepRaw": false,
  "Scope": null,
  "ReadableScope": null,
  "InstructionTtlMinutes": 10,
  "ResponseTtlMinutes": 10,
  "Export": false,
  "ExportLocation": null,
  "ParentInstructionId": null,
  "InstructionDefinitionId": 42347,
  "CreatedBy": "1E\\Alberto.Poblacion",
  "ResultsFilter": null,
  "PreviousResultsFilter": null,
  "ConsumerId": 1,
  "ConsumerName": "Explorer",
  "ConsumerCustomData": null,
  "ParameterJson": "[{\"Name\":\"type\",\"Pattern\":\"%type%\",\"DataType\":\"string\", ... }]",
  "OffloadResponses": false,
  "RequestedFor": null,
  "Comments": "Just testing from PostMan",
  "ActionedBy": null,
  "ActionReason": null,
  "ScheduleEnabled": true,
  "ScheduleFreqType": 4,
  "ScheduleFreqInterval": 1,
  "ScheduleFreqSubdayType": 1,
  "ScheduleFreqSubdayInterval": 1,
  "ScheduleFreqRelativeInterval": 0,
  "ScheduleFreqRecurrenceFactor": 0,
  "ScheduleActiveStartDate": null,
  "ScheduleActiveEndDate": null,
  "ScheduleActiveStartTime": null,
  "ScheduleActiveEndTime": null,
  "ScheduleDateCreated": "2017-05-09T14:53:51.19Z",
  "ScheduleDateModified": "2017-05-09T14:53:51.157Z",
  "ScheduleLastExecuted": null,
  "ScheduleNextExecution": "2017-05-10T14:53:51.163Z"
}
 


  • 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.

POST

/Consumer/ScheduledInstructions

 

 

Creates a scheduled question, action or event.

{
  "DefinitionName":"TachyonCore-BiosDetails",
  "InstructionTtlMinutes":10,
  "ResponseTtlMinutes":10,
  "Comments":"This is a comment",
  "ScheduleEnabled": true,
  "ScheduleFreqType": 4,
  "ScheduleFreqInterval": 1,
  "ScheduleFreqSubdayType": 1,
  "ScheduleFreqSubdayInterval": 1,
  "ScheduleFreqRelativeInterval": 0,
  "ScheduleFreqRecurrenceFactor": 0,
  "ScheduleDateCreated": "2017-05-09T14:50:01.343Z",
  "ScheduleDateModified": "2017-05-09T14:50:01.343Z"
}

will return:

[Similar to GET]


For questions

  • Questioner
  • Actioner

 

For actions

  • Actioner

Returns Unauthorized (401) if user does not have the required permissions on the instruction that is being scheduled.

 

NOTE: The attached JSON is just an example to demonstrate how to pass the Scheduling parameters. Otherwise, it accepts parameters that are similar to those allowed by the /Consumer/Instruction API.

 

PUT /Consumer/ScheduledInstructions/Update/{id}Takes a ScheduledInstruction (using the same schema as POST) and replaces it into the existing ScheduledInstruction whose Id is given by {id}. Permissions as above.
POST

/Consumer/ScheduledInstructions/Targeted

 

Creates a scheduled instruction, supplying a targeted list of devices by Fqdn

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

{
 "DefinitionName":"TachyonCore-BiosDetails",

 "InstructionTtlMinutes":10,
 "ResponseTtlMinutes":10,
 "Comment":"Just testing from PostMan", 
 "ScheduleEnabled": true,
 "ScheduleFreqType": 4,
 "ScheduleFreqInterval": 1,
 "ScheduleFreqSubdayType": 1,
 "ScheduleFreqSubdayInterval": 1,
 "ScheduleFreqRelativeInterval": 0,
 "ScheduleFreqRecurrenceFactor": 0,
 "ScheduleDateCreated": "2017-05-08T11:43:01.343Z",
 "ScheduleDateModified": "2017-05-08T11:43:01.343Z", 
 "Devices":["1EUKDEVWKS1349.1e.local"]
}


Permissions as above.

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

PUT/Consumer/ScheduledInstructions/Targeted/{id}Takes a ScheduledInstruction (using the same schema as POST, including list of devices by Fqdn) and replaces it into the existing ScheduledInstruction whose Id is given by {id}. Permissions as above.
DELETE

/Consumer/ScheduledInstructions/{id}

 

Deletes an individual row from the ShcheduledInstruction table by its Id.

 

Permission to execute schedule

POST /Consumer/ScheduledInstructions/{id}/cancelCancel an individual schedulePermission to execute schedule
POST

/Consumer/ScheduledInstructions/search

 

 

Find all occurrences of a schedule between two dates.

{
    "Filter":{
        "Operator": "AND",
        "Operands": [ 
            { 
                "Attribute": "DefinitionName",
                "Operator": "==",
                "Value": "TachyonCore-BiosDetails"
            }
        ]
    },
    "StartDate": "2017-05-01T00:00:00+0100",
    "EndDate": "2017-07-01T00:00:00+0100",
    "PageSize": 20
}

will return:

[Similar to GET: An array of ScheduleDefinitions where the relevant information is the ScheduleNextExecution field]

For past executions, the response contains an InstructionId field that reports the ID from the instruction that was triggered from the schedule. This field is null for future executions, since it is not possible to predict the ID that will be generated when the schedule is triggered.

Note: Either EndDate or PageSize needs to be specified when invoking this API. StartDate is optional, and it defaults to "the first occurrence of this schedule that ever happened".

 

POST/Consumer/ScheduledInstructions/Describe

Minimum API version - 3.2

Returns the description for a Scheduled Instruction even if it is not saved into the system.

Takes as input parameter a ScheduledInstruction, similar to what would be sent to /Consumer/ScheduledInstructions in order to add the schedule to the system. This API does not do anything with the schedule, except populate some data inside the object, namely the ScheduleReadableFrequency.

Returns the same object, including the newly populated information.

 None requried.
GET/Consumer/ScheduledInstructions/

Minimum API version - 3.3

Gets approximate target for specific instruction.

Approximate target will be calculated using the scope defined in the instruction.

Approximate target will be calculated for the user who created the instruction, using that user's current permissions.
Requires any permission on any of the instruction sets