Mantieni tutto organizzato con le raccolte
Salva e classifica i contenuti in base alle tue preferenze.
La pagina descrive i passaggi da completare prima di poter iniziare a utilizzare l'API Service Consumer Management. Si presume che tu abbia già un
Google Cloud progetto e un servizio gestito
(ad esempio un servizio gestito creato utilizzando Cloud Endpoints) nel
progetto e che tu abbia familiarità con le
unità di tenancy.
Attivazione del servizio
Sebbene l'API Service Consumer Management ti aiuti a gestire l'utilizzo dei tuoi
servizi gestiti, è anche un servizio
in sé. Pertanto, prima di poterla utilizzare, devi attivare l'API Service Consumer Management per il Google Cloud progetto che ospita il servizio gestito. Questo progetto è noto come progetto di produttore di servizi.
Il modo più semplice per abilitare l'API Service Consumer Management per il tuo progetto di produzione di servizi è utilizzare la Google Cloud console.
In alternativa, puoi attivarla dalla riga di comando o in modo programmatico. Puoi approfondire la questione in Abilitazione e disattivazione dei servizi.
Impostazione delle autorizzazioni
Dopo aver attivato l'API Service Consumer Management per il progetto producer di servizi, devi creare la tua identità di servizio e concederle le autorizzazioni per le tue risorse in modo che possa creare progetti tenant nelle tue cartelle e configurare l'account di fatturazione corretto sui progetti tenant. Queste azioni vengono eseguite da un account di servizio di proprietà dell'API Service Consumer Management, specificato nel seguente formato:
Assicurati di avere una cartella per contenere i progetti del tenant: dovrai avere un'organizzazione per creare cartelle all'interno del progetto di producer di servizi. Se non hai una
cartella, segui le istruzioni riportate in
Creare e gestire le cartelle
per crearne una. La cartella avrà un FOLDER_ID basato su un numero intero.
Nella cartella, assegna il ruolo Creator/Deleter del progetto all'account di servizio dell'API Service Consumer Management. Segui le istruzioni riportate in Configurazione dell'accesso alle cartelle per aggiungere i ruoli Creator di progetti e Cancellazione progetti utilizzando GCM_SA come utente.
Impostazione delle autorizzazioni per l'account di fatturazione
Assicurati di avere un account di fatturazione che possa essere condiviso per i progetti del tenant. Se non hai un account di fatturazione, consulta la sezione Creare, modificare o chiudere un account di fatturazione per istruzioni su come crearne uno.
Segui le
istruzioni
per aggiungere il ruolo Utente account di fatturazione a GCM_SA.
Requisiti delle risorse
L'API Service Consumer Management crea progetti tenant per tuo conto, quindi assicurati di disporre di una quota sufficiente per crearli.
Consulta la documentazione relativa ai limiti dei progetti per sapere quanti progetti possono essere creati per impostazione predefinita e per richiedere aumenti di questo limite.
[[["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,["# Getting Started with the Service Consumer Management API\n\nThe page describes the steps that need to be completed before you\ncan start to use the Service Consumer Management API. It assumes that you already have a\nGoogle Cloud project and a [managed service](/service-infrastructure/docs/glossary#managed)\n(such as a managed service created using [Cloud Endpoints](/endpoints/docs)) in\nthat project, and that you understand\n[Tenancy Units](/service-infrastructure/docs/glossary#tenancy).\n\nActivating the service\n----------------------\n\nWhile the Service Consumer Management API helps you to manage the usage of your own\n[managed services](/service-infrastructure/docs/glossary#managed), it is also a service\nitself. Therefore, before you can use it, you must activate the\nService Consumer Management API for the Google Cloud project that hosts your managed\nservice. This project is known as a [service producer](/service-infrastructure/docs/glossary#producer)\nproject.\n\nThe simplest way to enable the Service Consumer Management API for your service\nproducer project is to use the\n[Google Cloud console](https://console.cloud.google.com/apis/api/serviceconsumermanagement.googleapis.com).\nAlternatively, you can enable it from the command line or programmatically. You\ncan find out more in\n[Enabling and Disabling Services](/service-usage/docs/enable-disable).\n\nSetting permissions\n-------------------\n\nAfter the Service Consumer Management API is enabled for your service producer\nproject, you must create your own service identity and grant it permissions on\nyour resources so that it can create [tenant projects](/service-infrastructure/docs/glossary#tenant) in\nyour folders and set up the correct billing account on tenant projects. These\nactions are executed by a service account owned by the Service Consumer Management\nAPI, which is specified in the following format: \n\n```\nservice-PROJECT_NUMBER@service-consumer-management.iam.gserviceaccount.com\n```\n\nwhere *PROJECT_NUMBER* is the project number for your service producer project\nthat activated the Service Consumer Management service.\n\nThe remainder of this guide uses *GCM_SA* to represent the\nService Consumer Management API service account.\n\nYou can use the following commands to generate the service identity.\n\n1. Login with your user account.\n\n```\ngcloud auth login\n```\n\n1. Generate the service identity.\n\n```\ngcloud beta services identity create --service=serviceconsumermanagement.googleapis.com --project=PROJECT_ID\n```\n\n### Setting folder permissions\n\n1. Ensure that you have a folder for holding your tenant projects: you'll need\n to have an [Organization](/resource-manager/docs/creating-managing-organization)\n to create folders within your service producer project. If you don't have a\n folder, follow the instructions in\n [Creating and Managing Folders](/resource-manager/docs/creating-managing-folders#create-folder)\n to create one. Your folder will have an integer based *FOLDER_ID*.\n\n2. On your folder, assign the **Project Creator/Deleter** role to the\n Service Consumer Management API service account. Follow the instructions in\n [Configuring Access to Folders](/resource-manager/docs/creating-managing-folders#configuring_access_to_folders)\n to add the **Project Creator** and **Project Deleter** role, using *GCM_SA* as\n the user.\n\n### Setting billing account permissions\n\n1. Ensure that you have a billing account that can be shared for tenant\n projects. If you don't have a billing account, see\n [Create, Modify, or Close a Billing Account](/billing/docs/how-to/manage-billing-account)\n for instructions to create one.\n\n2. Follow the\n [instructions](/billing/docs/how-to/billing-access)\n to add the **Billing Account User** role to *GCM_SA*.\n\nResource requirements\n---------------------\n\n- The Service Consumer Management API creates [tenant projects](/service-infrastructure/docs/glossary#tenant) on your behalf, so ensure you have enough quota to create them.\n- See the [project limits](https://cloud.google.com/resource-manager/docs/limits#project-limits) documentation to know how many projects can be created by default and to request increases to that limit."]]