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());
}
}
Aggregations