Inferred dependencies between resources in an application programming interface
A processing device identifies a set of available endpoints published by an application programming interface (API) of a computing server, determines one or more dependencies between the available endpoints, and generates an executable operation comprising a subset of the available endpoints to be called in a given order based on the one or more dependencies.
1 . A method comprising:
identifying a set of available endpoints published by an application programming interface (API) of a computing server;
determining one or more dependencies between the available endpoints without direct access to a persistent state of the computing server by building a model of a probable server-side state of the computing server based on responses to a series of probe requests sent to the available endpoints, wherein building the model comprises generating an inference, based at least in part on parameter values received in responses to the probe requests, the inference indicating that a first endpoint of the set of available endpoints produces a parameter value that a second endpoint of the set of available endpoints is to consume, wherein the one or more dependencies were previously unknown prior to the probe requests; and
generating, by a processing device, an executable operation comprising a subset of the available endpoints to be called in a given order based on the one or more dependencies, wherein each at least one of the one or more dependencies represents the first endpoint of the set of available endpoints which is configured to provide a certain the parameter value in response to a first request and the second endpoint of the set of available endpoints which is configured to receive a second request including the parameter value.
2 . The method of claim 1 , wherein the set of available endpoints published by the API is received in response to a query of a corresponding API specification.
3 . The method of claim 1 , wherein determining the one or more dependencies between the available endpoints comprises:
storing the parameter values received in the responses to the series of probe requests in a resource graph of a knowledge base.
4 . The method of claim 1 , wherein determining the one or more dependencies between the available endpoints comprises using a number of heuristics related to the set of available endpoints.
5 . The method of claim 1 , wherein determining the one or more dependencies between the available endpoints comprises:
applying a corresponding API specification as an input to a trained machine learning model; and
receiving an output of the trained machine learning model, the output comprising an indication of the one or more dependencies.
6 . The method of claim 1 , further comprising:
executing the executable operation to cause a sequence of requests to be issued to the API of the computing server, the sequence of requests directed to the subset of the available endpoints;
receiving, from the computing server, a sequence of responses to the sequence of requests; and
extracting data from the sequence of responses and storing the data for use in future operations.
7 . A system comprising:
a memory; and
a processing device, coupled to the memory, and configured to perform operations comprising:
identifying a set of available endpoints published by an application programming interface (API) of a computing server;
determining one or more dependencies between the available endpoints without direct access to a persistent state of the computing server by building a model of a probable server-side state of the computing server based on responses to a series of probe requests sent to the available endpoints, wherein building the model comprises generating an inference, based at least in part on parameter values received in responses to the probe requests, the inference indicating that a first endpoint of the set of available endpoints produces a parameter value that a second endpoint of the set of available endpoints is to consume, wherein the one or more dependencies were previously unknown prior to the probe requests; and
generating an executable operation comprising a subset of the available endpoints to be called in a given order based on the one or more dependencies, wherein each at least one of the one or more dependencies represents the first endpoint of the set of available endpoints which is configured to provide a certain the parameter value in response to a first request and the second endpoint of the set of available endpoints which is configured to receive a second request including the parameter value.
8 . The system of claim 7 , wherein the set of available endpoints published by the API is received in response to a query of a corresponding API specification.
9 . The system of claim 7 , wherein determining the one or more dependencies between the available endpoints comprises:
storing the parameter values received in the responses to the series of probe requests in a resource graph of a knowledge base.
10 . The system of claim 7 , wherein determining the one or more dependencies between the available endpoints comprises using a number of heuristics related to the set of available endpoints.
11 . The system of claim 7 , wherein determining the one or more dependencies between the available endpoints comprises:
applying a corresponding API specification as an input to a trained machine learning model; and
receiving an output of the trained machine learning model, the output comprising an indication of the one or more dependencies.
12 . The system of claim 7 , wherein the processing device is configured to perform operations further comprising:
executing the executable operation to cause a sequence of requests to be issued to the API of the computing server, the sequence of requests directed to the subset of the available endpoints;
receiving, from the computing server, a sequence of responses to the sequence of requests; and
extracting data from the sequence of responses and storing the data for use in future operations.
13 . A non-transitory computer-readable storage medium storing instructions which, when executed, cause a processing device to perform operations comprising:
identifying a set of available endpoints published by an application programming interface (API) of a computing server;
determining one or more dependencies between the available endpoints without direct access to a persistent state of the computing server by building a model of a probable server-side state of the computing server based on responses to a series of probe requests sent to the available endpoints, wherein building the model comprises generating an inference, based at least in part on parameter values received in responses to the probe requests, the inference indicating that a first endpoint of the set of available endpoints produces a parameter value that a second endpoint of the set of available endpoints is to consume, wherein the one or more dependencies were previously unknown prior to the probe requests; and
generating, by the processing device, an executable operation comprising a subset of the available endpoints to be called in a given order based on the one or more dependencies, wherein each at least one of the one or more dependencies represents the first endpoint of the set of available endpoints which is configured to provide a certain the parameter value in response to a first request and the second endpoint of the set of available endpoints which is configured to receive a second request including the parameter value.
14 . The non-transitory computer-readable storage medium of claim 13 , wherein determining the one or more dependencies between the available endpoints comprises:
storing the parameter values received in the responses to the series of probe requests in a resource graph of a knowledge base.
15 . The non-transitory computer-readable storage medium of claim 13 , wherein determining the one or more dependencies between the available endpoints comprises using a number of heuristics related to the set of available endpoints.
16 . The non-transitory computer-readable storage medium of claim 13 , wherein determining the one or more dependencies between the available endpoints comprises:
applying a corresponding API specification as an input to a trained machine learning model; and
receiving an output of the trained machine learning model, the output comprising an indication of the one or more dependencies.
17 . The non-transitory computer-readable storage medium of claim 13 , wherein the instructions cause the processing device to perform operations further comprising:
executing the executable operation to cause a sequence of requests to be issued to the API of the computing server, the sequence of requests directed to the subset of the available endpoints;
receiving, from the computing server, a sequence of responses to the sequence of requests; and
extracting data from the sequence of responses and storing the data for use in future operations.
18 . The non-transitory computer-readable storage medium of claim 13 , wherein the set of available endpoints published by the API is received in response to a query of a corresponding API specification.