Search in sources :

Example 1 with EndpointName

use of com.google.cloud.servicedirectory.v1.EndpointName in project java-servicedirectory by googleapis.

the class EndpointsDelete method deleteEndpoint.

// Delete an endpoint.
public static void deleteEndpoint(String projectId, String locationId, String namespaceId, String serviceId, String endpointId) throws IOException {
    // the "close" method on the client to safely clean up any remaining background resources.
    try (RegistrationServiceClient client = RegistrationServiceClient.create()) {
        // The endpoint to delete.
        EndpointName endpointName = EndpointName.of(projectId, locationId, namespaceId, serviceId, endpointId);
        // Send the request to delete the endpoint.
        client.deleteEndpoint(endpointName);
        // Log the action.
        System.out.println("Deleted Endpoint: " + endpointName.toString());
    }
}
Also used : EndpointName(com.google.cloud.servicedirectory.v1.EndpointName) RegistrationServiceClient(com.google.cloud.servicedirectory.v1.RegistrationServiceClient)

Aggregations

EndpointName (com.google.cloud.servicedirectory.v1.EndpointName)1 RegistrationServiceClient (com.google.cloud.servicedirectory.v1.RegistrationServiceClient)1