Summary

The updateScheduledReport() mutation updates a scheduled report in a LogScale view or repository. Supply only the fields you want to change. All other fields retain their current values. Use this mutation to update settings such as the delivery schedule, recipient list, enabled state, description, or associated dashboard.

Syntax

graphql
updateScheduledReport(
      input: UpdateScheduledReportInput!
   ): ScheduledReport!

The mutation takes a single required argument, input, of type UpdateScheduledReportInput!. The input must include viewName, the name of the view that owns the report, and id, the unique report identifier. All other input fields are optional and retain their current values when omitted. The mutation returns a non-null ScheduledReport! object reflecting the updated state.

Input parameters

The input argument requires viewName, the name of the view that owns the report, and id, the unique identifier of the report to update. All other fields are optional. To update the recipient list, pass email addresses to recipients. To update the run schedule, pass an UpdateScheduledReportScheduleInput object to schedule. To update the page layout, pass an UpdateScheduledReportLayoutInput object to layout. To protect generated report files with a password, use password. To retrieve the report identifier before calling this mutation, use the scheduledReport() query.

Table: UpdateScheduledReportInput Input Datatype

ParameterTypeRequiredDefaultStabilityAvailabilityDescription
dashboardIdString  Long-Term The unique identifier of the dashboard for which the report was created.
descriptionString  Long-Term Description of the scheduled report.
enabledBoolean  Long-Term Flag indicating whether the scheduled report is enabled.
idStringyes Long-Term The unique identifier of the scheduled report.
labelsStringyes Long-Term Labels attached to the scheduled report.
layoutUpdateScheduledReportLayoutInput  Long-Term Layout of the scheduled report. See UpdateScheduledReportLayoutInput.
nameString  Long-Term The name of the scheduled report.
parametersUpdateScheduledReportParameterValueInputyes Long-Term A list of parameter value configurations. See UpdateScheduledReportParameterValueInput.
passwordString  Long-Term The password used to protect any generated reports.
recipientsStringyes Long-Term A list of recipients who should receive an email with the generated report.
scheduleUpdateScheduledReportScheduleInput  Long-Term The schedule by which to run the report. See UpdateScheduledReportScheduleInput.
timeIntervalFromString  Long-Term The start of the relative time interval for the dashboard.
viewNameStringyes Long-Term The name of the view of the scheduled report.

Example

Raw
graphql
mutation {
  updateScheduledReport(input:
       { id: "abc123",
         viewName: "humio",
         schedule: {cronExpression: "H 2 * * *", 
                    timeZone: "UTC+00:00", 
                    startDate: 1729781206587},
         recipients: ["bob@company.com", "ted@company.com"]
      } )
  { id }
}
Mac OS or Linux (curl)
shell
curl -v -X POST $YOUR_LOGSCALE_URL/graphql \
    -H "Authorization: Bearer $TOKEN" \
    -H "Content-Type: application/json" \
    -d @- << EOF
{"query" : "mutation {
  updateScheduledReport(input:
       { id: \"abc123\",
         viewName: \"humio\",
         schedule: {cronExpression: \"H 2 * * *\", 
                    timeZone: \"UTC+00:00\", 
                    startDate: 1729781206587},
         recipients: [\"bob@company.com\", \"ted@company.com\"]
      } )
  { id }
}"
}
EOF
Mac OS or Linux (curl) One-line
shell
curl -v -X POST $YOUR_LOGSCALE_URL/graphql \
    -H "Authorization: Bearer $TOKEN" \
    -H "Content-Type: application/json" \
    -d @- << EOF
{"query" : "mutation {
  updateScheduledReport(input:
       { id: \"abc123\",
         viewName: \"humio\",
         schedule: {cronExpression: \"H 2 * * *\", 
                    timeZone: \"UTC+00:00\", 
                    startDate: 1729781206587},
         recipients: [\"bob@company.com\", \"ted@company.com\"]
      } )
  { id }
}"
}
EOF
Windows Cmd and curl
shell
curl -v -X POST $YOUR_LOGSCALE_URL/graphql ^
    -H "Authorization: Bearer $TOKEN" ^
    -H "Content-Type: application/json" ^
    -d @'{"query" : "mutation { ^
  updateScheduledReport(input: ^
       { id: \"abc123\", ^
         viewName: \"humio\", ^
         schedule: {cronExpression: \"H 2 * * *\",  ^
                    timeZone: \"UTC+00:00\",  ^
                    startDate: 1729781206587}, ^
         recipients: [\"bob@company.com\", \"ted@company.com\"] ^
      } ) ^
  { id } ^
}" ^
} '
Windows Powershell and curl
powershell
curl.exe -X POST 
    -H "Authorization: Bearer $TOKEN"
    -H "Content-Type: application/json"
    -d '{"query" : "mutation {
  updateScheduledReport(input:
       { id: \"abc123\",
         viewName: \"humio\",
         schedule: {cronExpression: \"H 2 * * *\", 
                    timeZone: \"UTC+00:00\", 
                    startDate: 1729781206587},
         recipients: [\"bob@company.com\", \"ted@company.com\"]
      } )
  { id }
}"
}'
    "$YOUR_LOGSCALE_URL/graphql"
Perl
perl
#!/usr/bin/perl

use HTTP::Request;
use LWP;

my $TOKEN = "TOKEN";

my $uri = '$YOUR_LOGSCALE_URL/graphql';

my $query = "mutation {
  updateScheduledReport(input:
       { id: \"abc123\",
         viewName: \"humio\",
         schedule: {cronExpression: \"H 2 * * *\", 
                    timeZone: \"UTC+00:00\", 
                    startDate: 1729781206587},
         recipients: [\"bob@company.com\", \"ted@company.com\"]
      } )
  { id }
}";
$query =~ s/\n/ /g;
my $json = sprintf('{"query" : "%s"}',$query);
my $req = HTTP::Request->new("POST", $uri );

$req->header("Authorization" => "Bearer $TOKEN");
$req->header("Content-Type" => "application/json");

$req->content( $json );

my $lwp = LWP::UserAgent->new;

my $result = $lwp->request( $req );

print $result->{"_content"},"\n";
Python
python
#! /usr/local/bin/python3

import requests

url = '$YOUR_LOGSCALE_URL/graphql'
mydata = r'''{"query" : "mutation {
  updateScheduledReport(input:
       { id: \"abc123\",
         viewName: \"humio\",
         schedule: {cronExpression: \"H 2 * * *\", 
                    timeZone: \"UTC+00:00\", 
                    startDate: 1729781206587},
         recipients: [\"bob@company.com\", \"ted@company.com\"]
      } )
  { id }
}"
}'''

resp = requests.post(url,
                     data = mydata,
                     headers = {
   "Authorization" : "Bearer $TOKEN",
   "Content-Type" : "application/json"
}
)

print(resp.text)
Node.js
javascript
const https = require('https');

const data = JSON.stringify(
    {"query" : "mutation {
  updateScheduledReport(input:
       { id: \"abc123\",
         viewName: \"humio\",
         schedule: {cronExpression: \"H 2 * * *\", 
                    timeZone: \"UTC+00:00\", 
                    startDate: 1729781206587},
         recipients: [\"bob@company.com\", \"ted@company.com\"]
      } )
  { id }
}"
}
);


const options = {
  hostname: '$YOUR_LOGSCALE_URL',
  path: 'graphql',
  port: 443,
  method: 'POST',
  headers: {
    'Content-Type': 'application/json',
    'Content-Length': data.length,
    Authorization: 'BEARER ' + process.env.TOKEN,
    'User-Agent': 'Node',
  },
};

const req = https.request(options, (res) => {
  let data = '';
  console.log(`statusCode: ${res.statusCode}`);

  res.on('data', (d) => {
    data += d;
  });
  res.on('end', () => {
    console.log(JSON.parse(data).data);
  });
});

req.on('error', (error) => {
  console.error(error);
});

req.write(data);
req.end();
Example Responses
Success (HTTP Response Code 200 OK)
json
{
  "data": {
    "updateScheduledReport": {
      "id": "abc123"
    }
  }
}

Returned values

The mutation returns a ScheduledReport! object representing the updated report. Request id to confirm the report identifier, name for the report name, and enabled for the current enabled state. Use schedule to confirm the updated run schedule and recipients to confirm the current recipient list. Request status for the status of the most recent execution. Use timeOfNextPlannedReportExecution to see when the next execution is scheduled.

Table: ScheduledReport Datatype

ParameterTypeRequiredDefaultStabilityAvailabilityDescription
allowedActionsAssetActionyes Short-Term Allowed asset actions. This is a preview and subject to changes. See AssetAction .
createdByUser  Deprecateddeprecated in 1.306User who created the report. See User. This field is deprecated and will be removed at the earliest in version 1.306 It's replaced by createdInfo.
createdInfoAssetCommitMetadata  Long-Termadded in 1.253Metadata related to the creation of the scheduled report. See AssetCommitMetadata.
creationDateStringyes Deprecateddeprecated in 1.306The date when the report was created. This field is deprecated and will be removed at the earliest in version 1.306 It's replaced by createdInfo.
dashboardDashboard  Long-Term The dashboard for which the report was created. See Dashboard.
dashboardIdStringyes Long-Term The unique identifier of the dashboard for which the report was created.
descriptionStringyes Long-Term Description of the scheduled report.
enabledBooleanyes Long-Term Whether the scheduled report is enabled.
idStringyes Long-Term The unique identifier of the scheduled report.
isPasswordDefinedBooleanyes Long-Term Whether a password is defined for the report.
labelsStringyes Long-Term Labels attached to the scheduled report.
lastExecutionErrorsStringyes Long-Term Last errors encountered while generating the scheduled report.
lastExecutionWarningsStringyes Long-Term Last warnings encountered while generating the scheduled report.
layoutScheduledReportLayoutyes Long-Term Layout of the scheduled report. See ScheduledReportLayout.
nameStringyes Long-Term The name of the scheduled report.
packagePackageInstallation  Long-Term The package installation from which this scheduled report was created, if applicable. See PackageInstallation.
packageIdVersionedPackageSpecifier  Long-Term The versioned identifier of the package from which this scheduled report was created, in the format namespace/name@version. VersionedPackageSpecifier is a scalar.
parametersParameterValueyes Long-Term List of parameter value configurations. See ParameterValue.
recipientsStringyes Long-Term List of recipients who should receive an email with the generated report.
resourceStringyes Short-Term The resource identifier for this scheduled report.
scheduleScheduleyes Long-Term The schedule by which to run the report. See Schedule.
statusStringyes Long-Term Status of the latest report execution.
timeIntervalStartString  Long-Term Start of the relative time interval for the dashboard.
timeOfLastExecutionStartLong  Long-Term Unix timestamp for when the last execution was sent to the render service for generation.
timeOfLastReportExecutionLong  Long-Term Unix timestamp for the last report execution. The timestamp only indicates an attempt, not if it was successful.
timeOfNextPlannedReportExecutionLong  Long-Term Unix timestamp for the next planned report execution.
yamlTemplateYAMLyes Preview A YAML-formatted string that describes the scheduled report template used to create or last update this report.