Support service/instance/endpoint name and layer instead of ID in query. (#148)

diff --git a/common.graphqls b/common.graphqls
index 9eebdbb..19b80ed 100644
--- a/common.graphqls
+++ b/common.graphqls
@@ -150,6 +150,35 @@
     spans: [DebuggingSpan!]!
 }
 
+# The condition used for instead of serviceId in query.
+# If you have service name, you don't need to provide serviceId.
+input ServiceCondition {
+    serviceName: String!
+    # If the service is virtual then required, such the `layer` is `VIRTUAL_DATABASE/VIRTUAL_MQ/VIRTUAL_GATEWAY`.
+    # Otherwise, it is not required.
+    layer: String
+}
+
+# The condition used for instead of serviceInstanceId in query.
+# If you have service name and instance name, you don't need to provide serviceInstanceId.
+input InstanceCondition {
+    serviceName: String!
+    instanceName: String!
+    # If the service is virtual then required, such the `layer` is `VIRTUAL_DATABASE/VIRTUAL_MQ/VIRTUAL_GATEWAY`.
+    # Otherwise, it is not required.
+    layer: String
+}
+
+# The condition used for instead of endpointId in query.
+# If you have service name and endpoint name, you don't need to provide endpointId.
+input EndpointCondition {
+    serviceName: String!
+    endpointName: String!
+    # If the service is virtual then required, such the `layer` is `VIRTUAL_DATABASE/VIRTUAL_MQ/VIRTUAL_GATEWAY`.
+    # Otherwise, it is not required.
+    layer: String
+}
+
 extend type Query {
     # Query Health Checker module for the status of OAP server
     checkHealth: HealthStatus!
diff --git a/log.graphqls b/log.graphqls
index b16474a..ba657f4 100644
--- a/log.graphqls
+++ b/log.graphqls
@@ -60,6 +60,28 @@
     queryOrder: Order
 }
 
+# Use service, instance and endpoint name as the condition
+input LogQueryConditionByName {
+    # The value of 0 means all services.
+    service: ServiceCondition
+    instance: InstanceCondition
+    endpoint: EndpointCondition
+    # Related trace condition.
+    # When use related trace condition, duration is not required.
+    relatedTrace: TraceScopeCondition
+    # The time range of log happened
+    # [Required] duration is required in most query, only exception is when use relatedTrace.
+    queryDuration: Duration
+    paging: Pagination!
+    tags: [LogTag!]
+    # Fuzzy query conditions for the log content.
+    # Use these 2 keyword related condition, when supportQueryLogsByKeywords returns TRUE.
+    keywordsOfContent: [String!]
+    excludingKeywordsOfContent: [String!]
+    # Order by timestamp, default desc
+    queryOrder: Order
+}
+
 # Trace related condition
 input TraceScopeCondition {
     traceId: String!
@@ -104,6 +126,7 @@
     # Return true if the current storage implementation supports fuzzy query for logs.
     supportQueryLogsByKeywords: Boolean!
     queryLogs(condition: LogQueryCondition, debug: Boolean): Logs
+    queryLogsByName(condition: LogQueryConditionByName, debug: Boolean): Logs
 
     # Test the logs and get the results of the LAL output.
     test(requests: LogTestRequest!): LogTestResponse!
diff --git a/metadata-v2.graphqls b/metadata-v2.graphqls
index 2723515..b90abf1 100644
--- a/metadata-v2.graphqls
+++ b/metadata-v2.graphqls
@@ -150,13 +150,15 @@
     
     # Read service instance list.
     listInstances(duration: Duration!, serviceId: ID!): [ServiceInstance!]!
+    listInstancesByName(duration: Duration!, service: ServiceCondition!): [ServiceInstance!]!
     # Search and find service instance according to given ID. Return null if not existing.
     getInstance(instanceId: String!): ServiceInstance
-    
+
     # Search and find matched endpoints according to given service and keyword(optional)
     # If no keyword, randomly choose endpoint based on `limit` value.
     # If duration is nil mean get all endpoints, otherwise, get the endpoint list in the given duration.
     findEndpoint(keyword: String, serviceId: ID!, limit: Int!, duration: Duration): [Endpoint!]!
+    findEndpointByName(keyword: String, service: ServiceCondition!, limit: Int!, duration: Duration): [Endpoint!]!
     getEndpointInfo(endpointId: ID!): EndpointInfo
 
     # Read process list.
diff --git a/topology.graphqls b/topology.graphqls
index 0bb68b9..1d61049 100644
--- a/topology.graphqls
+++ b/topology.graphqls
@@ -134,15 +134,20 @@
     getGlobalTopology(duration: Duration!, layer: String, debug: Boolean): Topology
     # Query the topology, based on the given service
     getServiceTopology(serviceId: ID!, duration: Duration!, debug: Boolean): Topology
+    getServiceTopologyByName(service: ServiceCondition!, duration: Duration!, debug: Boolean): Topology
     # Query the topology, based on the given services.
     # `#getServiceTopology` could be replaced by this.
     getServicesTopology(serviceIds: [ID!]!, duration: Duration!, debug: Boolean): Topology
+    getServicesTopologyByNames(services: [ServiceCondition!]!, duration: Duration!, debug: Boolean): Topology
     # Query the instance topology, based on the given clientServiceId and serverServiceId
     getServiceInstanceTopology(clientServiceId: ID!, serverServiceId: ID!, duration: Duration!, debug: Boolean): ServiceInstanceTopology
+    getServiceInstanceTopologyByName(clientService: ServiceCondition!, serverService: ServiceCondition!, duration: Duration!, debug: Boolean): ServiceInstanceTopology
     # Query the topology, based on the given endpoint
     getEndpointTopology(endpointId: ID!, duration: Duration!): Topology
     # v2 of getEndpointTopology
     getEndpointDependencies(endpointId: ID!, duration: Duration!, debug: Boolean): EndpointTopology
+    getEndpointDependenciesByName(endpoint: EndpointCondition!, duration: Duration!, debug: Boolean): EndpointTopology
     # Query the topology, based on the given instance
     getProcessTopology(serviceInstanceId: ID!, duration: Duration!, debug: Boolean): ProcessTopology
+    getProcessTopologyByName(instance: InstanceCondition!, duration: Duration!, debug: Boolean): ProcessTopology
 }
diff --git a/trace.graphqls b/trace.graphqls
index b770345..5a6e3e2 100644
--- a/trace.graphqls
+++ b/trace.graphqls
@@ -51,6 +51,26 @@
     paging: Pagination!
 }
 
+# Use service, instance and endpoint name as the condition
+input TraceQueryConditionByName {
+    # The value of 0 means all services.
+    service: ServiceCondition
+    instance: InstanceCondition
+    endpoint: EndpointCondition
+    traceId: String
+    # The time range of traces started
+    queryDuration: Duration
+    # The min time of trace
+    minTraceDuration: Int
+    # The max time of trace
+    maxTraceDuration: Int
+    traceState: TraceState!
+    queryOrder: QueryOrder!
+    # Map to the tags included in the traces
+    tags: [SpanTag!]
+    paging: Pagination!
+}
+
 input SpanTag {
     key: String!
     value: String
@@ -175,6 +195,7 @@
 extend type Query {
     # Search segment list with given conditions
     queryBasicTraces(condition: TraceQueryCondition, debug: Boolean): TraceBrief
+    queryBasicTracesByName(condition: TraceQueryConditionByName, debug: Boolean): TraceBrief
     # Read the specific trace ID with given trace ID
     queryTrace(traceId: ID!, debug: Boolean): Trace
     # Only for BanyanDB, can be used to query the trace in the cold stage.