use of com.couchbase.client.core.endpoint.http.CoreHttpResponse in project couchbase-jvm-clients by couchbase.
the class CoreAnalyticsLinkManager method getLinks.
/**
* @param dataverseName (nullable)
* @param linkType (nullable)
* @param linkName (nullable) if present, dataverseName must also be present
*/
public CompletableFuture<byte[]> getLinks(String dataverseName, String linkType, String linkName, CoreCommonOptions options) {
if (linkName != null && dataverseName == null) {
throw InvalidArgumentException.fromMessage("When link name is specified, must also specify dataverse");
}
UrlQueryStringBuilder queryString = newQueryString().setIfNotNull("type", linkType);
CoreHttpPath path = path("/analytics/link");
if (dataverseName != null && dataverseName.contains("/")) {
path = path.plus("/{dataverse}", mapOf("dataverse", dataverseName));
if (linkName != null) {
path = path.plus("/{linkName}", mapOf("linkName", linkName));
}
} else {
queryString.setIfNotNull("dataverse", dataverseName).setIfNotNull("name", linkName);
}
return httpClient.get(path, options).queryString(queryString).trace(TracingIdentifiers.SPAN_REQUEST_MA_GET_ALL_LINKS).exec(core).thenApply(CoreHttpResponse::content);
}
use of com.couchbase.client.core.endpoint.http.CoreHttpResponse in project couchbase-jvm-clients by couchbase.
the class RateLimitingIntegrationTest method enforceRateLimits.
/**
* Makes sure that the rate limits are enforced on the server.
*/
static void enforceRateLimits() throws Exception {
CoreHttpClient client = adminCluster.core().httpClient(RequestTarget.manager());
CoreHttpResponse result = client.post(path("/internalSettings"), CoreCommonOptions.DEFAULT).form(UrlQueryStringBuilder.create().add("enforceLimits", true)).exec(adminCluster.core()).get();
assertEquals(ResponseStatus.SUCCESS, result.status());
}
Aggregations