Skip to main content

1E 8.1 (on-premises)

ScheduledInstructions

Entity - ScheduledInstructions - Interrogates the ScheduledInstruction table

Note for API version 8.0

As of API version 8.0, the visibility of the Scheduled Instructions is restricted in accordance to the Management Groups assigned to the users. See the note at the top of the Instructions page for an explanation of how this works.

Verb

Request

Notes

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

Returned JSON

[
  {
    "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.

Example Response

{
  "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.

Example Request

{
  "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:

Example Response

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

Example Request

{
 "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}/cancel

Cancel an individual schedule

Permission to execute schedule

POST

/Consumer/ScheduledInstructions/ search

Find all occurrences of a schedule between two dates.

Example Request

{
    "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:

Example Response

[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/ approxtarget

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.

New for API version 8.0: The calculation for the approximate target only counts the Devices that the current user is allowed to see in accordance to the Management Groups that are assigned to the user.

Requires any permission on any of the instruction sets