This disclosure relates to the field of cloud computing technologies, and in particular, to a method and an apparatus for debugging a cloud service application programming interface (API) on a cloud computing platform and a related device.
A cloud vendor provides a plurality of cloud services such as computing, storage, and network. An API is a bridge between a cloud service and a user. A prerequisite for the user to select a cloud service API is reliability and availability, but more importantly, usability of a corresponding tool during development and debugging. The usability of the cloud service API usually means that in terms of documents and tool support, whether accurate and detailed usage descriptions are provided, whether rich scenario examples are provided, whether a convenient debugging method is provided, and the like.
The cloud vendor provides massive APIs, but also brings usability problems, such as API search, convenient API debugging, API parameter selection, and API debugging and troubleshooting. Currently, to resolve problems such as API search and API debugging, cloud vendors generally provide functions such as full-element API information retrieval and online debugging. However, functions for API parameter selection, debugging and diagnosis, and the like are not well-developed. For parameter selection, correlation between service scenarios is not considered, and a personalized requirement is not met. For API debugging and diagnosis, a provided error prompt may be incomplete or inaccurate. Consequently, an associated solution is also incomplete, which makes troubleshooting difficult.
This disclosure provides a method and an apparatus for debugging a cloud service API on a cloud computing platform and a related device. A group dependency relationship between parameters in a cloud service API is pre-extracted, such that when a user configures a parameter of the cloud service API, a parameter group that is to be preferentially filled in is recommended. Therefore, correlation and accuracy of cloud service API parameter recommendation can be improved, and debugging time of the user can be reduced, thereby efficiently and quickly debugging the cloud service API.
According to a first aspect, a method for debugging a cloud service API on a cloud computing platform is provided, where the cloud computing platform provides a plurality of cloud services, and manages a cloud computing resource used for deploying the cloud service, the cloud service has a cloud service API, the cloud computing platform provides a debugging service for the cloud service API, and is configured with an API configuration interface and a debugging result interface of the debugging service are configured. The method includes that the cloud computing platform provides an API configuration interface, where the API configuration interface is used by a user to select a to-be-debugged cloud service API; the cloud computing platform obtains, through the API configuration interface, a first cloud service API selected by the user; obtains a parameter value that is of a first parameter of the first cloud service API and that is entered by the user; recommends, to the user, a parameter group that is of the first cloud service API and that is related to the first parameter; obtains a parameter value that is of a second parameter in the parameter group and that is entered by the user, where the second parameter group is a part or all of parameters in the parameter group; finally, the cloud computing platform deploys, in the cloud computing resource based on the parameter value of the first parameter and the parameter value of the second parameter, a cloud service associated with the first cloud service API, to debug the first cloud service API, and provides a debugging result of the first cloud service API through the debugging result interface.
It can be learned from the foregoing solution that, in this disclosure, when the user debugs the cloud service API, a parameter group that corresponds to the cloud service API and that is related to the parameter may be recommended to the user based on a parameter value that is of a parameter of the to-be-debugged cloud service API and that is entered by the user, such that correlation and accuracy of parameter filling in can be improved, and cloud service API debugging is more efficient.
In a possible implementation, before the cloud computing platform recommends, through the API configuration interface, the parameter group that is of the first cloud service API and that is related to the first parameter, the cloud computing platform selects, as the parameter group, one or more parameters that belong to a same function module as the first parameter.
In a possible implementation, the cloud computing platform generates an association relationship between a function module of the first cloud service API and the parameter group of the first cloud service API based on a parameter description file of the first cloud service API.
In a possible implementation, before the cloud computing platform recommends, through the API configuration interface, the parameter group that is of the first cloud service API and that is related to the first parameter, the cloud computing platform selects one or more parameters of a second cloud service called by the first cloud service API as the parameter group, where the first parameter belongs to the second cloud service.
In the foregoing implementation, the one or more parameters that are entered by the user and that belong to the same function module as the first parameter and the one or more parameters that are entered by the user and that are of the second cloud service called by the first cloud service API may be selected as the parameter group, to recommend, to the user, a parameter group that is to be preferentially filled in next, such that the user configures a parameter more accurately and quickly, and efficiency of debugging the cloud service API by the user can be improved.
In a possible implementation, when the parameter value that is of the first parameter and that is entered by the user does not meet a requirement of the first parameter, the cloud computing platform prompts, through the API configuration interface, the user to modify the parameter value of the first parameter.
In a possible implementation, the requirement of the first parameter includes one or more of a type of the first parameter, a parameter range of the first parameter, or a service requirement of the first parameter.
In a possible implementation, when a debugging error occurs in the first cloud service API, the cloud computing platform provides, through the debugging result interface, a solution for prompting to resolve the debugging error.
In the foregoing implementation, the user is prompted to modify the parameter value that does not meet the parameter requirement, and the solution for prompting to resolve the debugging error is provided for the user, such that the user can check a cause of the debugging error, the user can resolve the problem in a targeted manner, and cloud service API debugging is more efficient.
In a possible implementation, the cloud computing platform generates, based on a first programming language and a parameter value of the first cloud service API, code for triggering debugging of the first cloud service API.
According to a second aspect, a cloud computing platform for debugging a cloud service API on the cloud computing platform is provided, where the cloud computing platform provides a plurality of cloud services, and manages a cloud computing resource used for deploying the cloud service, the cloud service has a cloud service API, the cloud computing platform provides a debugging service for the cloud service API, and is configured with an API configuration interface and a debugging result interface of the debugging service. The cloud computing platform includes a configuration module configured to provide the API configuration interface, where the API configuration interface is used by a user to select a to-be-debugged cloud service API; the configuration module is configured to obtain, through the API configuration interface, a first cloud service API selected by the user, is configured to obtain, through the API configuration interface, a parameter value that is of a first parameter of the first cloud service API and that is entered by the user, is further configured to recommend, to the user through the API configuration interface, a parameter group that is of the first cloud service API and that is related to the first parameter, and then is configured to obtain, through the API configuration interface, a parameter value that is of a second parameter in the parameter group and that is entered by the user, where the second parameter is a part or all parameters in the parameter group; a debugging module configured to deploy in the cloud computing resource based on the parameter value of the first parameter and the parameter value of the second parameter, a cloud service associated with the first cloud service API to debug the first cloud service API; and a result presentation module configured to provide a debugging result of the first cloud service API through the debugging result interface.
In a possible implementation, the configuration module is configured to: before recommending, through the API configuration interface, the parameter group that is of the first cloud service API and that is related to the first parameter, select, as the parameter group, one or more parameters that belong to a same function module as the first parameter.
In a possible implementation, the configuration module is configured to generate an association relationship between a function module of the first cloud service API and the parameter group of the first cloud service API based on a parameter description file of the first cloud service API.
In a possible implementation, the configuration module is configured to: before recommending, through the API configuration interface, the parameter group that is of the first cloud service API and that is related to the first parameter, select one or more parameters of a second cloud service called by the first cloud service API as the parameter group, where the first parameter belongs to the second cloud service.
In a possible implementation, the configuration module is configured to: in a process in which the user enters a parameter value of a part of the parameters in the parameter group, prompt, through the API configuration interface, a proportion of a quantity of parameters with entered parameter values in the parameter group.
In a possible implementation, the configuration module is configured to: when the parameter value that is of the first parameter and that is entered by the user does not meet a requirement of the first parameter, prompt, through the API configuration interface, the user to modify the parameter value of the first parameter.
In a possible implementation, the requirement of the first parameter includes one or more of a type of the first parameter, a parameter range of the first parameter, or a service requirement of the first parameter.
In a possible implementation, the result presentation module is configured to: when a debugging error occurs in the first cloud service API, provide, through the debugging result interface, a solution for prompting to resolve the debugging error.
In a possible implementation, the configuration module is further configured to generate, based on a first programming language and a parameter value of the first cloud service API, code for triggering debugging of the first cloud service API.
According to a third aspect, a computing device cluster is provided, including at least one computing device, where each computing device includes a processor and a memory, and the processor of the at least one computing device is configured to execute instructions stored in the memory of the at least one computing device, to enable the computing device cluster to perform the method provided in any one of the first aspect or the possible implementations of the first aspect.
According to a fourth aspect, a computer program product including instructions is provided. When the instructions are run by a computing device cluster, the computing device cluster is enabled to perform the method provided in any one of the first aspect or the possible implementations of the first aspect.
According to a fifth aspect, a computer-readable storage medium is provided, including computer program instructions. When the computer program instructions are executed by a computing device cluster, the computing device cluster performs the method provided in any one of the first aspect or the possible implementations of the first aspect.
To describe the technical solutions in embodiments of this disclosure or in the background more clearly, the following describes the accompanying drawings for describing embodiments of this disclosure or the background.
This disclosure provides a method and an apparatus for debugging a cloud service API on a cloud computing platform, and another device. The following provides descriptions with reference to the accompanying drawings.
In the specification and claims of this disclosure, the terms “first”, “second”, and the like are used for distinguishing between different objects, but are not used for describing a particular order of the objects. For example, a “first request”, a “second request”, and the like are used to distinguish between different requests, but are not used to describe a particular order of the requests.
To make the technical solutions provided in this disclosure more clearly, before the technical solutions provided in this disclosure are described, related terms are first explained.
(1) API is a computing interface that defines types of calling or requests that can be made, how to make calling or send requests, a data format to be used, a convention to be complied with, and the like. A main purpose is to help a developer call a group of routine functions without considering an underlying source code implementation or understanding details of an internal working mechanism. This simplifies application development and saves time and costs.
(2) A YAML is a highly readable format used for expressing data serialization. The YAML language aims to be intuitively recognized by a computer, be easily read by humans, and can interact with a script language. The YAML language can be used to express or edit a data structure, configuration files, a file outline, and the like.
(3) A DAG is a directed graph without loops. When a path starts from any vertex and cannot return to the vertex through a plurality of edges in a directed graph, the graph is a directed acyclic graph. The graph is formed by vertices and edges that connect these vertices. A graph in which each edge has a direction from one vertex to another vertex is a directed graph. A path in the directed graph is a series of edges, and an end point of each edge in the series is a start point of a next edge. When a start point of a path is an end point of the path, the path is a cycle. A directed acyclic graph is a directed graph without a cycle.
(4) An integrated development environment (IDE) is an application that provides a program development environment, and usually includes a code editor, a compiler, a debugger, a graphical user interface, and the like. The integrated development environment integrates integrated development software services such as code writing, analysis, compilation, and debugging functions, to help developers efficiently develop software code.
(5) A software development kit (SDK) is a collection of development tools used by a developer for a specific software package, software framework, hardware platform, and operating system, to create application software, and can help the software developer create an application for a specific platform, system, or programming language.
The following briefly describes application scenarios in embodiments of this disclosure.
In the application scenario shown in
The API configuration interface 210 displays all parameters of a cloud service API, including mandatory parameters and optional parameters. As shown in
A “Debug” button on the API configuration interface 210 is clicked, and then, a result of debugging the cloud service API is displayed on the debugging result interface 220. When the cloud service API is successfully called, a result that debugging succeeds is displayed on the top of the debugging result interface 220. When the cloud service API fails to be called, a result that debugging fails is displayed on the top of the debugging result interface 220. In addition, a failure cause of the debugging failure is returned and a corresponding solution is associated. As shown in
When the cloud service API debugging service shown in
To avoid the foregoing problem, in the cloud service API debugging service, a parameter group is recommended to the user based on historical calling information of the cloud service API, and a proportion of the recommended parameter group in all parameter groups in succeeded calling is displayed, such that the user can select a corresponding parameter group based on the recommendation. However, for the recommendation based on the historical calling information of the cloud service API, a current service scenario of the user is not considered. In addition, recommendation cannot be performed for a cloud service API that is newly launched or has no calling history. Moreover, after a debugging error occurs, only one piece of error information is returned. The returned error information may be incomplete or inaccurate. As shown in
To resolve the foregoing problem, this disclosure provides a method and an apparatus for debugging a cloud service API on a cloud computing platform and a related device. A group dependency relationship between parameters in a cloud service API is pre-extracted, such that when a user configures a parameter of the cloud service API, a parameter group that is to be preferentially filled in is recommended. Therefore, correlation and accuracy of parameter recommendation can be improved, and cloud service API debugging is more efficient. In addition, a parameter pre-verification function is used to perform parameter pre-verification when the user configures the parameter of the cloud service API, and panoramic error information can be returned. This helps the user avoid the problem in advance and locate an error cause in a targeted manner, such that debugging time of the user is saved and the cloud service API is debugged efficiently and quickly.
To better understand the method and the apparatus for debugging a cloud service API on a cloud computing platform and the related device that are provided in this disclosure, the following separately provides detailed descriptions with reference to corresponding accompanying drawings.
First, with reference to
In embodiments of this disclosure, API parameter group recommendation and parameter pre-verification are combined, to resolve the to-be-resolved problem in
Refer to a diagram of a shallow integration manner shown in
Refer to a diagram of a deep integration manner shown in
As shown in
S501: Configure an API configuration interface 210 and a debugging result interface 220 of a cloud service API debugging service on a cloud computing platform 20.
In this embodiment, the cloud computing platform provides a plurality of cloud services, and manages a cloud computing resource used for deploying the cloud service, where the cloud service has a cloud service API. To facilitate debugging by a user, the cloud computing platform provides the cloud service API debugging service, and is configured with the API configuration interface and the debugging result interface shown in
For example, the user debugs the cloud service API on the cloud computing platform 20, and completes parameter configuration of the cloud service API on the API configuration interface 210. The cloud computing platform 20 deploys, in the cloud computing resource based on a parameter value configured by the user, a cloud service associated with the cloud service API, to debug the cloud service API. After the user clicks a “Debug” button, a debugging result of the cloud service API is provided on the debugging result interface 220. When the debugging is successful, a result that the cloud service API debugging succeeds is displayed. When the debugging fails, a result that the debugging fails is displayed, and a solution corresponding to the debugging failure is associated.
S502: The API configuration interface 210 is used by the user to select a to-be-debugged cloud service API.
In this embodiment, the API configuration interface 210 is used by the user to select the to-be-debugged cloud service API. The user can select, as required, a cloud service API that needs to be debugged, to perform debugging. In addition, on the API configuration interface 210, cloud service APIs are further classified based on a cloud service category, where for example, the cloud service APIs are classified based on storage, network, security, and the like, to facilitate the user in searching for and selecting a cloud service API based on the cloud service category. After the user selects the to-be-debugged API, the API configuration interface 210 further displays detailed information about the cloud service API to the user. The detailed information may be function introduction, a help document, related resource information, and the like of the cloud service.
In a possible implementation, the to-be-debugged cloud service API may alternatively be provided by an interface other than the API configuration interface 210. In addition to classifying the cloud service APIs and providing detailed information about the cloud service API, more functions may be further provided for the user. These functions may be a cloud service API recently accessed by the user, a cloud service API recently debugged by the user, and a cloud service API frequently debugged by the user, such that cloud service API configuration and debugging by the user is more efficient.
S503: The API configuration interface 210 obtains a first cloud service API selected by the user.
In this embodiment, the user selects, as required, the cloud service API that needs to be debugged, namely, the first cloud service API. The API configuration interface 210 presents, to the user, names of all parameters of the first cloud service API and an entry region of to-be-entered parameter values. In addition, the API configuration interface 210 may further provide description information of each parameter for the user. The description information may be a name, function information, a value range, a filling-in example, and the like of the parameter, such that the user can more accurately and quickly know a filling-in element and a filling-in specification of the parameter, thereby improving user experience and improving parameter configuration efficiency of the user.
S504: The API configuration interface 210 obtains a parameter value that is of a first parameter of the first cloud service API and that is entered by the user.
In this embodiment, after selecting the first cloud service API, the user needs to configure a parameter for the cloud service API. The user selects one parameter of the cloud service API and fills in a corresponding parameter value of the parameter, namely, the parameter value of the first parameter, and the API configuration interface 210 obtains the parameter value that is of the first parameter of the first cloud service API and that is entered by the user. The parameter may be a mandatory parameter of the cloud service API, or may be an optional parameter. This is not limited herein.
S505: The API configuration interface 210 recommends a parameter group that is of the first cloud service API and that is related to the first parameter.
In this embodiment, after the user enters the parameter value of the first parameter of the first cloud service API, the API configuration interface 210 recommends, to the user, the parameter group that is of the first cloud service API and that is related to the first parameter, for preferentially filling in by the user.
For example, as shown in
In this embodiment, the cloud computing platform 20 pre-extracts a group dependency relationship between parameters in the cloud service API, and when the user configures a parameter of the cloud service API, recommends, based on the pre-obtained group dependency relationship between the parameters, a parameter group that is to be preferentially filled in to the user. As shown in
S701: The cloud computing platform 20 generates an association relationship between a function module of the first cloud service API and the parameter group of the first cloud service API based on a parameter description file of the first cloud service API.
In this embodiment, the association relationship between the function module of the cloud service API and the parameter group of the cloud service API is generated based on the parameter description file of the cloud service API. The parameter description file may be a YAML definition and a function description of the cloud service API, and source code implemented by the cloud service API, or the like. Related technologies such as code analysis and data mining are used to parse the parameter description file of the cloud service API and obtain function modules of the cloud service API through division. An execution process of step S701 may include: First, implementation of the cloud service API depends on a plurality of other cloud services, each cloud service includes a plurality of independent service function modules, and implementation of each function module depends on one parameter group. Based on a code analysis technology or a natural language technology, the parameter description file of the cloud service API is analyzed to obtain running and calling relationships between the cloud service API, the function module, and the parameter group through parsing. Then, the cloud service API, the function module, and the parameter group are connected through the calling relationship, to finally obtain, through construction, a directed acyclic graph centered on the cloud service API. Nodes in the graph are extracted function modules of the cloud service API and extracted parameter groups, and paths between the nodes are dependency relationships between the extracted parameter groups.
A process of extracting the association relationship between the function module of the cloud service API and the parameter group of the cloud service API is shown in
For example, a parameter DAG library for computing the cloud service API is shown in
S702: The cloud computing platform 20 selects, as the parameter group, one or more parameters that belong to a same function module as the first parameter.
In this embodiment, after the user enters the parameter value of the first parameter of the first cloud service API, the cloud computing platform selects, as the parameter group based on the pre-generated association relationship between the function module of the first cloud service API and the parameter group of the first cloud service API, the one or more parameters that belong to the same function module as the first parameter, and recommends, to the user, a parameter group that is to be preferentially filled in next. This can improve correlation and accuracy of parameter configuration, and improve efficiency of debugging the cloud service API by the user.
During actual application, a parameter priority in the parameter group is calculated using a similarity algorithm, and a cosine similarity, a Euclidean distance, a Pearson correlation coefficient, a Manhattan distance, or the like may be calculated. This is not limited herein.
For example, after the user enters a parameter value of the parameter C in the computed cloud service API, the cloud computing platform pre-processes the parameter C, and understands and splits the parameter C (for example, performs normalization and vectorization). Then, based on the pre-constructed association relationship between the function module of the computed cloud service API and the parameter group of the computed cloud service API, the parameter C′ and the parameter C″ in the parameter group 3 that belongs to a same function module as the parameter C are recommended to the user for preferential filling in.
S703: The cloud computing platform 20 selects one or more parameters of a second cloud service called by the first cloud service API as the parameter group, where the first parameter belongs to the second cloud service.
In this embodiment, the second cloud service is called during implementation of the first cloud service API. When the first parameter entered by the user belongs to the second cloud service, the cloud computing platform selects the one or more parameters of the second cloud service called by the first cloud service API as the parameter group, and recommends the parameter group to the user for filling in.
For example, a parameter DAG library of another cloud service is called for the computation of the cloud service API. As shown in
S506: The API configuration interface 210 obtains a parameter value that is of a second parameter in the parameter group and that is entered by the user.
In this embodiment, the user enters the parameter value of the second parameter in the parameter group based on the parameter group that is of the first cloud service API, that is related to the first parameter, and that is recommended by the API configuration interface 210, where the second parameter is a part or all of parameters in the parameter group.
For example, still refer to
In some possible implementations, in a process in which the user configures the parameter of the cloud service API, the cloud computing platform further provides the parameter pre-verification function for the user. Before the user formally debugs the cloud service API, whether a parameter value that is of a parameter and that is entered by the user meets a requirement is verified. As shown in
S1101: In a process in which the user enters a parameter value of a part of the parameters in the parameter group, the API configuration interface 210 prompts a proportion of a quantity of parameters with entered parameter values in the parameter group.
In this embodiment, in a process in which the user enters the parameter value of the second parameter based on the recommended parameter group related to the first parameter, the API configuration interface reminds the user of the proportion of the quantity of parameters with entered parameter values in the current parameter group, and may notify the user in the form of a percentage progress bar. Completion progress verification of the parameter group reminds the user of whether any parameter in the current parameter group has not been entered. In addition, the form of the percentage progress bar can intuitively inform the user of a progress of entering the parameter values in the parameter group.
For example, refer to
S1102: When the parameter value that is of the first parameter and that is entered by the user does not meet a requirement of the first parameter, the API configuration interface 210 prompts the user to modify the parameter value of the first parameter.
In this embodiment, after the user enters the parameter value of the first parameter, when the parameter value of the first parameter does not meet the requirement of the first parameter, the API configuration interface prompts the user to modify the parameter value of the first parameter. In addition, when the parameter value that is of the second parameter and that is entered by the user based on the recommended parameter group related to the first parameter does not meet a requirement of the second parameter, the API configuration interface also prompts the user to modify the parameter value of the second parameter. The requirements of the first parameter and the second parameter may include one or more of a parameter type, a parameter range, or a parameter service requirement.
The entered parameter values of the first parameter and the second parameter are verified based on the requirements of the first parameter and the second parameter, and that the user is prompted to make a modification is implemented based on a parameter verification library. Still refer to
For example, the parameter verification library may verify the parameter value that is of the parameter and that is entered by the user from three aspects: a parameter type, a parameter range, and a parameter service requirement. Parameter type verification is to verify a data type of the parameter based on an initial definition of the parameter of the cloud service API. For example, only a character string can be filled in for the parameter or only a parameter type in a candidate item can be selected for the parameter. Parameter range verification is verification performed based on a value range of the parameter, and is used to restrict a filling-in specification of a single parameter. For example, only an integer ranging from 0 to 256 can be filled in for the parameter, or only 0 or 1 can be filled in for the parameter. Parameter service requirement verification is verification performed by obtaining a historical calling specification and a parameter value of the user in a team. For example, a selected parameter is not a parameter of an OS version commonly used by the team. There is a list of calling history values because an API may be successfully called for a plurality of times in the team's history calling.
S507: The cloud computing platform 20 deploys, in the cloud computing resource based on the parameter value of the first parameter and the parameter value of the second parameter, a cloud service associated with the first cloud service API, to debug the first cloud service API.
In this embodiment, after the user completes configuration of the parameter value of the first parameter and the parameter value of the second parameter of the first cloud service API, the cloud computing platform deploys, in the cloud computing resource based on the parameter value of the first parameter and the parameter value of the second parameter, the cloud service associated with the first cloud service API, to debug the first cloud service API.
S508: The debugging result interface 220 provides a debugging result of the first cloud service API.
After the user initiates the debugging, the debugging result interface 220 provides the debugging result of the first cloud service API. When the debugging is successful, the debugging result interface shows that the cloud service API is successfully debugged. When the debugging fails, the debugging result interface 220 provides the user with a solution for resolving a debugging error. Matching between the debugging error and a recorded parameter error type is performed, and a list of debugging error information is presented to the user in at least one or more forms of the parameter type, the parameter range, or the parameter service requirement in the parameter verification library. The debugging error information is also referred to as panoramic error information in this disclosure. Each piece of error information in the list of the error information is associated with a corresponding solution. This helps the user check a cause of the debugging error and improves debugging efficiency of the cloud service API.
In a possible implementation, the list of the panoramic error information is sorted based on importance, namely, a priority resolution degree, of parameters. Factors that affect the importance of the parameters include a dependency relationship between cloud services, a calling relationship between function modules, a dependency relationship between parameter groups, and the like. In relationships between the nodes in the parameter DAG library obtained through the foregoing construction, the dependency relationship between the parameter groups is at a lower layer, this means, is to be preferentially resolved, and the calling relationship between the function modules ranks second. Therefore, when the factors that affect the importance of the parameters are sorted, the dependency relationship between the parameter groups is to be preferentially resolved, the calling relationship between the function modules ranks second, and the dependency relationship between the cloud services ranks third. After a priority-resolving order of parameters is determined, the panoramic error information may be sorted in the priority-resolving order of parameters.
For example, as shown in
In another possible implementation, the user is prompted to preferentially modify a parameter value of a parameter with higher importance based on the importance of the parameters and a solution to a debugging error provided by the debugging result interface 220. With the modification of the user, the API configuration interface displays a phase success rate of the modification in real time, namely, a completion progress of successful cloud service API debugging.
In some possible implementations, after completing configuration of the first parameter and the second parameter of the first cloud service API on the API configuration interface 210, the user selects a programming language, and may generate, based on the programming language (a first programming language) selected by the user and a parameter value of the first cloud service API, code for triggering debugging of the first cloud service API. The programming language may include languages such as JAVA, PYTHON, C, C++, and Go.
For example, as shown in
In conclusion, according to the method for debugging a cloud service API on a cloud computing platform provided in this disclosure, the group dependency relationship between the parameters in the cloud service API is pre-extracted, and when the user configures the parameter of the cloud service API, the parameter group that is to be preferentially filled in is recommended. In addition, the parameter pre-verification function is used to perform parameter pre-verification during configuration of the parameter of the cloud service API, and the panoramic error information is returned. This can improve the accuracy and correlation of parameter recommendation and avoid problems in advance. In this way, the user can resolve problems in a targeted manner, thereby improving efficiency of cloud service API debugging.
The foregoing describes in detail the method for debugging a cloud service API on a cloud computing platform provided in this disclosure. To better implement the foregoing solutions provided in this disclosure, correspondingly, the following further provides a cloud computing platform and another device that are configured to cooperate in implementing the foregoing solutions.
The cloud computing platform provided in this disclosure may be used in the cloud service API debugging shown in
The configuration module 1410 is configured to provide an API configuration interface, where the API configuration interface is used by a user to select a to-be-debugged cloud service API.
The configuration module 1410 is further configured to obtain, through the API configuration interface, a first cloud service API selected by the user.
The configuration module 1410 is further configured to obtain, through the API configuration interface, a parameter value that is of a first parameter of the first cloud service API and that is entered by the user.
The configuration module 1410 is further configured to recommend, through the API configuration interface, a parameter group that is of the first cloud service API and that is related to the first parameter.
The configuration module 1410 is further configured to obtain, through the API configuration interface, a parameter value that is of a second parameter in the parameter group and that is entered by the user, where the second parameter is a part or all of parameters in the parameter group.
The debugging module 1420 is configured to deploy, in the cloud computing resource based on the parameter value of the first parameter and the parameter value of the second parameter, a cloud service associated with the first cloud service API, to debug the first cloud service API.
The result presentation module 1430 is configured to provide a debugging result of the first cloud service API through the debugging result interface.
In a possible implementation, the configuration module 1410 is configured to: before recommending, through the API configuration interface, the parameter group that is of the first cloud service API and that is related to the first parameter, select, as the parameter group, one or more parameters that belong to a same function module as the first parameter.
In a possible implementation, the configuration module 1410 is configured to generate an association relationship between a function module of the first cloud service API and the parameter group of the first cloud service API based on a parameter description file of the first cloud service API.
In a possible implementation, the configuration module 1410 is configured to select one or more parameters of a second cloud service called by the first cloud service API as the parameter group, where the first parameter belongs to the second cloud service.
In a possible implementation, the configuration module 1410 is configured to: in a process in which the user enters a parameter value of a part of the parameters in the parameter group, prompt, through the API configuration interface, a proportion of a quantity of parameters with entered parameter values in the parameter group.
In a possible implementation, the configuration module 1410 is configured to: when the parameter value that is of the first parameter and that is entered by the user does not meet a requirement of the first parameter, prompt, through the API configuration interface, the user to modify the parameter value of the first parameter.
In a possible implementation, the requirement of the first parameter includes one or more of a type of the first parameter, a parameter range of the first parameter, or a service requirement of the first parameter.
In a possible implementation, the result presentation module 1430 is configured to: when a debugging error occurs in the first cloud service API, provide, through the debugging result interface, a solution for prompting to resolve the debugging error.
In a possible implementation, the configuration module 1410 is further configured to generate, based on a first programming language and a parameter value of the first cloud service API, code for triggering debugging of the first cloud service API.
For specific implementation of performing various operations by the cloud computing platform 1400, refer to related content descriptions in the foregoing embodiment of the method for debugging a cloud service API on a cloud computing platform. For brevity of the specification, details are not described herein again.
In conclusion, it can be learned that the cloud computing platform (the cloud computing platform 1400 shown in
The configuration module 1410, the debugging module 1420, and the result presentation module 1430 may all be implemented using software, or may be implemented using hardware. For example, the following uses the configuration module 1410 as an example to describe an implementation of the configuration module 1410. Similarly, for implementations of the debugging module 1420 and the result presentation module 1430, refer to an implementation of the configuration module 1410.
The module is used as an example of a software functional unit, and the configuration module 1410 may include code run on a computing instance. The computing instance may include at least one of a physical host (computing device), a virtual machine, and a container. Further, there may be one or more computing instances. For example, the configuration module 1410 may include code run on a plurality of hosts/virtual machines/containers. It should be noted that, the plurality of hosts/virtual machines/containers configured to run the code may be distributed in a same region, or may be distributed in different regions. Further, the plurality of hosts/virtual machines/containers configured to run the code may be distributed in a same availability zone (AZ), or may be distributed in different AZs. Each AZ includes one data center or a plurality of data centers with similar geographical locations. Generally, one region may include a plurality of AZs.
Similarly, the plurality of hosts/virtual machines/containers configured to run the code may be distributed in a same virtual private cloud (VPC), or may be distributed in a plurality of VPCs. Usually, one VPC is disposed in one region. For cross-region communication between two VPCs in a same region and between VPCs in different regions, a communication gateway needs to be disposed in each VPC, and interconnection between the VPCs is implemented through the communication gateway.
An example in which the module is used as a hardware functional unit is used. The configuration module 1410 may include at least one computing device, such as a server. Alternatively, the configuration module 1410 may be a device implemented using an application-specific integrated circuit (ASIC) or a programmable logic device (PLD), or the like. The PLD may be implemented by a complex programmable logical device (CPLD), a field-programmable gate array (FPGA), generic array logic (GAL), or any combination thereof.
A plurality of computing devices included in the configuration module 1410 may be distributed in a same region, or may be distributed in different regions. The plurality of computing devices included in the configuration module 1410 may be distributed in a same AZ, or may be distributed in different AZs. Similarly, the plurality of computing devices included in the configuration module 1410 may be distributed in a same VPC, or may be distributed in the plurality of VPCs. The plurality of computing devices may be any combination of computing devices such as the server, the ASIC, the PLD, the CPLD, the FPGA, and the GAL.
It should be noted that, in another embodiment, the configuration module 1410 may be configured to perform any step in the method for debugging a cloud service API on a cloud computing platform. The debugging module 1420 may be configured to perform any step in the method for debugging a cloud service API on a cloud computing platform. The result presentation module 1430 may be configured to perform any step in the method for debugging a cloud service application programming interface API on a cloud computing platform. Steps that can be implemented by the configuration module 1410, the debugging module 1420, and the result presentation module 1430 may be specified as required. The configuration module 1410, the debugging module 1420, and the result presentation module 1430 respectively implement different steps in the method for debugging a cloud service API on the cloud computing platform, to implement all functions of the cloud computing platform.
This disclosure further provides a computing device 1500. As shown in
The bus 1502 may be a Peripheral Component Interconnect (PCI) bus, an Extended Industry Standard Architecture (EISA) bus, or the like. Buses may be classified into an address bus, a data bus, a control bus, and the like. To facilitate illustration, only one line is used in
The processor 1504 may include any one or more of processors such as a central processing unit (CPU), a graphics processing unit (GPU), a micro processor (MP), or a digital signal processor (DSP).
The memory 1506 may include a volatile memory, for example, a random-access memory (RAM). The memory 1506 may further include a non-volatile memory, for example, a read-only memory (ROM), a flash memory, a hard disk drive (HDD), or a solid-state drive (SSD).
The memory 1506 stores executable program code, and the processor 1504 executes the executable program code to separately implement functions of the configuration module 1410, the debugging module 1420, and the result presentation module 1430, to implement the method for debugging a cloud service API on a cloud computing platform. In other words, the memory 1506 stores instructions for executing the method for debugging a cloud service API on a cloud computing platform.
The communication interface 1508 implements communication between the computing device 1500 and another device or a communication network using a transceiver module, for example, but not limited to a network interface card or a transceiver.
An embodiment of this disclosure further provides a computing device cluster. The computing device cluster includes at least one computing device. The computing device may be a server, for example, a central server, an edge server, or a local server in a local data center. In some embodiments, the computing device may alternatively be a terminal device, for example, a desktop computer, a notebook computer, or a smartphone.
As shown in
In some possible implementations, the memories 1506 in the one or more computing devices 1500 in the computing device cluster may alternatively and separately store some instructions for executing the method for debugging a cloud service API on a cloud computing platform. In other words, a combination of one or more computing devices 1500 may jointly execute the instructions for performing the method for debugging a cloud service API on a cloud computing platform.
It should be noted that the memories 1506 in different computing devices 1500 in the computing device cluster may store different instructions respectively for performing some functions of the cloud computing platform. In other words, the instructions stored in the memories 1506 in different computing devices 1500 may implement functions of one or more of the configuration module 1410, the debugging module 1420, and the result presentation module 1430.
In some possible implementations, the one or more computing devices in the computing device cluster may be connected over a network. The network may be a wide area network, a local area network, or the like.
A connection manner between computing device clusters shown in
It should be understood that a function of the computing device 1500A shown in
An embodiment of this disclosure further provides a computer program product including instructions. The computer program product may be software or a program product that includes instructions and that can run on a computing device or be stored in any usable medium. When the computer program product runs on at least one computing device, the at least one computing device is enabled to perform the method for debugging a cloud service API on a cloud computing platform, or the method for debugging a cloud service API on a cloud computing platform.
An embodiment of this disclosure further provides a computer-readable storage medium. The computer-readable storage medium may be any usable medium that can be stored by a computing device, or a data storage device, such as a data center, including one or more usable media. The usable medium may be a magnetic medium (for example, a floppy disk, a hard disk drive, or a magnetic tape), an optical medium (for example, a DIGITAL VERSATILE DISC (DVD)), a semiconductor medium (for example, a solid-state drive), or the like. The computer-readable storage medium includes instructions, and the instructions instruct a computing device to perform a method for debugging a cloud service API on a cloud computing platform, or instruct a computing device to perform a method for debugging a cloud service API on a cloud computing platform.
Finally, it should be noted that the foregoing embodiments are merely intended for describing the technical solutions of the present disclosure, but not for limiting the present disclosure. Although the present disclosure is described in detail with reference to the foregoing embodiments, a person of ordinary skill in the art should understand that they may still make modifications to the technical solutions described in the foregoing embodiments or make equivalent replacements to some technical features thereof, without departing from the protection scope of the technical solutions of embodiments of the present disclosure.
| Number | Date | Country | Kind |
|---|---|---|---|
| 202211241026.6 | Oct 2022 | CN | national |
| 202310293831.1 | Mar 2023 | CN | national |
This is a continuation of International Patent Application No. PCT/CN2023/123680 filed on Oct. 10, 2023, which claims priority to Chinese Patent Application No. 202211241026.6 filed on Oct. 11, 2022, and Chinese Patent Application No. 202310293831.1 filed on Mar. 23, 2023. All of the aforementioned patent applications are hereby incorporated by reference in their entireties.
| Number | Date | Country | |
|---|---|---|---|
| Parent | PCT/CN2023/123680 | Oct 2023 | WO |
| Child | 19175457 | US |