Classe EndpointServiceClient (1.3.0)

public class EndpointServiceClient implements BackgroundResource

Descrizione servizio: un servizio per la gestione degli endpoint di Vertex AI.

Questa classe offre la possibilità di effettuare chiamate remote al servizio di supporto tramite chiamate di metodi mappate ai metodi API. Codice campione per iniziare:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (EndpointServiceClient endpointServiceClient = EndpointServiceClient.create()) {
   EndpointName name =
       EndpointName.ofProjectLocationEndpointName("[PROJECT]", "[LOCATION]", "[ENDPOINT]");
   Endpoint response = endpointServiceClient.getEndpoint(name);
 }
 

Nota: chiudi() deve essere chiamato sull'oggetto EndpointServiceClient per pulire risorse come i thread. Nell'esempio precedente, viene utilizzato provi-with-resources, che chiama automaticamente chiudi().

Metodi
Metodo Descrizione Varianti di metodo

CreateEndpoint

Crea un endpoint.

Le varianti del metodo dell'oggetto Richiedi ricevono un solo parametro, ovvero un oggetto della richiesta, che deve essere creato prima della chiamata.

  • createEndpointAsync(CreateEndpointRequest request)

I metodi che restituiscono operazioni a lunga esecuzione hanno varianti di metodo "asincrone" che restituiscono OperationFuture, utilizzata per monitorare il polling del servizio.

  • createEndpointAsync(LocationName parent, Endpoint endpoint)

  • createEndpointAsync(String parent, Endpoint endpoint)

  • createEndpointAsync(LocationName parent, Endpoint endpoint, String endpointId)

  • createEndpointAsync(String parent, Endpoint endpoint, String endpointId)

Le varianti di metodo richiamabili non accettano parametri e restituiscono un oggetto richiamabile API immutabile, che può essere utilizzato per avviare chiamate al servizio.

  • createEndpointOperationCallable()

  • createEndpointCallable()

GetEndpoint

Recupera un endpoint.

Le varianti del metodo dell'oggetto Richiedi ricevono un solo parametro, ovvero un oggetto della richiesta, che deve essere creato prima della chiamata.

  • getEndpoint(GetEndpointRequest request)

Le varianti di metodo "appiattite" hanno convertito i campi dell'oggetto della richiesta in parametri di funzione per consentire più modi di chiamare lo stesso metodo.

  • getEndpoint(EndpointName name)

  • getEndpoint(String name)

Le varianti di metodo richiamabili non accettano parametri e restituiscono un oggetto richiamabile API immutabile, che può essere utilizzato per avviare chiamate al servizio.

  • getEndpointCallable()

ListEndpoints

Elenca gli endpoint in una località.

Le varianti del metodo dell'oggetto Richiedi ricevono un solo parametro, ovvero un oggetto della richiesta, che deve essere creato prima della chiamata.

  • listEndpoints(ListEndpointsRequest request)

Le varianti di metodo "appiattite" hanno convertito i campi dell'oggetto della richiesta in parametri di funzione per consentire più modi di chiamare lo stesso metodo.

  • listEndpoints(LocationName parent)

  • listEndpoints(String parent)

Le varianti di metodo richiamabili non accettano parametri e restituiscono un oggetto richiamabile API immutabile, che può essere utilizzato per avviare chiamate al servizio.

  • listEndpointsPagedCallable()

  • listEndpointsCallable()

UpdateEndpoint

Aggiorna un endpoint.

Le varianti del metodo dell'oggetto Richiedi ricevono un solo parametro, ovvero un oggetto della richiesta, che deve essere creato prima della chiamata.

  • updateEndpoint(UpdateEndpointRequest request)

Le varianti di metodo "appiattite" hanno convertito i campi dell'oggetto della richiesta in parametri di funzione per consentire più modi di chiamare lo stesso metodo.

  • updateEndpoint(Endpoint endpoint, FieldMask updateMask)

Le varianti di metodo richiamabili non accettano parametri e restituiscono un oggetto richiamabile API immutabile, che può essere utilizzato per avviare chiamate al servizio.

  • updateEndpointCallable()

DeleteEndpoint

Elimina un endpoint.

Le varianti del metodo dell'oggetto Richiedi ricevono un solo parametro, ovvero un oggetto della richiesta, che deve essere creato prima della chiamata.

  • deleteEndpointAsync(DeleteEndpointRequest request)

I metodi che restituiscono operazioni a lunga esecuzione hanno varianti di metodo "asincrone" che restituiscono OperationFuture, utilizzata per monitorare il polling del servizio.

  • deleteEndpointAsync(EndpointName name)

  • deleteEndpointAsync(String name)

Le varianti di metodo richiamabili non accettano parametri e restituiscono un oggetto richiamabile API immutabile, che può essere utilizzato per avviare chiamate al servizio.

  • deleteEndpointOperationCallable()

  • deleteEndpointCallable()

DeployModel

Esegue il deployment di un modello in questo endpoint, creando un modello implementato al suo interno.

Le varianti del metodo dell'oggetto Richiedi ricevono un solo parametro, ovvero un oggetto della richiesta, che deve essere creato prima della chiamata.

  • deployModelAsync(DeployModelRequest request)

I metodi che restituiscono operazioni a lunga esecuzione hanno varianti di metodo "asincrone" che restituiscono OperationFuture, utilizzata per monitorare il polling del servizio.

  • deployModelAsync(EndpointName endpoint, DeployedModel deployedModel, Map<String, Integer> trafficSplit)

  • deployModelAsync(String endpoint, DeployedModel deployedModel, Map<String, Integer> trafficSplit)

Le varianti di metodo richiamabili non accettano parametri e restituiscono un oggetto richiamabile API immutabile, che può essere utilizzato per avviare chiamate al servizio.

  • deployModelOperationCallable()

  • deployModelCallable()

UndeployModel

Annulla il deployment di un modello da un endpoint, rimuovendo un DeploymentedModel da quest'ultimo e liberando tutte le risorse che utilizza.

Le varianti del metodo dell'oggetto Richiedi ricevono un solo parametro, ovvero un oggetto della richiesta, che deve essere creato prima della chiamata.

  • undeployModelAsync(UndeployModelRequest request)

I metodi che restituiscono operazioni a lunga esecuzione hanno varianti di metodo "asincrone" che restituiscono OperationFuture, utilizzata per monitorare il polling del servizio.

  • undeployModelAsync(EndpointName endpoint, String deployedModelId, Map<String, Integer> trafficSplit)

  • undeployModelAsync(String endpoint, String deployedModelId, Map<String, Integer> trafficSplit)

Le varianti di metodo richiamabili non accettano parametri e restituiscono un oggetto richiamabile API immutabile, che può essere utilizzato per avviare chiamate al servizio.

  • undeployModelOperationCallable()

  • undeployModelCallable()

MutateDeployedModel

Aggiorna un modello esistente di cui è stato eseguito il deployment. I campi aggiornabili includono min_replica_count, max_replica_count, autoscaling_metric_specs, disable_container_logging (solo v1) e enable_container_logging (solo v1beta1).

Le varianti del metodo dell'oggetto Richiedi ricevono un solo parametro, ovvero un oggetto della richiesta, che deve essere creato prima della chiamata.

  • mutateDeployedModelAsync(MutateDeployedModelRequest request)

I metodi che restituiscono operazioni a lunga esecuzione hanno varianti di metodo "asincrone" che restituiscono OperationFuture, utilizzata per monitorare il polling del servizio.

  • mutateDeployedModelAsync(EndpointName endpoint, DeployedModel deployedModel, FieldMask updateMask)

  • mutateDeployedModelAsync(String endpoint, DeployedModel deployedModel, FieldMask updateMask)

Le varianti di metodo richiamabili non accettano parametri e restituiscono un oggetto richiamabile API immutabile, che può essere utilizzato per avviare chiamate al servizio.

  • mutateDeployedModelOperationCallable()

  • mutateDeployedModelCallable()

ListLocations

Elenca le informazioni sulle località supportate per questo servizio.

Le varianti del metodo dell'oggetto Richiedi ricevono un solo parametro, ovvero un oggetto della richiesta, che deve essere creato prima della chiamata.

  • listLocations(ListLocationsRequest request)

Le varianti di metodo richiamabili non accettano parametri e restituiscono un oggetto richiamabile API immutabile, che può essere utilizzato per avviare chiamate al servizio.

  • listLocationsPagedCallable()

  • listLocationsCallable()

GetLocation

Recupera le informazioni su una posizione.

Le varianti del metodo dell'oggetto Richiedi ricevono un solo parametro, ovvero un oggetto della richiesta, che deve essere creato prima della chiamata.

  • getLocation(GetLocationRequest request)

Le varianti di metodo richiamabili non accettano parametri e restituiscono un oggetto richiamabile API immutabile, che può essere utilizzato per avviare chiamate al servizio.

  • getLocationCallable()

SetIamPolicy

Imposta il criterio di controllo dell'accesso sulla risorsa specificata. Sostituisce qualsiasi criterio esistente.

Può restituire errori NOT_FOUND, INVALID_ARGUMENT e PERMISSION_DENIED.

Le varianti del metodo dell'oggetto Richiedi ricevono un solo parametro, ovvero un oggetto della richiesta, che deve essere creato prima della chiamata.

  • setIamPolicy(SetIamPolicyRequest request)

Le varianti di metodo richiamabili non accettano parametri e restituiscono un oggetto richiamabile API immutabile, che può essere utilizzato per avviare chiamate al servizio.

  • setIamPolicyCallable()

GetIamPolicy

Ottieni il criterio di controllo dell'accesso per una risorsa. Restituisce un criterio vuoto se la risorsa esiste e non è stato impostato un criterio.

Le varianti del metodo dell'oggetto Richiedi ricevono un solo parametro, ovvero un oggetto della richiesta, che deve essere creato prima della chiamata.

  • getIamPolicy(GetIamPolicyRequest request)

Le varianti di metodo richiamabili non accettano parametri e restituiscono un oggetto richiamabile API immutabile, che può essere utilizzato per avviare chiamate al servizio.

  • getIamPolicyCallable()

TestIamPermissions

Restituisce le autorizzazioni di cui un chiamante dispone per la risorsa specificata. Se la risorsa non esiste, verrà restituito un insieme di autorizzazioni vuoto, non un errore NOT_FOUND.

Nota: questa operazione è progettata per essere utilizzata per le UI e gli strumenti a riga di comando che consentono la creazione di autorizzazioni, non per il controllo delle autorizzazioni. Questa operazione potrebbe non riuscire ad aprirsi senza preavviso.

Le varianti del metodo dell'oggetto Richiedi ricevono un solo parametro, ovvero un oggetto della richiesta, che deve essere creato prima della chiamata.

  • testIamPermissions(TestIamPermissionsRequest request)

Le varianti di metodo richiamabili non accettano parametri e restituiscono un oggetto richiamabile API immutabile, che può essere utilizzato per avviare chiamate al servizio.

  • testIamPermissionsCallable()

Consulta i singoli metodi per vedere il codice di esempio.

Molti parametri richiedono che i nomi delle risorse siano formattati in un determinato modo. Per facilitare questi nomi, questa classe include un metodo di formattazione per ogni tipo di nome e un metodo di analisi per estrarre i singoli identificatori contenuti all'interno dei nomi che vengono restituiti.

Questa classe può essere personalizzata passando un'istanza personalizzata di EndpointServiceSettings a create(). Ad esempio:

Per personalizzare le credenziali:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 EndpointServiceSettings endpointServiceSettings =
     EndpointServiceSettings.newBuilder()
         .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
         .build();
 EndpointServiceClient endpointServiceClient =
     EndpointServiceClient.create(endpointServiceSettings);
 

Per personalizzare l'endpoint:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 EndpointServiceSettings endpointServiceSettings =
     EndpointServiceSettings.newBuilder().setEndpoint(myEndpoint).build();
 EndpointServiceClient endpointServiceClient =
     EndpointServiceClient.create(endpointServiceSettings);
 

Per utilizzare il trasporto REST (HTTP1.1/JSON) (invece di gRPC) per l'invio e la ricezione delle richieste via rete:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 EndpointServiceSettings endpointServiceSettings =
     EndpointServiceSettings.newHttpJsonBuilder().build();
 EndpointServiceClient endpointServiceClient =
     EndpointServiceClient.create(endpointServiceSettings);
 

Fai riferimento agli esempi del repository GitHub per altri snippet di codice per la guida rapida.

Ereditarietà

java.lang.Object > EndpointServiceClient

Implementa

BackgroundResource

Metodi statici

creare()

public static final EndpointServiceClient create()

Crea un'istanza di EndpointServiceClient con impostazioni predefinite.

Restituisce
Tipo Description
EndpointServiceClient
Eccezioni
Tipo Description
IOException

create(impostazioni EndpointServiceSettings)

public static final EndpointServiceClient create(EndpointServiceSettings settings)

Crea un'istanza di EndpointServiceClient, utilizzando le impostazioni specificate. I canali vengono creati in base alle impostazioni trasmesse o ai valori predefiniti di qualsiasi impostazione non configurata.

Parametro
Nome Description
settings EndpointServiceSettings
Restituisce
Tipo Description
EndpointServiceClient
Eccezioni
Tipo Description
IOException

create(stub EndpointServiceStub)

public static final EndpointServiceClient create(EndpointServiceStub stub)

Crea un'istanza di EndpointServiceClient, utilizzando lo stub specificato per effettuare chiamate. Questa opzione è per un utilizzo avanzato, è preferibile utilizzare create(EndpointServiceSettings).

Parametro
Nome Description
stub EndpointServiceStub
Restituisce
Tipo Description
EndpointServiceClient

Costruttori

EndpointServiceClient(EndpointServiceSettings settings)

protected EndpointServiceClient(EndpointServiceSettings settings)

Crea un'istanza di EndpointServiceClient, utilizzando le impostazioni specificate. Questo è protetto in modo da semplificare la creazione di una sottoclasse, ma altrimenti i metodi di fabbrica statici dovrebbero essere preferiti.

Parametro
Nome Description
settings EndpointServiceSettings

EndpointServiceClient(EndpointServiceStub stub)

protected EndpointServiceClient(EndpointServiceStub stub)
Parametro
Nome Description
stub EndpointServiceStub

Metodi

awaitTermination(long duration, TimeUnit unit)

public boolean awaitTermination(long duration, TimeUnit unit)
Parametri
Nome Description
duration long
unit TimeUnit
Restituisce
Tipo Description
boolean
Eccezioni
Tipo Description
InterruptedException

chiudi()

public final void close()

createEndpointAsync(CreateEndpointRequest request)

public final OperationFuture<Endpoint,CreateEndpointOperationMetadata> createEndpointAsync(CreateEndpointRequest request)

Crea un endpoint.

Codice campione:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (EndpointServiceClient endpointServiceClient = EndpointServiceClient.create()) {
   CreateEndpointRequest request =
       CreateEndpointRequest.newBuilder()
           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
           .setEndpoint(Endpoint.newBuilder().build())
           .setEndpointId("endpointId-1837754992")
           .build();
   Endpoint response = endpointServiceClient.createEndpointAsync(request).get();
 }
 
Parametro
Nome Description
request CreateEndpointRequest

L'oggetto della richiesta contenente tutti i parametri per la chiamata API.

Restituisce
Tipo Description
OperationFuture<Endpoint,CreateEndpointOperationMetadata>

createEndpointAsync(LocationName parent, Endpoint endpoint)

public final OperationFuture<Endpoint,CreateEndpointOperationMetadata> createEndpointAsync(LocationName parent, Endpoint endpoint)

Crea un endpoint.

Codice campione:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (EndpointServiceClient endpointServiceClient = EndpointServiceClient.create()) {
   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
   Endpoint endpoint = Endpoint.newBuilder().build();
   Endpoint response = endpointServiceClient.createEndpointAsync(parent, endpoint).get();
 }
 
Parametri
Nome Description
parent LocationName

Obbligatorio. Il nome della risorsa della località in cui creare l'endpoint. Formato: projects/{project}/locations/{location}

endpoint Endpoint

Obbligatorio. L'endpoint da creare.

Restituisce
Tipo Description
OperationFuture<Endpoint,CreateEndpointOperationMetadata>

createEndpointAsync(LocationName parent, Endpoint endpoint, String endpointId)

public final OperationFuture<Endpoint,CreateEndpointOperationMetadata> createEndpointAsync(LocationName parent, Endpoint endpoint, String endpointId)

Crea un endpoint.

Codice campione:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (EndpointServiceClient endpointServiceClient = EndpointServiceClient.create()) {
   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
   Endpoint endpoint = Endpoint.newBuilder().build();
   String endpointId = "endpointId-1837754992";
   Endpoint response =
       endpointServiceClient.createEndpointAsync(parent, endpoint, endpointId).get();
 }
 
Parametri
Nome Description
parent LocationName

Obbligatorio. Il nome della risorsa della località in cui creare l'endpoint. Formato: projects/{project}/locations/{location}

endpoint Endpoint

Obbligatorio. L'endpoint da creare.

endpointId String

Immutabile. L'ID da utilizzare per l'endpoint, che diventerà il componente finale del nome della risorsa endpoint. Se non specificato, Vertex AI genererà un valore per questo ID.

Se il primo carattere è una lettera, questo valore può contenere fino a 63 caratteri, mentre i caratteri validi sono [a-z0-9-]. L'ultimo carattere deve essere una lettera o un numero.

Se il primo carattere è un numero, questo valore può contenere fino a 9 caratteri, mentre i caratteri validi sono [0-9] senza zeri iniziali.

Quando utilizzi HTTP/JSON, questo campo viene compilato in base all'argomento di una stringa di query, come ?endpoint_id=12345. Questo è il fallback per i campi che non sono inclusi nell'URI o nel corpo.

Restituisce
Tipo Description
OperationFuture<Endpoint,CreateEndpointOperationMetadata>

createEndpointAsync(String parent, Endpoint endpoint)

public final OperationFuture<Endpoint,CreateEndpointOperationMetadata> createEndpointAsync(String parent, Endpoint endpoint)

Crea un endpoint.

Codice campione:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (EndpointServiceClient endpointServiceClient = EndpointServiceClient.create()) {
   String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
   Endpoint endpoint = Endpoint.newBuilder().build();
   Endpoint response = endpointServiceClient.createEndpointAsync(parent, endpoint).get();
 }
 
Parametri
Nome Description
parent String

Obbligatorio. Il nome della risorsa della località in cui creare l'endpoint. Formato: projects/{project}/locations/{location}

endpoint Endpoint

Obbligatorio. L'endpoint da creare.

Restituisce
Tipo Description
OperationFuture<Endpoint,CreateEndpointOperationMetadata>

createEndpointAsync(String parent, Endpoint endpoint, String endpointId)

public final OperationFuture<Endpoint,CreateEndpointOperationMetadata> createEndpointAsync(String parent, Endpoint endpoint, String endpointId)

Crea un endpoint.

Codice campione:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (EndpointServiceClient endpointServiceClient = EndpointServiceClient.create()) {
   String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
   Endpoint endpoint = Endpoint.newBuilder().build();
   String endpointId = "endpointId-1837754992";
   Endpoint response =
       endpointServiceClient.createEndpointAsync(parent, endpoint, endpointId).get();
 }
 
Parametri
Nome Description
parent String

Obbligatorio. Il nome della risorsa della località in cui creare l'endpoint. Formato: projects/{project}/locations/{location}

endpoint Endpoint

Obbligatorio. L'endpoint da creare.

endpointId String

Immutabile. L'ID da utilizzare per l'endpoint, che diventerà il componente finale del nome della risorsa endpoint. Se non specificato, Vertex AI genererà un valore per questo ID.

Se il primo carattere è una lettera, questo valore può contenere fino a 63 caratteri, mentre i caratteri validi sono [a-z0-9-]. L'ultimo carattere deve essere una lettera o un numero.

Se il primo carattere è un numero, questo valore può contenere fino a 9 caratteri, mentre i caratteri validi sono [0-9] senza zeri iniziali.

Quando utilizzi HTTP/JSON, questo campo viene compilato in base all'argomento di una stringa di query, come ?endpoint_id=12345. Questo è il fallback per i campi che non sono inclusi nell'URI o nel corpo.

Restituisce
Tipo Description
OperationFuture<Endpoint,CreateEndpointOperationMetadata>

createEndpointCallable()

public final UnaryCallable<CreateEndpointRequest,Operation> createEndpointCallable()

Crea un endpoint.

Codice campione:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (EndpointServiceClient endpointServiceClient = EndpointServiceClient.create()) {
   CreateEndpointRequest request =
       CreateEndpointRequest.newBuilder()
           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
           .setEndpoint(Endpoint.newBuilder().build())
           .setEndpointId("endpointId-1837754992")
           .build();
   ApiFuture<Operation> future =
       endpointServiceClient.createEndpointCallable().futureCall(request);
   // Do something.
   Operation response = future.get();
 }
 
Restituisce
Tipo Description
UnaryCallable<CreateEndpointRequest,Operation>

createEndpointOperationCallable()

public final OperationCallable<CreateEndpointRequest,Endpoint,CreateEndpointOperationMetadata> createEndpointOperationCallable()

Crea un endpoint.

Codice campione:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (EndpointServiceClient endpointServiceClient = EndpointServiceClient.create()) {
   CreateEndpointRequest request =
       CreateEndpointRequest.newBuilder()
           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
           .setEndpoint(Endpoint.newBuilder().build())
           .setEndpointId("endpointId-1837754992")
           .build();
   OperationFuture<Endpoint, CreateEndpointOperationMetadata> future =
       endpointServiceClient.createEndpointOperationCallable().futureCall(request);
   // Do something.
   Endpoint response = future.get();
 }
 
Restituisce
Tipo Description
OperationCallable<CreateEndpointRequest,Endpoint,CreateEndpointOperationMetadata>

deleteEndpointAsync(DeleteEndpointRequest request)

public final OperationFuture<Empty,DeleteOperationMetadata> deleteEndpointAsync(DeleteEndpointRequest request)

Elimina un endpoint.

Codice campione:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (EndpointServiceClient endpointServiceClient = EndpointServiceClient.create()) {
   DeleteEndpointRequest request =
       DeleteEndpointRequest.newBuilder()
           .setName(
               EndpointName.ofProjectLocationEndpointName(
                       "[PROJECT]", "[LOCATION]", "[ENDPOINT]")
                   .toString())
           .build();
   endpointServiceClient.deleteEndpointAsync(request).get();
 }
 
Parametro
Nome Description
request DeleteEndpointRequest

L'oggetto della richiesta contenente tutti i parametri per la chiamata API.

Restituisce
Tipo Description
OperationFuture<Empty,DeleteOperationMetadata>

deleteEndpointAsync(EndpointName name)

public final OperationFuture<Empty,DeleteOperationMetadata> deleteEndpointAsync(EndpointName name)

Elimina un endpoint.

Codice campione:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (EndpointServiceClient endpointServiceClient = EndpointServiceClient.create()) {
   EndpointName name =
       EndpointName.ofProjectLocationEndpointName("[PROJECT]", "[LOCATION]", "[ENDPOINT]");
   endpointServiceClient.deleteEndpointAsync(name).get();
 }
 
Parametro
Nome Description
name EndpointName

Obbligatorio. Il nome della risorsa endpoint da eliminare. Formato: projects/{project}/locations/{location}/endpoints/{endpoint}

Restituisce
Tipo Description
OperationFuture<Empty,DeleteOperationMetadata>

deleteEndpointAsync(String name)

public final OperationFuture<Empty,DeleteOperationMetadata> deleteEndpointAsync(String name)

Elimina un endpoint.

Codice campione:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (EndpointServiceClient endpointServiceClient = EndpointServiceClient.create()) {
   String name =
       EndpointName.ofProjectLocationEndpointName("[PROJECT]", "[LOCATION]", "[ENDPOINT]")
           .toString();
   endpointServiceClient.deleteEndpointAsync(name).get();
 }
 
Parametro
Nome Description
name String

Obbligatorio. Il nome della risorsa endpoint da eliminare. Formato: projects/{project}/locations/{location}/endpoints/{endpoint}

Restituisce
Tipo Description
OperationFuture<Empty,DeleteOperationMetadata>

deleteEndpointCallable()

public final UnaryCallable<DeleteEndpointRequest,Operation> deleteEndpointCallable()

Elimina un endpoint.

Codice campione:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (EndpointServiceClient endpointServiceClient = EndpointServiceClient.create()) {
   DeleteEndpointRequest request =
       DeleteEndpointRequest.newBuilder()
           .setName(
               EndpointName.ofProjectLocationEndpointName(
                       "[PROJECT]", "[LOCATION]", "[ENDPOINT]")
                   .toString())
           .build();
   ApiFuture<Operation> future =
       endpointServiceClient.deleteEndpointCallable().futureCall(request);
   // Do something.
   future.get();
 }
 
Restituisce
Tipo Description
UnaryCallable<DeleteEndpointRequest,Operation>

deleteEndpointOperationCallable()

public final OperationCallable<DeleteEndpointRequest,Empty,DeleteOperationMetadata> deleteEndpointOperationCallable()

Elimina un endpoint.

Codice campione:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (EndpointServiceClient endpointServiceClient = EndpointServiceClient.create()) {
   DeleteEndpointRequest request =
       DeleteEndpointRequest.newBuilder()
           .setName(
               EndpointName.ofProjectLocationEndpointName(
                       "[PROJECT]", "[LOCATION]", "[ENDPOINT]")
                   .toString())
           .build();
   OperationFuture<Empty, DeleteOperationMetadata> future =
       endpointServiceClient.deleteEndpointOperationCallable().futureCall(request);
   // Do something.
   future.get();
 }
 
Restituisce
Tipo Description
OperationCallable<DeleteEndpointRequest,Empty,DeleteOperationMetadata>

deployModelAsync(DeployModelRequest request)

public final OperationFuture<DeployModelResponse,DeployModelOperationMetadata> deployModelAsync(DeployModelRequest request)

Esegue il deployment di un modello in questo endpoint, creando un modello implementato al suo interno.

Codice campione:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (EndpointServiceClient endpointServiceClient = EndpointServiceClient.create()) {
   DeployModelRequest request =
       DeployModelRequest.newBuilder()
           .setEndpoint(
               EndpointName.ofProjectLocationEndpointName(
                       "[PROJECT]", "[LOCATION]", "[ENDPOINT]")
                   .toString())
           .setDeployedModel(DeployedModel.newBuilder().build())
           .putAllTrafficSplit(new HashMap<String, Integer>())
           .build();
   DeployModelResponse response = endpointServiceClient.deployModelAsync(request).get();
 }
 
Parametro
Nome Description
request DeployModelRequest

L'oggetto della richiesta contenente tutti i parametri per la chiamata API.

Restituisce
Tipo Description
OperationFuture<DeployModelResponse,DeployModelOperationMetadata>

deployModelAsync(EndpointName endpoint, DeployedModel deployedModel, Map<String,Integer> trafficSplit)

public final OperationFuture<DeployModelResponse,DeployModelOperationMetadata> deployModelAsync(EndpointName endpoint, DeployedModel deployedModel, Map<String,Integer> trafficSplit)

Esegue il deployment di un modello in questo endpoint, creando un modello implementato al suo interno.

Codice campione:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (EndpointServiceClient endpointServiceClient = EndpointServiceClient.create()) {
   EndpointName endpoint =
       EndpointName.ofProjectLocationEndpointName("[PROJECT]", "[LOCATION]", "[ENDPOINT]");
   DeployedModel deployedModel = DeployedModel.newBuilder().build();
   Map<String, Integer> trafficSplit = new HashMap<>();
   DeployModelResponse response =
       endpointServiceClient.deployModelAsync(endpoint, deployedModel, trafficSplit).get();
 }
 
Parametri
Nome Description
endpoint EndpointName

Obbligatorio. Il nome della risorsa endpoint in cui eseguire il deployment di un modello. Formato: projects/{project}/locations/{location}/endpoints/{endpoint}

deployedModel DeployedModel

Obbligatorio. Il modello Deployed da creare all'interno dell'endpoint. Tieni presente che è necessario aggiornare Endpoint.traffic_split affinché DeployedModel inizi a ricevere traffico, come parte di questa chiamata o tramite EndpointService.UpdateEndpoint.

trafficSplit Map<String,Integer>

Una mappa dall'ID di un DeployedModel alla percentuale di traffico di questo endpoint che deve essere inoltrato a quel DeployedModel.

Se questo campo non è vuoto, il valore traffic_split dell'endpoint verrà sovrascritto. Per fare riferimento all'ID del modello di cui è stato appena eseguito il deployment, è necessario utilizzare uno "0" e l'ID effettivo del nuovo modello DeployedModel verrà compilato al posto con questo metodo. La somma dei valori percentuali di traffico deve essere pari a 100.

Se questo campo è vuoto, il valore traffic_split dell'endpoint non viene aggiornato.

Restituisce
Tipo Description
OperationFuture<DeployModelResponse,DeployModelOperationMetadata>

deployModelAsync(String endpoint, DeployedModel deployedModel, Map<String,Integer> trafficSplit)

public final OperationFuture<DeployModelResponse,DeployModelOperationMetadata> deployModelAsync(String endpoint, DeployedModel deployedModel, Map<String,Integer> trafficSplit)

Esegue il deployment di un modello in questo endpoint, creando un modello implementato al suo interno.

Codice campione:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (EndpointServiceClient endpointServiceClient = EndpointServiceClient.create()) {
   String endpoint =
       EndpointName.ofProjectLocationEndpointName("[PROJECT]", "[LOCATION]", "[ENDPOINT]")
           .toString();
   DeployedModel deployedModel = DeployedModel.newBuilder().build();
   Map<String, Integer> trafficSplit = new HashMap<>();
   DeployModelResponse response =
       endpointServiceClient.deployModelAsync(endpoint, deployedModel, trafficSplit).get();
 }
 
Parametri
Nome Description
endpoint String

Obbligatorio. Il nome della risorsa endpoint in cui eseguire il deployment di un modello. Formato: projects/{project}/locations/{location}/endpoints/{endpoint}

deployedModel DeployedModel

Obbligatorio. Il modello Deployed da creare all'interno dell'endpoint. Tieni presente che è necessario aggiornare Endpoint.traffic_split affinché DeployedModel inizi a ricevere traffico, come parte di questa chiamata o tramite EndpointService.UpdateEndpoint.

trafficSplit Map<String,Integer>

Una mappa dall'ID di un DeployedModel alla percentuale di traffico di questo endpoint che deve essere inoltrato a quel DeployedModel.

Se questo campo non è vuoto, il valore traffic_split dell'endpoint verrà sovrascritto. Per fare riferimento all'ID del modello di cui è stato appena eseguito il deployment, è necessario utilizzare uno "0" e l'ID effettivo del nuovo modello DeployedModel verrà compilato al posto con questo metodo. La somma dei valori percentuali di traffico deve essere pari a 100.

Se questo campo è vuoto, il valore traffic_split dell'endpoint non viene aggiornato.

Restituisce
Tipo Description
OperationFuture<DeployModelResponse,DeployModelOperationMetadata>

deployModelCallable()

public final UnaryCallable<DeployModelRequest,Operation> deployModelCallable()

Esegue il deployment di un modello in questo endpoint, creando un modello implementato al suo interno.

Codice campione:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (EndpointServiceClient endpointServiceClient = EndpointServiceClient.create()) {
   DeployModelRequest request =
       DeployModelRequest.newBuilder()
           .setEndpoint(
               EndpointName.ofProjectLocationEndpointName(
                       "[PROJECT]", "[LOCATION]", "[ENDPOINT]")
                   .toString())
           .setDeployedModel(DeployedModel.newBuilder().build())
           .putAllTrafficSplit(new HashMap<String, Integer>())
           .build();
   ApiFuture<Operation> future = endpointServiceClient.deployModelCallable().futureCall(request);
   // Do something.
   Operation response = future.get();
 }
 
Restituisce
Tipo Description
UnaryCallable<DeployModelRequest,Operation>

deployModelOperationCallable()

public final OperationCallable<DeployModelRequest,DeployModelResponse,DeployModelOperationMetadata> deployModelOperationCallable()

Esegue il deployment di un modello in questo endpoint, creando un modello implementato al suo interno.

Codice campione:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (EndpointServiceClient endpointServiceClient = EndpointServiceClient.create()) {
   DeployModelRequest request =
       DeployModelRequest.newBuilder()
           .setEndpoint(
               EndpointName.ofProjectLocationEndpointName(
                       "[PROJECT]", "[LOCATION]", "[ENDPOINT]")
                   .toString())
           .setDeployedModel(DeployedModel.newBuilder().build())
           .putAllTrafficSplit(new HashMap<String, Integer>())
           .build();
   OperationFuture<DeployModelResponse, DeployModelOperationMetadata> future =
       endpointServiceClient.deployModelOperationCallable().futureCall(request);
   // Do something.
   DeployModelResponse response = future.get();
 }
 
Restituisce
Tipo Description
OperationCallable<DeployModelRequest,DeployModelResponse,DeployModelOperationMetadata>

getEndpoint(EndpointName name)

public final Endpoint getEndpoint(EndpointName name)

Recupera un endpoint.

Codice campione:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (EndpointServiceClient endpointServiceClient = EndpointServiceClient.create()) {
   EndpointName name =
       EndpointName.ofProjectLocationEndpointName("[PROJECT]", "[LOCATION]", "[ENDPOINT]");
   Endpoint response = endpointServiceClient.getEndpoint(name);
 }
 
Parametro
Nome Description
name EndpointName

Obbligatorio. Il nome della risorsa endpoint. Formato: projects/{project}/locations/{location}/endpoints/{endpoint}

Restituisce
Tipo Description
Endpoint

getEndpoint(GetEndpointRequest request)

public final Endpoint getEndpoint(GetEndpointRequest request)

Recupera un endpoint.

Codice campione:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (EndpointServiceClient endpointServiceClient = EndpointServiceClient.create()) {
   GetEndpointRequest request =
       GetEndpointRequest.newBuilder()
           .setName(
               EndpointName.ofProjectLocationEndpointName(
                       "[PROJECT]", "[LOCATION]", "[ENDPOINT]")
                   .toString())
           .build();
   Endpoint response = endpointServiceClient.getEndpoint(request);
 }
 
Parametro
Nome Description
request GetEndpointRequest

L'oggetto della richiesta contenente tutti i parametri per la chiamata API.

Restituisce
Tipo Description
Endpoint

getEndpoint(String name)

public final Endpoint getEndpoint(String name)

Recupera un endpoint.

Codice campione:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (EndpointServiceClient endpointServiceClient = EndpointServiceClient.create()) {
   String name =
       EndpointName.ofProjectLocationEndpointName("[PROJECT]", "[LOCATION]", "[ENDPOINT]")
           .toString();
   Endpoint response = endpointServiceClient.getEndpoint(name);
 }
 
Parametro
Nome Description
name String

Obbligatorio. Il nome della risorsa endpoint. Formato: projects/{project}/locations/{location}/endpoints/{endpoint}

Restituisce
Tipo Description
Endpoint

getEndpointCallable()

public final UnaryCallable<GetEndpointRequest,Endpoint> getEndpointCallable()

Recupera un endpoint.

Codice campione:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (EndpointServiceClient endpointServiceClient = EndpointServiceClient.create()) {
   GetEndpointRequest request =
       GetEndpointRequest.newBuilder()
           .setName(
               EndpointName.ofProjectLocationEndpointName(
                       "[PROJECT]", "[LOCATION]", "[ENDPOINT]")
                   .toString())
           .build();
   ApiFuture<Endpoint> future = endpointServiceClient.getEndpointCallable().futureCall(request);
   // Do something.
   Endpoint response = future.get();
 }
 
Restituisce
Tipo Description
UnaryCallable<GetEndpointRequest,Endpoint>

getHttpJsonOperationsClient()

public final OperationsClient getHttpJsonOperationsClient()

Restituisce il valore OperationsClient che può essere utilizzato per eseguire query sullo stato di un'operazione a lunga esecuzione restituita da un'altra chiamata al metodo API.

Restituisce
Tipo Description
OperationsClient

getIamPolicy(GetIamPolicyRequest request)

public final Policy getIamPolicy(GetIamPolicyRequest request)

Ottieni il criterio di controllo dell'accesso per una risorsa. Restituisce un criterio vuoto se la risorsa esiste e non è stato impostato un criterio.

Codice campione:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (EndpointServiceClient endpointServiceClient = EndpointServiceClient.create()) {
   GetIamPolicyRequest request =
       GetIamPolicyRequest.newBuilder()
           .setResource(
               EndpointName.ofProjectLocationEndpointName(
                       "[PROJECT]", "[LOCATION]", "[ENDPOINT]")
                   .toString())
           .setOptions(GetPolicyOptions.newBuilder().build())
           .build();
   Policy response = endpointServiceClient.getIamPolicy(request);
 }
 
Parametro
Nome Description
request com.google.iam.v1.GetIamPolicyRequest

L'oggetto della richiesta contenente tutti i parametri per la chiamata API.

Restituisce
Tipo Description
com.google.iam.v1.Policy

getIamPolicyCallable()

public final UnaryCallable<GetIamPolicyRequest,Policy> getIamPolicyCallable()

Ottieni il criterio di controllo dell'accesso per una risorsa. Restituisce un criterio vuoto se la risorsa esiste e non è stato impostato un criterio.

Codice campione:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (EndpointServiceClient endpointServiceClient = EndpointServiceClient.create()) {
   GetIamPolicyRequest request =
       GetIamPolicyRequest.newBuilder()
           .setResource(
               EndpointName.ofProjectLocationEndpointName(
                       "[PROJECT]", "[LOCATION]", "[ENDPOINT]")
                   .toString())
           .setOptions(GetPolicyOptions.newBuilder().build())
           .build();
   ApiFuture<Policy> future = endpointServiceClient.getIamPolicyCallable().futureCall(request);
   // Do something.
   Policy response = future.get();
 }
 
Restituisce
Tipo Description
UnaryCallable<com.google.iam.v1.GetIamPolicyRequest,com.google.iam.v1.Policy>

getLocation(GetLocationRequest request)

public final Location getLocation(GetLocationRequest request)

Recupera le informazioni su una posizione.

Codice campione:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (EndpointServiceClient endpointServiceClient = EndpointServiceClient.create()) {
   GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build();
   Location response = endpointServiceClient.getLocation(request);
 }
 
Parametro
Nome Description
request com.google.cloud.location.GetLocationRequest

L'oggetto della richiesta contenente tutti i parametri per la chiamata API.

Restituisce
Tipo Description
com.google.cloud.location.Location

getLocationCallable()

public final UnaryCallable<GetLocationRequest,Location> getLocationCallable()

Recupera le informazioni su una posizione.

Codice campione:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (EndpointServiceClient endpointServiceClient = EndpointServiceClient.create()) {
   GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build();
   ApiFuture<Location> future = endpointServiceClient.getLocationCallable().futureCall(request);
   // Do something.
   Location response = future.get();
 }
 
Restituisce
Tipo Description
UnaryCallable<com.google.cloud.location.GetLocationRequest,com.google.cloud.location.Location>

getOperationsClient()

public final OperationsClient getOperationsClient()

Restituisce il valore OperationsClient che può essere utilizzato per eseguire query sullo stato di un'operazione a lunga esecuzione restituita da un'altra chiamata al metodo API.

Restituisce
Tipo Description
OperationsClient

getSettings()

public final EndpointServiceSettings getSettings()
Restituisce
Tipo Description
EndpointServiceSettings

getStub()

public EndpointServiceStub getStub()
Restituisce
Tipo Description
EndpointServiceStub

isShutdown()

public boolean isShutdown()
Restituisce
Tipo Description
boolean

isTerminated()

public boolean isTerminated()
Restituisce
Tipo Description
boolean

listEndpoints(ListEndpointsRequest request)

public final EndpointServiceClient.ListEndpointsPagedResponse listEndpoints(ListEndpointsRequest request)

Elenca gli endpoint in una località.

Codice campione:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (EndpointServiceClient endpointServiceClient = EndpointServiceClient.create()) {
   ListEndpointsRequest request =
       ListEndpointsRequest.newBuilder()
           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
           .setFilter("filter-1274492040")
           .setPageSize(883849137)
           .setPageToken("pageToken873572522")
           .setReadMask(FieldMask.newBuilder().build())
           .setOrderBy("orderBy-1207110587")
           .build();
   for (Endpoint element : endpointServiceClient.listEndpoints(request).iterateAll()) {
     // doThingsWith(element);
   }
 }
 
Parametro
Nome Description
request ListEndpointsRequest

L'oggetto della richiesta contenente tutti i parametri per la chiamata API.

Restituisce
Tipo Description
EndpointServiceClient.ListEndpointsPagedResponse

listEndpoints(LocationName parent)

public final EndpointServiceClient.ListEndpointsPagedResponse listEndpoints(LocationName parent)

Elenca gli endpoint in una località.

Codice campione:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (EndpointServiceClient endpointServiceClient = EndpointServiceClient.create()) {
   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
   for (Endpoint element : endpointServiceClient.listEndpoints(parent).iterateAll()) {
     // doThingsWith(element);
   }
 }
 
Parametro
Nome Description
parent LocationName

Obbligatorio. Il nome della risorsa della località da cui elencare gli endpoint. Formato: projects/{project}/locations/{location}

Restituisce
Tipo Description
EndpointServiceClient.ListEndpointsPagedResponse

listEndpoints(String parent)

public final EndpointServiceClient.ListEndpointsPagedResponse listEndpoints(String parent)

Elenca gli endpoint in una località.

Codice campione:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (EndpointServiceClient endpointServiceClient = EndpointServiceClient.create()) {
   String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
   for (Endpoint element : endpointServiceClient.listEndpoints(parent).iterateAll()) {
     // doThingsWith(element);
   }
 }
 
Parametro
Nome Description
parent String

Obbligatorio. Il nome della risorsa della località da cui elencare gli endpoint. Formato: projects/{project}/locations/{location}

Restituisce
Tipo Description
EndpointServiceClient.ListEndpointsPagedResponse

listEndpointsCallable()

public final UnaryCallable<ListEndpointsRequest,ListEndpointsResponse> listEndpointsCallable()

Elenca gli endpoint in una località.

Codice campione:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (EndpointServiceClient endpointServiceClient = EndpointServiceClient.create()) {
   ListEndpointsRequest request =
       ListEndpointsRequest.newBuilder()
           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
           .setFilter("filter-1274492040")
           .setPageSize(883849137)
           .setPageToken("pageToken873572522")
           .setReadMask(FieldMask.newBuilder().build())
           .setOrderBy("orderBy-1207110587")
           .build();
   while (true) {
     ListEndpointsResponse response =
         endpointServiceClient.listEndpointsCallable().call(request);
     for (Endpoint element : response.getEndpointsList()) {
       // doThingsWith(element);
     }
     String nextPageToken = response.getNextPageToken();
     if (!Strings.isNullOrEmpty(nextPageToken)) {
       request = request.toBuilder().setPageToken(nextPageToken).build();
     } else {
       break;
     }
   }
 }
 
Restituisce
Tipo Description
UnaryCallable<ListEndpointsRequest,ListEndpointsResponse>

listEndpointsPagedCallable()

public final UnaryCallable<ListEndpointsRequest,EndpointServiceClient.ListEndpointsPagedResponse> listEndpointsPagedCallable()

Elenca gli endpoint in una località.

Codice campione:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (EndpointServiceClient endpointServiceClient = EndpointServiceClient.create()) {
   ListEndpointsRequest request =
       ListEndpointsRequest.newBuilder()
           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
           .setFilter("filter-1274492040")
           .setPageSize(883849137)
           .setPageToken("pageToken873572522")
           .setReadMask(FieldMask.newBuilder().build())
           .setOrderBy("orderBy-1207110587")
           .build();
   ApiFuture<Endpoint> future =
       endpointServiceClient.listEndpointsPagedCallable().futureCall(request);
   // Do something.
   for (Endpoint element : future.get().iterateAll()) {
     // doThingsWith(element);
   }
 }
 
Restituisce
Tipo Description
UnaryCallable<ListEndpointsRequest,ListEndpointsPagedResponse>

listLocations(ListLocationsRequest request)

public final EndpointServiceClient.ListLocationsPagedResponse listLocations(ListLocationsRequest request)

Elenca le informazioni sulle località supportate per questo servizio.

Codice campione:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (EndpointServiceClient endpointServiceClient = EndpointServiceClient.create()) {
   ListLocationsRequest request =
       ListLocationsRequest.newBuilder()
           .setName("name3373707")
           .setFilter("filter-1274492040")
           .setPageSize(883849137)
           .setPageToken("pageToken873572522")
           .build();
   for (Location element : endpointServiceClient.listLocations(request).iterateAll()) {
     // doThingsWith(element);
   }
 }
 
Parametro
Nome Description
request com.google.cloud.location.ListLocationsRequest

L'oggetto della richiesta contenente tutti i parametri per la chiamata API.

Restituisce
Tipo Description
EndpointServiceClient.ListLocationsPagedResponse

listLocationsCallable()

public final UnaryCallable<ListLocationsRequest,ListLocationsResponse> listLocationsCallable()

Elenca le informazioni sulle località supportate per questo servizio.

Codice campione:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (EndpointServiceClient endpointServiceClient = EndpointServiceClient.create()) {
   ListLocationsRequest request =
       ListLocationsRequest.newBuilder()
           .setName("name3373707")
           .setFilter("filter-1274492040")
           .setPageSize(883849137)
           .setPageToken("pageToken873572522")
           .build();
   while (true) {
     ListLocationsResponse response =
         endpointServiceClient.listLocationsCallable().call(request);
     for (Location element : response.getLocationsList()) {
       // doThingsWith(element);
     }
     String nextPageToken = response.getNextPageToken();
     if (!Strings.isNullOrEmpty(nextPageToken)) {
       request = request.toBuilder().setPageToken(nextPageToken).build();
     } else {
       break;
     }
   }
 }
 
Restituisce
Tipo Description
UnaryCallable<com.google.cloud.location.ListLocationsRequest,com.google.cloud.location.ListLocationsResponse>

listLocationsPagedCallable()

public final UnaryCallable<ListLocationsRequest,EndpointServiceClient.ListLocationsPagedResponse> listLocationsPagedCallable()

Elenca le informazioni sulle località supportate per questo servizio.

Codice campione:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (EndpointServiceClient endpointServiceClient = EndpointServiceClient.create()) {
   ListLocationsRequest request =
       ListLocationsRequest.newBuilder()
           .setName("name3373707")
           .setFilter("filter-1274492040")
           .setPageSize(883849137)
           .setPageToken("pageToken873572522")
           .build();
   ApiFuture<Location> future =
       endpointServiceClient.listLocationsPagedCallable().futureCall(request);
   // Do something.
   for (Location element : future.get().iterateAll()) {
     // doThingsWith(element);
   }
 }
 
Restituisce
Tipo Description
UnaryCallable<com.google.cloud.location.ListLocationsRequest,ListLocationsPagedResponse>

mutateDeployedModelAsync(EndpointName endpoint, DeployedModel deployedModel, FieldMask updateMask)

public final OperationFuture<MutateDeployedModelResponse,MutateDeployedModelOperationMetadata> mutateDeployedModelAsync(EndpointName endpoint, DeployedModel deployedModel, FieldMask updateMask)

Aggiorna un modello esistente di cui è stato eseguito il deployment. I campi aggiornabili includono min_replica_count, max_replica_count, autoscaling_metric_specs, disable_container_logging (solo v1) e enable_container_logging (solo v1beta1).

Codice campione:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (EndpointServiceClient endpointServiceClient = EndpointServiceClient.create()) {
   EndpointName endpoint =
       EndpointName.ofProjectLocationEndpointName("[PROJECT]", "[LOCATION]", "[ENDPOINT]");
   DeployedModel deployedModel = DeployedModel.newBuilder().build();
   FieldMask updateMask = FieldMask.newBuilder().build();
   MutateDeployedModelResponse response =
       endpointServiceClient.mutateDeployedModelAsync(endpoint, deployedModel, updateMask).get();
 }
 
Parametri
Nome Description
endpoint EndpointName

Obbligatorio. Il nome della risorsa endpoint in cui modificare un modello Deployed. Formato: projects/{project}/locations/{location}/endpoints/{endpoint}

deployedModel DeployedModel

Obbligatorio. Il modello Deployed da mutare all'interno dell'endpoint. Possono essere modificati solo i seguenti campi:

  • min_replica_count in DedicatedResources o AutomaticResources
  • max_replica_count in DedicatedResources o AutomaticResources
  • autoscaling_metric_specs
  • disable_container_logging (solo v1)
  • enable_container_logging (solo v1beta1)

updateMask FieldMask

Obbligatorio. La maschera di aggiornamento si applica alla risorsa. Vedi google.protobuf.FieldMask.

Restituisce
Tipo Description
OperationFuture<MutateDeployedModelResponse,MutateDeployedModelOperationMetadata>

mutateDeployedModelAsync(MutateDeployedModelRequest request)

public final OperationFuture<MutateDeployedModelResponse,MutateDeployedModelOperationMetadata> mutateDeployedModelAsync(MutateDeployedModelRequest request)

Aggiorna un modello esistente di cui è stato eseguito il deployment. I campi aggiornabili includono min_replica_count, max_replica_count, autoscaling_metric_specs, disable_container_logging (solo v1) e enable_container_logging (solo v1beta1).

Codice campione:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (EndpointServiceClient endpointServiceClient = EndpointServiceClient.create()) {
   MutateDeployedModelRequest request =
       MutateDeployedModelRequest.newBuilder()
           .setEndpoint(
               EndpointName.ofProjectLocationEndpointName(
                       "[PROJECT]", "[LOCATION]", "[ENDPOINT]")
                   .toString())
           .setDeployedModel(DeployedModel.newBuilder().build())
           .setUpdateMask(FieldMask.newBuilder().build())
           .build();
   MutateDeployedModelResponse response =
       endpointServiceClient.mutateDeployedModelAsync(request).get();
 }
 
Parametro
Nome Description
request MutateDeployedModelRequest

L'oggetto della richiesta contenente tutti i parametri per la chiamata API.

Restituisce
Tipo Description
OperationFuture<MutateDeployedModelResponse,MutateDeployedModelOperationMetadata>

mutateDeployedModelAsync(String endpoint, DeployedModel deployedModel, FieldMask updateMask)

public final OperationFuture<MutateDeployedModelResponse,MutateDeployedModelOperationMetadata> mutateDeployedModelAsync(String endpoint, DeployedModel deployedModel, FieldMask updateMask)

Aggiorna un modello esistente di cui è stato eseguito il deployment. I campi aggiornabili includono min_replica_count, max_replica_count, autoscaling_metric_specs, disable_container_logging (solo v1) e enable_container_logging (solo v1beta1).

Codice campione:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (EndpointServiceClient endpointServiceClient = EndpointServiceClient.create()) {
   String endpoint =
       EndpointName.ofProjectLocationEndpointName("[PROJECT]", "[LOCATION]", "[ENDPOINT]")
           .toString();
   DeployedModel deployedModel = DeployedModel.newBuilder().build();
   FieldMask updateMask = FieldMask.newBuilder().build();
   MutateDeployedModelResponse response =
       endpointServiceClient.mutateDeployedModelAsync(endpoint, deployedModel, updateMask).get();
 }
 
Parametri
Nome Description
endpoint String

Obbligatorio. Il nome della risorsa endpoint in cui modificare un modello Deployed. Formato: projects/{project}/locations/{location}/endpoints/{endpoint}

deployedModel DeployedModel

Obbligatorio. Il modello Deployed da mutare all'interno dell'endpoint. Possono essere modificati solo i seguenti campi:

  • min_replica_count in DedicatedResources o AutomaticResources
  • max_replica_count in DedicatedResources o AutomaticResources
  • autoscaling_metric_specs
  • disable_container_logging (solo v1)
  • enable_container_logging (solo v1beta1)

updateMask FieldMask

Obbligatorio. La maschera di aggiornamento si applica alla risorsa. Vedi google.protobuf.FieldMask.

Restituisce
Tipo Description
OperationFuture<MutateDeployedModelResponse,MutateDeployedModelOperationMetadata>

mutateDeployedModelCallable()

public final UnaryCallable<MutateDeployedModelRequest,Operation> mutateDeployedModelCallable()

Aggiorna un modello esistente di cui è stato eseguito il deployment. I campi aggiornabili includono min_replica_count, max_replica_count, autoscaling_metric_specs, disable_container_logging (solo v1) e enable_container_logging (solo v1beta1).

Codice campione:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (EndpointServiceClient endpointServiceClient = EndpointServiceClient.create()) {
   MutateDeployedModelRequest request =
       MutateDeployedModelRequest.newBuilder()
           .setEndpoint(
               EndpointName.ofProjectLocationEndpointName(
                       "[PROJECT]", "[LOCATION]", "[ENDPOINT]")
                   .toString())
           .setDeployedModel(DeployedModel.newBuilder().build())
           .setUpdateMask(FieldMask.newBuilder().build())
           .build();
   ApiFuture<Operation> future =
       endpointServiceClient.mutateDeployedModelCallable().futureCall(request);
   // Do something.
   Operation response = future.get();
 }
 
Restituisce
Tipo Description
UnaryCallable<MutateDeployedModelRequest,Operation>

mutateDeployedModelOperationCallable()

public final OperationCallable<MutateDeployedModelRequest,MutateDeployedModelResponse,MutateDeployedModelOperationMetadata> mutateDeployedModelOperationCallable()

Aggiorna un modello esistente di cui è stato eseguito il deployment. I campi aggiornabili includono min_replica_count, max_replica_count, autoscaling_metric_specs, disable_container_logging (solo v1) e enable_container_logging (solo v1beta1).

Codice campione:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (EndpointServiceClient endpointServiceClient = EndpointServiceClient.create()) {
   MutateDeployedModelRequest request =
       MutateDeployedModelRequest.newBuilder()
           .setEndpoint(
               EndpointName.ofProjectLocationEndpointName(
                       "[PROJECT]", "[LOCATION]", "[ENDPOINT]")
                   .toString())
           .setDeployedModel(DeployedModel.newBuilder().build())
           .setUpdateMask(FieldMask.newBuilder().build())
           .build();
   OperationFuture<MutateDeployedModelResponse, MutateDeployedModelOperationMetadata> future =
       endpointServiceClient.mutateDeployedModelOperationCallable().futureCall(request);
   // Do something.
   MutateDeployedModelResponse response = future.get();
 }
 
Restituisce
Tipo Description
OperationCallable<MutateDeployedModelRequest,MutateDeployedModelResponse,MutateDeployedModelOperationMetadata>

setIamPolicy(SetIamPolicyRequest request)

public final Policy setIamPolicy(SetIamPolicyRequest request)

Imposta il criterio di controllo dell'accesso sulla risorsa specificata. Sostituisce qualsiasi criterio esistente.

Può restituire errori NOT_FOUND, INVALID_ARGUMENT e PERMISSION_DENIED.

Codice campione:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (EndpointServiceClient endpointServiceClient = EndpointServiceClient.create()) {
   SetIamPolicyRequest request =
       SetIamPolicyRequest.newBuilder()
           .setResource(
               EndpointName.ofProjectLocationEndpointName(
                       "[PROJECT]", "[LOCATION]", "[ENDPOINT]")
                   .toString())
           .setPolicy(Policy.newBuilder().build())
           .setUpdateMask(FieldMask.newBuilder().build())
           .build();
   Policy response = endpointServiceClient.setIamPolicy(request);
 }
 
Parametro
Nome Description
request com.google.iam.v1.SetIamPolicyRequest

L'oggetto della richiesta contenente tutti i parametri per la chiamata API.

Restituisce
Tipo Description
com.google.iam.v1.Policy

setIamPolicyCallable()

public final UnaryCallable<SetIamPolicyRequest,Policy> setIamPolicyCallable()

Imposta il criterio di controllo dell'accesso sulla risorsa specificata. Sostituisce qualsiasi criterio esistente.

Può restituire errori NOT_FOUND, INVALID_ARGUMENT e PERMISSION_DENIED.

Codice campione:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (EndpointServiceClient endpointServiceClient = EndpointServiceClient.create()) {
   SetIamPolicyRequest request =
       SetIamPolicyRequest.newBuilder()
           .setResource(
               EndpointName.ofProjectLocationEndpointName(
                       "[PROJECT]", "[LOCATION]", "[ENDPOINT]")
                   .toString())
           .setPolicy(Policy.newBuilder().build())
           .setUpdateMask(FieldMask.newBuilder().build())
           .build();
   ApiFuture<Policy> future = endpointServiceClient.setIamPolicyCallable().futureCall(request);
   // Do something.
   Policy response = future.get();
 }
 
Restituisce
Tipo Description
UnaryCallable<com.google.iam.v1.SetIamPolicyRequest,com.google.iam.v1.Policy>

stop()

public void shutdown()

stopNow()

public void shutdownNow()

testIamPermissions(TestIamPermissionsRequest request)

public final TestIamPermissionsResponse testIamPermissions(TestIamPermissionsRequest request)

Restituisce le autorizzazioni di cui un chiamante dispone per la risorsa specificata. Se la risorsa non esiste, verrà restituito un set di autorizzazioni vuoto, non un errore NOT_FOUND.

Nota: questa operazione è progettata per essere utilizzata per UI e strumenti a riga di comando che supportano la creazione di autorizzazioni, non per il controllo delle autorizzazioni. Questa operazione potrebbe non riuscire ad aprirsi senza avviso.

Codice campione:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (EndpointServiceClient endpointServiceClient = EndpointServiceClient.create()) {
   TestIamPermissionsRequest request =
       TestIamPermissionsRequest.newBuilder()
           .setResource(
               EndpointName.ofProjectLocationEndpointName(
                       "[PROJECT]", "[LOCATION]", "[ENDPOINT]")
                   .toString())
           .addAllPermissions(new ArrayList<String>())
           .build();
   TestIamPermissionsResponse response = endpointServiceClient.testIamPermissions(request);
 }
 
Parametro
Nome Description
request com.google.iam.v1.TestIamPermissionsRequest

L'oggetto della richiesta contenente tutti i parametri per la chiamata API.

Restituisce
Tipo Description
com.google.iam.v1.TestIamPermissionsResponse

testIamPermissionsCallable()

public final UnaryCallable<TestIamPermissionsRequest,TestIamPermissionsResponse> testIamPermissionsCallable()

Restituisce le autorizzazioni di cui un chiamante dispone per la risorsa specificata. Se la risorsa non esiste, verrà restituito un set di autorizzazioni vuoto, non un errore NOT_FOUND.

Nota: questa operazione è progettata per essere utilizzata per UI e strumenti a riga di comando che supportano la creazione di autorizzazioni, non per il controllo delle autorizzazioni. Questa operazione potrebbe non riuscire ad aprirsi senza avviso.

Codice campione:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (EndpointServiceClient endpointServiceClient = EndpointServiceClient.create()) {
   TestIamPermissionsRequest request =
       TestIamPermissionsRequest.newBuilder()
           .setResource(
               EndpointName.ofProjectLocationEndpointName(
                       "[PROJECT]", "[LOCATION]", "[ENDPOINT]")
                   .toString())
           .addAllPermissions(new ArrayList<String>())
           .build();
   ApiFuture<TestIamPermissionsResponse> future =
       endpointServiceClient.testIamPermissionsCallable().futureCall(request);
   // Do something.
   TestIamPermissionsResponse response = future.get();
 }
 
Restituisce
Tipo Description
UnaryCallable<com.google.iam.v1.TestIamPermissionsRequest,com.google.iam.v1.TestIamPermissionsResponse>

undeployModelAsync(EndpointName endpoint, String deployedModelId, Map<String,Integer> trafficSplit)

public final OperationFuture<UndeployModelResponse,UndeployModelOperationMetadata> undeployModelAsync(EndpointName endpoint, String deployedModelId, Map<String,Integer> trafficSplit)

Annulla il deployment di un modello da un endpoint, rimuovendo un modello DeployedModel da quest'ultimo e liberando tutte le risorse che utilizza.

Codice campione:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (EndpointServiceClient endpointServiceClient = EndpointServiceClient.create()) {
   EndpointName endpoint =
       EndpointName.ofProjectLocationEndpointName("[PROJECT]", "[LOCATION]", "[ENDPOINT]");
   String deployedModelId = "deployedModelId-1817547906";
   Map<String, Integer> trafficSplit = new HashMap<>();
   UndeployModelResponse response =
       endpointServiceClient.undeployModelAsync(endpoint, deployedModelId, trafficSplit).get();
 }
 
Parametri
Nome Description
endpoint EndpointName

Obbligatorio. Il nome della risorsa endpoint da cui annullare il deployment di un modello. Formato: projects/{project}/locations/{location}/endpoints/{endpoint}

deployedModelId String

Obbligatorio. L'ID del modello DeployedModel di cui annullare il deployment dall'endpoint.

trafficSplit Map<String,Integer>

Se questo campo viene fornito, il valore traffic_split dell'endpoint verrà sovrascritto. Se viene annullato il deployment dell'ultimo DeployedModel dall'endpoint, [Endpoint.traffic_split] sarà sempre vuoto quando viene restituita questa chiamata. Il deployment di un modello DeployedModel verrà annullato correttamente solo se non ha traffico assegnato quando questo metodo viene eseguito o se questo campo annulla l'assegnazione di traffico.

Restituisce
Tipo Description
OperationFuture<UndeployModelResponse,UndeployModelOperationMetadata>

undeployModelAsync(UndeployModelRequest request)

public final OperationFuture<UndeployModelResponse,UndeployModelOperationMetadata> undeployModelAsync(UndeployModelRequest request)

Annulla il deployment di un modello da un endpoint, rimuovendo un modello DeployedModel da quest'ultimo e liberando tutte le risorse che utilizza.

Codice campione:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (EndpointServiceClient endpointServiceClient = EndpointServiceClient.create()) {
   UndeployModelRequest request =
       UndeployModelRequest.newBuilder()
           .setEndpoint(
               EndpointName.ofProjectLocationEndpointName(
                       "[PROJECT]", "[LOCATION]", "[ENDPOINT]")
                   .toString())
           .setDeployedModelId("deployedModelId-1817547906")
           .putAllTrafficSplit(new HashMap<String, Integer>())
           .build();
   UndeployModelResponse response = endpointServiceClient.undeployModelAsync(request).get();
 }
 
Parametro
Nome Description
request UndeployModelRequest

L'oggetto della richiesta contenente tutti i parametri per la chiamata API.

Restituisce
Tipo Description
OperationFuture<UndeployModelResponse,UndeployModelOperationMetadata>

undeployModelAsync(String endpoint, String deployedModelId, Map<String,Integer> trafficSplit)

public final OperationFuture<UndeployModelResponse,UndeployModelOperationMetadata> undeployModelAsync(String endpoint, String deployedModelId, Map<String,Integer> trafficSplit)

Annulla il deployment di un modello da un endpoint, rimuovendo un modello DeployedModel da quest'ultimo e liberando tutte le risorse che utilizza.

Codice campione:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (EndpointServiceClient endpointServiceClient = EndpointServiceClient.create()) {
   String endpoint =
       EndpointName.ofProjectLocationEndpointName("[PROJECT]", "[LOCATION]", "[ENDPOINT]")
           .toString();
   String deployedModelId = "deployedModelId-1817547906";
   Map<String, Integer> trafficSplit = new HashMap<>();
   UndeployModelResponse response =
       endpointServiceClient.undeployModelAsync(endpoint, deployedModelId, trafficSplit).get();
 }
 
Parametri
Nome Description
endpoint String

Obbligatorio. Il nome della risorsa endpoint da cui annullare il deployment di un modello. Formato: projects/{project}/locations/{location}/endpoints/{endpoint}

deployedModelId String

Obbligatorio. L'ID del modello DeployedModel di cui annullare il deployment dall'endpoint.

trafficSplit Map<String,Integer>

Se questo campo viene fornito, il valore traffic_split dell'endpoint verrà sovrascritto. Se viene annullato il deployment dell'ultimo DeployedModel dall'endpoint, [Endpoint.traffic_split] sarà sempre vuoto quando viene restituita questa chiamata. Il deployment di un modello DeployedModel verrà annullato correttamente solo se non ha traffico assegnato quando questo metodo viene eseguito o se questo campo annulla l'assegnazione di traffico.

Restituisce
Tipo Description
OperationFuture<UndeployModelResponse,UndeployModelOperationMetadata>

undeployModelCallable()

public final UnaryCallable<UndeployModelRequest,Operation> undeployModelCallable()

Annulla il deployment di un modello da un endpoint, rimuovendo un modello DeployedModel da quest'ultimo e liberando tutte le risorse che utilizza.

Codice campione:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (EndpointServiceClient endpointServiceClient = EndpointServiceClient.create()) {
   UndeployModelRequest request =
       UndeployModelRequest.newBuilder()
           .setEndpoint(
               EndpointName.ofProjectLocationEndpointName(
                       "[PROJECT]", "[LOCATION]", "[ENDPOINT]")
                   .toString())
           .setDeployedModelId("deployedModelId-1817547906")
           .putAllTrafficSplit(new HashMap<String, Integer>())
           .build();
   ApiFuture<Operation> future =
       endpointServiceClient.undeployModelCallable().futureCall(request);
   // Do something.
   Operation response = future.get();
 }
 
Restituisce
Tipo Description
UnaryCallable<UndeployModelRequest,Operation>

undeployModelOperationCallable()

public final OperationCallable<UndeployModelRequest,UndeployModelResponse,UndeployModelOperationMetadata> undeployModelOperationCallable()

Annulla il deployment di un modello da un endpoint, rimuovendo un modello DeployedModel da quest'ultimo e liberando tutte le risorse che utilizza.

Codice campione:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (EndpointServiceClient endpointServiceClient = EndpointServiceClient.create()) {
   UndeployModelRequest request =
       UndeployModelRequest.newBuilder()
           .setEndpoint(
               EndpointName.ofProjectLocationEndpointName(
                       "[PROJECT]", "[LOCATION]", "[ENDPOINT]")
                   .toString())
           .setDeployedModelId("deployedModelId-1817547906")
           .putAllTrafficSplit(new HashMap<String, Integer>())
           .build();
   OperationFuture<UndeployModelResponse, UndeployModelOperationMetadata> future =
       endpointServiceClient.undeployModelOperationCallable().futureCall(request);
   // Do something.
   UndeployModelResponse response = future.get();
 }
 
Restituisce
Tipo Description
OperationCallable<UndeployModelRequest,UndeployModelResponse,UndeployModelOperationMetadata>

updateEndpoint(Endpoint endpoint, FieldMask updateMask)

public final Endpoint updateEndpoint(Endpoint endpoint, FieldMask updateMask)

Aggiorna un endpoint.

Codice campione:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (EndpointServiceClient endpointServiceClient = EndpointServiceClient.create()) {
   Endpoint endpoint = Endpoint.newBuilder().build();
   FieldMask updateMask = FieldMask.newBuilder().build();
   Endpoint response = endpointServiceClient.updateEndpoint(endpoint, updateMask);
 }
 
Parametri
Nome Description
endpoint Endpoint

Obbligatorio. L'endpoint che sostituisce la risorsa sul server.

updateMask FieldMask

Obbligatorio. La maschera di aggiornamento si applica alla risorsa. Vedi google.protobuf.FieldMask.

Restituisce
Tipo Description
Endpoint

updateEndpoint(UpdateEndpointRequest request)

public final Endpoint updateEndpoint(UpdateEndpointRequest request)

Aggiorna un endpoint.

Codice campione:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (EndpointServiceClient endpointServiceClient = EndpointServiceClient.create()) {
   UpdateEndpointRequest request =
       UpdateEndpointRequest.newBuilder()
           .setEndpoint(Endpoint.newBuilder().build())
           .setUpdateMask(FieldMask.newBuilder().build())
           .build();
   Endpoint response = endpointServiceClient.updateEndpoint(request);
 }
 
Parametro
Nome Description
request UpdateEndpointRequest

L'oggetto della richiesta contenente tutti i parametri per la chiamata API.

Restituisce
Tipo Description
Endpoint

updateEndpointCallable()

public final UnaryCallable<UpdateEndpointRequest,Endpoint> updateEndpointCallable()

Aggiorna un endpoint.

Codice campione:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (EndpointServiceClient endpointServiceClient = EndpointServiceClient.create()) {
   UpdateEndpointRequest request =
       UpdateEndpointRequest.newBuilder()
           .setEndpoint(Endpoint.newBuilder().build())
           .setUpdateMask(FieldMask.newBuilder().build())
           .build();
   ApiFuture<Endpoint> future =
       endpointServiceClient.updateEndpointCallable().futureCall(request);
   // Do something.
   Endpoint response = future.get();
 }
 
Restituisce
Tipo Description
UnaryCallable<UpdateEndpointRequest,Endpoint>