Summary

The updatePersistedAggregationMetadata() mutation updates the name, description, and labels of a persisted aggregation. The query string, schedule, destination repository, and enabled state are not affected. Use this mutation to rename an aggregation, revise its description, or replace its labels without altering its query behavior or execution configuration.

Syntax

graphql
updatePersistedAggregationMetadata(
      input: UpdatePersistedAggregationMetadataInput!
   ): PersistedAggregation!

The mutation requires a single input argument of type UpdatePersistedAggregationMetadataInput!. The id field is required and identifies the persisted aggregation to update. Use the persistedAggregations() query to retrieve that identifier. The labels field is also required and replaces the current label set entirely; to leave labels unchanged, pass the existing labels back as the value. The name and description fields are optional; omitting either leaves its current value unchanged.

The mutation returns a non-null PersistedAggregation! object. It returns FieldValidationException on validation errors such as a name or label that violates character or length constraints.

Input parameters

Provide the unique identifier of the persisted aggregation to update. Use the persistedAggregations() query to retrieve the identifier and the current label set before calling this mutation. The labels field is required and replaces all current labels; to leave labels unchanged, pass the current list back. Each label must contain only alphanumeric characters, spaces, hyphens, or underscores, and must not exceed 64 characters. To clear all labels, supply an empty list. Optionally provide a new name or description; fields you omit remain unchanged. A name must start with an alphanumeric character and must not exceed 128 characters.

Table: UpdatePersistedAggregationMetadataInput Input Datatype

ParameterTypeRequiredDefaultStabilityAvailabilityDescription
descriptionString    An optional new description. Maximum 1024 characters. If not provided, the current description is unchanged.
idStringyes   The unique ID of the persisted aggregation to update. This field is required and identifies which aggregation to modify.
labelsStringyes   An optional list of labels to replace the current labels. Maximum 10 labels. Each label must be non-empty, contain only alphanumeric characters, spaces, hyphens, and underscores, and be at most 64 characters. If not provided, the current labels are unchanged.
nameString    An optional new name for the persisted aggregation. Must start with an alphanumeric character, contain only alphanumeric characters, spaces, hyphens, and underscores, and be at most 128 characters. If not provided, the current name is unchanged.

Example

Raw
graphql
mutation {
  updatePersistedAggregationMetadata(
    input: { id: "abc123",
             name: "per-sister" }
  ) { 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 {
  updatePersistedAggregationMetadata(
    input: { id: \"abc123\",
             name: \"per-sister\" }
  ) { 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 {
  updatePersistedAggregationMetadata(
    input: { id: \"abc123\",
             name: \"per-sister\" }
  ) { 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 { ^
  updatePersistedAggregationMetadata( ^
    input: { id: \"abc123\", ^
             name: \"per-sister\" } ^
  ) { id } ^
}" ^
} '
Windows Powershell and curl
powershell
curl.exe -X POST 
    -H "Authorization: Bearer $TOKEN"
    -H "Content-Type: application/json"
    -d '{"query" : "mutation {
  updatePersistedAggregationMetadata(
    input: { id: \"abc123\",
             name: \"per-sister\" }
  ) { 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 {
  updatePersistedAggregationMetadata(
    input: { id: \"abc123\",
             name: \"per-sister\" }
  ) { 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 {
  updatePersistedAggregationMetadata(
    input: { id: \"abc123\",
             name: \"per-sister\" }
  ) { 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 {
  updatePersistedAggregationMetadata(
    input: { id: \"abc123\",
             name: \"per-sister\" }
  ) { 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": {
    "updatePersistedAggregationMetadata": {
      "id": "abc123"
    }
  }
}

Returned values

The mutation returns the updated PersistedAggregation object. Request the id, name, description, and labels fields to confirm the updated values. Fields unaffected by this mutation — including queryString, schedule, and enabled — reflect their current state but are not modified by this mutation.

Table: PersistedAggregation Datatype

ParameterTypeRequiredDefaultStabilityAvailabilityDescription
createdInfoAssetCommitMetadatayes Preview Metadata related to the creation of the persisted aggregation.
descriptionString  Preview The description of the persisted aggregation.
destinationRepository  Preview The destination repository where aggregation output data is written. Immutable after creation.
enabledBooleanyes Preview Whether the persisted aggregation is enabled.
healthInfoPersistedAggregationHealthInfo  Preview Derived health status information for this persisted aggregation.
idStringyes Preview The ID of the persisted aggregation.
isRollupableBoolean  Preview Whether this persisted aggregation has rollups enabled.
labelsStringyes Preview The labels associated with this aggregation.
modifiedInfoAssetCommitMetadata  Preview Metadata related to the last modification of the persisted aggregation.
nameStringyes Preview The name of the persisted aggregation.
queryOwnershipTypeQueryOwnershipTypeyes Preview The ownership type of the query.
queryStringStringyes Preview The query string for the aggregation.
schedulePersistedAggregationScheduleyes Preview The schedule configuration for this aggregation.
searchDomainSearchDomain  Preview The search domain (view or repository) this persisted aggregation belongs to.
staticFieldsPersistedAggregationStaticFieldyes Preview Static key-value fields attached to every result event.
tagStringyes Preview The unique tag identifier for the persisted aggregation. Immutable after creation.