Examples: query, "exact match", wildcard*, wild?ard, wild*rd
Fuzzy search: cake~ (finds cakes, bake)
Term boost: "red velvet"^4, chocolate^2
Field grouping: tags:(+work -"fun-stuff")
Escape special characters +-&|!(){}[]^"~*?:\ - e.g. \+ \* \!
Range search: properties.timestamp:[1587729413488 TO *] (inclusive), properties.title:{A TO Z}(excluding A and Z)
Combinations: chocolate AND vanilla, chocolate OR vanilla, (chocolate OR vanilla) NOT "vanilla pudding"
Field search: properties.title:"The Title" AND text
Answered
List all system features

Hi,

I have to list all system features(/v1/admin/system/features/list that endpoint). Is there any service in java BDK to do that? If not how I may achive that?

regards
Daniel

  
  
Posted one year ago
Votes Newest

Answers


Unfortunately, not at this point in time. That endpoint is used to list every entitlement feature available in the current pod so it seems unlikely to be used in an automation context. Maybe you can elaborate on the workflow you are trying to achieve and file it as a feature request on the BDK repo.

https://github.com/finos/symphony-bdk-java/issues

What is available is the user features endpoint, available via userService.getFeatureEntitlements(long userId) as well as the ability to update it via userService.updateFeatureEntitlements(long userId, List<Feature> features).

You can choose to implement this yourself using a BDK Extension. Here's a quick example:

public class BotApplication {
  public static void main(String[] args) throws Exception {
    final SymphonyBdk bdk = new SymphonyBdk(loadFromClasspath("/config.yaml"));
    bdk.extensions().register(FeaturesExt.class);
    List<String> featuresList = FeaturesExt.listFeatures();
    System.out.println(String.join(",", featuresList));
  }
}
public class FeaturesExt implements BdkExtension, BdkApiClientFactoryAware, BdkAuthenticationAware {
    private static AuthSession authSession;
    private static ApiClient apiClient;

    public void setAuthSession(AuthSession a) { authSession = a; }
    public void setApiClientFactory(ApiClientFactory a) { apiClient = a.getPodClient("/pod"); }

    public static List<String> listFeatures() throws ApiException {
        String path = "/v1/admin/system/features/list";
        String json = "application/json";
        Map<String, String> headers = Map.of("sessionToken", authSession.getSessionToken());
        TypeReference<List<String>> type = new TypeReference<>() {};
        ApiResponse<List<String>> response = apiClient.invokeAPI(path, "GET", null, null, headers, null, null, json, json, null, type);

        if (response.getStatusCode() != 200) {
            throw new ApiException(response.getStatusCode(), "Error");
        }
        return response.getData();
    }
}
  
  
Posted one year ago
Edited one year ago
Yong Sheng Tan
39 × 2 Administrator
  
  

Thanks for the answer, a requirement that I am working on is simply display all features ;/ I work it around with direct http call.

Daniel Biniek   one year ago Report
  
  

@<1414962189839634432|Daniel Biniek> i added an implementation example using the BDK Extension framework

Yong Sheng Tan   one year ago Report
1K Views
1 Answer
one year ago
one year ago
Tags