Mantieni tutto organizzato con le raccolte
Salva e classifica i contenuti in base alle tue preferenze.
Questo documento fornisce informazioni dettagliate su come creare e aggiornare
le etichette per i progetti utilizzando l'API Resource Manager e la console Google Cloud . Fornisce
dettagli su come comprendere i costi utilizzando le etichette e i servizi che le supportano.
Creare etichette per i progetti
Console
Per aggiungere etichette a un singolo progetto:
Apri la pagina Etichette nella console Google Cloud .
Seleziona il progetto dal menu a discesa Seleziona un progetto.
Per aggiungere una nuova voce di etichetta, fai clic su + Aggiungi etichetta e inserisci una chiave e un valore per ogni etichetta che vuoi aggiungere.
Al termine dell'aggiunta delle etichette, fai clic su Salva.
Per aggiungere etichette per più progetti contemporaneamente:
Apri la pagina Gestisci risorse nella console Google Cloud .
Nella pagina Gestisci risorse, seleziona i progetti a cui vuoi aggiungere etichette.
Nel riquadro delle informazioni, nella scheda Etichette, fai clic su + Aggiungi etichetta e
inserisci una chiave e un valore per ogni etichetta che vuoi aggiungere.
Al termine dell'aggiunta delle etichette, fai clic su Salva.
Dopo aver aggiunto le etichette, puoi filtrare i progetti digitando una chiave o un valore di etichetta nella
casella del filtro sopra l'elenco dei progetti. La casella del filtro suggerirà chiavi e
valori per consentirti di visualizzare l'anteprima dei risultati.
REST
Per creare un nuovo progetto con un'etichetta, imposta il campo labels quando crei il progetto.
Una volta aggiunte le etichette, puoi filtrare i progetti in base a queste. Per informazioni dettagliate sull'utilizzo delle etichette per filtrare i progetti, consulta Elenco dei progetti.
Aggiorna le etichette per i progetti
Console
Per aggiornare le etichette di un singolo progetto:
Apri la pagina Etichette nella console Google Cloud .
[[["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-04 UTC."],[],[],null,["# Create and update labels for projects\n\nThis document provides details on how to create and update\nlabels for projects using the Resource Manager API and the Google Cloud console. It provides\ndetails on how to understand costs using labels and the services that support labels.\n| **Note:** For more information about adding or updating labels on specific resources, such as Compute Engine instance and Cloud Storage buckets, see the corresponding product documentation of the resource.\n\n\nCreate labels for projects\n--------------------------\n\n\u003cbr /\u003e\n\n\n### Console\n\nTo add labels to a single project:\n\n1. Open the **Labels** page in the Google Cloud console.\n\n [Open the Labels page](https://console.cloud.google.com/projectselector/iam-admin/labels)\n2. Select your project from the **Select a project** drop-down.\n\n3. To add a new label entry, click **+ Add label** and enter a label key and\n value for each label you want to add.\n\n4. When you're finished adding labels, click **Save**.\n\nTo add labels for more than one project at the same time:\n\n1. Open the **Manage resources** page in the Google Cloud console.\n\n [Open the Manage resources page](https://console.cloud.google.com/cloud-resource-manager)\n2. On the **Manage resources** page, select the projects for\n which you want to add labels.\n\n3. In the info panel, in the **Labels** tab, click **+ Add label** and\n enter a label key and value for each label you want to add.\n\n4. When you're finished adding labels, click **Save**.\n\nAfter you add labels, you can filter projects by typing a label key or value in\nthe filter box above the projects list. The filter box will suggest keys and\nvalues so you can preview results.\n\n\u003cbr /\u003e\n\n\n### REST\n\nTo create a **new** project with a label, set the `labels` field when you create\nthe project.\n\nRequest: \n\n```text\nPOST https://cloudresourcemanager.googleapis.com/v3/projects\n\n{\n \"labels\": {\n \"color\": \"red\"\n },\n \"name\": \"myproject\",\n \"projectId\": \"our-project-123\"\n}\n```\n\nResponse: \n\n```text\n{\n \"projectNumber\": \"333197460082\",\n \"projectId\": \"our-project-123\",\n \"lifecycleState\": \"ACTIVE\",\n \"name\": \"myproject\",\n \"labels\": {\n \"color\": \"red\"\n },\n \"createTime\": \"2016-01-12T22:18:28.633Z\",\n}\n```\n\nTo add labels for **existing** projects:\n\n- Get the project using the [`projects.get()`](https://cloud.google.com/resource-manager/reference/rest/v3/projects/get) method.\n- Modify the `labels` field.\n- Update the project using the [`projects.patch()`](https://cloud.google.com/resource-manager/reference/rest/v3/projects/patch) method.\n\nOnce you add labels, you can filter projects based on labels. For details about\nusing labels to filter projects, see [Listing Projects](/resource-manager/docs/creating-managing-projects#listing_projects).\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\nUpdate labels for projects\n--------------------------\n\n\u003cbr /\u003e\n\n\n### Console\n\nTo update labels for a single project:\n\n\u003cbr /\u003e\n\n1. Open the **Labels** page in the Google Cloud console.\n\n [Open the Labels page](https://console.cloud.google.com/projectselector/iam-admin/labels)\n2. Select your project from the **Select a project** drop-down.\n\n3. Update the labels for your project:\n\n 1. To edit a label, click the value that you want to edit, then make your desired changes.\n 2. To delete a label, hold the pointer over the key or value, then click delete .\n4. When you're finished updating labels, click **Save**.\n\nTo update labels for more than one project at the same time:\n\n1. Open the **Manage resources** page in the Google Cloud console.\n\n [Open the Manage resources page](https://console.cloud.google.com/cloud-resource-manager)\n2. On the **Manage resources** page, select the projects for\n which you want to update labels.\n\n3. In the info panel, click the **Labels** tab and update labels for the\n selected projects:\n\n 1. To edit a label, click the value that you want to edit, then make your desired changes.\n 2. To delete a label, hold the pointer over the key or value, then click delete .\n4. When you're finished updating labels, click **Save**.\n\n\u003cbr /\u003e\n\n\n### REST\n\nTo update a project's labels, do the following:\n\n- Get the `project` object using the\n [`projects.get()`](/resource-manager/reference/rest/v3/projects/get)\n method.\n\n- Modify the labels that you want to update.\n\n- Call the `projects.patch` method.\n\nThe following example updates the label `color:blue`:\n\nThe following code snippet changes the value of the `color` label from `blue`\nto `red`.\n\nRequest: \n\n PATCH https://cloudresourcemanager.googleapis.com/v3/projects/\u003cvar translate=\"no\"\u003ePROJECT_NAME\u003c/var\u003e\n {\n updateMask=labels\n }\n\nWhere \u003cvar translate=\"no\"\u003ePROJECT_NAME\u003c/var\u003e is the name of the project you want\nto update.\n\nRequest JSON body: \n\n {\n \"labels\":\n {\n \"color\": \"red\"\n }\n }\n\nResponse: \n\n {\n \"projects\": [\n {\n \"name\": \"projects/123456789012\",\n \"parent\": \"folders/123456789012\",\n \"projectId\": \"my-project\",\n \"state\": \"ACTIVE\",\n \"displayName\": \"\u003cvar translate=\"no\"\u003ePROJECT_NAME\u003c/var\u003e\"\n \"createTime\": \"2013-11-13T20:31:53.308Z\"\n \"updateTime\": \"2013-11-13T20:35:42.308Z\"\n \"etag\": \"BwWUlZ6XEfY=\"\n \"labels\": {\n \"color\": \"red\"\n },\n }\n ]\n }\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e"]]