the installation. Afterward, (iii) the execution of the
scripts needs to be parameterized, which may be done
by setting environment variables or storing configu-
ration files. The final challenge is (iv) retrieving the
results of the invocation, e.g., by reading, parsing, and
potentially transforming the console output or files
that were written to disk. In comparison to a simple
API call, these steps are more complex and error-prone
because lower-level implementation details such as dif-
ferent transport protocols and invocation mechanisms
have to be considered and combined with each other.
The overarching provisioning logic orchestrating all
API calls as well as the preparation and invocation
of the executables could be implemented by a script
using a general-purpose scripting language such as
Ruby or Python. However, such a script would be
polluted with lower-level implementation details such
as establishing SSH connections and placing files on
the virtual machine. Furthermore, service composi-
tion languages such as BPEL or BPMN cannot be
used without manually creating wrapping logic for the
different executables involved. This is due to their
focus on Web service orchestration. Consequently,
the implementation details of the underlying APIs and
executables directly influence which orchestration ap-
proaches can be used. This clearly contradicts with
the idea of loose coupling, i.e., selecting an orches-
tration approach and implementing the orchestration
logic without considering the implementation details
of the underlying, lower-level technologies.
To tackle these challenges we propose an auto-
mated approach to generate APIs for arbitrary executa-
bles. The approach is based on the APIfication method
we present in Section 3. In the context of our motivat-
ing scenario discussed in this section, the approach can
be used to completely wrap the script invocation by
generating an API that hides the (i) placement, (ii) in-
stallation of required runtime environments, (iii) pa-
rameterization and execution of the executable, as well
as (iv) transforming and returning the results. Conse-
quently, the orchestration logic deals with API calls
only, without getting polluted, error-prone, or unnec-
essarily complex because of implementation details of
the underlying executables.
3 APIfication METHOD
The APIfication approach presented in this section is
based on the assumption that each executable has some
metadata associated with it. These metadata are either
natively attached and/or they are explicitly specified
and additionally attached to the executable. Metadata
indicate which input parameters are expected, where
results are put, which dependencies have to be resolved
before the invocation, etc. The main purpose of a gen-
erated API implementation is to enable the invocation
of the corresponding executable through a well-defined
interface, independent from the underlying technology
stack. Furthermore, a generated API implementation
enables the invocation of the corresponding executable
not only locally in the same environment (e.g., same
server), but enables the execution using remote access
mechanisms such as SSH and PowerShell in remote
environments. This is to decouple the environment of
an API implementation instance from the environment
of the actual executable that is exposed by the API. Dis-
tributed environments as they are, for instance, used
in the field of Cloud computing are thereby supported.
An API call could be made from a workstation (run-
ning a script that orchestrates multiple APIs) to an API
implementation instance that is hosted on premises
(e.g., a local server); the actual executable (e.g., a Chef
cookbook to install a middleware component) runs on
a Cloud infrastructure. However, one could also run all
parts on a single machine, e.g., a developer’s laptop.
Figure 3 shows an overview of the APIfication
method, outlining the individual steps and their order-
ing to generate API implementations in an automated
manner. In the
first step,
the executable targeted for
the APIfication is selected. Then, the interface type
(e.g., RESTful API) and the API implementation type
(e.g., Node.js or Java) is selected
(step 2 & 3).
The
type of interface including the communication proto-
col (HTTP, WebSocket, etc.) and the communication
paradigm (RPC, REST, etc.) can be chosen when
generating an API implementation. This choice may
be driven by existing expertise, alignment with ex-
isting APIs, or personal preferences. Similarly moti-
vated, the type of the underlying implementation (Java,
Node.js, etc.) for the generated API can be chosen
when generating an API implementation. A generated
API should be language-agnostic to allow the usage of
arbitrary languages (scripting languages, programming
languages, service composition languages, etc.) to or-
chestrate and integrate different APIs. Thus, Web APIs
are the preferred and universal type of APIs because
they can be utilized in nearly any kind of language.
After the selection part, the executable including
its metadata is scanned to discover input and output
parameters
(step 4).
If the scan did not discover all
parameters, the following (optional) step can be used
to refine the input and output parameters for the gener-
ated API (step 5). However, this is not required if the
metadata associated with the executable are sufficient
as this is, e.g., the case for many open-source deploy-
ment automation artifacts such as Chef cookbooks and
Juju charms. Consequently, the method can be applied
ANY2API-AutomatedAPIfication-GeneratingAPIsforExecutablestoEasetheirIntegrationandOrchestrationfor
CloudApplicationDeploymentAutomation
479