> For the complete documentation index, see [llms.txt](https://docs.geopard.tech/geopard-tutorials/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.geopard.tech/geopard-tutorials/it/documentazione-api/geopard-api-requests-overview/83.-query-collect-platform-context.md).

# 83. Query: Raccogli il contesto della piattaforma

Quando si gestisce un gran numero di dataset (centinaia o migliaia), ad esempio "SatelliteImage", "AsAppliedDataset", "YieldDataset", "SoilDataset" e così via, è sempre necessario conoscere lo stato dell'elaborazione di ciascun dataset e raccogliere un riepilogo dell'elaborazione. Questi dettagli sono forniti tramite `getPlatformContext` query.

Casi d'uso comuni:

* Monitorare l'avanzamento dell'elaborazione
* Raccogliere riepiloghi e statistiche sull'elaborazione
* Esaminare gli errori e gli avvisi durante l'elaborazione per approfondire l'analisi dei dataset interessati

{% code overflow="wrap" lineNumbers="true" %}

```graphql
query CollectPlatformContext {
 getPlatformContext(input: {
   userUuids: ["<placeholder_of_user_uuid>"],
   statuses: [Start, Done, Warning, Error, Ignored],
   dateFrom: "2023-05-25T12:49:00.000Z", 
   dateTo: "2023-05-30T06:35:00.000Z", 
 }) {
   events {
     fieldUuid
     subFieldUuid
     subFieldType
     operationId
     status 
     executionDate
     messageKey
     optional
   }
 }
}
```

{% endcode %}

Filtri di input supportati:

* `dateFrom` come data e ora in formato ISO 8601 (esempio: `"2023-05-25T12:49:00.000Z"`)
* `dateTo` come data e ora in formato ISO 8601 (esempio: `"2023-05-30T06:35:00.000Z"`)
* `operationIds` come array di identificativi delle operazioni (`Strings`)
* `statuses` come array contenente valori di `ContextEventStatus` enum con tutti gli stati di elaborazione, compresi quelli intermedi; si consiglia di usare quelli principali `[Start, Done, Warning, Error, Ignored]`
* `subFieldTypes` come array di valori di `TreeNodeEntity` enum con tutte le entità GeoPard
* `subFieldUuids` come array di UUID associati alle entità selezionate in `subFieldTypes`
* `userUuids` come array di UUID degli "User" da cercare

{% hint style="info" %}
È necessario inizializzare almeno uno dei seguenti filtri: `userUuids`, `fieldUuids`, `subFieldUuids`, oppure `operationIds`.
{% endhint %}

{% hint style="info" %}
Se `dateFrom` e `dateTo` non sono specificati, la durata predefinita della query è impostata su 12 ore. L'intervallo di tempo massimo consigliato per il recupero dei dati è di 24 ore.
{% endhint %}

{% hint style="info" %}
È previsto un limite massimo di 10.000 righe restituite.
{% endhint %}

{% hint style="info" %}
Per osservare tutti i valori più recenti disponibili degli enum (come: `TreeNodeEntity`, `ContextEventStatus, ContextMessageKey`), si consiglia di usare [Altair](https://docs.geopard.tech/geopard-tutorials/it/documentazione-api/getting-started-with-the-geopard-api.md).
{% endhint %}

L'oggetto di output include i seguenti attributi:

* `fieldUuid` rappresenta l'UUID del campo associato
* `subFieldUuid` indica l'UUID del dataset elaborato collegato (ad esempio "SatelliteImage", "AsAppliedDataset", "YieldDataset", "SoilDataset" ecc.)
* `subFieldType` come enum collegato a `TreeNodeEntity`
* `operationId` come stringa contenente l'identificatore dell'operazione, che rimane invariato in tutte le catene di elaborazione correlate; è consigliabile raggruppare per questo identificatore per tracciare tutte le fasi di elaborazione
* `status` come enum collegato a `ContextEventStatus`
* `executionDate` come stringa nel formato ISO 8601 che indica il momento dell'esecuzione
* `messageKey` come enum collegato a `ContextMessageKey` che descrive l'esito dell'esecuzione
* `optional` come stringa che fornisce una descrizione tecnica (se pertinente), usata principalmente per il debug e la segnalazione di bug


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.geopard.tech/geopard-tutorials/it/documentazione-api/geopard-api-requests-overview/83.-query-collect-platform-context.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
