-
Notifications
You must be signed in to change notification settings - Fork 130
add query by name for buckets,tasks and orgs api #277
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Hi @lonelyleaf, The Something like will works: package example;
import com.influxdb.client.InfluxDBClient;
import com.influxdb.client.InfluxDBClientFactory;
import com.influxdb.client.domain.Organization;
import com.influxdb.client.domain.Task;
import com.influxdb.client.service.OrganizationsService;
import com.influxdb.client.service.TasksService;
public class PlatformExample {
public static void main(final String[] args) throws Exception {
String url = "http://localhost:8086";
String token = "my-token";
String orgName = "my-org";
String taskName = "my-task";
try (InfluxDBClient client = InfluxDBClientFactory.create(url, token.toCharArray()))
{
OrganizationsService organizations = client.getService(OrganizationsService.class);
Organization org = organizations.getOrgs(null, null, null, null, orgName, null, null)
.execute()
.body()
.getOrgs()
.get(0);
System.out.println("org = " + org);
TasksService tasks = client.getService(TasksService.class);
Task task = tasks.getTasks(null, taskName, null, null, null, null, null, null)
.execute()
.body()
.getTasks()
.get(0);
System.out.println("task = " + task);
}
}
} Regards |
@bednar thank you,your replay is very helpful.But why not add one method with param like findTask(TaskQuery taskQuery)
public class TaskQuery {
String after;
String name;
String org;
String orgId;
String String;
String status;
String type;
String user;
} no need to hide so many information from rest api,but add so many method with different params |
@lonelyleaf thanks for the suggestion 👍. Is this something you might be willing to help with? |
@lonelyleaf, of course. It is awesome improvement 👍. I will review your PR later today. Thanks for PR 👍 |
Proposal:
Add query param for taskApi and orgApi for query by name。
Use case:
In my case,I need add bucket by code in runtime,but I need find all task first,and then filter them by name。Influxdb's rest api have this feature but why you not open it in java client?
The text was updated successfully, but these errors were encountered: