Mantieni tutto organizzato con le raccolte
Salva e classifica i contenuti in base alle tue preferenze.
Il seguente pseudocodice illustra una procedura che puoi seguire utilizzando
l'API Data Lineage per recuperare i link della struttura di dati
da tutte le regioni disponibili.
Configurazione dell'input:
linksToFetch = 5 (numero di link da recuperare da tutte le regioni)
regionalPageToken = "" (ultimo token pagina regionale ricevuto utilizzato per la paginazione)
Crea:
Elenco di tutte le regioni da espandere chiamato regions.
Elenco di regioni non raggiungibili chiamato unreachable.
Un elenco vuoto dei link trovati chiamato foundLinks.
una variabile vuota nextPageToken e nextRegionalPageToken.
una variabile vuota lastRegion.
una variabile vuota lastRegionLinksCount.
Ordina regions in ordine alfabetico.
Analizza regionalPageToken
Se è vuoto, vai al passaggio 5.
Se non è vuoto,
analizzare regionalPageToken dividendolo in due segmenti in base al primo punto
filtra le regioni prendendo solo quelle che si trovano dopo (in ordine alfabetico) il primo segmento dall'regionalPageToken analizzato.
Filtra le risposte riuscite e memorizza i nomi delle regioni non riuscite nell'elenco unreachable.
Per ogni risposta (a partire dalla prima regione in ordine alfabetico)
se non sono stati restituiti link insieme a un token pagina non vuoto
il nome della regione del negozio in lastRegion.
Salva il token pageToken ricevuto in nextPageToken.
ignora le risposte rimanenti.
otherwise
il nome della regione del negozio in lastRegion.
salvare i link ricevuti in foundLinks (fino a linksToFetch).
Salva il token pageToken ricevuto in nextPageToken.
Memorizza il numero di link acquisiti dalla risposta in lastRegionLinksCount.
se foundLinks è inferiore a linksToFetch
continua lo pseudocodice con la risposta successiva ricevuta in ordine alfabetico.
se foundLinks è uguale a linksToFetch
effettua un'altra richiesta all'endpoint projects.locations.searchLinks
nella stessa regione, ma imposta il parametro pageSize sul valore di lastRegionLinksCount.
Il negozio ha ricevuto pageToken in nextPageToken.
vai al passaggio 9
Anteponi nextPageToken a lastRegion (ad es. [region].[receivedNextPageToken]) per creare nextRegionalPageToken per gestire la paginazione nelle chiamate consecutive.
[[["Facile da capire","easyToUnderstand","thumb-up"],["Il problema è stato risolto","solvedMyProblem","thumb-up"],["Altra","otherUp","thumb-up"]],[["Difficile da capire","hardToUnderstand","thumb-down"],["Informazioni o codice di esempio errati","incorrectInformationOrSampleCode","thumb-down"],["Mancano le informazioni o gli esempi di cui ho bisogno","missingTheInformationSamplesINeed","thumb-down"],["Problema di traduzione","translationIssue","thumb-down"],["Altra","otherDown","thumb-down"]],["Ultimo aggiornamento 2025-09-05 UTC."],[[["\u003cp\u003eThis pseudocode details a procedure for using the Data Lineage API to retrieve data lineage links from multiple regions, specifying the number of links to fetch.\u003c/p\u003e\n"],["\u003cp\u003eThe process involves creating and managing lists of regions, unreachable regions, and found links, as well as variables for pagination and tracking the last region processed.\u003c/p\u003e\n"],["\u003cp\u003eIt utilizes parallel calls to the \u003ccode\u003eprojects.locations.searchLinks\u003c/code\u003e API endpoint in each region, handling both successful and failed responses and dealing with the sorting of the regions alphabetically.\u003c/p\u003e\n"],["\u003cp\u003ePagination is managed through page tokens, which are processed to filter regions and then appended with the last region's name for use in subsequent calls.\u003c/p\u003e\n"],["\u003cp\u003eThe pseudocode outlines how to handle cases where fewer than the requested number of links are found, including making an additional request in the last region to get the correct \u003ccode\u003enextPageToken\u003c/code\u003e.\u003c/p\u003e\n"]]],[],null,["# Fetch lineage links from multiple regions\n\nThe following pseudocode outlines a procedure you can follow using\nthe Data Lineage API to fetch data lineage links\nfrom all available regions.\n\n1. Input setup:\n - `linksToFetch` = 5 (number of links to fetch from all regions)\n - `regionalPageToken` = \"\" (last received regional page token used for pagination)\n2. Create:\n 1. list of all regions to fan-out called `regions`.\n 2. list of unreachable regions called `unreachable`.\n 3. an empty list of found links called `foundLinks`.\n 4. an empty variable `nextPageToken` and `nextRegionalPageToken`.\n 5. an empty variable `lastRegion`.\n 6. an empty variable `lastRegionLinksCount`.\n3. Sort `regions` alphabetically.\n4. Parse `regionalPageToken`\n 1. If it is empty then continue to step 5\n 2. If it is not empty then\n 1. parse `regionalPageToken` by splitting it by first dot into two segments\n 2. filter out regions by taking only the ones that are after (in alphabetical order) the first segment from parsed `regionalPageToken`.\n 3. store the second segment aside to use it in all [projects.locations.searchLinks](/dataplex/docs/reference/data-lineage/rest/v1/projects.locations/searchLinks) calls.\n5. Make a call to [projects.locations.searchLinks](/dataplex/docs/reference/data-lineage/rest/v1/projects.locations/searchLinks) in each region in the `regions` list in parallel.\n6. Wait for all requests to complete.\n7. Filter out successful responses and store failed region names in the `unreachable` list.\n8. For each of the responses (starting with first region in alphabetical order)\n 1. if no links were returned along with a non empty page token\n 1. store region name in `lastRegion`.\n 2. save received pageToken in `nextPageToken`.\n 3. ignore the remaining responses.\n 2. otherwise\n 1. store region name in `lastRegion`.\n 2. save received links in `foundLinks` (up to `linksToFetch`).\n 3. save received pageToken in `nextPageToken`.\n 4. store number of taken links from the response in `lastRegionLinksCount`.\n 5. if `foundLinks` is less than `linksToFetch`\n 1. continue the pseudocode with the next received response in the alphabetical order.\n 6. if `foundLinks` equals `linksToFetch`\n 1. make another request to [projects.locations.searchLinks](/dataplex/docs/reference/data-lineage/rest/v1/projects.locations/searchLinks) endpoint in the same region but set the `pageSize` parameter to the value of `lastRegionLinksCount`.\n 2. store received pageToken in `nextPageToken`.\n 3. continue to step 9\n9. Prepend `nextPageToken` with the `lastRegion` (i.e. `[region].[receivedNextPageToken]`) to create `nextRegionalPageToken` to handle pagination in consecutive calls."]]